/* ===================================================================
   EL MIRADOR — DESIGN TOKENS
   Paleta inspirada en los humedales del Río Luján: verde marisma oscuro,
   agua/verde-azulado apagado, arena cálida y un acento arcilla discreto.
=================================================================== */
:root{
  --em-marsh: #1F2E28;      /* verde marisma profundo — fondos oscuros */
  --em-marsh-2: #16211C;    /* variante aún más oscura */
  --em-teal: #4C6B63;       /* verde-agua apagado — acento principal */
  --em-teal-light: #7C9791;
  --em-sand: #EDE6D6;       /* arena cálida — fondos claros alternativos */
  --em-sand-2: #E3D9C4;
  --em-clay: #B5764F;       /* arcilla — acento cálido, uso reducido */
  --em-ink: #24231E;        /* texto principal */
  --em-paper: #FAF8F2;      /* blanco cálido — fondo base */
  --em-line: rgba(36,35,30,0.12);
  --em-line-light: rgba(250,248,242,0.18);

  --em-font-display: "Fraunces", Georgia, serif;
  --em-font-body: "Archivo", "Segoe UI", sans-serif;

  --em-container-max: 1280px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  font-family: var(--em-font-body);
  color: var(--em-ink);
  background-color: var(--em-paper);
  overflow-x: hidden;
  line-height: 1.6;
  text-rendering: optimizeSpeed;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

img{ max-width: 100%; height: auto; display: block; }

a{ color: inherit; text-decoration: none; }

::selection{ background: var(--em-teal); color: var(--em-paper); }

:focus-visible{
  outline: 2px solid var(--em-clay);
  outline-offset: 3px;
}

/* ===================== RENDERING PERF =====================
   content-visibility:auto le dice al navegador que no gaste tiempo de
   layout/paint en secciones que todavía no están cerca del viewport.
   Se excluye el hero (siempre visible al cargar) para no afectar el LCP. */
.em-section,
.em-footer{
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

/* ===================== TYPE SCALE ===================== */
.em-kicker{
  font-family: var(--em-font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--em-teal);
  margin-bottom: 0.9rem;
  letter-spacing: 0.01em;
}
.em-kicker-light{ color: var(--em-teal-light); }

.em-h2{
  font-family: var(--em-font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  line-height: 1.18;
  max-width: 16ch;
  margin-bottom: 1.25rem;
  color: var(--em-ink);
}
.em-h2-light{ color: var(--em-paper); }

.em-body{
  font-size: 1.05rem;
  max-width: 58ch;
  color: rgba(36,35,30,0.85);
  margin-bottom: 1.1rem;
}
.em-body-light{ color: rgba(250,248,242,0.82); }

.em-brand{
  font-family: var(--em-font-display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--em-paper);
  letter-spacing: 0.01em;
}

/* ===================== LAYOUT / SECTIONS ===================== */
.em-section{
  padding: clamp(4rem, 8vw, 7.5rem) 0;
}
.em-section-dark{
  background-color: var(--em-marsh);
  color: var(--em-paper);
}
.em-section-sand{
  background-color: var(--em-sand);
}

/* ===================== NAVBAR ===================== */
.em-navbar{
  background: transparent;
  padding: 1.6rem 0;
  transition: background-color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}
.em-navbar.em-navbar-scrolled{
  background-color: rgba(31,46,40,0.94);
  padding: 0.9rem 0;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  /* SIN position:relative — el nav ya es fixed (clase .fixed-top de Bootstrap),
     y fixed también sirve como containing block para el pseudo-elemento de abajo. */
}
/* El blur va en un pseudo-elemento (no backdrop-filter directo en el nav) para
   no romper el posicionamiento del offcanvas fixed que cuelga dentro del nav. */
.em-navbar.em-navbar-scrolled::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.em-navbar .nav-link{
  color: var(--em-paper);
  font-size: 0.98rem;
  padding: 0.5rem 1rem;
  opacity: 0.88;
  transition: opacity 0.25s ease;
}
.em-navbar .nav-link:hover{ opacity: 1; }

.em-toggler-icon{
  color: var(--em-paper);
  font-size: 1.6rem;
  display: inline-flex;
}
.navbar-toggler{ border: none; padding: 0.2rem; }
.navbar-toggler:focus{ box-shadow: none; }

.em-offcanvas{
  background-color: var(--em-marsh);
  color: var(--em-paper);
  width: min(320px, 84vw);
}
.em-offcanvas .nav-link{ padding: 0.75rem 0; font-size: 1.05rem; }

.em-btn-primary{
  background-color: var(--em-clay);
  color: var(--em-paper);
  border: 1px solid var(--em-clay);
  padding: 0.65rem 1.6rem;
  border-radius: 2px;
  font-size: 0.95rem;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.em-btn-primary:hover{
  background-color: #9B6340;
  border-color: #9B6340;
  color: var(--em-paper);
  transform: translateY(-1px);
}

.em-btn-outline-light{
  border: 1px solid var(--em-line-light);
  color: var(--em-paper);
  padding: 0.75rem 1.9rem;
  border-radius: 2px;
  display: inline-block;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.em-btn-outline-light:hover{
  background-color: rgba(250,248,242,0.08);
  border-color: var(--em-paper);
  color: var(--em-paper);
}

/* ===================== HERO ===================== */
.em-hero{
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  /* El hero se mantiene fuera de content-visibility: siempre es lo primero visible */
  content-visibility: visible;
}
.em-hero-carousel, .em-hero-carousel .carousel-inner, .em-hero-carousel .carousel-item{
  height: 100%;
}
.em-hero-carousel img{
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.em-hero-carousel::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 550px at 50% 50%, rgba(10,14,12,0.35) 0%, rgba(10,14,12,0) 70%),
    linear-gradient(180deg, rgba(15,20,17,0.15) 0%, rgba(15,20,17,0.05) 40%, rgba(15,20,17,0.3) 100%);
  pointer-events: none;
}

.em-hero-overlay{
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Zona desenfocada detrás del texto, con bordes difuminados */
.em-hero-blur{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 85vw);
  height: min(280px, 45vh);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 55%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 55%, rgba(0,0,0,0) 100%);
}

.em-hero-eyebrow{
  color: rgba(250,248,242,0.95);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
}
.em-hero-title{
  font-family: var(--em-font-display);
  color: var(--em-paper);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 0.9rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
}
.em-hero-sub{
  color: var(--em-paper);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  max-width: 40ch;
  margin: 0 auto;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  position: relative;
  z-index: 1;
}

.em-carousel-arrow{
  width: 46px; height: 46px;
  border: 1px solid rgba(250,248,242,0.5);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--em-paper);
  font-size: 1.1rem;
  background: rgba(22,33,28,0.25);
}
.carousel-control-prev, .carousel-control-next{ width: 5%; opacity: 0.9; }

.em-carousel-indicators{ margin-bottom: 1.6rem; }
.em-carousel-indicators [data-bs-target]{
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background-color: rgba(250,248,242,0.5);
  margin: 0 5px;
  opacity: 1;
}
.em-carousel-indicators .active{ background-color: var(--em-paper); }

.em-scroll-cue{
  position: absolute;
  bottom: 1.6rem;
  right: clamp(1.2rem, 4vw, 3rem);
  z-index: 2;
  color: var(--em-paper);
  font-size: 1.3rem;
  opacity: 0.85;
  animation: emBob 2.4s ease-in-out infinite;
}
@keyframes emBob{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(8px); }
}

/* ===================== EDITORIAL IMAGE (El Barrio) ===================== */
.em-editorial-image{
  position: relative;
  overflow: hidden;
}
.em-editorial-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

.em-stats-row{
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 2.5rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--em-line);
}
.em-stat{ display: flex; flex-direction: column; }
.em-stat-num{
  font-family: var(--em-font-display);
  font-size: 1.9rem;
  color: var(--em-ink);
}
.em-stat-label{
  font-size: 0.85rem;
  color: rgba(36,35,30,0.6);
  margin-top: 0.15rem;
}

/* ===================== NATURALEZA (collage) ===================== */
.em-nature-collage{
  position: relative;
  min-height: 420px;
}
.em-nature-main{
  width: 88%;
  aspect-ratio: 8/5;
  object-fit: cover;
}
.em-nature-secondary{
  position: absolute;
  right: 0;
  bottom: -8%;
  width: 46%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border: 6px solid var(--em-marsh);
  box-shadow: 0 20px 45px rgba(0,0,0,0.35);
}
@media (max-width: 991.98px){
  .em-nature-collage{ min-height: auto; margin-bottom: 3rem; }
  .em-nature-main{ width: 100%; }
  .em-nature-secondary{ width: 55%; right: 0; bottom: -6%; }
}

/* ===================== AMENITIES ===================== */
.em-amenity-feature{
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0;
  display: flex;
  align-items: flex-end;
  background-color: #16211c; /* mismo tono que el degradado, por si quedan espacios */
}
.em-amenity-feature img{
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.em-amenity-feature-text{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 2.5rem;
  color: var(--em-paper);
  background: linear-gradient(0deg, rgba(22,33,28,0.85) 0%, rgba(22,33,28,0) 55%);
  width: 100%;
}
.em-amenity-feature-text h3{
  font-family: var(--em-font-display);
  font-size: 2rem;
  margin-bottom: 0.4rem;
}
.em-amenity-feature-text p{
  margin: 0;
  opacity: 0.9;
  max-width: 40ch;
}

/* ===================== INFRAESTRUCTURA / SEGURIDAD ===================== */
.em-radius-img{
  border-radius: 4px;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.em-check-list{
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.em-check-list li{
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--em-line);
  font-size: 1.02rem;
}
.em-check-list li:last-child{ border-bottom: 1px solid var(--em-line); }
.em-check-list i{ color: var(--em-teal); margin-top: 0.2rem; }

.em-security-row{ margin-top: clamp(3rem, 6vw, 5rem); }

/* ===================== GALERÍA ===================== */
.em-gallery{
  columns: 4 220px;
  column-gap: 0.9rem;
}
.em-gallery-item{
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0 0 0.9rem;
  break-inside: avoid;
  background: none;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}
.em-gallery-item img{ width: 100%; transition: transform 0.5s ease, filter 0.5s ease; }
.em-gallery-item:hover img{ transform: scale(1.04); }
.em-gallery-item::after{
  content: "\f52d";
  font-family: "bootstrap-icons";
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  color: #fff;
  background: rgba(22,33,28,0.55);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.em-gallery-item:hover::after{ opacity: 1; }

@media (max-width: 767.98px){
  .em-gallery{ columns: 2 160px; }
}

.em-gallery-modal .modal-content{
  background: var(--em-marsh-2);
  border: none;
  border-radius: 4px;
  overflow: hidden;
}
.em-modal-close{
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 3;
}

/* ===================== UBICACIÓN ===================== */
.em-location-list{
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.em-location-list li{
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 1.02rem;
}
.em-location-list i{ color: var(--em-clay); margin-top: 0.2rem; font-size: 1.1rem; }

.em-map-frame{
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--em-line);
}

/* ===================== PROCESO / FINANCIACIÓN ===================== */
.em-process-step{
  padding: 2rem 1.75rem;
  border: 1px solid var(--em-line-light);
  border-radius: 4px;
  height: 100%;
}
.em-process-index{
  font-family: var(--em-font-display);
  font-size: 1.6rem;
  color: var(--em-teal-light);
  display: block;
  margin-bottom: 1rem;
}
.em-process-step h4{
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--em-paper);
}
.em-process-step p{
  color: rgba(250,248,242,0.78);
  font-size: 0.98rem;
  margin: 0;
}

/* ===================== CONTACTO / FORM ===================== */
.em-contact-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.em-contact-list li{
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 1.02rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--em-line);
}
.em-contact-list li:last-child{ border-bottom: none; }
.em-contact-list i{ color: var(--em-teal); font-size: 1.15rem; margin-top: 0.15rem; }
.em-contact-list a:hover{ color: var(--em-clay); }
.em-todo{ color: rgba(36,35,30,0.45); font-style: italic; }

.em-label{
  font-size: 0.85rem;
  color: rgba(36,35,30,0.7);
  margin-bottom: 0.35rem;
  display: block;
}
.em-input{
  border-radius: 2px;
  border: 1px solid var(--em-line);
  padding: 0.7rem 0.9rem;
  background-color: var(--em-paper);
}
.em-input:focus{
  border-color: var(--em-teal);
  box-shadow: 0 0 0 3px rgba(76,107,99,0.15);
}
.em-form-feedback{
  font-size: 0.92rem;
  color: var(--em-teal);
  min-height: 1.3em;
}

/* ===================== FOOTER ===================== */
.em-footer{
  background-color: var(--em-marsh-2);
  color: rgba(250,248,242,0.85);
  padding: clamp(3.5rem, 6vw, 5.5rem) 0 2rem;
}
.em-footer-brand{ font-size: 1.6rem; margin-bottom: 1rem; }
.em-footer-heading{
  font-size: 0.9rem;
  text-transform: none;
  color: var(--em-paper);
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.em-footer-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: rgba(250,248,242,0.72);
}
.em-footer-list a:hover{ color: var(--em-paper); }
.em-footer-rule{
  border-color: var(--em-line-light);
  margin: 2.5rem 0 1.75rem;
}
.em-footer-copy{
  font-size: 0.85rem;
  color: rgba(250,248,242,0.55);
}
.em-footer-copy a{ color: rgba(250,248,242,0.8); }
.em-footer-copy a:hover{ color: var(--em-paper); }

/* ===================== REVEAL ON SCROLL ===================== */
.em-reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.em-reveal.em-in-view{
  opacity: 1;
  transform: translateY(0);
}