/* ═══════════════════════════════════════════════════════════
   HERO ATLAS — Patrón generalizado para TODAS las páginas E&E
   Se carga antes que cada CSS por página.
   ═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   1. SECTION WRAPPER
   ══════════════════════════════════════════════ */
.hero-atlas {
  position: relative;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
  padding-top: calc(70px + 1.25rem);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
@media (min-width: 768px) {
  .hero-atlas { padding-top: calc(80px + 1.5rem); }
}

/* Variantes de fondo */
.hero-atlas--deep {
  background: var(--em-deep);
}
.hero-atlas--darker {
  background: var(--em-darker);
}

/* ══════════════════════════════════════════════
   2. BACKGROUND LAYER
   ══════════════════════════════════════════════ */
.hero-atlas-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Default (interiores): em-darker con acentos dorados y verdes */
.hero-atlas--darker .hero-atlas-bg {
  background:
    radial-gradient(ellipse 60% 50% at 75% 20%, rgba(212,165,32,.07) 0%, transparent 70%),
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(22,163,74,.18) 0%, transparent 65%),
    linear-gradient(180deg, var(--em-darker) 0%, var(--em-deep) 100%);
}

/* Home: em-deep con acentos verdes dominantes */
.hero-atlas--deep .hero-atlas-bg {
  background:
    radial-gradient(ellipse 60% 50% at 20% 60%, rgba(22,163,74,.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 30%, rgba(74,222,128,.1) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 80%, rgba(5,46,22,.5) 0%, transparent 60%);
}

/* ══════════════════════════════════════════════
   3. GRID LINES — desactivadas, reemplazadas por
   el grain texture (sección 20)
   ══════════════════════════════════════════════ */
.hero-atlas-grid-lines {
  display: none;
}

/* ══════════════════════════════════════════════
   4. CORNERS (etiquetas tipo atlas)
   ══════════════════════════════════════════════ */
.hero-atlas-corner {
  position: absolute;
  z-index: 1;
  font-family: var(--ff-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  display: none;
}
@media (min-width: 1024px) {
  .hero-atlas-corner { display: block; }
  .hero-atlas-corner--tl { top: 1.5rem; left: 1.5rem; }
  .hero-atlas-corner--tr { top: 1.5rem; right: 1.5rem; }
  .hero-atlas-corner--br { bottom: 1.5rem; right: 1.5rem; }
  .hero-atlas-corner--bl { bottom: 1.5rem; left: 1.5rem; }
  .hero-atlas-corner--n  { top: 1.5rem; left: 50%; transform: translateX(-50%); }
  .hero-atlas-corner--s  { bottom: 5rem; left: 50%; transform: translateX(-50%); }
  .hero-atlas-corner--w  { top: 50%; left: 1.5rem; transform: translateY(-50%) rotate(-90deg); transform-origin: left top; }
  .hero-atlas-corner--e  { top: 50%; right: 1.5rem; transform: translateY(-50%) rotate(90deg); transform-origin: right top; }
}

/* ══════════════════════════════════════════════
   5. ORBS FLOTANTES (Home only)
   ══════════════════════════════════════════════ */
.hero-atlas-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 2;
  opacity: .35;
}
.hero-atlas-orb--green {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(74,222,128,.45) 0%, transparent 70%);
  top: -10%; left: -8%;
  animation: orbFloat 8s ease-in-out infinite;
}
.hero-atlas-orb--gold {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(212,165,32,.35) 0%, transparent 70%);
  bottom: 10%; right: -5%;
  animation: orbFloat 10s ease-in-out infinite reverse;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.08); }
}


/* ══════════════════════════════════════════════
   7. H1
   ══════════════════════════════════════════════ */
.hero-atlas-h1 {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 0 0 1rem;
}
.hero-atlas-h1 em {
  font-style: italic;
  color: var(--gold);
}

/* ══════════════════════════════════════════════
   8. LEDE
   ══════════════════════════════════════════════ */
.hero-atlas-lede {
  font-family: var(--ff-body);
  font-size: clamp(1rem, 1.1vw, 1.12rem);
  line-height: 1.7;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin: 0 0 1.5rem;
}

/* ══════════════════════════════════════════════
   9. WRAP LAYOUT (grid 2 col)
   ══════════════════════════════════════════════ */
.hero-atlas-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  align-items: start;
  flex: 1;
}
@media (min-width: 1024px) {
  .hero-atlas-wrap {
    grid-template-columns: 1.05fr 1fr;
    gap: 3.5rem;
    padding-top: 2.75rem;
    padding-bottom: 3.25rem;
    align-items: center;
  }
}

/* ══════════════════════════════════════════════
   10. COPY COLUMN (izquierda)
   ══════════════════════════════════════════════ */
.hero-atlas-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* ══════════════════════════════════════════════
   10b. NMLS INLINE — visible en todos los tamaños
   ══════════════════════════════════════════════ */
.hero-nmls-line {
  font-family: var(--ff-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,.38);
  margin-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════
   11. ACTIONS (botones + link secundario)
   ══════════════════════════════════════════════ */
.hero-atlas-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.hero-atlas-link-secondary {
  font-family: var(--ff-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 2px;
  transition: color .25s, border-color .25s, gap .25s;
}
.hero-atlas-link-secondary:hover {
  color: var(--gold);
  border-color: var(--gold);
  gap: 0.6rem;
}

/* ══════════════════════════════════════════════
   12. VISUAL COLUMN (derecha)
   ══════════════════════════════════════════════ */
.hero-atlas-visual {
  position: relative;
  min-width: 0;
}

/* ══════════════════════════════════════════════
   13. STATS BAND (opcional)
   ══════════════════════════════════════════════ */
.hero-atlas-stats-band {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,.32);
  border-top: 1px solid rgba(212,165,32,.16);
  border-bottom: 1px solid rgba(74,222,128,.12);
  backdrop-filter: blur(4px);
}
.hero-atlas-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 1.1rem 0;
}
@media (min-width: 768px) {
  .hero-atlas-stats-row {
    grid-template-columns: repeat(4, 1fr);
    padding: 1.25rem 0;
  }
}
.hero-atlas-stat {
  padding: 0.35rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  border-right: 1px solid rgba(255,255,255,.08);
}
.hero-atlas-stat:last-child { border-right: none; }
@media (max-width: 767.98px) {
  .hero-atlas-stat:nth-child(2n) { border-right: none; }
  .hero-atlas-stat:nth-child(-n+2) {
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
  }
}
.hero-atlas-stat-val {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero-atlas-stat-val span {
  font-size: 0.55em;
  color: rgba(212,165,32,.65);
  margin-left: 1px;
  vertical-align: super;
}
.hero-atlas-stat-lbl {
  font-family: var(--ff-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  line-height: 1.45;
}

/* ══════════════════════════════════════════════
   14. WAVE SEPARATOR (Home only)
   ══════════════════════════════════════════════ */
.hero-atlas-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 5;
  pointer-events: none;
}

/* ══════════════════════════════════════════════
   15. DIVIDER DORADO (Contacto)
   ══════════════════════════════════════════════ */
.hero-atlas-divider {
  position: relative;
  height: 48px;
  background: var(--em-darker);
  overflow: hidden;
}
.hero-atlas-divider-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212,165,32,.35) 20%, var(--gold) 50%, rgba(212,165,32,.35) 80%, transparent 100%);
}
.hero-atlas-divider-glow {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% - 6px);
  height: 12px;
  background: radial-gradient(ellipse 60% 100% at 50% 50%, rgba(212,165,32,.12), transparent 70%);
  pointer-events: none;
}

/* ══════════════════════════════════════════════
   16. TRUST GRID (Contacto / Home variant)
   ══════════════════════════════════════════════ */
.hero-atlas-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  max-width: 520px;
  margin-bottom: 1.5rem;
}
.hero-atlas-trust > div {
  min-height: 5.25rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(14px);
}
.hero-atlas-trust strong {
  display: block;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
}
.hero-atlas-trust span {
  display: block;
  margin-top: .45rem;
  color: rgba(255,255,255,.56);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   17. MODIFICADORES DE CONTENIDO VISUAL
   ══════════════════════════════════════════════ */

/* --with-orbs: muestra los orbs */
.hero-atlas--with-orbs .hero-atlas-orb { display: block; }

/* --with-wave: muestra la wave */
.hero-atlas--with-wave { padding-bottom: 0; }

/* --with-stats: padding-bottom se ajusta para la stats band */
.hero-atlas--with-stats { padding-bottom: 0; }

/* --with-divider: no padding-bottom en el hero */
.hero-atlas--with-divider { padding-bottom: 0; }

/* ══════════════════════════════════════════════
   18. UTILIDADES RESPONSIVE
   ══════════════════════════════════════════════ */

/* Tablet (768px – 1023px): columna única, gap reducido */
@media (max-width: 1023.98px) {
  .hero-atlas-visual { order: -1; }
  .hero-atlas-wrap { gap: 2rem; }
}

/* Mobile (≤767px): orbs pequeños + botones en columna para TODAS las páginas */
@media (max-width: 767.98px) {
  .hero-atlas-orb--green { width: 300px; height: 300px; }
  .hero-atlas-orb--gold  { width: 200px; height: 200px; }
  .hero-atlas-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  /* Cubrir todas las variantes de botón usadas en heroes internos */
  .hero-atlas-actions .btn,
  .hero-atlas-actions [class*="eee-btn"],
  .hero-atlas-actions .contact-hero-btn-email {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* iPhone Pro Max (≤430px) y menores: gap más ajustado */
@media (max-width: 479px) {
  .hero-atlas-wrap { gap: 1.25rem; }
  .hero-atlas-copy { padding-bottom: 1.5rem; }
  .hero-atlas-lede { font-size: 0.93rem; max-width: 100%; }
  /* H1 escala con viewport en lugar de clampear al mínimo de 28.8px */
  .hero-atlas-h1 { font-size: clamp(1.4rem, 7vw, 2rem); }
}

/* ══════════════════════════════════════════════
   19. HERO CON FOTO DE FONDO
   Usar: añadir clase hero-atlas--with-photo a la section
         + style="--hero-photo: url('/wp-content/uploads/...')"
   ══════════════════════════════════════════════ */
.hero-atlas--with-photo .hero-atlas-bg {
  background-image:
    radial-gradient(ellipse 60% 50% at 75% 20%, rgba(212,165,32,.07) 0%, transparent 70%),
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(22,163,74,.15) 0%, transparent 65%),
    linear-gradient(180deg, rgba(5,46,22,.78) 0%, rgba(20,83,45,.84) 100%),
    var(--hero-photo, none);
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
}

/* ══════════════════════════════════════════════
   20. GRAIN TEXTURE — cuero Saffiano / papel premium
   feTurbulence fractalNoise genera micro-irregularidades
   que simulan grano fino con acabado mate.
   mix-blend-mode:overlay crea micro-sombras en los
   valles del grano sin desaturar el verde bosque.
   isolation:isolate en .hero-atlas contiene el blend.
   ══════════════════════════════════════════════ */
.hero-atlas::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.18;
  filter: url('#eee-grain');
}

/* ══════════════════════════════════════════════
   21. HERO PHOTO COLUMN — columna de imagen portrait
   Mismo estilo que la home (LATINAREALTOR).
   Clases: hero-photo-wrap > hero-photo-frame > img
   En mobile se oculta la columna del grid;
   usar hero-photo-mobile para versión inline (opcional).
   ══════════════════════════════════════════════ */
.hero-photo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo-frame {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(74,222,128,.15);
  background: linear-gradient(160deg, #166534 0%, #14532d 50%, #052e16 100%);
}

.hero-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  max-width: none;
}

.hero-photo-mobile { margin: 1.25rem 0; }
.hero-photo-mobile .hero-photo-frame { max-width: 200px; margin: 0 auto; }

@media (min-width: 1024px) {
  .hero-photo-mobile { display: none; }
  .hero-photo-desktop .hero-photo-frame { max-width: 400px; }
}

@media (max-width: 1023.98px) {
  .hero-photo-desktop { display: none; }
}

@media (max-width: 375px) {
  .hero-photo-mobile .hero-photo-frame { max-width: 160px; }
}
