/**
 * Shortcode [gas_comite_membres]
 * Design : grille de cartes portrait avec overlay texte
 * Dépend de gas-design-tokens.css
 *
 * NOTE : spécificité doublée (.gas-comite .gas-comite__xxx)
 * pour contrer les overrides du thème sur img/a.
 */

/* =============================================
   CONTAINER — grille responsive auto-fill
   ============================================= */

.gas-comite {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gas-space-xl);
    max-width: 1100px;
    margin: 0 auto;
    list-style: none;
    padding: 0;
}

/* =============================================
   CARD
   ============================================= */

.gas-comite .gas-comite__card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--gas-radius-m);
    overflow: hidden;
    height: 400px;
    background-color: hsl(0 0% 85%);
}

/* =============================================
   IMAGE — fond portrait
   ============================================= */

.gas-comite .gas-comite__photo {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gas-comite .gas-comite__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Imagify : <picture> wrapper */
.gas-comite .gas-comite__photo picture {
    position: absolute;
    inset: 0;
}

.gas-comite .gas-comite__photo picture img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =============================================
   LABEL ROLE — badge orange en haut
   ============================================= */

.gas-comite .gas-comite__roles {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gas-space-xs);
    margin: var(--gas-space-l) var(--gas-space-l) 0 var(--gas-space-l);
}

.gas-comite .gas-comite__role-label {
    padding: var(--gas-space-xs) var(--gas-space-m);
    background-color: hsla(var(--gas-accent-h), var(--gas-accent-s), var(--gas-accent-l), 0.75);
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--gas-text-xs);
    font-weight: var(--gas-weight-semibold);
    line-height: 1.3;
    border-radius: var(--gas-radius-s);
    max-width: 70%;
}

/* =============================================
   CONTENT — nom + description en bas
   ============================================= */

.gas-comite .gas-comite__content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: var(--gas-space-l);
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 60%,
        transparent 100%
    );
}

.gas-comite .gas-comite__name {
    margin: 0 0 var(--gas-space-xs) 0;
    font-size: var(--gas-text-m);
    font-weight: var(--gas-weight-bold);
    color: var(--gas-white);
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.gas-comite .gas-comite__role-detail {
    margin: 0;
    font-size: var(--gas-text-xs);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
}

/* =============================================
   PLACEHOLDER — pas de photo
   ============================================= */

.gas-comite .gas-comite__card--no-photo {
    background: linear-gradient(
        135deg,
        hsl(var(--gas-primary-h) var(--gas-primary-s) calc(var(--gas-primary-l) + 15%)),
        var(--gas-primary)
    );
}

/* =============================================
   LIENS CLIQUABLES — photo + nom
   ============================================= */

.gas-comite .gas-comite__photo-link {
    display: block;
    position: absolute;
    inset: 0;
}

.gas-comite .gas-comite__photo-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gas-comite .gas-comite__card:hover .gas-comite__photo-link img {
    transform: scale(1.03);
}

.gas-comite .gas-comite__name-link {
    color: inherit;
    text-decoration: none;
}

.gas-comite .gas-comite__name-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =============================================
   INTRO — lien historique au-dessus du comite
   ============================================= */

.gas-comite__intro {
    max-width: 1100px;
    margin: 0 auto var(--gas-space-xl) auto;
    text-align: center;
}

.gas-comite__intro-text {
    margin: 0 0 var(--gas-space-s) 0;
    font-size: var(--gas-text-s);
    color: var(--gas-text-color-light);
    line-height: 1.5;
}

.gas-comite__intro-link {
    font-size: var(--gas-text-s);
    font-weight: var(--gas-weight-semibold);
    color: var(--gas-primary);
    text-decoration: none;
}

.gas-comite__intro-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =============================================
   INSIDE PAGE /comite/ — pas de double max-width
   La grille prend toute la largeur du parent
   qui a deja son propre max-width: 1100px.
   ============================================= */

.gas-comite-history .gas-comite {
    max-width: none;
}

/* =============================================
   COMMISSION SECTIONS — titres entre les grilles
   ============================================= */

.gas-comite__commission-section {
    margin-top: var(--gas-space-2xl);
}

.gas-comite__commission-section:first-child {
    margin-top: 0;
}

.gas-comite .gas-comite__commission-title,
.gas-comite__commission-title {
    font-size: var(--gas-text-xl);
    font-weight: var(--gas-weight-bold);
    color: var(--gas-text-color);
    margin: 0 0 var(--gas-space-l) 0;
    padding-bottom: var(--gas-space-s);
    border-bottom: 2px solid var(--gas-primary);
}

.gas-comite__commission-description {
    font-size: var(--gas-text-s);
    color: var(--gas-text-color-light);
    margin: 0 0 var(--gas-space-l) 0;
    line-height: 1.5;
}

/* =============================================
   COMPACT — 5 colonnes, cartes plus petites
   compact="1" sur [gas_comite_membres]
   ============================================= */

.gas-comite.gas-comite--compact {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--gas-space-m);
}

.gas-comite--compact .gas-comite__card {
    height: 280px;
}

.gas-comite--compact .gas-comite__roles {
    margin: var(--gas-space-s) var(--gas-space-s) 0 var(--gas-space-s);
}

.gas-comite--compact .gas-comite__role-label {
    font-size: 11px;
    padding: 2px var(--gas-space-s);
}

.gas-comite--compact .gas-comite__content {
    padding: var(--gas-space-s) var(--gas-space-m);
}

.gas-comite--compact .gas-comite__name {
    font-size: var(--gas-text-s);
}

.gas-comite--compact .gas-comite__role-detail {
    font-size: 11px;
}

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

@media (max-width: 640px) {
    .gas-comite {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--gas-space-m);
    }

    .gas-comite .gas-comite__card {
        height: 280px;
        border-radius: var(--gas-radius-s);
    }

    .gas-comite .gas-comite__roles {
        margin: var(--gas-space-m) var(--gas-space-m) 0 var(--gas-space-m);
    }

    .gas-comite .gas-comite__role-label {
        font-size: 11px;
        padding: var(--gas-space-xs) var(--gas-space-s);
    }

    .gas-comite .gas-comite__content {
        padding: var(--gas-space-m);
    }

    .gas-comite .gas-comite__name {
        font-size: var(--gas-text-s);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .gas-comite .gas-comite__card {
        height: 360px;
    }

    /* Compact sur tablette : 3 colonnes */
    .gas-comite.gas-comite--compact {
        grid-template-columns: repeat(3, 1fr);
    }
}
