/*
 * Hero de la vue projet (single du CPT "client") : 110vh, image de mise
 * en avant en fond. Les 100 premiers vh portent le nom, les tags et
 * l'accroche ; les ~10vh restants affichent la barre méta (client,
 * domaine, collaboration).
 */

.project-hero {
    position: relative;
    min-height: 110vh;
    display: flex;
    flex-direction: column;
    background-color: #0D0D0D;
    background-size: cover;
    background-position: center;
    color: #f5f5f5;
}

.project-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.25) 69%, rgba(0, 0, 0, 0.9) 88%, rgba(0, 0, 0, 1) 100%);
    pointer-events: none;
}

.project-hero__content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 99vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: end;
    gap: var(--chirripo-space-sm, 0.75rem);
    padding: 0 10%;
    text-align: left;
}

/* Forme/typographie communes : .hero-title (tokens.css). */
.project-hero__title {
    --hero-title-max: 72px;
    --hero-title-vw: 8vw;
}

/*
 * Petit titre (ACF "petit_titre_vue_projet"), en tête du H1 : taille en
 * "em" pour rester proportionnel au clamp() de .hero-title plutôt qu'une
 * taille fixe (même principe que .client-card__tagline).
 */
.project-hero__title-small {
    display: block;
    letter-spacing: -3%;
    line-height: 1.2;
    font-family: var(--chirripo-font-body, sans-serif);
    font-size: 32px;
    font-weight: 400;
    color: var(--chirripo-color-text, #f5f5f5);
}

/* Gros titre (ACF "gros_titre_vue_projet") : reste la taille de .hero-title. */
.project-hero__title-big {
    display: block;
}

.project-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin: 0.3em 0 0;
    padding: 0 0 3%;
    list-style: none;
}

.project-hero__tags li {
    padding: 0.5em 1em;
    border: 1px solid #f5f5f590;
    border-radius: 25px;
    color: #f5f5f590;
    font-family: var(--chirripo-font-body, sans-serif);
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease;
}

/* Traitement hover commun à tous les tags du site : .client-card__tag (client-card.css). */
.project-hero__tags li:hover {
    background: rgba(217, 217, 217, 0.3);
    backdrop-filter: blur(6px);
}

.project-hero__meta {
    position: relative;
    z-index: 1;
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--chirripo-space-lg, 3rem);
    padding: var(--chirripo-space-md, 1.5rem) 0;
    border-top: 1px solid #fff;
}

.project-hero__meta-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--chirripo-space-xl, 6rem);
}

.project-hero__meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25em;
}

.project-hero__meta-label {
    font-family: var(--chirripo-font-body, sans-serif);
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0.08em;
    color: rgba(245, 245, 245, 0.6);
}

.project-hero__meta-value {
    font-family: var(--chirripo-font-body, sans-serif);
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
}

/* .has-bg-light (voir tokens.css) fournit les variables de couleur claires
   consommées par tous les "Blocs des projets" ci-dessous. */
.project-content {
    background: var(--chirripo-color-bg, #f5f5f5);
    padding: var(--chirripo-space-lg, 3rem) 0;
}

@media (max-width: 768px) {
    .project-hero {
        max-height: fit-content;
        background-size: 300%;
        background-position: top;
        background-repeat: no-repeat;
    }

    .project-hero__content {
        min-height: 98vh;
    }

    /*
     * Assombrit davantage derrière le texte (plus tôt, plus opaque) qu'en
     * desktop — pas un box-shadow sur .project-hero__content : sa boîte
     * couvre presque toute la hauteur du hero (min-height:99vh) alors que
     * le texte, lui, est aligné en bas (justify-content:end) ; un décalage
     * négatif fait donc apparaître l'ombre loin au-dessus du texte, pas
     * derrière lui. Le scrim existant, un calque en overlay indépendant du
     * texte, n'a pas ce problème.
     */
    .project-hero__scrim {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0.95) 85%, rgba(0, 0, 0, 1) 100%);
    }

    .project-hero__meta-group {
        gap: 40px;
        width: 90%;
    }

    .project-hero__meta {
        gap: 20px;
    }

    /*
     * Une seule ligne défilable horizontalement, comme .hero-filter/
     * .client-card__tags/.clients-list__tags. width:100% nécessaire :
     * .project-hero__content est en align-items:flex-start (pas stretch),
     * donc sans largeur explicite .project-hero__tags s'élargirait pour
     * épouser son contenu non wrappé au lieu d'être borné à la largeur du
     * conteneur (même piège que .clients-list__info, cf. mémoire).
     */
    .project-hero__tags {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 25px;
    }

    .project-hero__tags::-webkit-scrollbar {
        display: none;
    }

    .project-hero__tags li {
        flex: none;
        white-space: nowrap;
        font-size: 12px;
    }

    .project-content {
        padding: 0;
    }
}

/*
 * "Découvrez plus de projets" — commun à toutes les vues projet (voir
 * single-projet.php, chirripo_get_related_projects()), pas un bloc
 * Gutenberg. Réutilise .client-card (client-card.css) pour les vignettes
 * et .section-header__label/__title (tokens.css) pour le sur-titre/titre,
 * comme partout ailleurs sur le site plutôt que des styles dédiés.
 */
.project-related {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0 var(--chirripo-space-md, 1.5rem);
    background: var(--chirripo-color-bg, #0D0D0D);
    color: var(--chirripo-color-text, #f5f5f5);
    text-align: center;
}

.project-related__inner {
    max-width: 85%;
    width: 100%;
    margin: 0 auto;
}

.project-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* align-items:stretch (par défaut) étirait chaque .client-card à la
       hauteur de la piste — qui, via .client-card__link { height:100% },
       se résout AU DÉTRIMENT du contenu réel de la card (image + overlay
       texte/tags, empilés en flux normal sur mobile) : la card se
       retrouvait coupée à la hauteur de l'image seule, .client-card étant
       en overflow:hidden. align-items:start laisse chaque card garder sa
       hauteur naturelle (image + texte). */
    align-items: start;
    gap: var(--chirripo-space-lg, 3rem);
    margin: var(--chirripo-space-lg, 3rem) 0;
    text-align: left;
}

/* Forme/couleur communes : .btn-pill (tokens.css). */
.project-related__cta {
    margin: 0 auto;
    width: fit-content;
}

@media (max-width: 768px) {
    .project-related {
        min-height: auto;
        padding: var(--chirripo-space-lg, 3rem) var(--chirripo-space-md, 1.5rem);
    }

    .project-related__grid {
        grid-template-columns: 1fr;
    }
}