/* Paleta y tipografía tomadas de tepuhueico.com (ver tepuhueico.com.md) —
   única referencia de diseño para este sitio. Corregido 3-oct: el verde
   dominante real es el OLIVO de las barras persistentes (nav + footer) y los
   botones — no el lima, que es secundario/raro en la página real. */
:root {
  --ink: #202020;
  --paper: #f3f2ea; /* sage pálido — tepuhueico.com no usa blanco puro fuera del hero/footer */
  --card: #ffffff;
  --line: rgba(32, 32, 32, 0.12);
  --muted: #6b6f63;
  --olive: #4c6444;
  --olive-dark: #3b4f35;
  --moss: #79804d;
  --sage: #a8b29d;
  --accent: var(--olive);
  --accent-ink: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

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

.kicker {
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Nav — barra olivo persistente, igual que el top/bottom bar de tepuhueico.com ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--olive);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
}
.site-nav .logo {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-nav .links { display: flex; gap: 1.4rem; }
.site-nav .links a {
  color: #e9ead9;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.site-nav .links a:hover { color: #ffffff; }
.site-nav .links a.lang { border: 1px solid rgba(255,255,255,0.45); border-radius: 2px; padding: 0.15rem 0.45rem; font-size: 0.72rem; letter-spacing: 0.1em; }
@media (max-width: 680px) { .site-nav .links { display: flex; } .site-nav .links a:not(.lang) { display: none; } }
@media (max-width: 680px) { .site-nav .links { display: none; } }

/* Padding asimétrico (más abajo que arriba) — patrón medido en tepuhueico.com:
   section padding: 100px 0 235px. Escalado a nuestras secciones más cortas. */
section { padding: 4rem 1.4rem 6.5rem; max-width: 1100px; margin: 0 auto; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }

/* ── Hero ──
   Proporción medida en tepuhueico.com: el logo queda solo arriba, ~70% del
   alto es vacío, y el bloque de texto (chico, centrado) recién aparece en el
   último tercio de la pantalla — nada de un párrafo largo acá. */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--paper); /* mientras la foto se descubre se ve el crema del sitio, no negro (Pancho, 14-oct) */
  overflow: hidden;
  padding: 0;
  max-width: none;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1; /* sin transparencia: el fondo del hero es crema y cualquier opacidad la deslava (Pancho, 14-oct) */
}
/* El degradado va DENTRO de la máscara de la foto: se descubre con ella y el
   crema de la apertura queda limpio (antes el hero entero se veía gris). */
.hero::after, .mask-reveal--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0.48) 100%);
}
.js .hero::after { content: none; }
.hero-content {
  position: relative;
  z-index: 1;
  padding: 3.5rem 1.4rem 3rem;
  max-width: 640px;
  color: #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-content .kicker { color: var(--sage); margin-bottom: 1rem; }
/* H1 en Playfair Display — único nivel (junto a H4) que usa el serif, igual
   que tepuhueico.com: el resto del sitio corre en Montserrat. */
.hero-content h1 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 1.8rem;
}

/* ── Sections ── */
.section-head { margin-bottom: 2.2rem; }
.section-head .kicker { margin-bottom: 0.5rem; }
/* H2 en Montserrat liviano — en tepuhueico.com el H2 NO usa el serif (300, Montserrat). */
.section-head h2 { font-weight: 300; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { color: var(--muted); max-width: 60ch; margin-top: 0.6rem; }

/* ── Split foto + texto ── */
/* Proporción medida en tepuhueico.com: una foto grande de un lado, texto +
   un solo botón del otro, con mucho aire — no una grilla densa como primer
   contacto. La grilla de fotos queda como contenido secundario, más abajo. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 5rem;
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 2rem; } }
.split-media img { width: 100%; height: 480px; object-fit: cover; }
.split-text h2 { font-weight: 300; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 0.6rem 0 1.2rem; }
.split-text p { color: var(--muted); margin-bottom: 1.6rem; max-width: 50ch; }

/* ── Galería secundaria ── */
/* Sin radio — tepuhueico.com es prácticamente plano (radii: 0px salvo 1 caso). */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  /* Ratio de foto de feature en la referencia: 1.5:1 — object-fit cover ya lo resuelve visualmente. */
}

/* ── Masterplan / iframes ── */
.frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000000;
}
.frame-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ── Conteo de lotes (dato real del masterplan, sin cuenta regresiva) ── */
.conteo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem 2rem;
  margin-bottom: 1.4rem;
}
.conteo__cifras { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.conteo__cifra { display: flex; align-items: baseline; gap: 0.5rem; }
.conteo__cifra .num { font-family: "Playfair Display", serif; font-size: 2rem; font-weight: 700; color: var(--olive); line-height: 1; }
.conteo__cifra .label { font-size: 0.82rem; color: var(--muted); }
.conteo__barra { height: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.conteo__relleno { display: block; height: 100%; width: 55%; background: var(--olive); transition: width 0.8s ease; }
.conteo__pie { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.8rem; font-size: 0.78rem; color: var(--muted); }
.conteo__fecha { white-space: nowrap; }
@media (max-width: 680px) { .conteo { padding: 1.2rem 1.2rem; } .conteo__cifras { gap: 1.2rem; } }

.legend { display: flex; gap: 1.4rem; margin-top: 1rem; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--disponible { background: #fff; border: 1px solid var(--line); }
.dot--vendido { background: #c0392b; }

/* ── Condiciones ── */
/* radio 10px: es el único valor de radio real medido en tepuhueico.com (1 caso) —
   se usa acá para el único bloque "tipo card" del sitio, sin sombra. */
.conditions {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.conditions .item .num { font-family: "Playfair Display", serif; font-size: 1.8rem; font-weight: 700; color: var(--olive); }
.conditions .item .label { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }

/* ── Ubicación ── */
.loc-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.5rem; }
.frame-wrap--4-3 { aspect-ratio: 4 / 3; }
@media (max-width: 760px) { .loc-grid { grid-template-columns: 1fr; } }
.loc-facts { display: flex; flex-direction: column; gap: 0.9rem; }
.loc-fact { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.loc-fact b { display: block; font-size: 0.95rem; }
.loc-fact span { font-size: 0.85rem; color: var(--muted); }

/* ── Contacto ── */
.contact {
  background: #000000;
  color: #ffffff;
  max-width: none;
  padding: 4rem 1.4rem 6rem;
  text-align: center;
}
.contact .kicker { color: var(--sage); }
.contact h2 { font-family: "Playfair Display", serif; font-weight: 700; font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.6rem 0 1rem; }
.contact p { color: var(--sage); max-width: 50ch; margin: 0 auto 1.6rem; }

/* Botón principal — olivo sólido, igual que "VER MÁS" en tepuhueico.com
   (el CTA real de la referencia, no un lima separado). */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--olive);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.6rem;
  border-radius: 2px;
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  transition: background 0.3s, box-shadow 0.3s;
}
.btn:hover { background: var(--olive-dark); }
.btn--ghost {
  background: transparent;
  border: 1px solid #4a4d42;
  color: #ffffff;
}
.btn--ghost:hover { border-color: var(--sage); color: var(--sage); }

.contact-links { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* ── Footer — barra olivo, igual que el bottom bar persistente de tepuhueico.com ── */
footer {
  text-align: center;
  padding: 1.6rem;
  font-size: 0.75rem;
  color: #e9ead9;
  background: var(--olive-dark);
}

.placeholder-note {
  font-size: 0.72rem;
  color: var(--moss);
  margin-top: 0.6rem;
}

/* ── WhatsApp flotante ── */
/* Sombra difusa de blur grande (0 30px 27px -13px) — el único patrón de sombra
   real medido en tepuhueico.com, reservado a UI flotante (su barra inferior
   sticky), no a contenido. */
.wasap {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--olive);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px; /* píldora — pedido de Pancho 6-oct; el resto del sitio sigue plano */
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 30px 27px -13px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.3s;
  z-index: 50;
}
.wasap:hover { background: var(--olive-dark); }
.wasap--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.wasap svg { width: 20px; height: 20px; }

/* ── Mapa (Leaflet + satélite Esri) ── */
#mapa { z-index: 0; }
.pin-refugio { position: relative; }
.pin-refugio__punto {
  position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--olive);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.pin-refugio__halo {
  position: absolute; left: 50%; top: 50%;
  width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%;
  background: rgba(118, 171, 3, 0.35);
  animation: pin-pulso 2.2s ease-out infinite;
}
@keyframes pin-pulso {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pin-refugio__halo { animation: none; opacity: 0.5; } }
.leaflet-popup-content-wrapper { border-radius: 4px; font-family: "Montserrat", sans-serif; }
.leaflet-container { font-family: "Montserrat", sans-serif; }

/* ── Lightbox (fotos de "El lugar") ── */
.es-clickeable { cursor: zoom-in; transition: opacity 0.3s; }
.es-clickeable:hover { opacity: 0.88; }
.sin-scroll { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.lightbox--abierto { display: flex; }
.lightbox__img {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 30px 27px -13px rgba(0,0,0,0.5);
}
.lightbox button {
  position: absolute;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.6rem 1rem;
  opacity: 0.8;
  transition: opacity 0.3s;
}
.lightbox button:hover { opacity: 1; }
.lightbox__close { top: 0.8rem; right: 1rem; }
.lightbox__prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.6rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 680px) { .lightbox button { font-size: 2rem; padding: 0.5rem 0.7rem; } }

/* ── Movimiento (referencia: estudio premium — GSAP + SplitText + Lenis) ──
   El ritmo es lento y sin rebotes; el color lo pone la fotografía, la paleta
   olivo/crema no cambia. Todo se degrada a estático sin JS o con
   prefers-reduced-motion. */
h1 em, h2 em, .franja em { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; }
.linea-v { display: block; width: 1px; height: 44px; background: currentColor; opacity: 0.45; margin: 0.9rem 0 1.1rem; transform-origin: top; }
.hero-content .linea-v { margin-left: auto; margin-right: auto; color: var(--sage); height: 56px; }
.section-head .linea-v, .split-text .linea-v { color: var(--moss); }
.contact .linea-v { color: var(--sage); margin-left: auto; margin-right: auto; }
.hero img, .franja img { will-change: transform; }
.hero img { height: 110%; top: -5%; }
.franja { position: relative; max-width: none; padding: 0; height: 62vh; min-height: 380px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; }
.franja img { position: absolute; inset: 0; width: 100%; height: 112%; top: -6%; object-fit: cover; opacity: 0.8; }
.franja p { position: relative; z-index: 1; color: #fff; font-weight: 300; font-size: clamp(1.6rem, 4vw, 2.6rem); text-align: center; padding: 0 1.4rem; text-shadow: 0 2px 24px rgba(0,0,0,0.4); }
[data-clip] { clip-path: inset(0 0 0 0); }
/* Máscara del revelado tipo maira.cl: la crea motion.js alrededor de cada foto. */
.mask-reveal { display: block; overflow: hidden; }
.split-media .mask-reveal img { width: 100%; height: 480px; object-fit: cover; }
.gallery .mask-reveal { height: 160px; }
.gallery .mask-reveal img { height: 100%; }
.mask-reveal img { will-change: transform; }
.mask-reveal--hero { position: absolute; inset: 0; }
/* Apertura: "Refugio Chiloé / presenta" sobre el crema, antes de que se descubra la foto. */
.hero-presenta { position: absolute; inset: 0; z-index: 2; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; color: var(--ink); pointer-events: none; }
.hero-presenta .kicker { color: var(--moss); }
.hero-presenta em { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.js .hero-presenta { display: flex; }
.js .hero-content { opacity: 0; }
.js .hero img { clip-path: inset(0 0 100% 0); } /* hasta que motion.js la envuelva */
.js [data-reveal] { visibility: hidden; } /* hasta que SplitText lo parta: evita el destello del título antes de la foto */
.js [data-reveal] .line { overflow: hidden; }
.js [data-clip] { clip-path: inset(0 0 100% 0); }
.js .linea-v { transform: scaleY(0); }
.js .conditions, .js .conteo, .js .loc-fact { opacity: 0; transform: translateY(24px); }
.js #lugar .gallery img { clip-path: inset(0 0 100% 0); }
@media (prefers-reduced-motion: reduce) {
  /* Con "reducir movimiento" sólo se apaga el movimiento continuo (parallax,
     scroll suave); los revelados de una vez siguen (decisión 14-oct). */
  .hero img, .franja img { height: 100%; top: 0; }
}
