:root {
  --fondo: #faf7f2;
  --superficie: #ffffff;
  --texto: #1f1a16;
  --suave: #6b625a;
  --borde: #e8e1d7;
  --acento: #b4432c;
  --acento-suave: #f6e3dc;
  --sombra: 0 1px 2px rgb(40 25 10 / .06), 0 8px 24px rgb(40 25 10 / .06);
  --serif: "Literata", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #14110f;
    --superficie: #1d1916;
    --texto: #ece6df;
    --suave: #a59a8f;
    --borde: #2f2925;
    --acento: #e9785f;
    --acento-suave: #3a2219;
    --sombra: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font-family: var(--sans); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.saltar { position: absolute; left: -999px; }
.saltar:focus { left: 16px; top: 16px; background: var(--acento); color: #fff; padding: 8px 12px; z-index: 10; }

.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.contenedor-lectura { max-width: 700px; margin: 0 auto; padding: 0 16px; }

/* Cabecera */
.cabecera { background: var(--superficie); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5; }
.cabecera-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.logo-marca { color: var(--acento); font-size: 2rem; line-height: 1; margin-top: 10px; }
.cabecera nav { display: flex; gap: 18px; font-size: .92rem; }
.cabecera nav a { text-decoration: none; color: var(--suave); }
.cabecera nav a:hover { color: var(--texto); }

/* Portada */
.portada { padding: 56px 0 32px; }
.portada-mini { padding: 32px 0 8px; }
.sobretitulo { color: var(--acento); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 12px; }
.portada h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.25; max-width: 760px; margin: 0; text-wrap: balance; }

/* Filtros */
.filtros { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 28px; }
#buscar { width: 100%; max-width: 420px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); font: inherit; }
#buscar:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--borde); background: var(--superficie); color: var(--suave); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .88rem; cursor: pointer; }
.chip.activo, .chip:hover { background: var(--texto); color: var(--fondo); border-color: var(--texto); }

/* Tarjetas */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; box-shadow: var(--sombra); transition: transform .15s ease; }
.tarjeta:hover { transform: translateY(-3px); }
.tarjeta a { text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.tarjeta-img { aspect-ratio: 16 / 9; background: var(--acento-suave); position: relative; overflow: hidden; }
.tarjeta-img img { width: 100%; height: 100%; object-fit: cover; }
.tarjeta-img.sin-img { display: grid; place-items: center; font-family: var(--serif); font-size: 4rem; color: var(--acento); }
.chip-video { position: absolute; left: 10px; bottom: 10px; background: rgb(0 0 0 / .72); color: #fff; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.tarjeta-cuerpo { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tarjeta h2 { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; margin: 0; }
.tarjeta p { margin: 0; color: var(--suave); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.etiqueta { color: var(--acento); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; }
.meta { color: var(--suave); font-size: .82rem; margin-top: auto; }
.vacio { text-align: center; color: var(--suave); padding: 40px 0; }

.paginacion { display: flex; justify-content: space-between; align-items: center; margin: 40px 0; color: var(--suave); font-size: .9rem; gap: 12px; }
.paginacion a { color: var(--acento); font-weight: 600; text-decoration: none; }

/* Historia */
.historia-cab { padding-top: 44px; padding-bottom: 8px; }
.historia-cab h1 { font-family: var(--serif); font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.15; margin: 10px 0 14px; text-wrap: balance; }
.entradilla { font-family: var(--serif); font-size: 1.2rem; color: var(--suave); margin: 0 0 12px; font-style: italic; }
.historia-img { border-radius: 14px; margin: 16px 0; }

.texto { font-family: var(--serif); font-size: 1.2rem; line-height: 1.8; }
.texto p { margin: 0 0 1.3em; }
.texto h2, .texto h3 { font-family: var(--sans); margin: 2em 0 .6em; line-height: 1.3; }
.texto h2 { font-size: 1.4rem; }
.texto blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--acento); font-style: italic; color: var(--suave); }
.sep { border: 0; text-align: center; margin: 2em 0; }
.sep::before { content: "✦  ✦  ✦"; color: var(--suave); letter-spacing: .3em; }
.fin { text-align: center; color: var(--suave); font-style: italic; margin-top: 2.5em; }
.pagina-fija .texto { font-size: 1.05rem; }

/* Video (se carga solo al hacer clic, para que la página sea rápida) */
.video { margin: 20px 0; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-btn { all: unset; cursor: pointer; position: relative; display: block; width: 100%; height: 100%; }
.video-btn img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; background: var(--acento); color: #fff; display: grid; place-items: center; font-size: 1.6rem; padding-left: 5px; box-shadow: 0 6px 20px rgb(0 0 0 / .4); }
.video-txt { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 6px rgb(0 0 0 / .8); }

.compartir { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 20px 0; border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); margin: 24px 0; font-size: .92rem; }
.compartir span { color: var(--suave); margin-right: 4px; }
.compartir a, .compartir button { border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); border-radius: 8px; padding: 6px 12px; text-decoration: none; font: inherit; cursor: pointer; }
.compartir a:hover, .compartir button:hover { border-color: var(--acento); color: var(--acento); }

.anterior-siguiente { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0; }
.anterior-siguiente a { text-decoration: none; font-family: var(--serif); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.anterior-siguiente a.der { text-align: right; }
.anterior-siguiente small { font-family: var(--sans); color: var(--acento); font-weight: 600; font-size: .8rem; }
.relacionadas { padding: 24px 16px 48px; }
.relacionadas > h2 { font-family: var(--serif); font-weight: 600; }

.boton { display: inline-block; background: var(--acento); color: #fff; text-decoration: none; padding: 12px 20px; border-radius: 10px; font-weight: 600; margin-top: 20px; }

/* Anuncios */
.ad { margin: 28px 0; min-height: 100px; text-align: center; }
.ad-label { display: block; font-size: .7rem; color: var(--suave); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; font-family: var(--sans); }
.ad-demo { border: 1px dashed var(--borde); border-radius: 10px; display: grid; place-items: center; color: var(--suave); font-family: var(--sans); font-size: .8rem; }

/* Pie */
.pie { border-top: 1px solid var(--borde); background: var(--superficie); margin-top: 48px; padding: 32px 0 16px; font-size: .9rem; }
.pie-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pie p { margin: 4px 0; color: var(--suave); }
.pie nav { display: flex; flex-direction: column; gap: 6px; }
.pie nav a, .redes a { color: var(--suave); }
.copy { color: var(--suave); font-size: .8rem; margin-top: 24px; }

@media (max-width: 560px) {
  .cabecera-in { padding-top: 8px; padding-bottom: 8px; }
  .cabecera nav { gap: 14px; }
  .texto { font-size: 1.1rem; }
  .anterior-siguiente { grid-template-columns: 1fr; }
  .anterior-siguiente a.der { text-align: left; }
}
