/* Mi Biblioteca 0.2 — layout compartido */
:root {
  --mb-max: 74rem;
  --mb-text: 1.1rem;
  --mb-leading: 1.65;
  --mb-ease: 220ms ease;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--mb-font-body);
  font-size: var(--mb-text);
  line-height: var(--mb-leading);
  color: var(--mb-ink);
  background: var(--mb-bg);
  background-image: var(--mb-bg-image);
  background-attachment: fixed;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--mb-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover { color: var(--mb-ink); }

.mb-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--mb-ink);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.mb-skip-link:focus { left: 1rem; top: 1rem; }

.mb-site { min-height: 100vh; display: flex; flex-direction: column; }

/* Cabecera con imagen (banda, no hero a pantalla completa) — flotante al hacer scroll */
.mb-header {
  position: sticky;
  top: 0;
  z-index: 40;
  isolation: isolate;
  border-bottom: 1px solid var(--mb-line);
  min-height: clamp(7.5rem, 18vw, 11.5rem);
  display: flex;
  align-items: flex-end;
  color: #f7f3ea;
}

.mb-header__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #2a322c;
  background-image: var(--mb-header-image, none);
  background-position: center 40%;
  background-size: cover;
  background-repeat: no-repeat;
}

.mb-header__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      100deg,
      rgba(18, 22, 20, 0.78) 0%,
      rgba(18, 22, 20, 0.55) 42%,
      rgba(18, 22, 20, 0.35) 70%,
      rgba(18, 22, 20, 0.28) 100%
    );
  pointer-events: none;
}

.mb-header__inner,
.mb-footer__inner,
.mb-hero__inner,
.mb-grid-section,
.mb-section,
.mb-feature,
.mb-single,
.mb-page {
  width: min(100% - 2rem, var(--mb-max));
  margin-inline: auto;
}

.mb-header__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 0 1.25rem;
  width: min(100% - 2rem, var(--mb-max));
}

.mb-brand__name {
  margin: 0;
  font-family: var(--mb-font-display);
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.mb-brand__name a {
  color: #f7f3ea;
  text-decoration: none;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}
.mb-brand__name a:hover {
  color: #fff;
}

.mb-brand__tagline {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: rgba(247, 243, 234, 0.82);
  max-width: 28rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.mb-nav-toggle {
  display: none;
  border: 1px solid rgba(247, 243, 234, 0.45);
  background: rgba(0, 0, 0, 0.2);
  color: #f7f3ea;
  padding: 0.4rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.mb-nav__list,
.mb-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
}

.mb-nav__list a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0.65rem;
  color: rgba(247, 243, 234, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  border-radius: 0.3rem;
  transition: color 0.22s ease, background 0.22s ease;
}

.mb-nav__list a::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.22rem;
  height: 2px;
  background: #f0e6d4;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.26s ease;
}

.mb-nav__list a:hover {
  color: #fff;
  background: rgba(247, 243, 234, 0.12);
}

.mb-nav__list a:hover::after {
  transform: scaleX(1);
}

.mb-nav__list .current-menu-item > a,
.mb-nav__list .current_page_item > a,
.mb-nav__list .current-menu-ancestor > a,
.mb-nav__list a[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  background: rgba(247, 243, 234, 0.14);
}

.mb-nav__list .current-menu-item > a::after,
.mb-nav__list .current_page_item > a::after,
.mb-nav__list .current-menu-ancestor > a::after,
.mb-nav__list a[aria-current="page"]::after {
  transform: scaleX(1);
}

.mb-main { flex: 1; padding: 1.75rem 0 4rem; }

.mb-hero { margin-bottom: 2rem; }
.mb-hero__kicker {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mb-accent);
}
.mb-hero__lead {
  margin: 0;
  font-family: var(--mb-font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  max-width: 16ch;
}

.mb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 1.25rem;
}
.mb-grid--shelf {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}
.mb-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mb-card { margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }

.mb-card__media {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--mb-surface);
  box-shadow: var(--mb-shadow);
  text-decoration: none;
  color: inherit;
}

.mb-card__image,
.mb-card__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms ease;
}
.mb-card__placeholder {
  display: block;
  background: linear-gradient(145deg, color-mix(in srgb, var(--mb-accent) 40%, var(--mb-surface)), var(--mb-surface));
}
.mb-card:hover .mb-card__image { transform: scale(1.04); }

.mb-card__overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 1.1rem 0.85rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.78));
  color: #fff;
  opacity: 0;
  transition: opacity var(--mb-ease);
}
.mb-card--shelf:hover .mb-card__overlay,
.mb-card--shelf:focus-within .mb-card__overlay { opacity: 1; }
.mb-card__overlay-title {
  font-family: var(--mb-font-display);
  font-size: 0.95rem;
  line-height: 1.25;
  display: block;
}

.mb-card__title {
  margin: 0;
  font-family: var(--mb-font-display);
  font-size: 1.15rem;
  line-height: 1.25;
}
.mb-card__title a { color: var(--mb-ink); text-decoration: none; }
.mb-card__title a:hover { color: var(--mb-accent); }
.mb-card__excerpt { margin: 0; font-size: 0.9rem; color: var(--mb-muted); }

/* Feature (cuaderno home) */
.mb-feature { margin-bottom: 3rem; }
.mb-feature__card {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 2rem;
  align-items: center;
  margin: 0;
}
.mb-feature__media {
  display: block;
  text-decoration: none;
  box-shadow: var(--mb-shadow);
}
.mb-feature__image { width: 100%; height: auto; }
.mb-feature__placeholder { aspect-ratio: 2/3; }
.mb-feature__kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mb-accent);
}
.mb-feature__title {
  margin: 0 0 0.75rem;
  font-family: var(--mb-font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
}
.mb-feature__title a { color: var(--mb-ink); text-decoration: none; }
.mb-feature__excerpt { margin: 0 0 1.25rem; color: var(--mb-muted); max-width: 38rem; }

.mb-section { margin-bottom: 3rem; }
.mb-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--mb-line);
  padding-bottom: 0.6rem;
}
.mb-section__title {
  margin: 0;
  font-family: var(--mb-font-display);
  font-size: 1.5rem;
}
.mb-section__link { font-size: 0.9rem; text-decoration: none; font-weight: 600; }
.mb-section__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mb-muted);
}
.mb-lecturas__count {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--mb-muted);
}

.mb-cuaderno-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.mb-cuaderno-list__item a {
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
}
.mb-cuaderno-list__date {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mb-muted);
}
.mb-cuaderno-list__title {
  font-family: var(--mb-font-display);
  font-size: 1.35rem;
  color: var(--mb-ink);
}
.mb-cuaderno-list__item a:hover .mb-cuaderno-list__title { color: var(--mb-accent); }
.mb-cuaderno-list__excerpt { margin: 0.35rem 0 0; color: var(--mb-muted); font-size: 0.95rem; }

/* Home: cuaderno secundario (no compite con reseñas) */
.mb-cuaderno-aside {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--mb-line);
}

.mb-cuaderno-aside__inner {
  width: min(100% - 2rem, var(--mb-max));
  margin-inline: auto;
}

.mb-cuaderno-aside__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.mb-cuaderno-aside__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mb-muted);
}

.mb-cuaderno-aside__all {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--mb-muted);
}

.mb-cuaderno-aside__all:hover {
  color: var(--mb-accent);
}

.mb-cuaderno-aside__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.mb-cuaderno-aside__list a {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  text-decoration: none;
  color: var(--mb-ink);
  font-size: 0.95rem;
  line-height: 1.35;
}

.mb-cuaderno-aside__list time {
  flex: 0 0 3.2rem;
  font-size: 0.78rem;
  color: var(--mb-muted);
  font-variant-numeric: tabular-nums;
}

.mb-cuaderno-aside__list span {
  font-weight: 500;
}

.mb-cuaderno-aside__list a:hover span {
  color: var(--mb-accent);
}

/* Páginas y reseñas: columna de lectura centrada (no “móvil a la izquierda”). */
.mb-single,
.mb-page:not(.mb-page--lecturas) {
  width: min(100% - 2rem, 46rem);
}

.mb-single__header,
.mb-page__header { margin-bottom: 1.75rem; }

.mb-page:not(.mb-page--lecturas) .mb-page__header,
.mb-page:not(.mb-page--lecturas) .entry-content,
.mb-single .mb-single__header,
.mb-single .entry-content {
  max-width: none;
}
.mb-single__kicker {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mb-accent);
}

.mb-back {
  margin: 0 0 1.25rem;
}

.mb-back--bottom {
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--mb-line);
}

.mb-back__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--mb-accent);
}

.mb-back__link:hover {
  color: var(--mb-ink);
}
.mb-single__title,
.mb-page__title {
  margin: 0.35rem 0 0;
  font-family: var(--mb-font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.1;
}
.mb-single__meta,
.mb-page__lead { margin: 0.5rem 0 0; color: var(--mb-muted); }
.mb-single__cover { margin: 0 0 2rem; max-width: 17rem; }
.entry-content { max-width: 46rem; }
.entry-content p { margin: 0 0 1.1em; }

.mb-button {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  background: var(--mb-accent);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600;
}
.mb-button:hover { opacity: 0.92; color: #fff !important; }

/* Lecturas list */
.mb-lecturas__note {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--mb-muted);
}
.mb-lecturas__table-wrap { overflow-x: auto; border: 1px solid var(--mb-line); }
.mb-lecturas__table,
.mb-lecturas--content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0;
}
.mb-lecturas__table th,
.mb-lecturas__table td,
.mb-lecturas--content table th,
.mb-lecturas--content table td {
  padding: 0.85rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--mb-line);
}
.mb-lecturas__table th,
.mb-lecturas--content table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mb-muted);
  background: color-mix(in srgb, var(--mb-surface) 70%, transparent);
  white-space: nowrap;
}
.mb-lecturas--content .entry-content {
  max-width: none;
  font-size: 0.92rem;
}
.mb-lecturas--content .entry-content > *:first-child { margin-top: 0; }
.mb-lecturas--content .entry-content > *:last-child { margin-bottom: 0; }
.mb-lecturas--content table a {
  font-weight: 600;
  color: var(--mb-ink);
  text-decoration: none;
}
.mb-lecturas--content table a:hover { color: var(--mb-accent); }
.mb-lecturas--content table td:first-child {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mb-accent);
  white-space: nowrap;
}
.mb-lecturas__title {
  font-weight: 600;
  color: var(--mb-ink);
  text-decoration: none;
}
a.mb-lecturas__title:hover { color: var(--mb-accent); }
.mb-lecturas__status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mb-accent);
}
.mb-lecturas__nota { color: var(--mb-muted); max-width: 28rem; }
.mb-lecturas__amazon {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.mb-pagination { margin-top: 2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.mb-footer {
  position: relative;
  isolation: isolate;
  margin-top: auto;
  min-height: clamp(9rem, 20vw, 13rem);
  display: flex;
  align-items: stretch;
  color: #f7f3ea;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mb-footer__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #2a322c;
  background-image: var(--mb-header-image, none);
  background-position: center 65%;
  background-size: cover;
  background-repeat: no-repeat;
}

.mb-footer__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(14, 18, 16, 0.72) 0%,
      rgba(14, 18, 16, 0.82) 55%,
      rgba(14, 18, 16, 0.9) 100%
    );
  pointer-events: none;
}

.mb-footer__inner {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, var(--mb-max));
  margin: auto;
  padding: 2rem 0 1.75rem;
  display: grid;
  gap: 1rem;
}

.mb-footer__brand {
  margin: 0;
  font-family: var(--mb-font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: #f7f3ea;
}

.mb-footer__tagline {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: rgba(247, 243, 234, 0.78);
  max-width: 28rem;
}

.mb-footer__list a {
  position: relative;
  display: inline-block;
  padding: 0.25rem 0.45rem;
  color: rgba(247, 243, 234, 0.88);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.mb-footer__list a:hover,
.mb-footer__list .current-menu-item > a,
.mb-footer__list .current_page_item > a,
.mb-footer__list a[aria-current="page"] {
  color: #fff;
}

.mb-footer__copy {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(247, 243, 234, 0.62);
}
.mb-empty { color: var(--mb-muted); }

.mb-card__media .mbl-latest-thumb-wrap { position: absolute; inset: 0; }
.mb-card__media .mbl-latest-thumb-wrap img {
  width: 100%; height: 100%; object-fit: cover;
}
.mb-card .mbl-latest-badge--inline { display: none; }

.review-meta,
.mbs-share { max-width: 40rem; }

@media (max-width: 980px) {
  .mb-grid--shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mb-feature__card { grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 1.25rem; }
}

@media (max-width: 720px) {
  .mb-nav-toggle { display: inline-flex; align-self: center; }
  .mb-header__inner { align-items: center; flex-wrap: wrap; }
  .mb-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: rgba(18, 22, 20, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem;
  }
  .mb-nav.is-open { display: block; }
  .mb-nav__list { flex-direction: column; gap: 0.85rem; }
  .mb-nav__list a { color: #f7f3ea; text-shadow: none; }
  .mb-grid,
  .mb-grid--shelf,
  .mb-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mb-feature__card { grid-template-columns: 1fr; }
  .mb-feature__media { max-width: 14rem; }

  .mb-lecturas__table thead { display: none; }
  .mb-lecturas__table tr {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--mb-line);
  }
  .mb-lecturas__table td {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.5rem;
    border: 0;
    padding: 0.25rem 0.9rem;
  }
  .mb-lecturas__table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mb-muted);
    font-weight: 600;
  }

  /* Tabla real de producción: scroll horizontal (sin data-label) */
  .mb-lecturas--content .mb-lecturas__table-wrap {
    -webkit-overflow-scrolling: touch;
  }
  .mb-lecturas--content table {
    min-width: 40rem;
  }
}

@media (max-width: 420px) {
  .mb-grid,
  .mb-grid--shelf,
  .mb-grid--compact { grid-template-columns: 1fr; max-width: 18rem; margin-inline: auto; }
}
