/* ─────────────────────────────────────────────────────────────
   FIFÍ DE PUEBLO · gama alta
   Capa final. No cambia textos, rutas ni datos.
   El reposo sigue siendo visible: nada nace en opacity 0.
   Niebla y lustre animan sólo transform y opacity.
   ───────────────────────────────────────────────────────────── */

body[data-editorial] {
  --gama-ink: var(--obsidian-black);
  --gama-cream: var(--mist-white);
  --gama-gold: var(--golden-crema);
  --gama-line: rgb(182 130 53 / 0.55);
  --gama-ease: cubic-bezier(0.65, 0, 0.35, 1);
  --gama-enter: cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-editorial][data-ruta="/"] .hero .orfe-polvo,
body[data-editorial][data-ruta="/"] .hero .orfe-rive {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

body[data-editorial][data-ruta="/"] .hero .orfe-rive {
  width: 120px;
  height: 120px;
  inset: auto 16px 16px auto;
}

/* ── Barra fija, espresso, filete de oro ─────────────────────
   Chat y admin se quedan con su barra: ahí el layout es una
   herramienta, no una portada. */

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.oscuro,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.claro {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  color: var(--gama-cream);
  background: rgb(16 14 12 / 0.94);
  border-bottom: 1px solid var(--gama-line);
  padding-block: 12px;
  transition: transform 0.55s var(--gama-ease);
}

body[data-editorial][data-ruta="/"] nav.oscuro {
  color: var(--gama-cream);
  background: rgb(16 14 12 / 0.9);
  border-bottom: 1px solid var(--gama-line);
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.oscuro .marca,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.oscuro .seccion,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.oscuro .entrar,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.oscuro summary,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.claro .marca,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.claro .seccion,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.claro .entrar,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.claro summary,
body[data-editorial][data-ruta="/"] nav.oscuro .marca,
body[data-editorial][data-ruta="/"] nav.oscuro .seccion,
body[data-editorial][data-ruta="/"] nav.oscuro .entrar,
body[data-editorial][data-ruta="/"] nav.oscuro summary {
  color: var(--gama-cream);
}

body[data-editorial] nav .seccion.activa {
  color: var(--gama-gold);
}

body[data-editorial] nav.gama-oculta {
  transform: translateY(-110%);
}

body[data-editorial]:not([data-ruta="/"]):not([data-ruta^="/chat"]):not([data-ruta^="/admin"]):has(nav.claro) .pagina {
  padding-top: 4.75rem;
  background: linear-gradient(var(--chiapas-espresso) 0 5.25rem, var(--marfil) 5.25rem calc(100% - 160px), var(--chiapas-espresso) calc(100% - 160px));
}

/* ── Aperturas interiores: banda de obsidiana ──────────────── */

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera {
  background: var(--gama-ink);
  color: var(--gama-cream);
  border-bottom: 1px solid var(--gama-line);
  /* 068 · Sobre la obsidiana, la tinta de papel se invierte. Sin esto los
     controles de cabecera que escriben con --carbon o --piedra (pestañas de la
     galería, cuentas) salían a 1,1:1 y 3,0:1 sobre negro. Medido. */
  --carbon: var(--mist-white);
  --piedra: rgb(245 243 240 / 0.72);
  --oro-texto: var(--golden-crema);
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera h1,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera p {
  color: var(--gama-cream);
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera .ante,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera .antetitulo {
  color: var(--gama-gold);
}

body[data-editorial][data-ruta="/sobre"] header {
  background: var(--gama-ink);
  color: var(--gama-cream);
}

body[data-editorial][data-ruta="/sobre"] header h1,
body[data-editorial][data-ruta="/sobre"] header .entrada {
  color: var(--gama-cream);
}

body[data-editorial][data-ruta="/sobre"] header .antetitulo {
  color: var(--gama-gold);
}

body[data-editorial][data-ruta^="/lugares/"] .hero {
  background: var(--gama-ink);
  color: var(--gama-cream);
}

body[data-editorial][data-ruta^="/lugares/"] .hero-texto,
body[data-editorial][data-ruta^="/lugares/"] .hero h1 {
  color: var(--gama-cream);
}

body[data-editorial][data-ruta^="/lugares/"] .hero .miga,
body[data-editorial][data-ruta^="/lugares/"] .hero .creditos,
body[data-editorial][data-ruta^="/lugares/"] .hero .atribucion {
  color: #d6cdbb;
}

/* ── Portada: el valle se ve, el titular es marfil sólido ──── */

body[data-editorial][data-ruta="/"] .hero {
  position: relative;
  min-height: 100svh;
  /* 068 · auto, no 100svh: con 100svh fijo, en pantallas de 800 px de alto el
     texto del hero se salía 53 px por abajo y la franja de datos caía sobre
     la línea «Bosque de niebla…» y bajo el atajo del chat (medido a 1280×800). */
  height: auto;
  max-height: none;
  isolation: isolate;
}

body[data-editorial][data-ruta="/"] .hero-hueco {
  background: transparent !important;
  min-height: clamp(72px, 12vh, 140px) !important;
}

body[data-editorial][data-ruta="/"] .hero-velo {
  background:
    linear-gradient(to bottom, rgb(16 14 12 / 0.32), transparent 16%),
    linear-gradient(to top, rgb(16 14 12 / 0.58), transparent 44%);
}

body[data-editorial][data-ruta="/"] .hero::before,
body[data-editorial][data-ruta="/"] .hero::after,
body[data-editorial][data-ruta="/"] .hero-velos {
  display: none;
}

body[data-editorial][data-ruta="/"] .hero::before,
body[data-editorial][data-ruta="/"] .hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 2;
  left: -6%;
  right: -6%;
}

body[data-editorial][data-ruta="/"] .hero::before {
  top: 0;
  height: 28%;
  background: linear-gradient(to bottom, rgb(16 14 12 / 0.42), transparent);
}

body[data-editorial][data-ruta="/"] .hero::after {
  bottom: 0;
  height: 42%;
  background:
    linear-gradient(to top, rgb(16 14 12 / 0.55), transparent 72%),
    radial-gradient(70% 90% at 20% 100%, rgb(243 240 234 / 0.14), transparent 70%);
  animation: gama-niebla 16s var(--gama-enter) infinite alternate;
}

body[data-editorial][data-ruta="/"] .hero-texto {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  /* 068 · 4.25rem al pie, no 2.5: la línea «Bosque de niebla…» (bottom 17 px,
     enlace de 44 px) y el atajo del chat ocupan los últimos ~64 px. Con 2.5rem
     la franja bajaba hasta ellos en pantallas de 800 px de alto (medido). */
  padding: 5.5rem clamp(22px, 4vw, 72px) 4.25rem;
}

body[data-editorial][data-ruta="/"] .antetitulo {
  display: block;
  margin: 0 0 22px;
  color: var(--gama-gold);
  font-family: var(--font-ui), "Jost", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-shadow: 0 8px 24px rgb(8 7 6 / 0.65);
}

body[data-editorial][data-ruta="/"] .titular {
  color: var(--gama-cream);
  font-weight: 500;
  text-align: left;
  text-shadow: 0 22px 48px rgb(8 7 6 / 0.55);
}

body[data-editorial][data-ruta="/"] .titular-caja {
  margin: 0;
  width: min(100%, 18ch);
}

body[data-editorial][data-ruta="/"] .guia {
  align-items: flex-start;
  text-align: left;
  max-width: 34rem;
}

body[data-editorial][data-ruta="/"] .hero-sumario {
  margin: 16px 0 0;
  text-align: left;
  max-width: 22ch;
}

body[data-editorial][data-ruta="/"] .linea-uno {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #fdfbf7 !important;
  -webkit-text-fill-color: #fdfbf7 !important;
}

body[data-editorial][data-ruta="/"] .linea-dos {
  color: rgb(243 240 234 / 0.92);
}

@media (hover: hover) and (pointer: fine) {
  body[data-editorial][data-ruta="/"] .linea-dos {
    transform: translate3d(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * -8px), 0);
    transition: transform 0.7s var(--gama-enter);
  }

  body[data-editorial] .boton-oro,
  body[data-editorial] .boton-claro,
  body[data-editorial] .chat-flotante,
  body[data-editorial] [data-iman] {
    transform: translate3d(calc(var(--ix, 0) * 1px), calc(var(--iy, 0) * 1px), 0);
    transition: transform 0.45s var(--gama-enter), border-color 0.35s var(--gama-ease);
  }
}

/* El calco no sustituye al h1: si el recorte falla, este clon
   queda transparente y el titular de verdad sigue en marfil. */
body[data-editorial][data-ruta="/"] .lustre-texto {
  display: block;
  font-weight: 500;
  font-size: clamp(92px, 11.6vw, 178px);
  line-height: 0.82;
  letter-spacing: -0.055em;
  opacity: 0.42;
  animation: gama-vapor 8s var(--gama-ease) infinite alternate;
}

@media (min-width: 900px) {
  body[data-editorial][data-ruta="/"] .titular,
  body[data-editorial][data-ruta="/"] .lustre-texto {
    font-size: clamp(118px, 13.4vw, 210px);
  }

  body[data-editorial][data-ruta="/"] .capitulo-abre .titulo-capitulo {
    font-size: clamp(64px, 7.2vw, 118px);
  }
}

/* ── Pie de portada: la firma a escala de cartel ───────────── */

body[data-editorial] footer .firma {
  font-family: var(--font-heading), "Cormorant Garamond", Palatino, serif;
  font-weight: 500;
  font-size: clamp(4.5rem, 14vw, 11rem);
  line-height: 0.84;
  letter-spacing: -0.045em;
  color: var(--gama-cream);
}

body[data-editorial] footer .lema {
  max-width: 28ch;
  font-size: 1.05rem;
  line-height: 1.45;
}

body[data-editorial] .titulo-capitulo,
body[data-editorial] .titulo-chat,
body[data-editorial] .cabecera h1 {
  letter-spacing: -0.04em;
  text-wrap: balance;
}

body[data-editorial] .boton-oro,
body[data-editorial] .boton-claro,
body[data-editorial] .chat-flotante {
  min-height: 44px;
}

@media (hover: hover) {
  body[data-editorial] .trama,
  body[data-editorial] .lamina,
  body[data-editorial] .episodio-marco,
  body[data-editorial] .foto {
    overflow: hidden;
  }

  body[data-editorial] .trama img,
  body[data-editorial] .lamina-img,
  body[data-editorial] .episodio-marco img,
  body[data-editorial] .foto {
    transition: transform 0.7s var(--gama-enter);
  }

  body[data-editorial] .tarjeta:hover .trama img,
  body[data-editorial] .tarjeta:hover .foto,
  body[data-editorial] .episodio:hover .episodio-marco img,
  body[data-editorial] .lamina:hover .lamina-img {
    transform: scale(1.045);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    body[data-editorial] .titulo-capitulo,
    body[data-editorial] .titulo-medio,
    body[data-editorial] .titulo-grande {
      animation: gama-asomo linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

@keyframes gama-niebla {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(2.2%, -1.4%, 0); }
}

@keyframes gama-vapor {
  from { opacity: 0.22; }
  to { opacity: 0.7; }
}

@keyframes gama-asomo {
  from { transform: translate3d(0, 14px, 0); }
  to { transform: none; }
}

/* El valle se desplaza al bajar. En gama alta el reloj escribe el
   transform y esta animación no compite: el estilo en línea gana. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body[data-editorial][data-ruta="/"] .bosque {
      animation: gama-fondo linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100svh;
    }
  }

  @supports (animation-timeline: view()) {
    body[data-editorial] .archivo-reja figure,
    body[data-editorial] .tarjeta .trama {
      animation: gama-recorte linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}

@keyframes gama-fondo {
  from { transform: scale(1.06); }
  to { transform: scale(1.1) translate3d(0, 6%, 0); }
}

@keyframes gama-recorte {
  from { clip-path: inset(7% 0 10% 0); }
  to { clip-path: inset(0); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-editorial] nav.oscuro,
  body[data-editorial] nav.claro,
  body[data-editorial][data-ruta="/"] .hero::after,
  body[data-editorial][data-ruta="/"] .lustre-texto,
  body[data-editorial] .titulo-capitulo,
  body[data-editorial] .titulo-medio,
  body[data-editorial] .titulo-grande,
  body[data-editorial] .cabecera h1,
  body[data-editorial] .trama img,
  body[data-editorial] .lamina-img,
  body[data-editorial] .episodio-marco img,
  body[data-editorial] .foto {
    animation: none;
    transition: none;
  }

  body[data-editorial][data-ruta="/"] .linea-dos,
  body[data-editorial] .boton-oro,
  body[data-editorial] .boton-claro,
  body[data-editorial] .chat-flotante,
  body[data-editorial] [data-iman] {
    transform: none;
    transition: none;
  }

  body[data-editorial] nav.gama-oculta {
    transform: none;
  }
}

@media (max-width: 700px) {
  body[data-editorial][data-ruta="/"] .hero {
    height: auto;
    min-height: 100svh;
  }

  body[data-editorial][data-ruta="/"] .hero-texto {
    padding: 5.25rem 22px 1.75rem;
    text-align: left;
    justify-content: flex-end;
    align-items: flex-start;
  }

  body[data-editorial][data-ruta="/"] .hero-sumario {
    margin: 14px 0 0;
    text-align: left;
    max-width: 18ch;
  }

  body[data-editorial][data-ruta="/"] .titular-caja {
    width: 100%;
  }

  body[data-editorial][data-ruta="/"] .antetitulo {
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  body[data-editorial][data-ruta="/"] .lustre-texto {
    font-size: clamp(85px, 24vw, 150px);
  }

  body[data-editorial] footer .firma {
    font-size: clamp(3.4rem, 18vw, 5.5rem);
  }

  /* El panel colapsaba: top:100% y bottom:0 a la vez, y las
     letras salían sin fondo encima del titular. */
  body[data-editorial] nav .menu-movil[open] .menu-panel {
    position: fixed;
    top: 4.25rem;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    z-index: 5;
    margin: 0;
    padding: 8px 28px 28px;
    background: var(--chiapas-espresso) !important;
    color: var(--mist-white);
    box-shadow: none;
    overflow: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }

  body[data-editorial] nav .menu-movil[open] .menu-panel a {
    font: 500 clamp(34px, 9vw, 46px) / 1.05 var(--font-heading), Palatino, serif !important;
    letter-spacing: -0.03em;
    color: var(--mist-white);
    min-height: 52px;
    padding: 6px 0;
    border-bottom: 1px solid rgb(182 130 53 / 0.35);
    text-decoration: none;
  }

  body[data-editorial] nav .menu-movil[open] .menu-panel a span {
    display: none;
  }

  body[data-editorial][data-ruta="/"] .origen {
    background: none;
    margin-top: 18px;
    padding: 12px 0 4px;
    gap: 8px 0;
    border-top: 1px solid rgb(228 201 154 / 0.4);
  }

  body[data-editorial][data-ruta="/"] .origen::before {
    inset: -10px -16px -14px -16px;
    width: auto;
    background: color-mix(in srgb, var(--obsidian-black) 88%, transparent);
  }

  body[data-editorial][data-ruta="/"] .ap-dato {
    gap: 2px;
    padding: 4px 8px;
  }

  body[data-editorial][data-ruta="/"] .chat-flotante {
    bottom: 14px;
  }
}

@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body[data-editorial][data-ruta="/"] .chat-flotante {
      animation: gama-ceder linear both;
      animation-timeline: scroll(root);
      animation-range: 80svh 120svh;
    }
    /* Un foco invisible no es foco: si el teclado llega antes que el scroll, se ve. */
    body[data-editorial][data-ruta="/"] .chat-flotante:focus-visible {
      opacity: 1 !important;
      pointer-events: auto !important;
    }
  }
}

@keyframes gama-ceder {
  from { opacity: 0; pointer-events: none; }
  to { opacity: 1; pointer-events: auto; }
}

body[data-editorial]:has(nav .menu-movil[open]) {
  overflow: hidden;
}

/* Escritorio. Aquí había `nav .menu-movil { display: none }` con el
   argumento de que «los enlaces ya están en la barra». No lo estaban: la
   barra sólo lleva 3 de las 6 secciones (Nav.astro, enlaces.slice(0,3)) y
   Podcast, Agenda, Sobre y Entrar quedaban sin ninguna entrada en escritorio.
   El botón «Menú» vuelve, con el desplegable de escritorio que ya define
   editorial.css (panel de 460 px a la derecha). 2026-11-01, decisión 146. */
@media (min-width: 701px) {

  /* Si el menú estaba abierto y la ventana crece, la página vuelve a scrollear. */
  body[data-editorial]:has(nav .menu-movil[open]) {
    overflow: visible;
  }
}

/* Galería: la pieza central estaba suelta y tapaba el mosaico. */
body[data-editorial][data-ruta="/galeria"] .archivo-reja {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  grid-template-rows: minmax(220px, 28vw) minmax(200px, 24vw) auto;
  gap: 12px;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .bosque {
  grid-column: 1;
  grid-row: 1 / 3;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .hojas {
  grid-column: 2;
  grid-row: 1;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .detalle {
  grid-column: 3;
  grid-row: 1;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .valle {
  grid-column: 2;
  grid-row: 2;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .central {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  grid-column: 3;
  grid-row: 2;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .central a {
  height: 100%;
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja .central figcaption {
  position: absolute;
  background: rgb(16 14 12 / 0.55);
  color: var(--mist-white);
}

body[data-editorial][data-ruta="/galeria"] .archivo-reja img {
  transform: none;
  object-fit: cover;
}

body[data-editorial][data-ruta="/galeria"] .archivo-titulo {
  grid-column: 1 / -1;
  grid-row: 3;
  padding: 4px 0 0;
}

body[data-editorial][data-ruta="/galeria"] .archivo-titulo h2 {
  font-size: clamp(32px, 4vw, 52px);
  margin: 0;
}

@media (max-width: 700px) {
  body[data-editorial][data-ruta="/galeria"] .archivo-reja {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 160px 160px auto;
  }

  body[data-editorial][data-ruta="/galeria"] .archivo-reja .bosque {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  body[data-editorial][data-ruta="/galeria"] .archivo-reja .hojas {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-editorial][data-ruta="/galeria"] .archivo-reja .detalle {
    grid-column: 2;
    grid-row: 2;
  }

  body[data-editorial][data-ruta="/galeria"] .archivo-reja .valle {
    grid-column: 1;
    grid-row: 3;
  }

  body[data-editorial][data-ruta="/galeria"] .archivo-reja .central {
    display: block !important;
    grid-column: 2;
    grid-row: 3;
  }
}

/* Pie: la firma es un renglón, no tres líneas sueltas. */
body[data-editorial] footer .columnas > div:first-child {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 32px;
  padding-bottom: 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgb(228 201 154 / 0.28);
}

/* El trazo ya dice «Fifí de Pueblo». El mismo nombre en romano,
   debajo, era la segunda firma y en el teléfono se cortaba. */
body[data-editorial] footer .columnas .firma {
  display: none;
}

body[data-editorial] footer .cierre {
  justify-content: center;
  text-align: center;
  padding-bottom: 8px;
}

/* Un solo espresso. La barra estaba al 94 % sobre marfil y se leía
   más cálida que la banda del título, que era #1b2246 sólido. */
html:has(body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"])) {
  background: var(--chiapas-espresso);
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) {
  background: var(--chiapas-espresso);
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.oscuro,
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) nav.claro,
body[data-editorial][data-ruta="/"] nav.oscuro {
  background: var(--chiapas-espresso) !important;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) footer {
  box-shadow: none;
}

body[data-editorial] .cabecera {
  box-shadow: inset 0 -1px 0 rgb(182 130 53 / 0.55);
}

body[data-editorial] ::selection {
  background: #3e5a80;
  color: var(--mist-white);
}

/* Hilo de lectura. Una sola línea, el scroll del documento.
   Sin JavaScript. En reposo, al inicio, mide cero: no tapa la barra. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"])::before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      z-index: 81;
      width: 100%;
      height: 1px;
      background: #3e5a80;
      transform-origin: left center;
      pointer-events: none;
      animation: gama-hilo linear both;
      animation-timeline: scroll(root);
      animation-range: 0% 100%;
    }
  }
}

@keyframes gama-hilo {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* El marco textil se ve en reposo. Antes nacía recortado del todo
   y sólo aparecía al pasar el puntero. */
body[data-editorial] [data-tejer-borde] {
  clip-path: inset(0 0 0 0);
  opacity: 0.9;
}

/* Esquinas generadas. Reposo visible. No recortan la foto al entrar. */
body[data-editorial] .tarjeta .trama {
  animation-name: none;
  clip-path: none;
}

body[data-editorial] .tarjeta .trama::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 9px;
  pointer-events: none;
  background:
    linear-gradient(#3e5a80, #3e5a80) left 0 top 0 / 22px 2px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) left 0 top 0 / 2px 22px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) right 0 top 0 / 22px 2px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) right 0 top 0 / 2px 22px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) left 0 bottom 0 / 22px 2px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) left 0 bottom 0 / 2px 22px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) right 0 bottom 0 / 22px 2px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) right 0 bottom 0 / 2px 22px no-repeat;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera {
  position: relative;
  background-image: none;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .cabecera::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 12px clamp(12px, 2.2vw, 28px);
  pointer-events: none;
  background:
    linear-gradient(var(--gama-gold), var(--gama-gold)) left 0 top 0 / 28px 2px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) left 0 top 0 / 2px 28px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) right 0 top 0 / 28px 2px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) right 0 top 0 / 2px 28px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) left 0 bottom 0 / 28px 2px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) left 0 bottom 0 / 2px 28px no-repeat,
    linear-gradient(var(--gama-gold), var(--gama-gold)) right 0 bottom 0 / 28px 2px no-repeat,
    linear-gradient(#3e5a80, #3e5a80) right 0 bottom 0 / 2px 28px no-repeat;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) footer {
  background: var(--chiapas-espresso) !important;
}

body[data-editorial] nav .seccion {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}

/* La firma caligráfica se salía de su casilla de 150 px y empujaba
   el ancho de la página. El nombre en romano ya no va en una sola
   línea más ancha que el teléfono: eso recortaba el menú y el título. */
body[data-editorial] footer .sello {
  height: auto;
  padding: 36px 24px 12px;
  overflow: hidden;
}

body[data-editorial] footer .sello .firma-editorial {
  width: min(240px, 68vw) !important;
  height: auto !important;
  max-height: none;
  margin: 0 auto;
}

body[data-editorial] nav[aria-label="Atajo al chat"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: visible;
  background: transparent;
}

body[data-editorial] .pagina {
  background-color: var(--marfil);
  background-image: linear-gradient(var(--chiapas-espresso), var(--chiapas-espresso));
  background-size: 100% 160px;
  background-repeat: no-repeat;
  background-position: bottom;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) footer {
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .pagina::after {
  content: none;
}

@media (max-width: 700px) {
  body[data-editorial] .cabecera-fila {
    flex-direction: column;
    align-items: flex-start;
  }

  body[data-editorial] .cabecera h1 {
    font-size: clamp(40px, 11vw, 56px);
    max-width: 100%;
  }

  body[data-editorial] .cabecera .ante {
    letter-spacing: 0.12em;
    max-width: 100%;
  }

  body[data-editorial] nav .marca {
    min-width: 0;
    flex: 1 1 auto;
  }

  body[data-editorial] nav .marca-nombre {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-editorial] nav .menu-movil {
    flex: none;
  }
}

/* ── Paleta. editorial.css la había corrido a tres marrones.
      Desde 066 los valores salen de la paleta fuente de tokens.css;
      la obsidiana vuelve a ser el lienzo y el espresso, la marca. ── */
body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) {
  --lino: #fdfbf7;
  --marfil: #fdfbf7;
  --beige: #ece5d6;
  --carbon: #222b52;
  --piedra: #5a5f73;
  --espresso: #1f2538;
  --obsidiana: #1f2538;
  --oro: #3e5a80;
  --oro-texto: #3e5a80;
  --oro-claro: #dda13f;
  --ed-acento: #9a4a1c;
  --hilo-jade: #2f4a4f;
  --hilo-grana: #9a4a1c;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) .menu-panel {
  background: var(--chiapas-espresso) !important;
  color: var(--mist-white) !important;
}

body[data-editorial]:not([data-ruta^="/chat"]):not([data-ruta^="/admin"]) footer {
  color: var(--mist-white) !important;
}

/* El trazo es el eje. El lema cae debajo, centrado.
   Las columnas respiran. El chat queda en la franja vacía. */
body[data-editorial] footer .columnas > div:first-child {
  justify-content: center;
  text-align: center;
  border-bottom-color: rgb(182 130 53 / 0.4);
  padding-bottom: 28px;
}

body[data-editorial] footer .lema {
  max-width: 36ch;
  margin-inline: auto;
  text-align: center;
  color: rgb(243 240 234 / 0.82);
  font-size: 1.05rem;
  line-height: 1.5;
}

body[data-editorial] footer .columnas {
  gap: clamp(36px, 5vw, 72px);
}

body[data-editorial] footer .columna-titulo {
  color: var(--gama-gold);
  letter-spacing: 0.18em;
}

body[data-editorial] .chat-flotante,
body[data-editorial][data-ruta="/"] .chat-flotante {
  bottom: calc(16px + env(safe-area-inset-bottom));
}

@media (max-width: 700px) {
  body[data-editorial] footer .columna {
    align-items: center;
    text-align: center;
  }

  body[data-editorial] footer .columnas {
    gap: 20px;
    padding-top: 4px;
  }
}

/* Pie interior: la firma cabe, el crédito y los tres enlaces
   caen en el mismo eje, y no queda un pozo negro debajo. */
body[data-editorial] footer .firma-pie {
  height: auto;
  padding: 28px 24px 0;
}

body[data-editorial] footer .firma-pie .firma-editorial {
  width: min(210px, 58vw) !important;
  height: auto !important;
  margin: 0 auto;
}

body[data-editorial] footer .pie {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 24px 12px;
  gap: 16px;
}

body[data-editorial] footer .aviso {
  text-align: center;
  max-width: 34ch;
}

body[data-editorial] footer .enlaces {
  justify-content: center;
}

@media (max-width: 700px) {
  body[data-editorial][data-ruta="/lugares"] .barra-derecha,
  body[data-editorial][data-ruta="/lugares"] .busca {
    width: 100%;
    min-width: 0;
  }

  body[data-editorial][data-ruta="/lugares"] .busca-campo {
    width: auto;
    flex: 1;
    min-width: 0;
  }
}

/* Portada, después del valle: un capítulo grande, una ficha ancha
   y dos estrechas. El texto no se justifica. */
body[data-editorial][data-ruta="/"] .titulo-medio,
body[data-editorial][data-ruta="/"] .titulo-grande,
body[data-editorial][data-ruta="/"] .titulo-capitulo {
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

body[data-editorial][data-ruta="/"] .prosa,
body[data-editorial][data-ruta="/"] .tarjeta-extracto,
body[data-editorial][data-ruta="/"] .banda-mapa-texto {
  text-align: left;
  hyphens: manual;
}

@media (min-width: 800px) {
  body[data-editorial][data-ruta="/"] .tarjetas {
    grid-template-columns: 1.45fr 0.78fr 0.78fr;
    align-items: start;
  }
}
