/* ============================================================
   JHMA THEME — hero.css
   Desktop : overlay plein écran
   Mobile  : photo entière en haut + texte empilé en bas
   ============================================================ */

/* ============================================================
   HERO PRINCIPAL
   ============================================================ */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: var(--neutral);
}

/* Image MOBILE — cachée sur desktop */
.hero__photo-mobile {
    display: none;
    width: 100%;
    height: auto;          /* Proportions naturelles — aucun crop */
    flex-shrink: 0;
}

/* Fond DESKTOP — image à 100% largeur, hauteur proportionnelle */
.hero__bg {
    position: absolute;
    inset: 0;
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Overlay desktop — gradient fort en bas pour lisibilité du texte */
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.05) 0%,
        rgba(0,0,0,0.15) 35%,
        rgba(0,0,0,0.70) 65%,
        rgba(0,0,0,0.92) 100%
    );
    z-index: 1;
}

/* Ampersand décoratif */
.hero__ampersand {
    position: absolute;
    bottom: -0.1em;
    right: -0.05em;
    font-family: var(--condensed);
    font-weight: 800;
    font-size: clamp(8rem, 20vw, 20rem);
    line-height: 1;
    color: var(--primary);
    opacity: 0.04;
    user-select: none;
    pointer-events: none;
    z-index: 1;
}

/* Wrapper contenu — desktop: overlay centré */
.hero__content-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* ============================================================
   CONTENU HERO — desktop centré
   ============================================================ */

.hero__content {
    padding: 8rem 0 5rem;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Badge cyan solide — desktop normal */
.hero__tag {
    display: inline-flex;
    align-items: center;
    background: var(--primary);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    margin-bottom: 1.25rem;
    line-height: 1;
    white-space: nowrap;
}
.hero__tag::before { display: none; }

/* ============================================================
   TITRE HERO — structure en 4 spans
   .hero__t1  = "Human Resources"
   .hero__t-amp = "&"
   .hero__t2  = "Management"
   .hero__t3  = "Association"
   ============================================================ */

.hero__title {
    font-family: var(--condensed);
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: min(820px, 92vw);
}

/* Lignes de texte desktop */
.hero__t1,
.hero__t23 {
    display: block;
    color: var(--white);
    line-height: 1.05;
    letter-spacing: 0.01em;
    font-size: clamp(2rem, 4.5vw, 3.75rem);
}

/* Desktop: t2 et t3 inline dans t23 */
.hero__t2,
.hero__t3 {
    display: inline;
    color: var(--white);
    font-size: inherit;
}

/* & desktop — médium, cyan */
.hero__t-amp {
    display: block;
    color: var(--primary);
    font-size: clamp(1.8rem, 4vw, 3.4rem);
    line-height: 1;
}

/* Lead centré */
.hero__lead {
    font-size: clamp(0.88rem, 1.6vw, 1.05rem);
    font-weight: 500;
    line-height: 1.7;
    color: rgba(255,255,255,0.88);
    max-width: min(540px, 90vw);
    margin-bottom: 2.25rem;
    text-align: center;
}

/* CTA group centré */
.hero__ctas {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================================
   STATS BAR
   ============================================================ */

.stats-bar {
    background: var(--black);
    width: 100%;
    position: relative;
    z-index: 3;
}

.stats-bar-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* 4 stats grid columns */
.stats-bar-inner:has(.stat:nth-child(4):last-child) {
    grid-template-columns: repeat(4, 1fr);
}

/* 5 stats grid columns */
.stats-bar-inner:has(.stat:nth-child(5):last-child) {
    grid-template-columns: repeat(5, 1fr);
}

/* 6 stats grid columns */
.stats-bar-inner:has(.stat:nth-child(6):last-child) {
    grid-template-columns: repeat(6, 1fr);
}

/* ── Cellule commune ── */
.stat {
    padding: 28px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
}
.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* ── Cellules impaires (stat-odd) — fond noir ── */
.stat.stat-odd {
    background: var(--black);
}
.stat.stat-odd .stat-num {
    font-family: var(--condensed), 'Fira Sans Condensed', sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--cyan);
    line-height: 1;
}
.stat.stat-odd .stat-label {
    font-family: var(--sans), 'Fira Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Cellules paires (stat-even) — fond cyan ── */
.stat.stat-even {
    background: var(--cyan);
}
.stat.stat-even .stat-num {
    font-family: var(--condensed), 'Fira Sans Condensed', sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--black);
    line-height: 1;
}
.stat.stat-even .stat-label {
    font-family: var(--sans), 'Fira Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(var(--black-rgb), 0.65);
}

/* ============================================================
   HERO INTÉRIEUR (pages internes)
   ============================================================ */

.interior-hero {
    background: var(--neutral);
    padding: 14rem 0 4rem; /* Augmenté pour aérer sous la navigation */
    position: relative;
    overflow: hidden;
}
.interior-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--cyan-rgb),0.1) 0%, transparent 60%);
}
.interior-hero .wrap { position: relative; z-index: 1; }
.interior-hero__label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.75rem;
}
.interior-hero__title {
    font-family: var(--condensed);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    color: var(--white);
    margin-bottom: 0.75rem;
    word-break: break-word;
}
.interior-hero__lead {
    font-size: 1rem;
    color: rgba(255,255,255,0.65);
    max-width: 560px;
    line-height: 1.6;
}

/* ============================================================
   RESPONSIVE DESKTOP > 820px — contenu en bas du hero
   ============================================================ */

@media (min-width: 821px) {
    /* Pousse le bloc texte vers le bas — libère les visages */
    .hero {
        justify-content: flex-end;
    }
    .hero__content {
        padding: 8rem 0 3rem; /* Pousse le texte vers le bas pour ne pas chevaucher la nav */
    }

    /* Titre agrandi — espace en bas du hero desktop */
    .hero__title {
        position: relative;
        max-width: min(1100px, 92vw);
        margin-bottom: 1rem;
        overflow: visible;           /* Pas de clip : le & s'inscrit naturellement */
    }

    /* Lignes de texte : au-dessus du & — z-index 1 */
    .hero__t1,
    .hero__t23 {
        position: relative;
        z-index: 1;
        font-size: clamp(3rem, 5.5vw, 5rem);
        line-height: 1.05;
    }

    /* & ABSOLU — derrière les lignes, 80% opacité
       font-size calibré pour remplir exactement les 2 lignes sans être coupé :
       2 lignes × 5rem × 1.05 = 10.5rem de hauteur
       cap-height du caractère ≈ 0.72em → font-size = 10.5 / 0.72 ≈ 14.5rem */
    .hero__t-amp {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(8rem, 8.5vw, 14rem); /* Calibré : remplit sans déborder */
        color: var(--primary);
        opacity: 0.80;
        z-index: 0;
        line-height: 1;
        margin: 0;
        pointer-events: none;
        user-select: none;
    }

    /* Badge — élargi à la largeur de "HUMAN RESOURCES", texte noir */
    .hero__tag {
        color: var(--neutral);           /* Texte noir sur fond cyan */
        min-width: clamp(280px, 33vw, 600px); /* ≈ largeur de HUMAN RESOURCES */
        justify-content: center;
        padding: 0.5rem 2rem;
        font-size: 0.85rem;
        letter-spacing: 0.18em;
    }
}

/* ============================================================
   RESPONSIVE DESKTOP ≤ 1024px
   ============================================================ */

@media (max-width: 1024px) {
    .hero__content { padding: 7rem 0 4rem; }
    .hero__t1, .hero__t2, .hero__t3 { font-size: clamp(2rem, 4vw, 3.2rem); }
}

/* ============================================================
   MOBILE ≤ 820px — layout empilé : photo entière + zone texte
   ============================================================ */

@media (max-width: 820px) {

    /* Hero colonne : photo en haut */
    .hero {
        min-height: auto;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* Photo entière visible — proportions naturelles */
    .hero__photo-mobile {
        display: block;
        width: 100%;
        height: auto;
        flex-shrink: 0;
    }

    /* Cacher le fond desktop */
    .hero__bg { display: none; }
    .hero__overlay { display: none; }
    .hero__ampersand { display: none; }

    /* Zone texte : fond sombre sous la photo */
    .hero__content-wrap {
        position: relative;
        background: var(--neutral);
        width: 100%;
        padding-top: 1.8rem; /* Espace pour le badge absolu */
        z-index: 5;
    }

    /* Badge — positionné à CHEVAL sur la frontière photo/texte */
    .hero__tag {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translate(-50%, -50%); /* Centre exact sur la frontière */
        z-index: 10;
        margin-bottom: 0;
        font-size: 0.78rem;
        padding: 0.38rem 0.9rem;
        white-space: nowrap;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    /* Contenu : padding top pour laisser espace au badge absolu */
    .hero__content {
        padding: 0.8rem 1.25rem 2rem;  /* Réduit : titre monté près du bandeau */
        text-align: center;
        align-items: center;
    }

    /* ——— TITRE MOBILE ——— */
    .hero__title {
        position: relative;
        max-width: 100%;
        gap: 0;
        margin-bottom: 0.5rem;
        overflow: visible;  /* Pas de clip : le & s'inscrit naturellement */
    }

    /* Ligne 1 : "HUMAN RESOURCES" — au-dessus du & */
    .hero__t1 {
        position: relative;
        z-index: 1;
        font-size: clamp(1.55rem, 8.5vw, 2.8rem);
        letter-spacing: 0.02em;
        line-height: 1.1;
    }

    /* GRAND & — ARRIÈRE-PLAN absolu, 80% opacité
       Calcul : 2 lignes × 8.5vw × 1.1 = 18.7vw de hauteur totale
       cap-height ≈ 0.72em → font-size = 18.7 / 0.72 = 26vw
       Mais on réduit à 20vw pour que le glyph ne soit pas coupé */
    .hero__t-amp {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(4rem, 20vw, 8rem); /* Remplit sans déborder */
        color: var(--primary);
        opacity: 0.80;
        z-index: 0;
        line-height: 1;
        pointer-events: none;
        user-select: none;
    }

    /* Wrapper ligne 2+3 — au-dessus du & */
    .hero__t23 {
        position: relative;
        z-index: 1;
        display: block;
        text-align: center;
        /* Taille réduite pour tenir "MANAGEMENT ASSOCIATION" sur une ligne */
        font-size: clamp(1.05rem, 6.2vw, 2.4rem);
        letter-spacing: 0.02em;
        line-height: 1.1;
        white-space: nowrap;
    }

    /* t2 et t3 inline dans le wrapper */
    .hero__t2,
    .hero__t3 {
        display: inline;
        color: var(--white);
        font-size: inherit;
        letter-spacing: inherit;
    }

    /* Lead centré — réduit margin-bottom */
    .hero__lead {
        font-size: 0.93rem;
        max-width: 88vw;
        text-align: center;
        color: rgba(255,255,255,0.80);
        margin-bottom: 1.25rem;      /* Réduit */
    }

    /* Boutons centrés, empilés, taille proportionnelle */
    .hero__ctas {
        flex-direction: column;
        align-items: center;         /* Centre les boutons */
        width: 100%;
        gap: 0.65rem;
    }

    /* Surcharge style.css width:100% — boutons auto-centrés */
    .hero__ctas .btn-gold,
    .hero__ctas .btn-ghost {
        width: 100% !important;
        justify-content: center;
        text-align: center;
        /* Taille texte/padding proportionnels */
        font-size: clamp(0.82rem, 2.8vw, 0.95rem);
        padding: clamp(0.55rem, 1.8vw, 0.7rem) clamp(1rem, 4vw, 1.6rem);
    }
}

/* ---- Tablet & Mobile Checkerboard pattern for 2-column layouts ---- */
@media (max-width: 900px) {
    .stats-bar-inner {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Overrule standard odd/even classes with checkerboard flow: 1 & 4 is Dark, 2 & 3 is Cyan, etc. */
    .stat:nth-child(4n+1),
    .stat:nth-child(4n) {
        background: var(--black) !important;
    }
    .stat:nth-child(4n+1) .stat-num,
    .stat:nth-child(4n) .stat-num {
        color: var(--cyan) !important;
    }
    .stat:nth-child(4n+1) .stat-label,
    .stat:nth-child(4n) .stat-label {
        color: rgba(255, 255, 255, 0.5) !important;
    }

    .stat:nth-child(4n+2),
    .stat:nth-child(4n+3) {
        background: var(--cyan) !important;
    }
    .stat:nth-child(4n+2) .stat-num,
    .stat:nth-child(4n+3) .stat-num {
        color: var(--black) !important;
    }
    .stat:nth-child(4n+2) .stat-label,
    .stat:nth-child(4n+3) .stat-label {
        color: rgba(var(--black-rgb), 0.65) !important;
    }
}

/* ---- Petit mobile ≤ 480px ---- */
@media (max-width: 480px) {
    .hero__t1,
    .hero__t2,
    .hero__t3 {
        font-size: clamp(1.4rem, 8vw, 2.2rem);
    }
    .hero__t-amp {
        font-size: clamp(4rem, 20vw, 6rem);
    }
    .stat {
        padding: 20px 16px !important;
        gap: 6px !important;
    }
    .stat .stat-num {
        font-size: 2.2rem !important;
    }
    .stat .stat-label {
        font-size: 14px !important;
        letter-spacing: .08em !important;
    }
    .interior-hero__title { font-size: clamp(1.8rem, 8vw, 2.5rem); }
}
