/*
 * FILE: assets/css/components/hero.css
 * COMPONENT: hero.php  →  .hero-section
 *
 * Paleta oficial:
 *   #003824  verde oscuro
 *   #205F3E  verde bosque
 *   #45A85A  verde esmeralda
 *   #E94E89  magenta (acento artístico, máx 10% opacidad)
 */

/* ============================================================
   HERO — Contenedor
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    overflow: hidden;
    /* Fallback: si la imagen no carga, este gradiente sostiene el diseño */
    background: linear-gradient(135deg, #003824 0%, #0d4a2c 50%, #003824 100%);
}

/* ============================================================
   CAPA 1: IMAGEN DE FONDO
   ============================================================ */
.hero-section__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-section__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    animation: heroBgZoom 20s ease-in-out alternate infinite;
    /*
     * Domar los colores crudos de la foto sin destruir la imagen.
     * brightness(0.82): oscurece levemente para que el overlay sea dueño del contraste.
     * saturate(0.72):   baja la intensidad del rosa/magenta de la foto
     *                   para que los colores de diseño dominen.
     * Los dos juntos = imagen apreciable pero armoniosa con la paleta.
     */
    filter: brightness(0.82) saturate(0.72);
}

@keyframes heroBgZoom {
    from { transform: scale(1.0); }
    to   { transform: scale(1.05); }
}

/* ============================================================
   CAPA 2: GLOW MAGENTA — radial en esquina superior derecha
   Opacidad: 9% — sentido artístico, no invasivo
   ============================================================ */
.hero-section__bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 52% 48% at 82% 12%,
        rgba(233, 78, 137, 0.09) 0%,
        rgba(233, 78, 137, 0.04) 45%,
        transparent 70%
    );
}

/* ============================================================
   CAPA 3: OVERLAY PRINCIPAL — verde oscuro izquierda → derecha
   + vignette superior para legibilidad del navbar
   ============================================================ */
.hero-section__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        /* Vignette superior: garantiza contraste del navbar */
        linear-gradient(
            to bottom,
            rgba(0, 25, 12, 0.55) 0%,
            transparent           22%
        ),
        /* Overlay principal izquierda → derecha
         *
         * Lado izquierdo (0–38%): verde oscuro sólido → texto legible
         * Zona media   (38–62%): transición, imagen empieza a aparecer
         * Lado derecho (62–100%): tinte oscuro MUY suave — imagen visible
         *                         pero nunca cruda ni invasiva
         *
         * La clave: NO terminar en transparent.
         * rgba(0,18,10, 0.28) al 100% = velo protector casi imperceptible
         * que armoniza cualquier color de foto con la paleta verde.
         */
        linear-gradient(
            108deg,
            #003824             0%,
            rgba(0,56,36,0.95)  20%,
            rgba(0,56,36,0.75)  42%,
            rgba(0,40,24,0.32)  62%,
            rgba(0,20,12,0.18)  80%,
            rgba(0,15,8, 0.15) 100%
        );
}

/* Gradiente inferior: fusión suave con la barra de métricas */
.hero-section__overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(
        to top,
        rgba(0, 15, 8, 0.75) 0%,
        transparent          100%
    );
}

/* ============================================================
   CAPA 4: STREAK DIAGONAL — raya de luz en magenta
   Opción B elegida: light streak muy sutil
   Se posiciona sobre la zona visible de la imagen (derecha)
   ============================================================ */
.hero-section__streak {
    position: absolute;
    z-index: 3;
    pointer-events: none;

    /* Desde la esquina superior-derecha, diagonal descendente */
    top:   -30%;
    right: 10%;
    width: 28%;
    height: 160%;

    background: linear-gradient(
        to bottom,
        transparent                   0%,
        rgba(233, 78, 137, 0.00)      20%,
        rgba(233, 78, 137, 0.055)     42%,
        rgba(233, 78, 137, 0.04)      55%,
        rgba(233, 78, 137, 0.00)      75%,
        transparent                   100%
    );

    transform: rotate(-18deg);
    transform-origin: top center;

    /* Difuminar los bordes del streak */
    mask-image: linear-gradient(
        to right,
        transparent  0%,
        black        25%,
        black        75%,
        transparent  100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent  0%,
        black        25%,
        black        75%,
        transparent  100%
    );
}

/* ============================================================
   CUERPO — Contenido principal
   ============================================================ */
.hero-section__body {
    position: relative;
    z-index: 4;
    flex: 1;
    display: flex;
    align-items: center;
    padding-top:    calc(var(--nav-height, 72px) + 52px);
    padding-bottom: calc(86px + 130px + 16px);
}

.hero-section__content {
    max-width: min(800px, 56vw);
    padding-right: var(--space-8);
    border-right: 1.5px solid rgba(226, 58, 123, 0.20);
}

/*
 * "11 años" — posición absoluta en la zona de imagen (derecha del hero).
 *
 * Lógica de anclaje al container desde la derecha:
 *   - En pantallas > 1200px el container tiene margen lateral.
 *     max() elige el mayor entre el padding del container (1.5rem)
 *     y el margen real del container, así el badge queda dentro
 *     del "borde" del container sin importar el ancho del viewport.
 *   - top: alineado con el inicio del h1 (nav + padding-top + badge ~= 170px)
 */
.hero-section__aside {
    position: absolute;
    right: max(var(--container-px, 1.5rem),
               calc((100% - var(--container-max, 1200px)) / 2 + var(--space-8)));
    top:  calc(var(--nav-height, 72px) + 52px + 46px);
    animation: heroEnter 0.85s cubic-bezier(0.16,1,0.3,1) both 0.40s;
}

/* ============================================================
   BADGE — EDICIÓN 2026
   ============================================================ */
.hero-section__badge {
    margin-bottom: var(--space-4);
    animation: heroEnter 0.6s cubic-bezier(0.16,1,0.3,1) both 0.05s;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border: 1px solid rgba(69, 168, 90, 0.50);
    border-radius: 999px;
    background: rgba(69, 168, 90, 0.10);
    color: #8ed99e;
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #45A85A;
    flex-shrink: 0;
    animation: badgePulse 2.8s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.7); }
}

/* ============================================================
   MICROCOMPONENTE "11 AÑOS" — identidad institucional
   Glassmorphism oscuro + borde verde suave
   ============================================================ */
.hero-years {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px 10px 14px;
    background: rgba(0, 18, 10, 0.52);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(69, 168, 90, 0.28);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    /* Glow pulsante verde — respira para llamar la atención */
    box-shadow:
        0 4px 24px rgba(0, 18, 10, 0.40),
        0 0 0 1px rgba(69, 168, 90, 0.12);
    animation: heroYearsGlow 3.5s ease-in-out infinite alternate;
    transition: border-color 0.3s ease;
}

/* Shimmer: destello de luz que barre de izquierda a derecha */
.hero-years::after {
    content: '';
    position: absolute;
    top: 0;
    left: -110%;
    width: 65%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent        20%,
        rgba(255,255,255, 0.10) 50%,
        transparent        80%
    );
    border-radius: 12px;
    animation: heroYearsShimmer 5s ease-in-out infinite;
    animation-delay: 1.5s;
    pointer-events: none;
}

.hero-years:hover {
    border-color: rgba(69, 168, 90, 0.50);
    box-shadow:
        0 6px 32px rgba(0, 18, 10, 0.50),
        0 0 28px rgba(69, 168, 90, 0.22),
        0 0 0 1px rgba(69, 168, 90, 0.30);
}

@keyframes heroYearsGlow {
    from {
        box-shadow:
            0 4px 20px rgba(0, 18, 10, 0.35),
            0 0  8px rgba(69, 168, 90, 0.08),
            0 0  0 1px rgba(69, 168, 90, 0.14);
    }
    to {
        box-shadow:
            0 6px 30px rgba(0, 18, 10, 0.50),
            0 0 22px rgba(69, 168, 90, 0.22),
            0 0  0 1px rgba(69, 168, 90, 0.32);
    }
}

@keyframes heroYearsShimmer {
    0%        { left: -110%; opacity: 0; }
    8%        { opacity: 1; }
    55%       { left: 120%;  opacity: 1; }
    56%, 100% { left: 120%;  opacity: 0; }
}

.hero-years__number {
    font-size: 2.1rem;
    font-weight: 800;
    color: #45A85A;
    line-height: 1;
    letter-spacing: -0.04em;
    flex-shrink: 0;
}

.hero-years__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    border-left: 1px solid rgba(69, 168, 90, 0.22);
}

.hero-years__line1 {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    line-height: 1;
}

.hero-years__line2 {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.50);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1;
}

/* ============================================================
   TÍTULO — Presupuesto + Participativo
   ============================================================ */
.hero-section__title {
    font-size: clamp(2.6rem, 5.5vw, 4.4rem);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: var(--space-5);
    animation: heroEnter 0.75s cubic-bezier(0.16,1,0.3,1) both 0.28s;
    /* Profundidad sutil — separar del fondo */
    text-shadow:
        0 2px 32px rgba(0, 20, 12, 0.4),
        0 1px  4px rgba(0,  0,  0, 0.15);
}

/* "Participativo" — verde esmeralda, mismo peso */
.hero-section__title-accent {
    display: block;
    color: #45A85A;
    /* Glow suave verde para reforzar contraste */
    text-shadow:
        0 0 40px rgba(69, 168, 90, 0.30),
        0 2px 32px rgba(0, 20, 12, 0.35);
}

/* ============================================================
   SUBTÍTULO
   ============================================================ */
.hero-section__subtitle {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.78;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: var(--space-10);   /* 2.5rem — era --space-9 (inexistente → 0) */
    max-width: 100%;
    animation: heroEnter 0.75s cubic-bezier(0.16,1,0.3,1) both 0.42s;
}

/* ============================================================
   BOTONES — CTA
   ============================================================ */
.hero-section__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    animation: heroEnter 0.75s cubic-bezier(0.16,1,0.3,1) both 0.56s;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    transition:
        background-color 0.22s ease,
        border-color     0.22s ease,
        color            0.22s ease,
        transform        0.22s ease,
        box-shadow       0.22s ease;
}

.hero-btn:hover  { transform: translateY(-2px); }
.hero-btn:active { transform: translateY(0);    }

/* Primario: verde esmeralda → más brillante en hover */
.hero-btn--primary {
    background: #45A85A;
    border-color: #45A85A;
    color: #ffffff;
    box-shadow:
        0  4px 20px rgba(69, 168, 90, 0.38),
        0  1px  4px rgba(0,   0,  0, 0.12);
}
.hero-btn--primary:hover {
    background: #50bc66;
    border-color: #50bc66;
    box-shadow:
        0  8px 32px rgba(69, 168, 90, 0.55),
        0  2px  6px rgba(0,   0,  0, 0.12);
}

/* Secundario: outline magenta → hover = magenta sólido + texto blanco */
.hero-btn--outline {
    background: transparent;
    border-color: #E23A7B;
    color: #f0a0c0;
    box-shadow: 0 0 0 0 rgba(226, 58, 123, 0);
    transition:
        background-color 0.22s ease,
        border-color     0.22s ease,
        color            0.22s ease,
        transform        0.22s ease,
        box-shadow       0.22s ease;
}
.hero-btn--outline:hover {
    background: #E23A7B;
    border-color: #E23A7B;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(226, 58, 123, 0.40);
}

/* ============================================================
   BARRA DE MÉTRICAS — glassmorphism oscuro en la base
   ============================================================ */
.hero-section__metrics {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: rgba(0, 12, 6, 0.72);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    animation: heroEnter 0.8s cubic-bezier(0.16,1,0.3,1) both 0.70s;
}

.metrics-row {
    display: flex;
    align-items: center;
    height: 86px;
}

.metrics-row__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: var(--space-4) var(--space-6);
    transition: background-color 0.2s ease;
}

.metrics-row__item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.metrics-row__value {
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.03em;
}

.metrics-row__label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 500;
    white-space: nowrap;
}

.metrics-row__sep {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.09);
    flex-shrink: 0;
}

.metrics-row__item--cta {
    flex: 0.85;
}

.metrics-row__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #45A85A;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: gap 0.2s ease, color 0.2s ease;
}
.metrics-row__cta-link:hover {
    color: #7dce8e;
    gap: 10px;
}

/* ============================================================
   ANIMACIONES DE ENTRADA
   ============================================================ */
@keyframes heroEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   BLOB ROSADO — círculo suave magenta, lado derecho
   Referencia: acento visual que da vida sin invadir
   ============================================================ */
.hero-section__blob {
    position: absolute;
    z-index: 2;           /* encima del overlay, parte de la atmósfera */
    pointer-events: none;

    /* Posición: derecha, centrado verticalmente */
    right:  -120px;
    top:    50%;
    transform: translateY(-50%);

    width:  560px;
    height: 560px;
    border-radius: 50%;

    /* Gradiente radial magenta → transparente */
    background: radial-gradient(
        circle at center,
        rgba(233, 78, 137, 0.20)  0%,
        rgba(233, 78, 137, 0.10) 35%,
        rgba(233, 78, 137, 0.03) 60%,
        transparent              80%
    );

    /* Blur para suavidad máxima — no es un círculo duro */
    filter: blur(32px);
}

/* ============================================================
   ONDAS DECORATIVAS — entre contenido y barra de métricas
   Inspiradas en el estilo orgánico de la referencia
   ============================================================ */
.hero-section__waves {
    position: absolute;
    bottom: 86px;         /* justo sobre la barra de métricas */
    left:   0;
    right:  0;
    height: 130px;
    z-index: 3;           /* sobre el overlay y blob, bajo el contenido */
    pointer-events: none;

    /* Animación muy sutil: las ondas "respiran" */
    animation: waveDrift 12s ease-in-out alternate infinite;
}

.hero-section__waves svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Onda magenta: anima en dirección opuesta — movimiento orgánico entre capas */
.hero-section__waves svg path:last-child {
    transform-origin: right center;
    animation: waveDriftMagenta 14s ease-in-out alternate infinite;
}

@keyframes waveDrift {
    from { transform: translateX(0); }
    to   { transform: translateX(-18px); }
}

@keyframes waveDriftMagenta {
    from { transform: translateX(0); }
    to   { transform: translateX(22px); }
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-section__bg-img,
    .hero-badge__dot,
    .hero-section__waves,
    .hero-section__waves svg path:last-child,
    .hero-years,
    .hero-years::after { animation: none; }

    .hero-section__badge,
    .hero-section__aside,
    .hero-section__title,
    .hero-years,
    .hero-section__subtitle,
    .hero-section__cta,
    .hero-section__metrics {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .hero-section__content { max-width: 510px; }

    /* Reducir intensidad del streak en tablet */
    .hero-section__streak { opacity: 0.6; }
}

@media (max-width: 768px) {
    /* En mobile, overlay cubre todo para legibilidad */
    .hero-section__overlay {
        background:
            linear-gradient(to bottom, rgba(0,20,10,0.65) 0%, transparent 20%),
            linear-gradient(180deg, rgba(0,56,36,0.94) 0%, rgba(0,40,24,0.82) 100%);
    }

    /* Ocultar streak en mobile: no aporta en pantalla pequeña */
    .hero-section__streak { display: none; }

    .hero-section__bg::before {
        /* Reducir glow magenta en mobile */
        opacity: 0.5;
    }

    .hero-section__body {
        padding-top:    calc(var(--nav-height, 72px) + 28px);
        align-items: flex-start;
    }

    .hero-section__content {
        max-width: 100%;
        padding-right: 0;
        border-right: none;
    }

    /* En mobile: ocultar el aside flotante — ocupa demasiado espacio */
    .hero-section__aside {
        display: none;
    }

    .hero-years__number { font-size: 1.8rem; }

    .hero-section__cta  { flex-direction: column; }
    .hero-btn           { width: 100%; justify-content: center; }

    .metrics-row {
        height: auto;
        overflow-x: auto;
        scrollbar-width: none;
        padding-block: var(--space-4);
    }
    .metrics-row::-webkit-scrollbar { display: none; }

    .metrics-row__item    { flex-shrink: 0; min-width: 110px; padding: var(--space-3) var(--space-4); }
    .metrics-row__item--cta { display: none; }
}

@media (max-width: 480px) {
    .hero-section__title { font-size: 2.3rem; }
    .hero-years          { gap: 10px; padding: 8px 14px 8px 10px; }
    .hero-years__number  { font-size: 1.6rem; }
}

/* ============================================================
   SCROLL CTA — Un único llamado a la acción tipo scroll-down
   Reemplaza los múltiples botones. Ancla al primer bloque.
   ============================================================ */
.hero-scroll-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.25s ease, transform 0.25s ease;
}

.hero-scroll-cta:hover {
    color: #45A85A;
    transform: translateY(4px);
}

.hero-scroll-cta__text {
    display: block;
}

.hero-scroll-cta__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: scrollBounce 2.2s ease-in-out infinite;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.hero-scroll-cta:hover .hero-scroll-cta__arrow {
    border-color: rgba(69, 168, 90, 0.55);
    background: rgba(69, 168, 90, 0.12);
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-cta__arrow { animation: none; }
}

@media (max-width: 768px) {
    .hero-scroll-cta {
        align-self: flex-start;
    }
}
