/* Variables (colores, tipografía, escala): ver style.css · SISTEMA DE DISEÑO */

/* ==========================================
   1. FUENTES & BASE GLOBALES
   ========================================== */
@font-face {
  font-family: 'Jost'; 
  src: url('../fonts/Jost-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jost'; 
  src: url('../fonts/Jost-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jost';
  src: url('../fonts/Jost-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: clamp(13px, calc(0.55rem + 0.375vw), 16px);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  max-width: min(75rem, calc(100% - clamp(48px, 12vw, 720px)));
  margin: 0 auto;
  padding: 0 clamp(16px, 2vw, 24px);
}

/* ==========================================
   2. HERO VIDEO CONTAINER
   ========================================== */
.video-container {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  background: rgba(22, 26, 18, 0.6);
}

.video-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.video-container .bg-videobio {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(.98) brightness(.75);
}

.hero-title {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 3;
  width: 100%;
  text-align: center;
  color: var(--white);
}

.hero-title h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0 auto;
  font-size: var(--fs-h1);
  font-weight: 300;
  letter-spacing: 4px;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero-title h1::before,
.hero-title h1::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.7);
  flex: 1;
  max-width: 150px;
}

.hero-title p {
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 3px;
  margin-top: 14px;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   3. SECCIONES Y GRAMÁTICA DE DISEÑO
   ========================================== */
main > section {
  width: 100%;
  padding: 130px 0 120px 0px;
}

/* --- TÍTULOS Y REGLAS (RULERS) --- */
.section-title {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--lime);
}

.section-title-naranja {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-olive-dark);
}

.hrow {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* --- SECCIÓN 1 Y 3: VERDE OLIVA (.main) --- */
section.main {
  background-color: var(--color-olive);
  color: var(--white);
}

#neblina-personaje {
  --plant-divider-height: clamp(50px, 8vw, 100px);
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--plant-divider-height));
  padding: calc(80px + var(--plant-divider-height)) 0 130px;
  background: linear-gradient(
    to bottom,
    transparent 0,
    transparent var(--plant-divider-height),
    var(--color-olive) var(--plant-divider-height)
  );
}

#neblina-personaje::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--plant-divider-height);
  background: var(--color-olive);
  mask: url("../assets/2.svg") center bottom / 40% auto repeat-x;
  -webkit-mask: url("../assets/2.svg") center bottom / 40% auto repeat-x;
  pointer-events: none;
}

@media (max-width: 767px) {
  #neblina-personaje::before {
    height: clamp(56px, 15.625vw, 80px);
    mask-size: 100% auto;
    -webkit-mask-size: 100% auto;
  }
}

/* Grid de Proyectos / Hábitat / Neblina */
.neblina-personaje-section .habitat-projects-grid {
  display: flex;
  flex-direction: column;
  gap: 50px;
  margin-top: 20px;
}

.habitat-project-row {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 50px; /* <--- Añade esta línea para separar las filas */
}

.habitat-project-row-reverse {
  grid-template-columns: 1fr 380px;
}

.habitat-project-row-reverse .habitat-media {
  order: 2;
}

.habitat-media img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 6px 20px var(--shadow-color);
  object-fit: cover;
}

/* Misma interacción de clic para ampliar que .neblina-poster en Bioculturalidad */
.neblina-poster {
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.neblina-poster:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px var(--shadow-color-strong);
}

/* El modal de imagen ampliada (lightbox) vive en css/lightbox.css,
   compartido por todas las páginas que lo usan. */

/* Limita la altura de la portada de documento para que sea proporcionada a la página */
.neblina-personaje-section .habitat-media img {
  aspect-ratio: 4 / 5;
  max-height: 480px;
  object-fit: cover;
}

.habitat-info h3 {
  font-size: var(--fs-h2);
  color: var(--lime);
  font-weight: 300;
  margin: 0 0 8px 0;
}

.habitat-tagline {
  font-size: var(--fs-eyebrow);
  color: var(--lime);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.habitat-info p {
  line-height: 1.5;
  margin-bottom: 16px;
  color: var(--cream);
} 

.habitat-info .rule{
  display:block;
  width: 39%;
  height:2px;
  margin-bottom: 18px;
  background:var(--color-terracotta);
}

.section-orange .habitat-info .rule{
  display:block;
  width: 50%;
  height:2px;
  margin-bottom: 18px;
  background: #2b2b23;
}

/* Enlaces y botones de acción */
.habitat-video-link {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  border: 1px solid var(--lime);
  border-radius: 4px;
  color: var(--olive-deep);
  background-color: var(--lime);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.25s ease;
}

.habitat-video-link:hover {
  background-color: var(--cream);
  color: var(--color-olive-dark);
  border-color: var(--cream);
  transform: translateY(-2px);
}

/* --- SECCIÓN 2 Y 4: NARANJA / TERRACOTA (.section-orange) --- */
section.section-orange {
  background-color: var(--color-orange);
  color: var(--white);
}

/* LLUVIA DE KINDES: SEPARADOR SUPERIOR hacia ARRIBA con 9.svg
   (misma técnica que #neblina-personaje). La sección sube sobre NEBLINA con
   margen negativo; el degradado deja transparente la franja del separador y
   la silueta naranja se apoya sobre el oliva de la sección anterior. */
#escuela-lluvia-de-kindes {
  --kindes-divider-height: clamp(50px, 8vw, 100px);
  --kindes-divider-size: 43%;
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--kindes-divider-height));
  padding: calc(80px + var(--kindes-divider-height)) 0 80px;
  background: linear-gradient(
    to bottom,
    transparent 0,
    transparent var(--kindes-divider-height),
    var(--color-orange) var(--kindes-divider-height)
  );
}

#escuela-lluvia-de-kindes::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--kindes-divider-height);
  background: var(--color-orange);
  mask: url("../assets/9.svg") center bottom / var(--kindes-divider-size) auto repeat-x;
  -webkit-mask: url("../assets/9.svg") center bottom / var(--kindes-divider-size) auto repeat-x;
  pointer-events: none;
}

@media (max-width: 767px) {
  #escuela-lluvia-de-kindes {
    --kindes-divider-size: 65%;
  }
}

/* LLUVIA DE KINDES: SEPARADOR INFERIOR hacia ABAJO con 8.svg
   Misma configuración que el 9.svg de arriba (todo el ancho, repetido en
   horizontal, mismos tamaños), pero invertido verticalmente (solo el SVG, vía
   la máscara) y pegado al borde inferior de la sección. Va en ::after,
   posicionado en absoluto, así que no ocupa espacio ni cambia el padding.
   Color = naranja de Kindes: se ve sobrepuesto sobre el oliva de ARTE RURAL. */
#escuela-lluvia-de-kindes::after {
  content: "";
  position: absolute;
  top: calc(100% - 1px); /* -1px evita la línea fina entre secciones */
  left: 0;
  width: 100%;
  height: var(--kindes-divider-height);
  background: var(--color-orange);
  mask: url("../assets/8.svg") center bottom / var(--kindes-divider-size) auto repeat-x;
  -webkit-mask: url("../assets/8.svg") center bottom / var(--kindes-divider-size) auto repeat-x;
  transform: rotateX(180deg);
  transform-origin: center;
  pointer-events: none;
}

/* Contraste de títulos y filetes sobre fondo naranja (misma gramática que stylehabitat.css) */
.section-orange .section-title,
.section-orange .section-title-naranja {
  color: var(--cream);
}

.section-orange .hrow .rule,
.section-orange .section-title + .rule,
.section-orange .section-title-naranja + .rule {
  background: var(--cream);
}

.section-orange .lead-text,
.section-orange strong {
  color: var(--cream);
}

.escuela-section .habitat-info h3 {
  color: var(--white);
}

.escuela-section .habitat-info p {
  color: var(--cream);
}

.escuela-section strong {
  color: var(--color-olive-dark);
}

/* --- BLOQUES DE ARTE RURAL --- */
.section-title-arte-rural {
  margin: 0 0 15px;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--lime);
}

.habitat-context {
  background: rgba(0, 0, 0, 0.15);
  padding: 30px;
  border-radius: 12px;
  border-left: 4px solid var(--lime);
  margin-bottom: 40px;
}

.habitat-context-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: center;
}

.habitat-context-media {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.surcando-bloque {
  max-width: 580px;
  margin: 0 auto 3rem;
  text-align: center;
}

.surcando-poster img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 25px var(--shadow-color);
  transition: transform 0.3s ease;
}

.surcando-poster img:hover {
  transform: scale(1.02);
}

.surcando-cta {
  display: inline-block;
  margin-top: 18px;
}

/* Miniatura de video reutilizable (poster + botón de reproducción) */
.habitat-video-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 25px var(--shadow-color);
}

.habitat-video-thumb img {
  width: 100%;
  transition: transform 0.35s ease;
}

.habitat-video-thumb:hover img {
  transform: scale(1.04);
}

/* Copy de una sola columna (Arte Rural) */
.habitat-copy p {
  margin: 0 0 14px;
  line-height: 1.6;
  color: var(--cream);
}

.habitat-copy p:last-child {
  margin-bottom: 0;
}

.apuesta-artistica {
  max-width: 780px;
  margin: 3.5rem auto;
  text-align: center;
}

.apuesta-titulo {
  margin-bottom: 18px;
  font-size: var(--fs-eyebrow);
  letter-spacing: 2px;
  color: var(--lime);
  text-transform: uppercase;
}

.apuesta-video {
  position: relative;
  display: block;
  max-width: 640px;
  margin: 0 auto 24px;
}

.apuesta-video img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.habitat-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(245, 240, 230, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.habitat-play::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 18px solid var(--color-olive-dark);
  margin-left: 4px;
}

.apuesta-video:hover .habitat-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--lime);
}

/* ==========================================
   --- GALERÍAS Y THUMBNAILS (Estandarizado & Sin Scrollbar) ---
   ========================================== */
.habitat-gallery {
  margin-top: 60px;
}

.habitat-gallery-title {
  margin-bottom: 25px;
}

/* El carrusel (vista, miniaturas, flechas, texto) vive en css/gallery.css,
   compartido por todas las páginas con galería. */

/* --- SECCIÓN MURAL --- */
/* MURAL: SEPARADOR SUPERIOR hacia ARRIBA con 9.svg
   Idéntico al de LLUVIA DE KINDES (misma técnica que #neblina-personaje). La
   sección sube sobre ARTE RURAL con margen negativo; el degradado deja
   transparente la franja del separador y la silueta naranja se apoya sobre
   el oliva de la sección anterior. */
#mural {
  --mural-divider-height: clamp(50px, 8vw, 100px);
  --mural-divider-size: 61%;
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--mural-divider-height));
  padding: calc(80px + var(--mural-divider-height)) 0 80px;
  background: linear-gradient(
    to bottom,
    transparent 0,
    transparent var(--mural-divider-height),
    var(--color-orange) var(--mural-divider-height)
  );
}

#mural::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--mural-divider-height);
  background: var(--color-orange);
  mask: url("../assets/5.svg") center bottom / var(--mural-divider-size) auto repeat-x;
  -webkit-mask: url("../assets/5.svg") center bottom / var(--mural-divider-size) auto repeat-x;
  pointer-events: none;
}

@media (max-width: 767px) {
  #mural {
    --mural-divider-size: 65%;
  }
}

.mural-section .section-title-naranja {
  color: var(--cream);
}

.mural {
  width: 100%;
  max-height: 550px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 25px var(--shadow-color);
}

.mural-caption {
  max-width: 800px;
  margin: 28px auto 0;
  text-align: center;
  line-height: 1.6;
  font-size: var(--fs-body);
  color: var(--cream);
}

/* El responsive del carrusel (vista, miniaturas) vive en css/gallery.css. */

@media (max-width: 767px) {
  /* Corrige el desborde horizontal: la columna fija de 380px
     de .habitat-project-row no cabe en pantallas de móvil */
  .habitat-project-row,
  .habitat-project-row-reverse {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .habitat-project-row-reverse .habitat-media {
    order: 0;
  }

  .neblina-personaje-section .habitat-media img {
    max-height: 320px;
  }

  .video-container {
    height: 40vh;
    min-height: 0;
  }

  .video-container .bg-videobio {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-title {
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
  }

  .hero-title.reveal.is-visible {
    transform: translate(-50%, -50%);
  }

  .hero-title h1 {
    font-size: 1.8rem;
  }

  .hero-title h1::before,
  .hero-title h1::after {
    display: none;
  }

  main > section {
    padding: 50px 0;
  }

  .apuesta-artistica .apuesta-video {
    max-width: 100%;
  }
}

/* Visor compartido de PDF */
/* ============================================================
     VISOR DE PDF CON PASADOR DE PÁGINA
     Colores y tamaños se cambian en estas variables.
     ============================================================ */
  .pfm {
    --pfm-backdrop: rgba(18, 16, 14, .82);
    --pfm-ui: #f5f2ed;
    --pfm-ui-dim: rgba(245, 242, 237, .6);
    --pfm-paper: #fff;
    --pfm-bar-offset: 5vh;
    position: fixed; inset: 0; z-index: 2147483000;
    display: none; flex-direction: column;
    background: var(--pfm-backdrop);
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    opacity: 0; transition: opacity .25s ease;
  }
  .pfm.is-open { display: flex; }
  .pfm.is-visible { opacity: 1; }

  .pfm__bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: calc(12px + var(--pfm-bar-offset)) 16px 12px; color: var(--pfm-ui);
    font: 500 14px/1.2 "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  .pfm__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pfm-ui-dim); }
  .pfm__close, .pfm__nav, .pfm__tool {
    appearance: none; border: 0; cursor: pointer; color: var(--pfm-ui);
    background: rgba(255,255,255,.1); border-radius: 999px;
    width: 40px; height: 40px; display: grid; place-items: center;
    transition: background .15s ease, opacity .15s ease;
  }
  .pfm__close:hover:not(:disabled), .pfm__nav:hover:not(:disabled), .pfm__tool:hover:not(:disabled) { background: rgba(255,255,255,.2); }
  .pfm__close:focus-visible, .pfm__nav:focus-visible, .pfm__tool:focus-visible { outline: 2px solid var(--pfm-ui); outline-offset: 2px; }
  .pfm__nav:disabled, .pfm__tool:disabled { opacity: .3; cursor: default; }
  .pfm svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .pfm__title { flex: 1; min-width: 0; }
  .pfm__dl {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
    border-radius: 999px; background: rgba(255,255,255,.1); color: var(--pfm-ui);
    font: inherit; text-decoration: none; cursor: pointer;
    transition: background .15s ease;
  }
  .pfm__dl[hidden] { display: none; }
  .pfm__dl:hover { background: rgba(255,255,255,.2); }
  .pfm__dl:focus-visible { outline: 2px solid var(--pfm-ui); outline-offset: 2px; }
  .pfm__dl svg { width: 18px; height: 18px; }
  .pfm__tools { display: flex; align-items: center; gap: 8px; }
  .pfm__zoomlabel { min-width: 44px; text-align: center; color: var(--pfm-ui-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
  .pfm__book { transform-origin: center center; }

  /* Capa que permite arrastrar el documento cuando hay zoom (bloquea el giro de hoja) */
  .pfm__pan { position: absolute; inset: 0; z-index: 1; cursor: grab; touch-action: none; }
  .pfm__pan.is-drag { cursor: grabbing; }

  /* Evita que el navegador robe los gestos táctiles (scroll, zoom, "tirar para refrescar") */
  .pfm, .pfm__stage, .pfm__book { touch-action: none; overscroll-behavior: contain; }
  .pfm__book { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

  /* Flechas siempre visibles a los costados */
  .pfm__nav--side {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 48px; height: 48px; background: rgba(20, 18, 16, .55);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  }
  .pfm__nav--prev { left: max(10px, env(safe-area-inset-left, 0px)); }
  .pfm__nav--next { right: max(10px, env(safe-area-inset-right, 0px)); }
  .pfm__nav--side svg { width: 24px; height: 24px; }

  .pfm__stage {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
  }
  .pfm__book { position: relative; }
  .pfm__page { background: var(--pfm-paper); overflow: hidden; }
  .pfm__page canvas { width: 100%; height: 100%; display: block; }
  .pfm__msg {
    position: absolute; color: var(--pfm-ui); text-align: center; padding: 0 24px;
    font: 15px/1.4 "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  }

  .pfm__foot {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 12px 16px 16px; color: var(--pfm-ui);
    font: 500 14px/1 "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
  }

  @media (prefers-reduced-motion: reduce) { .pfm { transition: none; } }