/**
 * Page Header Module - Styles
 *
 * CSS Custom Properties utilisées :
 * --cj-ph-bg-color : Couleur de fond (rgb)
 * --cj-ph-bg-image : Image de fond (url)
 * --cj-ph-min-height : Hauteur minimum
 * --cj-ph-overlay-rgb : Couleur du degradé
 * --cj-ph-overlay-opacity : Opacité du degradé en bas
 * --cj-ph-overlay-stop : Position ou le degradé atteint sa couleur
 * --cj-ph-title-max-width : Largeur maximum du titre en desktop
 */

/* ================================================
   RESET DES CONTENEURS THEMIFY PARENTS
   ================================================ */

/* Supprimer les paddings/margins des conteneurs Themify quand ils contiennent notre module */
.module-pageheader,
.cj-ph-module-wrap {
    padding: 0 !important;
    margin: 0 !important;
}

/* Row parente - classes ajoutées par JS + :has() pour navigateurs modernes */
.cj-ph-row,
.themify_builder_row:has(.module-pageheader),
.module_row:has(.module-pageheader) {
    padding: 0 !important;
    margin: 0 !important;
}

/* Column parente */
.cj-ph-column,
.themify_builder_column:has(.module-pageheader),
.module_column:has(.module-pageheader),
.tb-column:has(.module-pageheader) {
    padding: 0 !important;
}

/* Row inner */
.cj-ph-row-inner,
.row_inner:has(.module-pageheader) {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* ================================================
   CONTAINER PRINCIPAL
   ================================================ */

.cj-page-header {
    position: relative;
    min-height: var(--cj-ph-min-height, 100vh) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 110px 6% 80px !important;
    overflow: hidden;
    background: var(--cj-ph-bg-color, rgb(11, 10, 9));
    color: #f5f2ec;
    box-sizing: border-box;
    width: 100%;
}

.cj-page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgba(var(--cj-ph-overlay-rgb, 11, 10, 9), 0) 0%,
        rgba(var(--cj-ph-overlay-rgb, 11, 10, 9), var(--cj-ph-overlay-opacity, 0.86)) var(--cj-ph-overlay-stop, 100%)
    );
    pointer-events: none;
}

/* Assurer une hauteur minimum même sans contenu */
.cj-page-header__content:empty::before {
    content: "Ajoutez du contenu dans les options du module";
    display: block;
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Layout centré */
.cj-page-header--center {
    align-items: center;
    text-align: center;
    padding: 128px 6% 118px;
}

/* ================================================
   FOND / MEDIA
   ================================================ */

.cj-page-header__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--cj-ph-bg-image) center center / cover no-repeat;
}

/* ================================================
   OVERLAY
   ================================================ */

.cj-page-header__overlay {
    display: none !important;
}

/* Overlay sombre (par défaut) */
.cj-page-header--overlay-dark .cj-page-header__overlay {
    background: none !important;
}

/* Overlay clair */
.cj-page-header--overlay-light .cj-page-header__overlay {
    background: none !important;
}

/* ================================================
   CONTENU
   ================================================ */

.cj-page-header__content {
    position: relative;
    z-index: 3;
    max-width: 1180px;
}

/* Layout centré */
.cj-page-header--center .cj-page-header__content {
    display: grid;
    justify-items: center;
    width: min(85vw, 1500px);
    max-width: none;
}

/* ================================================
   EYEBROW (Sur-titre badge)
   ================================================ */

.cj-page-header__eyebrow {
    display: inline-block;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #0b0a09;
    background: #eb5d0f;
    padding: 7px 13px;
    margin-bottom: 28px;
}

/* ================================================
   TITRE
   ================================================ */

.cj-page-header__title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: min(100%, var(--cj-ph-title-max-width, 1180px));
    margin: 0;
    font-family: "Saira Condensed", sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(42px, 7.2vw, 112px);
    line-height: 0.93;
    letter-spacing: -0.01em;
}

/* Ligne de titre (contient un ou plusieurs spans) */
.cj-page-header__title-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
    row-gap: 10px;
    column-gap: 0;
    line-height: 0.82;
}

/* Spans du titre */
.cj-page-header__title-primary,
.cj-page-header__title-accent {
    display: inline-flex;
    align-items: center;
    min-height: 0.98em;
    line-height: 0.82;
    padding: 0.03em 0.08em 0.11em;
    margin-right: 0.02em;
    box-sizing: border-box;
    white-space: nowrap;
    /* Pour que le surlignage se coupe proprement sur les retours à la ligne automatiques */
}

/* Fond sombre */
.cj-page-header__title-primary {
    background: #0b0a09;
    color: #f5f2ec;
    box-shadow: 0.06em 0 0 #0b0a09, -0.06em 0 0 #0b0a09;
}

/* Fond orange (accent) */
.cj-page-header__title-accent {
    background: #eb5d0f;
    color: #0b0a09;
    box-shadow: 0.06em 0 0 #eb5d0f, -0.06em 0 0 #eb5d0f;
}

.cj-page-header__title-line .cj-page-header__title-word:last-child {
    margin-right: 0;
}

/* Centré */
.cj-page-header--center .cj-page-header__title {
    align-items: center;
    max-width: none;
}

.cj-page-header--center .cj-page-header__title-line {
    justify-content: center;
}

/* ================================================
   INTRODUCTION
   ================================================ */

.cj-page-header__intro {
    display: inline-block;
    max-width: 600px;
    margin: 28px 0 0;
    font-family: "Saira", sans-serif;
    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1.52;
    color: #f3eee5;
    background: rgba(11, 10, 9, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 14px 18px;
}

/* Centré */
.cj-page-header--center .cj-page-header__intro {
    max-width: 80%;
}

/* ================================================
   BOUTONS
   ================================================ */

.cj-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

/* Centré */
.cj-page-header--center .cj-page-header__actions {
    justify-content: center;
    margin-top: 34px;
}

/* Buttons use shared assets/buttons.css. */

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

.cj-page-header__stats {
    position: absolute;
    bottom: 48px;
    left: 6%;
    right: 6%;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    gap: 48px;
}

.cj-page-header__stat-number {
    font-family: "Saira Condensed", sans-serif;
    font-weight: 900;
    font-size: 46px;
    line-height: 1;
    color: #f3efe8;
}

.cj-page-header__stat-suffix {
    color: #eb5d0f;
}

.cj-page-header__stat-label {
    font-family: "Space Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8d877d;
    margin-top: 4px;
}

.cj-page-header__stat-divider {
    width: 1px;
    height: 46px;
    background: rgba(255, 255, 255, 0.14);
}

/* ================================================
   TORN DIVIDERS
   ================================================ */

.cj-page-header__torn-light {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: #f5f2ec;
    clip-path: polygon(0 55%, 100% 18%, 100% 100%, 0 100%);
    z-index: 4;
}

.cj-page-header__torn-orange {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: #eb5d0f;
    clip-path: polygon(0 50%, 100% 10%, 100% 20%, 0 58%);
    z-index: 5;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1024px) {
    .cj-page-header {
        padding: 100px 5% 40px;
    }

    .cj-page-header--center {
        padding: 110px 5% 100px;
    }

    .cj-page-header__stats {
        gap: 28px;
        flex-wrap: wrap;
    }

    .cj-page-header__stat-number {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .cj-page-header {
        min-height: auto;
        padding: 90px 5% 60px;
    }

    .cj-page-header--has-stats {
        padding-bottom: 140px;
    }

    .cj-page-header__title {
        font-size: clamp(52px, 14vw, 76px);
        gap: 7px;
        max-width: 100%;
    }

    .cj-page-header__intro {
        max-width: 100%;
        font-size: 15px;
    }

    .cj-page-header__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .cj-page-header--center .cj-page-header__actions {
        align-items: center;
    }

    .cj-page-header__stats {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin-top: 40px;
        gap: 20px;
    }

    .cj-page-header__stat-divider {
        height: 32px;
    }

    .cj-page-header__torn-light,
    .cj-page-header__torn-orange {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .cj-page-header {
        padding: 80px 4% 50px;
    }

    .cj-page-header__title {
        font-size: clamp(48px, 15vw, 64px);
        gap: 6px;
    }

    .cj-page-header__eyebrow {
        font-size: 10px;
        padding: 5px 10px;
    }

    .cj-page-header__button {
        width: fit-content;
        max-width: 100%;
    }

    .cj-page-header__button span:first-child {
        flex: 0 1 auto;
        justify-content: flex-start;
    }
}
