/* Colores tomados de las páginas de apertura de cada estación del libro */
:root {
  /* Alto de la casa: como mínimo, lo justo para que el humo llegue al borde de arriba
     (la imagen mide 1,554 veces la casa). El texto termina antes de donde empieza la casa. */
  --house-h: max(min(80vh, 760px, 42vw), 64.5vh);
  --house-w: calc(var(--house-h) * 642 / 722);
  --bg: #d3c2a8;
  --ink: #3f3226;
  --soft: #6b5a48;
  --accent: #a9532d;
  --accent-ink: #fff8ef;
  --river: #b9a587;
  --glow: #ffd98a;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --fade: 1.1s var(--ease);
}
body[data-season="otono"]     { --bg: #d3c2a8; --ink: #3f3226; --soft: #6b5a48; --accent: #a9532d; --river: #b9a587; }
body[data-season="invierno"]  { --bg: #a2b1b4; --ink: #26343a; --soft: #435459; --accent: #2e4a5e; --river: #8a9b9f; }
body[data-season="primavera"] { --bg: #7eb480; --ink: #1d3420; --soft: #2f4f33; --accent: #2a5a31; --river: #65a06b; }
body[data-season="verano"]    { --bg: #efdb9e; --ink: #43361a; --soft: #6b5a35; --accent: #e8662a; --river: #d9c27f; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Circe Slab", "Roboto Slab", Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.65;
  transition: background-color var(--fade), color var(--fade);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Escenario fijo ---------- */
.stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
/* La casa va en su propia capa, por encima del menú, así el humo sube hasta el borde.
   No recibe toques. El río y los efectos siguen detrás del texto. */
.house-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}
.house {
  position: absolute;
  right: 5vw;
  bottom: 0;
  height: var(--house-h);
  aspect-ratio: 642 / 722;
  z-index: 2;
}
/* La imagen (al doble, para retina) tiene más lugar arriba para el humo y a la derecha
   para el farol. El recuadro .house sigue siendo la casa, del mismo tamaño que antes;
   la imagen sobresale hacia arriba y el humo se corta en el borde de la pantalla. */
.house img {
  position: absolute;
  left: -24.45%;
  bottom: 0;
  width: 126.6%;
  height: auto;
  max-width: none;
}

/* Luz que titila en la ventana, como en la app */
.window-light {
  position: absolute;
  left: 36.5%;
  top: 35.3%;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 221, 140, .75) 0%, rgba(255, 210, 120, .25) 38%, transparent 70%);
  mix-blend-mode: screen;
  animation: flicker 3.4s infinite;
  opacity: .55;
  transition: opacity var(--fade);
}
body[data-season="invierno"] .window-light,
body[data-season="verano"] .window-light { opacity: 1; }
@keyframes flicker {
  0%, 100% { filter: brightness(1); }
  42% { filter: brightness(1.25); }
  46% { filter: brightness(.7); }
  50% { filter: brightness(1.15); }
  75% { filter: brightness(.95); }
}

/* Humo de la chimenea (invierno) */
.smoke {
  position: absolute;
  left: 11.3%;
  top: -2%;
  width: 14%;
  height: 30%;
  opacity: 0;
  transition: opacity var(--fade);
}
.smoke i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 70%);
  animation: smoke 6s linear infinite;
}
.smoke i:nth-child(2) { animation-delay: -2s; }
.smoke i:nth-child(3) { animation-delay: -4s; }
@keyframes smoke {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(-60%, -260%) scale(1.8); opacity: 0; }
}
body[data-season="invierno"] .smoke { opacity: 1; }

/* Río al pie de los pilotes */
.river {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 11vh;
  z-index: 3;
}
.river path { fill: var(--river); transition: fill var(--fade); }

/* Efectos de cada estación: solo se ve el de la estación activa */
.fx {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--fade);
  overflow: hidden;
}
body[data-season="otono"] .fx-otono,
body[data-season="invierno"] .fx-invierno,
body[data-season="primavera"] .fx-primavera,
body[data-season="verano"] .fx-verano { opacity: 1; }

.leaf {
  position: absolute;
  top: -8vh;
  animation: fall linear infinite;
}
.leaf img { width: 100%; animation: sway ease-in-out infinite alternate; }
@keyframes fall { to { transform: translate(-18vw, 116vh); } }
@keyframes sway { from { transform: rotate(-35deg) translateX(-10px); } to { transform: rotate(45deg) translateX(14px); } }

/* Nubes de invierno: pasan despacio, detrás del texto. */
.cloud {
  position: absolute;
  height: auto;
  max-width: none;
  animation: drift ease-in-out infinite alternate;
}
.cloud.c1 { width: 46vw; right: -8vw; top: 10vh; animation-duration: 38s; }
.cloud.c2 { width: 34vw; left: 18vw; top: 34vh; opacity: .8; animation-duration: 46s; animation-direction: alternate-reverse; }
.cloud.c3 { width: 40vw; right: 6vw; bottom: 4vh; opacity: .9; animation-duration: 52s; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-14vw); } }

/* Flores de primavera: caen como copos de nieve, llevadas apenas hacia el costado. Sutiles. */
.flower {
  position: absolute;
  top: -8vh;
  animation: snow linear infinite;
}
.flower img {
  display: block;
  width: 100%;
  height: auto;
  opacity: .55;
  animation: flutter ease-in-out infinite, turn linear infinite;
}
@keyframes snow { to { transform: translate(-22vw, 116vh); } }
@keyframes flutter { from { translate: -14px 0; } to { translate: 14px 0; } }
@keyframes turn { to { rotate: 360deg; } }

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff6c4;
  box-shadow: 0 0 10px 4px rgba(255, 240, 150, .7);
  animation: blink ease-in-out infinite, wander ease-in-out infinite alternate;
}
@keyframes blink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes wander { to { translate: 40px -30px; } }

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5vw;
  background: linear-gradient(var(--bg) 40%, transparent);
  transition: background var(--fade);
}
.brand img { height: 46px; width: auto; }
.menu { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.menu a:not(.btn) { text-decoration: none; opacity: .8; }
.menu a:not(.btn):hover { opacity: 1; }

/* Indicador de estaciones */
.seasons {
  position: fixed;
  left: 2vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Puntitos sutiles: color de la sección (también dentro de WordPress), chicos y transparentes. */
.seasons a,
.seasons a:visited {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 12px;
  color: var(--ink) !important;
  opacity: .35;
  transition: opacity .3s;
}
.seasons a:hover, .seasons a.active { opacity: .7; }
.seasons a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: background .3s;
}
.seasons a span { opacity: 0; transform: translateX(-4px); transition: opacity .3s, transform .3s; }
.seasons a:hover span, .seasons a.active span { opacity: 1; transform: none; }
.seasons a.active::before { background: currentColor; }

/* ---------- Secciones ---------- */
main { position: relative; z-index: 10; }
.season {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 5vw 18vh 11vw;
}
.content { width: min(540px, calc(100vw - 16vw - var(--house-w) - 32px)); }

.content > * + * { margin-top: 1.1em; }
.content p { margin-bottom: 0; }
.hero-logo { width: min(250px, 55%); max-height: 24vh; object-fit: contain; object-position: left; }
/* Oculto en la página, pero lo leen los buscadores y los lectores de pantalla. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.author-note { margin: 1.4em 0 0; }
.author-note p { font-size: 20px; line-height: 1.6; }
.author-note footer { margin-top: .6em; font-size: 15px; color: var(--soft); }
.author { font-weight: 400; font-size: 20px; margin-top: .4em !important; color: var(--soft); }
.lead { font-size: 23px; line-height: 1.5; }
.season-title { height: clamp(46px, 7vw, 82px); width: auto; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .06)); }
blockquote { margin: 3em 0 0; padding-left: 22px; border-left: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); }
blockquote .season-title { height: 48px; margin-bottom: 10px; }
blockquote p { color: var(--soft); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 1.8em !important; }
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 400;
  font-size: 16px;
  transition: background-color var(--fade), transform .2s;
}
.btn:hover { transform: translateY(-2px); }
/* Sello de la selección (The Unpublished Picturebook Showcase) */
.award {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: .5em !important;
  font-size: 14px;
  color: var(--soft);
}
.award img { width: 104px; height: auto; }
.btn-small { padding: 9px 20px; font-size: 14px; }
/* Aviso de algo que todavía no está: mismo formato que un botón, pero sin relleno y sin enlace. */
.btn-soon { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px currentColor; cursor: default; }
.btn-soon:hover { transform: none; }
/* En el menú: texto completo en pantallas grandes, más corto en el celular. */
.btn-buy .short { display: none; }
.link { font-size: 16px; text-underline-offset: 4px; }

/* Video */
.video {
  position: relative;
  margin: 2em 0 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .45);
}
.video img, .video iframe, .video video { width: 100%; height: 100%; object-fit: cover; border: 0; }
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: var(--accent);
  cursor: pointer;
  transition: transform .2s;
}
.play:hover { transform: translate(-50%, -50%) scale(1.06); }
.play svg { width: 34px; margin-left: 5px; fill: currentColor; }
.video figcaption {
  position: absolute;
  left: 18px;
  bottom: 14px;
  color: #fff;
  font-size: 15px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.video.playing .play, .video.playing figcaption { display: none; }

/* Bloque de compra */
.buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 2em !important;
  padding: 20px 22px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 70%, white);
  transition: background-color var(--fade);
}
.buy-title { font-weight: 700; margin: 0; }
.buy-sub { font-size: 15px; color: var(--soft); margin: 0 !important; }

/* Galería */
/* Carrusel de láminas, apaisadas con la proporción del libro (42 × 21 cm = 2 : 1) */
.gallery {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-top: 2em !important;
  padding-bottom: 6px;
  scrollbar-width: none;
  outline: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery button {
  flex: 0 0 88%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: zoom-in;
  aspect-ratio: 2 / 1;
  background: var(--soft);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery button:hover img { transform: scale(1.03); }
.gallery-nav { display: flex; gap: 10px; }
.gallery-nav button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 4vw;
  background: rgba(20, 24, 20, .86);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; border-radius: 8px; }
/* Miniatura del booktráiler */
.trailer-thumb {
  position: relative;
  display: block;
  margin-top: 2em !important;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .35);
}
.trailer-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.trailer-thumb:hover img { transform: scale(1.03); }
.trailer-thumb .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  transition: transform .2s;
}
.trailer-thumb:hover .play { transform: translate(-50%, -50%) scale(1.06); }
.trailer-thumb .play svg { width: 32px; margin-left: 4px; fill: currentColor; }

/* Booktráiler encima de la página */
.video-box {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 4vw;
  background: rgba(20, 24, 20, .86);
}
.video-box[hidden] { display: none; }
.video-frame { width: min(1100px, 92vw); aspect-ratio: 16 / 9; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }

.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

/* App */
.tablet {
  position: relative;
  margin-top: 2em !important;
  padding: 14px;
  border-radius: 26px;
  background: #23211e;
  box-shadow: 0 24px 60px -26px rgba(0, 0, 0, .5);
}
.tablet img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; }
.tap-hint {
  position: absolute;
  left: 63%;
  top: 33%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9);
  animation: tap 2.2s ease-out infinite;
}
@keyframes tap {
  0% { transform: scale(.4); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}
.features { list-style: none; padding: 0; }
.features li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); }
.features li::before { content: "✦"; position: absolute; left: 0; color: var(--accent); }

.footer {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 26px 12vw 13vh;
  font-size: 14px;
  color: var(--soft);
}

/* ---------- Pantallas chicas ---------- */
@media (max-width: 860px) {
  .btn-buy .long { display: none; }
  .btn-buy .short { display: inline; }
  body { font-size: 17px; }
  .menu a:not(.btn) { display: none; }
  .brand img { height: 36px; }
  .seasons { left: auto; right: 12px; top: auto; bottom: 14vh; transform: none; gap: 12px; }
  .seasons a span { display: none; }
  .house-layer { z-index: 0; }
  .house { right: -14vw; height: 36vh; opacity: .4; }
  .season { padding: 110px 16px 22vh; align-items: flex-start; }
  .content { width: 100%; }
  .lead { font-size: 20px; }
  .buy, .video, .gallery, .tablet { position: relative; }
  .footer { padding: 20px 16px 12vh; flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
  html { scroll-behavior: auto; }
}

/* Pie de página de Salient: por encima de la casa y del río fijos. */
.la-isla-footer { position: relative; z-index: 40; }
.la-isla-footer #footer-outer { position: relative; }
