/* ==========================================================================
   Los Secretos de Sofi — estructura completa (v1)
   Escritorio + responsive (tablet y móvil; media queries al final del archivo).
   Paleta: negro cinematográfico + dorado (en línea con el banner).
   ========================================================================== */

:root {
  --bg: #0b0c0e;
  --bg-2: #101114;
  --card: #17181c;
  --paper: #f4efe3;        /* sección clara (sinopsis) */
  --ink: #f0ece2;          /* texto sobre oscuro */
  --text-dark: #1c1a15;    /* texto sobre claro */
  --muted: #a49e8f;        /* secundario sobre oscuro */
  --muted-dark: #6a655a;   /* secundario sobre claro */
  --gold: #cba24f;
  --gold-soft: #e3c684;
  --gold-deep: #8a6a28;
  --line: rgba(240, 236, 226, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container { width: min(var(--maxw), 92%); margin-inline: auto; }
.narrow { max-width: 780px; }
.center { text-align: center; }

/* --------------------------------------------------------------------------
   Botón "Comprar en Amazon" (CTA principal)
   -------------------------------------------------------------------------- */
.btn-amazon {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #1a1204;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-amazon:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45); }

/* --------------------------------------------------------------------------
   Cabecera / navbar
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease;
  background: linear-gradient(180deg, rgba(6, 7, 9, 0.6), transparent);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(9, 10, 12, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav {
  width: min(var(--maxw), 94%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem 0;
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand span { color: var(--gold); font-style: italic; }
.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.nav-links a:hover { color: var(--gold); opacity: 1; }
.nav-cta { padding: 0.6rem 1.4rem; font-size: 0.86rem; }

/* --------------------------------------------------------------------------
   Hero — banner por capas (16:9). Escala proporcionalmente con el ancho.
   Las posiciones van en % / cqw (ajustables al ver el fondo real).
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  width: 100%;
  /* Fondo ANCHO (fondo-expandido.png): el banner llena toda la ventana
     (100% de ancho y de alto). El fondo se recorta por los lados con
     object-fit:cover según el monitor, sin franjas ni scroll. */
  height: 100vh;
  overflow: hidden;
  background: #0a0b0d;
  container-type: inline-size;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* Las imágenes (PC y móvil) ya vienen encuadradas para su formato, así que
     se muestran centradas. */
  object-position: center;
  z-index: 0;
}
.hero--nobg {
  background:
    radial-gradient(60% 80% at 20% 75%, rgba(224, 120, 40, 0.28), transparent 60%),
    linear-gradient(105deg, #3a1e0b, #1b1207 30%, #0d0e12 60%, #08090c);
}

/* Columna de textos (izquierda-centro, sobre el mar) */
.hero-copy-zone {
  position: absolute;
  z-index: 2;
  left: 7%;
  top: 9%;
  width: 58%;
  height: 74%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.9cqw;
}
.hero-title-img { display: block; width: 56%; height: auto; margin-bottom: 0.6cqw; }
.hero-title-fb { font-family: var(--serif); font-size: 5.4cqw; font-weight: 600; line-height: 1; color: var(--gold-soft); }
.hero-title-fb span { font-style: italic; }
.hero-tag1 { font-family: var(--serif); font-style: italic; font-size: 1.9cqw; line-height: 1.1; color: #f4ecd6; }
.hero-tag2 { font-family: var(--serif); font-size: 1.9cqw; line-height: 1.1; letter-spacing: 0.05em; color: #ece0c4; }
.hero-rule {
  display: block; width: 62%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 15%, var(--gold) 85%, transparent);
  opacity: 0.9;
}
.hero-amazon {
  font-family: var(--serif);
  font-size: 1.7cqw;
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-soft);
  text-decoration: none;
  transition: color 0.2s ease, letter-spacing 0.2s ease;
}
.hero-amazon:hover { color: #fff; letter-spacing: 0.24em; }

/* Libro 3D (columna derecha) — PNG transparente con su propia sombra */
.hero-book {
  position: absolute;
  z-index: 2;
  right: 3%;
  top: 50%;
  transform: translateY(-50%);
  height: 80%;
  width: auto;
  object-fit: contain;
}

/* 2ª edición + adorno (esquina inferior izquierda) */
.hero-edition {
  position: absolute;
  z-index: 3;
  left: 3%;
  bottom: 3.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1cqw;
}
.hero-edition-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2cqw;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1;
  /* Números "de caja alta": el 2 pasa a tener la misma altura que las
     mayúsculas (la serif usa por defecto cifras de estilo antiguo, más bajas). */
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
/* Ordinal "a" volada, de tamaño controlado (evita la "ª" diminuta de la serif) */
.hero-edition-text .hero-ord {
  text-transform: none;
  font-size: 0.6em;
  vertical-align: super;
  line-height: 0;
}
.hero-edition-adorno { display: block; width: 13cqw; max-width: 280px; height: auto; opacity: 0.95; }

.hero-scroll {
  position: absolute;
  left: 50%; bottom: 1.4%;
  transform: translateX(-50%);
  z-index: 3;
  color: var(--ink);
  opacity: 0.7;
  animation: bob 2s ease-in-out infinite;
}
.hero-scroll:hover { opacity: 1; }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* Portada del libro (bloque que solo se muestra en móvil/tablet) ------------*/
.portada-movil { display: none; }
.portada-movil-img {
  display: block;
  width: min(320px, 78%);
  height: auto;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Secciones
   -------------------------------------------------------------------------- */
.section { padding: 6rem 0; }
.section-dark { background: var(--bg); }
.section-light { background: var(--paper); color: var(--text-dark); }

.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1rem;
}
.section-light .eyebrow { color: var(--gold-deep); }
.section-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.6rem;
}
.section-lead { color: var(--muted); max-width: 56ch; margin: 0 auto 2.4rem; }

/* Bloque vídeo horizontal 16:9 + texto --------------------------------------*/
.section-media { background: var(--bg-2); }
.video-frame-h {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(960px, 100%);
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.video-frame-h video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-frame-h iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-caption {
  max-width: 62ch;
  margin: 2.2rem auto 0;
  color: #d9d3c6;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.6;
  text-align: left;
}
.media-caption p { margin-bottom: 1.1rem; }
.media-caption p:last-child { margin-bottom: 0; }
.media-caption .ded-strong { font-weight: 700; color: var(--ink); }

/* Vídeo vertical 9:16 -------------------------------------------------------*/
.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  width: min(360px, 82%);
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-unmute {
  position: absolute; left: 50%; top: 1rem; transform: translateX(-50%);
  z-index: 3; padding: 0.5rem 1.1rem; font-size: 0.82rem;
  font-family: var(--sans); font-weight: 600; letter-spacing: 0.02em;
  color: #1a1204;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.video-unmute:hover { filter: brightness(1.05); }

/* Sinopsis -----------------------------------------------------------------*/
.synopsis { text-align: left; }
.synopsis p {
  margin-bottom: 1.4rem; font-size: 1.1rem; line-height: 1.85;
  text-align: justify;
  -webkit-hyphens: auto; hyphens: auto;
}
.synopsis .synopsis-lead {
  font-family: var(--serif); font-style: italic;
  font-size: 1.5rem; line-height: 1.7;
  color: var(--text-dark); margin-bottom: 1.4rem;
  text-align: left; -webkit-hyphens: manual; hyphens: manual;
}
.synopsis .synopsis-close {
  font-family: var(--serif); font-style: italic;
  font-size: 1.5rem; line-height: 1.7;
  color: var(--text-dark);
  margin-top: 0;
  text-align: left; -webkit-hyphens: manual; hyphens: manual;
}
.synopsis-cta { text-align: center; margin-top: 2.4rem; }

/* Redes --------------------------------------------------------------------*/
.social-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; list-style: none; }
.social-card {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: 12px; background: var(--card);
  border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; font-weight: 500;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.social-card svg { width: 20px; height: 20px; color: var(--gold); }
.social-card:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--gold); }

/* Autor: card horizontal ---------------------------------------------------*/
.author-card {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 1.1rem 1.8rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text-dark);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.author-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1); }
.author-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}
.author-meta { display: flex; flex-direction: column; gap: 0.15rem; }
.author-eyebrow { font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }
.author-name { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--text-dark); line-height: 1.15; }
.author-hint { font-size: 0.9rem; color: var(--muted-dark); }
.author-card:hover .author-hint { color: var(--gold-deep); }

/* Autor: ventana / modal de biografía --------------------------------------*/
.author-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 2rem;
}
.author-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.author-modal-panel {
  position: relative; z-index: 1;
  width: min(1000px, 100%);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  color: var(--text-dark);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.author-modal-header {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 1.1rem 3.4rem;
  background: #e9e3d5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.author-modal-header h2 { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--text-dark); text-align: center; }
.author-modal-close {
  position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%);
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--text-dark);
  cursor: pointer;
  transition: background 0.2s ease;
}
.author-modal-close:hover { background: rgba(0, 0, 0, 0.1); }
.author-modal-body {
  overflow-y: auto;
  padding: 2rem 2.2rem 2.4rem;
  display: flex; gap: 2rem; align-items: flex-start;
}
.author-modal-portrait { flex: 0 0 300px; position: sticky; top: 0; align-self: flex-start; }
.author-modal-portrait img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); }
.author-modal-bio { flex: 1; min-width: 0; }
.author-modal-bio h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-dark); }
.author-modal-bio p { margin-bottom: 1rem; font-size: 1rem; line-height: 1.75; color: #3a352b; }
.author-modal-bio em { font-style: italic; }
body.no-scroll { overflow: hidden; }

/* Footer -------------------------------------------------------------------*/
.site-footer { background: #070809; border-top: 1px solid var(--line); padding: 3rem 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }
.footer-brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--ink); }
.footer-brand span { color: var(--gold); font-style: italic; }
.footer-contact a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.footer-contact a:hover { color: var(--gold); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 0.4rem; }
.footer-legal a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.footer-legal a:hover { color: var(--gold); }
.footer-legal span { color: var(--muted); opacity: 0.5; }
.footer-copy { font-size: 0.82rem; color: var(--muted); opacity: 0.65; }

/* Aviso de cookies ---------------------------------------------------------*/
.cookie-notice {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  z-index: 100; width: min(680px, calc(100% - 2rem));
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1rem 1.3rem; background: rgba(18, 19, 22, 0.96);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.cookie-notice p { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--ink); }
.cookie-notice a { color: var(--gold); }
.cookie-notice .btn-amazon { flex-shrink: 0; padding: 0.55rem 1.2rem; font-size: 0.82rem; }

/* ==========================================================================
   RESPONSIVE — tablet y móvil
   ========================================================================== */

/* Las páginas legales tienen cabecera fija: aseguramos que el contenido no
   quede tapado por ella en ningún tamaño. */
main.legal { padding-top: 6rem; }

/* -------- Tablet y pantallas estrechas (≤ 900px) -------------------------- */
@media (max-width: 900px) {
  .section { padding: 4rem 0; }

  /* Hero: el texto pasa a una columna centrada a todo el ancho y con tamaños
     legibles (en móvil las unidades cqw se quedaban diminutas). */
  .hero-bg { object-position: center; }
  /* El libro (imagen superpuesta) se agranda y tapa el texto en pantallas
     estrechas: lo ocultamos en el hero y lo mostramos en su propia sección
     (.portada-movil), entre el banner y el vídeo. */
  .hero-book { display: none; }
  .portada-movil { display: block; }
  .hero-copy-zone {
    left: 6%;
    width: 88%;
    top: 0;
    height: 100%;
    gap: 2.4vw;
  }
  .hero-title-img { width: min(80%, 420px); }
  .hero-title-fb { font-size: clamp(2rem, 9vw, 3.4rem); }
  .hero-tag1,
  .hero-tag2 { font-size: clamp(15px, 3.2vw, 24px); }
  .hero-rule { width: 42%; }
  .hero-amazon { font-size: clamp(13px, 2.8vw, 20px); letter-spacing: 0.14em; }
  .hero-edition-text { font-size: clamp(13px, 2.6vw, 20px); }
  .hero-edition-adorno { width: clamp(130px, 28vw, 220px); }

  /* Vídeo horizontal y sinopsis un poco más contenidos */
  .video-frame-h { border-radius: 12px; }
  .media-caption { font-size: 1.2rem; }
}

/* -------- Móvil (≤ 600px) ------------------------------------------------- */
@media (max-width: 600px) {
  .section { padding: 3rem 0; }

  /* Hero */
  .hero-copy-zone { gap: 3vw; }
  .hero-title-img { width: 82%; }
  .hero-tag1,
  .hero-tag2 { font-size: clamp(15px, 4.4vw, 20px); }
  .hero-amazon { font-size: clamp(13px, 3.8vw, 18px); }
  .hero-edition-text { font-size: clamp(13px, 4vw, 18px); }
  .hero-edition-adorno { width: clamp(130px, 44vw, 200px); }
  .hero-rule { width: 52%; }

  /* Sinopsis: frases en cursiva un poco menores para que quepan bien y un
     margen lateral algo mayor para que respire. */
  #sinopsis .container { padding-inline: 0.7rem; }
  .synopsis p { font-size: 1.05rem; }
  .synopsis .synopsis-lead,
  .synopsis .synopsis-close { font-size: 1.3rem; }

  /* Dedicatoria de la canción */
  .media-caption { font-size: 1.12rem; }

  /* Redes: tarjetas a lo ancho, apiladas y centradas */
  .social-grid { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .social-card { justify-content: center; }

  /* Card del autor: más compacto */
  .author-card { padding: 1rem 1.1rem; gap: 1rem; width: 100%; }
  .author-avatar { width: 64px; height: 64px; }
  .author-eyebrow { font-size: 0.72rem; }
  .author-name { font-size: 1.35rem; }
  .author-hint { font-size: 0.82rem; }

  /* Ventana de biografía: a pantalla completa y en una sola columna */
  .author-modal { padding: 0; }
  .author-modal-panel { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .author-modal-header { padding: 0.9rem 3rem; }
  .author-modal-header h2 { font-size: 1.3rem; }
  .author-modal-close { right: 0.5rem; }
  .author-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.3rem 1.2rem 1.8rem;
  }
  .author-modal-portrait {
    position: static;
    flex: none;
    width: 62%;
    max-width: 210px;
    margin: 0 auto;
  }
  .author-modal-bio h3 { font-size: 1.3rem; }

  /* Aviso de cookies: en vertical y botón a lo ancho */
  .cookie-notice {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    text-align: center;
    bottom: 0.8rem;
    padding: 0.9rem 1rem;
  }
  .cookie-notice .btn-amazon { width: 100%; }

  /* Cabecera de las páginas legales, más compacta */
  .nav { padding: 0.9rem 0; }
  .nav-brand { font-size: 1.15rem; }
}
