/* KoiHoy — hoja de estilos principal */
:root {
  --papel: #f6f1e8;
  --papel-2: #efe7da;
  --superficie: #fffdf9;
  --tinta: #1d1a16;
  --tinta-2: #4a443c;
  --tinta-3: #7a7266;
  --linea: #ddd3c3;
  --kohaku: #c0392b;
  --kohaku-osc: #9c2c21;
  --oro: #a8824a;
  --indigo: #1d2b3a;
  --indigo-2: #26384b;
  --sombra: 0 1px 2px rgba(29, 26, 22, .06), 0 8px 24px rgba(29, 26, 22, .07);
  --radio: 14px;
  --ancho: 1180px;
  --lectura: 700px;
  --f-titulo: "Shippori Mincho", "Noto Serif JP", Georgia, serif;
  --f-texto: "Source Serif 4", Georgia, serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #12161b; --papel-2: #182029; --superficie: #1a2028;
    --tinta: #eee8dd; --tinta-2: #c8c0b3; --tinta-3: #948b7e; --linea: #2c3540;
    --kohaku: #e0574a; --kohaku-osc: #f07264; --oro: #cfa86c;
    --indigo: #0d1116; --indigo-2: #141b23;
    --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papel: #12161b; --papel-2: #182029; --superficie: #1a2028;
  --tinta: #eee8dd; --tinta-2: #c8c0b3; --tinta-3: #948b7e; --linea: #2c3540;
  --kohaku: #e0574a; --kohaku-osc: #f07264; --oro: #cfa86c;
  --indigo: #0d1116; --indigo-2: #141b23;
  --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font-family: var(--f-ui); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }
a { color: inherit; }
::selection { background: var(--kohaku); color: #fff; }
:focus-visible { outline: 2px solid var(--kohaku); outline-offset: 3px; border-radius: 4px; }
.salto { position: absolute; left: -9999px; top: 0; background: var(--tinta); color: var(--papel); padding: .6rem 1rem; z-index: 100; }
.salto:focus { left: 1rem; top: 1rem; }
.contenedor { width: min(var(--ancho), 100% - 2rem); margin-inline: auto; }
.visual-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--papel) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.cabecera.con-borde { border-bottom-color: var(--linea); }
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.marca { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.marca svg, .marca .logo { width: 42px; height: 42px; flex: none; object-fit: contain; }
.logo-claro { display: none; }
:root[data-theme="dark"] .logo-tinta { display: none; }
:root[data-theme="dark"] .logo-claro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-tinta { display: none; }
  :root:not([data-theme="light"]) .logo-claro { display: block; }
}
.marca-texto { font-family: var(--f-titulo); font-size: 1.45rem; font-weight: 700; letter-spacing: .01em; line-height: 1; }
.marca-texto span { color: var(--kohaku); }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  font-size: .93rem; font-weight: 500; text-decoration: none; color: var(--tinta-2);
  padding: .5rem .8rem; border-radius: 999px; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--tinta); background: var(--papel-2); }
.nav a[aria-current="page"] { color: var(--kohaku); }
.btn-icono {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--linea); background: transparent; color: var(--tinta); cursor: pointer;
}
.btn-icono:hover { background: var(--papel-2); }
.btn-icono svg { width: 18px; height: 18px; }
.solo-movil { display: none; }
.icono-sol { display: none; }
:root[data-theme="dark"] .icono-sol { display: block; }
:root[data-theme="dark"] .icono-luna { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icono-sol { display: block; }
  :root:not([data-theme="light"]) .icono-luna { display: none; }
}
@media (max-width: 760px) {
  .solo-movil { display: inline-grid; }
  .nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--papel); border-bottom: 1px solid var(--linea); padding: .75rem 1rem 1.25rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .nav.abierta { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { font-size: 1.05rem; padding: .8rem 1rem; border-radius: 10px; }
}
.acciones { display: flex; align-items: center; gap: .5rem; }

/* ---------- Botones y etiquetas ---------- */
.boton {
  display: inline-flex; align-items: center; gap: .5rem; font: 600 .95rem var(--f-ui);
  padding: .85rem 1.4rem; border-radius: 999px; text-decoration: none; border: 1px solid transparent;
  background: var(--kohaku); color: #fff; cursor: pointer; transition: background .15s, transform .15s;
}
.boton:hover { background: var(--kohaku-osc); transform: translateY(-1px); }
.boton.secundario { background: transparent; color: var(--tinta); border-color: var(--linea); }
.boton.secundario:hover { background: var(--papel-2); }
.boton svg { width: 18px; height: 18px; }
.etiqueta {
  display: inline-flex; align-items: center; gap: .4rem; font: 600 .72rem var(--f-ui);
  text-transform: uppercase; letter-spacing: .12em; color: var(--kohaku); text-decoration: none;
}
.etiqueta::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.meta { font-size: .85rem; color: var(--tinta-3); display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; }
.meta span + span::before { content: "·"; margin-right: .9rem; color: var(--linea); }

/* ---------- Portada ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: url("../img/seigaiha.svg"); background-size: 64px 32px;
  -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 100%);
  mask-image: linear-gradient(115deg, transparent 35%, #000 100%);
}
.hero .contenedor { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 {
  font-family: var(--f-titulo); font-weight: 700; font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.04; letter-spacing: -.015em; margin: 1rem 0 1.25rem;
}
.hero h1 em { font-style: normal; color: var(--kohaku); }
.hero p.entradilla { font-family: var(--f-texto); font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--tinta-2); max-width: 34rem; margin: 0 0 2rem; }
.hero .botones { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-imagen { position: relative; }
.hero-imagen img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 200px 200px var(--radio) var(--radio);
  box-shadow: var(--sombra);
}
.hero-kanji {
  position: absolute; top: 1.5rem; right: -1.1rem; writing-mode: vertical-rl;
  font-family: var(--f-titulo); font-size: 1.15rem; letter-spacing: .5em; color: var(--tinta);
  background: var(--superficie); padding: 1rem .55rem; border-radius: 999px; box-shadow: var(--sombra);
}
.hanko {
  position: absolute; left: -1.1rem; bottom: 2rem; width: 84px; height: 84px; border-radius: 12px;
  background: var(--kohaku); color: #fff; display: grid; place-items: center; transform: rotate(-6deg);
  font-family: var(--f-titulo); font-size: 1.05rem; line-height: 1.15; text-align: center; box-shadow: var(--sombra);
}
.cifras { display: flex; gap: 2.25rem; margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--linea); }
.cifras strong { display: block; font-family: var(--f-titulo); font-size: 1.9rem; line-height: 1; }
.cifras span { font-size: .82rem; color: var(--tinta-3); }
@media (max-width: 900px) {
  .hero .contenedor { grid-template-columns: 1fr; }
  .hero-imagen { max-width: 420px; margin-inline: auto; width: 100%; }
  .hero-kanji { right: -.5rem; }
  .hanko { left: -.5rem; }
}

/* ---------- Secciones ---------- */
.seccion { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.seccion.alterna { background: var(--papel-2); }
.seccion-cabecera { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.seccion-cabecera h2, .titulo-seccion {
  font-family: var(--f-titulo); font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.15; margin: .6rem 0 0; font-weight: 700;
}
.seccion-cabecera p { margin: .6rem 0 0; color: var(--tinta-2); max-width: 36rem; }
.enlace-flecha { font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--kohaku); display: inline-flex; gap: .4rem; align-items: center; }
.enlace-flecha:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Destacado */
.destacado {
  display: grid; grid-template-columns: 1.2fr 1fr; background: var(--superficie); border-radius: calc(var(--radio) + 6px);
  overflow: hidden; box-shadow: var(--sombra); text-decoration: none; border: 1px solid var(--linea);
}
.destacado-img { overflow: hidden; min-height: 320px; }
.destacado-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.destacado:hover .destacado-img img { transform: scale(1.03); }
.destacado-texto { padding: clamp(1.75rem, 4vw, 3.25rem); display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.destacado-texto h3 { font-family: var(--f-titulo); font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.15; margin: 0; }
.destacado-texto p { font-family: var(--f-texto); color: var(--tinta-2); font-size: 1.1rem; margin: 0; }
@media (max-width: 820px) { .destacado { grid-template-columns: 1fr; } .destacado-img { min-height: 0; aspect-ratio: 16/10; } }

/* Tarjetas */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.75rem; }
.tarjeta {
  display: flex; flex-direction: column; background: var(--superficie); border-radius: var(--radio); overflow: hidden;
  border: 1px solid var(--linea); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease;
}
.tarjeta:hover { transform: translateY(-4px); box-shadow: var(--sombra); }
.tarjeta-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--papel-2); }
.tarjeta-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tarjeta:hover .tarjeta-img img { transform: scale(1.04); }
.tarjeta-cuerpo { padding: 1.35rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.tarjeta h3 { font-family: var(--f-titulo); font-size: 1.35rem; line-height: 1.25; margin: 0; }
.tarjeta p { margin: 0; color: var(--tinta-2); font-size: .95rem; flex: 1; }
.tarjeta[hidden] { display: none; }

/* Temas */
.temas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.tema {
  position: relative; padding: 1.75rem 1.5rem; border-radius: var(--radio); background: var(--superficie);
  border: 1px solid var(--linea); text-decoration: none; overflow: hidden; transition: border-color .2s, transform .2s;
}
.tema:hover { border-color: var(--kohaku); transform: translateY(-3px); }
.tema-kanji { font-family: var(--f-titulo); font-size: 3rem; line-height: 1; color: var(--kohaku); opacity: .9; }
.tema h3 { font-family: var(--f-titulo); font-size: 1.25rem; margin: 1rem 0 .35rem; }
.tema p { margin: 0; font-size: .9rem; color: var(--tinta-2); }
.tema small { display: block; margin-top: 1rem; font-size: .78rem; color: var(--tinta-3); font-weight: 600; letter-spacing: .04em; }
@media (max-width: 960px) { .temas { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .temas { grid-template-columns: 1fr; } }

/* Cita / leyenda */
.leyenda { background: var(--indigo); color: #f1ebe0; position: relative; overflow: hidden; }
.leyenda::after {
  content: "龍"; position: absolute; right: -2rem; bottom: -5rem; font-family: var(--f-titulo);
  font-size: 26rem; line-height: 1; color: rgba(255,255,255,.04); pointer-events: none;
}
.leyenda .contenedor { position: relative; z-index: 1; max-width: 860px; text-align: center; }
.leyenda .etiqueta { color: #e8a29a; justify-content: center; }
.leyenda blockquote { margin: 1.25rem 0 1.5rem; font-family: var(--f-titulo); font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.4; }
.leyenda p { color: rgba(241,235,224,.75); font-family: var(--f-texto); font-size: 1.1rem; margin: 0 auto; max-width: 40rem; }

/* Glosario */
.glosario { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0; border-top: 1px solid var(--linea); }
.glosario div { padding: 1.4rem 1.25rem 1.4rem 0; border-bottom: 1px solid var(--linea); }
.glosario dt { font-family: var(--f-titulo); font-size: 1.2rem; font-weight: 700; display: flex; align-items: baseline; gap: .6rem; }
.glosario dt small { font-size: .85rem; color: var(--kohaku); font-weight: 400; }
.glosario dd { margin: .35rem 0 0; color: var(--tinta-2); font-size: .93rem; }

/* CTA */
.cta {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: calc(var(--radio) + 6px);
  padding: clamp(2rem, 5vw, 3.5rem); display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
  background-image: url("../img/seigaiha.svg"); background-size: 64px 32px; background-position: right center;
}
.cta h2 { font-family: var(--f-titulo); font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .5rem 0 .5rem; }
.cta p { margin: 0; color: var(--tinta-2); max-width: 34rem; }
@media (max-width: 720px) { .cta { grid-template-columns: 1fr; } }

/* ---------- Listado de artículos ---------- */
.cabecera-pagina { padding: clamp(3rem, 6vw, 5rem) 0 2rem; }
.cabecera-pagina h1 { font-family: var(--f-titulo); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.1; margin: .75rem 0 .75rem; }
.cabecera-pagina p { font-family: var(--f-texto); font-size: 1.2rem; color: var(--tinta-2); max-width: 40rem; margin: 0; }
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0 2.5rem; }
.filtro {
  font: 500 .9rem var(--f-ui); padding: .55rem 1.05rem; border-radius: 999px; border: 1px solid var(--linea);
  background: transparent; color: var(--tinta-2); cursor: pointer; transition: all .15s;
}
.filtro:hover { border-color: var(--tinta-3); color: var(--tinta); }
.filtro[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--papel); }

/* ---------- Artículo ---------- */
.progreso { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--kohaku); z-index: 60; }
.articulo-cabecera { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; text-align: center; }
.articulo-cabecera .contenedor { max-width: 860px; }
.migas { font-size: .85rem; color: var(--tinta-3); margin-bottom: 1.5rem; }
.migas a { text-decoration: none; } .migas a:hover { color: var(--kohaku); }
.articulo-cabecera h1 { font-family: var(--f-titulo); font-size: clamp(2.3rem, 5.5vw, 3.9rem); line-height: 1.1; margin: 1rem 0 1.25rem; letter-spacing: -.01em; }
.articulo-cabecera .entradilla { font-family: var(--f-texto); font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--tinta-2); margin: 0 auto 1.5rem; max-width: 40rem; }
.articulo-cabecera .meta { justify-content: center; }
.portada-articulo { width: min(1100px, 100% - 2rem); margin: 1rem auto 0; }
.portada-articulo img { width: 100%; max-height: 620px; object-fit: cover; border-radius: calc(var(--radio) + 6px); box-shadow: var(--sombra); }

.articulo-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--lectura)) minmax(0, 1fr); gap: 2.5rem; padding: 3.5rem 0 2rem; }
.indice { grid-column: 1; justify-self: end; width: 100%; max-width: 230px; }
.indice-caja { position: sticky; top: 96px; font-size: .86rem; }
.indice-caja p { font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--tinta-3); margin: 0 0 .75rem; }
.indice ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--linea); }
.indice a { display: block; padding: .35rem 0 .35rem 1rem; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--tinta-3); line-height: 1.35; }
.indice a:hover { color: var(--tinta); }
.indice a.activo { color: var(--kohaku); border-left-color: var(--kohaku); }
.prosa { grid-column: 2; font-family: var(--f-texto); font-size: 1.16rem; line-height: 1.78; color: var(--tinta); }
.lateral { grid-column: 3; }
.compartir-caja { position: sticky; top: 96px; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.compartir-caja p { font: 700 .72rem var(--f-ui); text-transform: uppercase; letter-spacing: .1em; color: var(--tinta-3); margin: 0 0 .25rem; }
.compartir-caja a, .compartir-caja button { text-decoration: none; }
@media (max-width: 1100px) {
  .articulo-cuerpo { grid-template-columns: minmax(0, 1fr); max-width: var(--lectura); margin-inline: auto; width: calc(100% - 2rem); }
  .indice, .prosa, .lateral { grid-column: 1; }
  .indice { max-width: none; justify-self: stretch; }
  .indice-caja { position: static; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.25rem 1.25rem .75rem; }
  .lateral { order: 3; }
  .compartir-caja { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .compartir-caja p { margin: 0 .5rem 0 0; }
}
.prosa > :first-child { margin-top: 0; }
.prosa p { margin: 0 0 1.4em; }
.prosa > p:first-of-type::first-letter {
  float: left; font-family: var(--f-titulo); font-size: 4.1em; line-height: .85; margin: .08em .1em 0 0; color: var(--kohaku); font-weight: 700;
}
.prosa h2 { font-family: var(--f-titulo); font-size: 1.85rem; line-height: 1.25; margin: 2.4em 0 .8em; scroll-margin-top: 90px; clear: both; }
.prosa h3 { font-family: var(--f-titulo); font-size: 1.4rem; margin: 2em 0 .6em; scroll-margin-top: 90px; }
.prosa ul, .prosa ol { padding-left: 1.4em; margin: 0 0 1.5em; }
.prosa li { margin: .45em 0; padding-left: .25em; }
.prosa li::marker { color: var(--kohaku); }
.prosa a { color: var(--kohaku); text-underline-offset: 3px; }
.prosa strong { font-weight: 700; }
.prosa blockquote { margin: 2em 0; padding: .25em 0 .25em 1.5em; border-left: 3px solid var(--kohaku); font-style: italic; color: var(--tinta-2); }
.fig { margin: 2.25em 0; }
.fig img { border-radius: 10px; margin-inline: auto; background: var(--papel-2); cursor: zoom-in; }
.fig figcaption { font: .86rem/1.5 var(--f-ui); color: var(--tinta-3); margin-top: .75em; text-align: center; }
.fig-center img, .fig-none img { width: auto; max-width: 100%; }
@media (min-width: 700px) {
  .fig-right { float: right; width: 46%; margin: .4em 0 1.25em 2rem; }
  .fig-left { float: left; width: 46%; margin: .4em 2rem 1.25em 0; }
  .fig-right figcaption, .fig-left figcaption { text-align: left; }
}
@media (min-width: 1100px) {
  .fig-right { margin-right: -2.5rem; }
  .fig-left { margin-left: -2.5rem; }
}
.prosa::after { content: ""; display: table; clear: both; }
.fig.video { clear: both; }
.video-marco { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--sombra); }
.video-marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.fin-articulo { max-width: var(--lectura); margin: 0 auto; width: calc(100% - 2rem); padding-bottom: 3rem; }
.firma { display: flex; gap: 1.25rem; align-items: center; padding: 1.75rem; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); }
.firma svg, .firma .logo { width: 64px; height: 64px; flex: none; object-fit: contain; }
.firma h3 { margin: 0 0 .25rem; font-family: var(--f-titulo); font-size: 1.15rem; }
.firma p { margin: 0; color: var(--tinta-2); font-size: .93rem; }
.navegacion-articulos { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.navegacion-articulos a { padding: 1.25rem 1.4rem; border: 1px solid var(--linea); border-radius: var(--radio); text-decoration: none; transition: border-color .2s; }
.navegacion-articulos a:hover { border-color: var(--kohaku); }
.navegacion-articulos small { display: block; color: var(--tinta-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-bottom: .3rem; }
.navegacion-articulos strong { font-family: var(--f-titulo); font-size: 1.1rem; line-height: 1.3; }
.navegacion-articulos .siguiente { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .navegacion-articulos { grid-template-columns: 1fr; } .navegacion-articulos .siguiente { grid-column: 1; } }

/* Visor de imágenes */
.visor { position: fixed; inset: 0; background: rgba(10, 12, 15, .92); display: grid; place-items: center; z-index: 200; padding: 2rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
.visor.abierto { opacity: 1; pointer-events: auto; cursor: zoom-out; }
.visor img { max-height: 88vh; max-width: 100%; width: auto; border-radius: 8px; }
.visor p { color: #ddd; font-size: .9rem; text-align: center; margin: 1rem 0 0; max-width: 60ch; }

/* ---------- Páginas ---------- */
.pagina-texto { max-width: var(--lectura); margin: 0 auto; width: calc(100% - 2rem); padding-bottom: 4rem; }
.aviso { background: color-mix(in srgb, var(--oro) 14%, var(--superficie)); border: 1px dashed var(--oro); border-radius: var(--radio); padding: 1rem 1.25rem; font-size: .92rem; color: var(--tinta-2); margin-bottom: 2rem; }
.formulario { display: grid; gap: 1.1rem; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: clamp(1.5rem, 4vw, 2.25rem); }
.formulario label { font-weight: 600; font-size: .9rem; display: grid; gap: .4rem; }
.formulario input, .formulario textarea, .formulario select {
  font: 400 1rem var(--f-ui); color: var(--tinta); background: var(--papel); border: 1px solid var(--linea);
  border-radius: 10px; padding: .8rem .95rem; width: 100%;
}
.formulario input:focus, .formulario textarea:focus, .formulario select:focus { outline: none; border-color: var(--kohaku); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kohaku) 18%, transparent); }
.formulario textarea { min-height: 160px; resize: vertical; }
.formulario .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.formulario .casilla { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .85rem; color: var(--tinta-2); }
.formulario .casilla input { width: auto; margin-top: .25rem; }
@media (max-width: 560px) { .formulario .dos { grid-template-columns: 1fr; } }

/* ---------- Pie ---------- */
.pie { background: var(--indigo); color: rgba(241,235,224,.8); padding: 4rem 0 2rem; margin-top: 0; }
.pie a { color: rgba(241,235,224,.8); text-decoration: none; }
.pie a:hover { color: #fff; }
.pie-rejilla { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; }
.pie .marca-texto { color: #f1ebe0; }
.pie p { font-size: .93rem; max-width: 26rem; }
.pie h4 { font: 700 .75rem var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: #e8a29a; margin: .5rem 0 1rem; }
.pie ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .93rem; }
.pie-legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 3rem; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: rgba(241,235,224,.55); }
@media (max-width: 760px) { .pie-rejilla { grid-template-columns: 1fr 1fr; } .pie-rejilla > :first-child { grid-column: 1 / -1; } }

/* Animación de aparición */
.aparece { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.aparece.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .aparece { opacity: 1; transform: none; }
}
@media print {
  .cabecera, .pie, .indice, .lateral, .progreso, .fin-articulo .navegacion-articulos { display: none !important; }
  body { background: #fff; color: #000; }
}
