/* =============================================================================
   HERO.CSS — La Providencia Patagonia
   Preloader · Hero outer/sticky · Clouds · Content · Stats bar
   Solo se carga en front-page (ver functions.php)
   ============================================================================= */


/* ── Preloader — cortina full-screen ─────────────────────────────────────── */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--bg-green);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1.4s ease;
    will-change: opacity;
}

.preloader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader__logo {
    width: clamp(120px, 14vw, 200px);
    height: auto;
    opacity: 0;
    animation: heroFadeUp 0.55s ease 0.25s both;
}

body.no-scroll { overflow: hidden; }


/* ── Hero outer — contenedor sticky ─────────────────────────────────────── */
/*
   250vh de alto: el hero sticky ocupa 100vh y se mantiene fijo
   durante los 150vh restantes mientras transcurre la animación.
*/

.hero-outer {
    position: relative;
    height: 250vh;
    height: 250dvh;
}


/* ── Hero — panel pegajoso ───────────────────────────────────────────────── */

.hero {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;  /* content al medio, stats al fondo */
}


/* ── Fondo ────────────────────────────────────────────────────────────────── */
/*
   height: auto mantiene la proporción natural de la imagen.
   Si es portrait (más alta que 100vh), el JS puede hacer un viaje
   vertical largo. Si es landscape, min-height asegura cobertura.
*/

.hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 110%;
    object-fit: cover;
    z-index: 0;
    will-change: transform;
    transform-origin: center top;
}


/* ── Overlay ─────────────────────────────────────────────────────────────── */

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        170deg,
        rgba(0,  0,  0, 0.30)  0%,
        rgba(0,  0,  0, 0.04) 30%,
        rgba(10, 30, 30, 0.20) 62%,
        rgba(5,  20, 20, 0.65) 100%
    );
}


/* ── Nubes ───────────────────────────────────────────────────────────────── */

.hero__cloud {
    position: absolute;
    z-index: 3;
    width: 88%;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Nube izquierda: sale por la izquierda */
.hero__cloud--left {
    left: -46%;
    top: 58%;
}

/* Nube derecha: espejada horizontalmente, sale por la derecha */
.hero__cloud--right {
    right: -50%;
    top: 26%;
    transform: scaleX(-1);
}


/* ── Contenido central ───────────────────────────────────────────────────── */

.hero__content {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;       /* alineado a la izquierda */
    justify-content: flex-end;     /* empuja hacia el fondo, sobre los stats */
    text-align: left;
    padding: 196px var(--padding-h) 48px;
    will-change: opacity, transform;
}

/* Copete */
.hero__copete {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 28px;
    opacity: 0;
    letter-spacing: 0.1em;
}

.hero-ready .hero__copete {
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* H1 */
.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(48px, 8vw, 71px);
    font-weight: 400;
    line-height: 1.05;
    color: var(--white);
    margin-bottom: 28px;
    max-width: 16ch;
}

.hero__title .reveal-line--italic {
    font-style: italic;
    font-weight: 300;
}

/* Reveal de líneas: texto oculto detrás de overflow:hidden,
   sube desde abajo cuando .hero-ready se agrega al body */
.reveal-line {
    display: block;
    overflow: hidden;
    line-height: 1.1;
}

.reveal-inner {
    display: block;
    transform: translateY(110%);
}

.hero-ready .hero__title .reveal-line:nth-child(1) .reveal-inner {
    animation: heroRevealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.18s forwards;
}

.hero-ready .hero__title .reveal-line:nth-child(2) .reveal-inner {
    animation: heroRevealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.34s forwards;
}

/* Reveal para secciones de contenido (activado por .in-view) */
.in-view .reveal-line:nth-child(1) .reveal-inner {
    animation: heroRevealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}

.in-view .reveal-line:nth-child(2) .reveal-inner {
    animation: heroRevealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.24s forwards;
}

.in-view .reveal-line:nth-child(3) .reveal-inner {
    animation: heroRevealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.38s forwards;
}

/* Bajada */
.hero__sub {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.68);
    max-width: 60ch;
    margin-bottom: 40px;
    opacity: 0;
}

.hero-ready .hero__sub {
    animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.54s both;
}

/* CTA */
.hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
    background: var(--green-light);
    padding: 22px 28px;
    border-radius: 100px;
    opacity: 0;
    transition: background 0.25s ease, gap 0.25s ease;
}

.hero-ready .hero__cta {
    animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.72s both;
}

.hero__cta:hover {
    background: var(--green-dark);
    color: var(--white);
    gap: 16px;
    opacity: 1;
}

.hero__cta-arrow {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.hero__cta:hover .hero__cta-arrow {
    transform: translateX(4px);
}


/* ── Stats bar — alineados a la derecha ─────────────────────────────────── */

.hero__stats {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    gap: 32px;
    padding: 28px var(--padding-h) 36px;
    opacity: 0;
    margin-top: 40px;
}

.hero-ready .hero__stats {
    animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.88s both;
}

.hero__stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 24px;
}

.hero__stat:first-child {
    border-left: none;
    padding-left: 0;
}

.hero__stat-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    color: var(--white);
}

.hero__stat-label {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 400;
    color: var(--text-grey-light);
}


/* ── Keyframes ───────────────────────────────────────────────────────────── */

@keyframes heroRevealUp {
    to { transform: translateY(0); }
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .hero__stats {
        gap: 20px;
    }

    .hero__stat-value {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .hero__content {
        padding: 72px var(--padding-h-mobile) 32px;
    }

    .hero__stats {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 16px 0;
        padding-inline: var(--padding-h-mobile);
        padding-top: 16px;
        padding-bottom: 24px;
        margin-top: 0;
    }

    .hero__stat {
        flex: 1 1 30%;
        align-items: center;
        text-align: center;
        padding-left: 12px;
    }

    .hero__stat:first-child {
        padding-left: 0;
    }

    .hero__stat-value {
        font-size: 16px;
    }

    .hero__stat-label {
        font-size: 8px;
        line-height: 1.3;
        letter-spacing: 0.05em;
    }

    .hero__cloud {
        width: 130%;
    }

    .hero__cloud--left {
        left: -55%;
        top: 62%;
    }

    .hero__cloud--right {
        right: -45%;
        top: 20%;
    }
}

/* Pantallas muy cortas (iPhone SE, iPhone mini, landscape mobile) */
@media (max-height: 680px) and (max-width: 768px) {
    .hero__content {
        padding-top: 56px;
        padding-bottom: 20px;
    }

    .hero__sub {
        display: none;
    }

    .hero__stats {
        padding-bottom: 16px;
    }

    .hero__stat-value {
        font-size: 15px;
    }
}

/* Viewport corto en desktop/laptop (ej: 1200×578) — hero compacto */
@media (max-height: 700px) and (min-width: 769px) {
    /* Menos padding superior: 196px era para despejar el logo grande */
    .hero__content {
        padding-top: 110px;
        padding-bottom: 24px;
    }

    /* H1 más pequeño */
    .hero__title {
        font-size: clamp(36px, 5vw, 52px);
        margin-bottom: 16px;
    }

    /* Copete menos margen */
    .hero__copete {
        margin-bottom: 14px;
    }

    /* Bajada más compacta */
    .hero__sub {
        font-size: 15px;
        margin-bottom: 22px;
        line-height: 1.5;
    }

    /* CTA más chico */
    .hero__cta {
        padding: 14px 22px;
    }

    /* Stats: menos padding vertical */
    .hero__stats {
        padding-top: 16px;
        padding-bottom: 20px;
        margin-top: 0;
    }

    .hero__stat-value {
        font-size: 20px;
    }
}
