/* =========================================================
   CONCOURS DU BETTERAVIER DE L'ANNÉE
   ========================================================= */

.bf-portrait-contest {
    --portrait-red: #E3013A;
    --portrait-text: #171b20;
    --portrait-muted: #5f6770;
    --portrait-border: #dfe4e8;
    --portrait-bg: #f5f8fa;
    --portrait-white: #ffffff;
    --portrait-shell: 1360px;

    background: var(--portrait-bg);
    color: var(--portrait-text);
}

.portrait-contest {
    width: 100%;
    overflow: hidden;
}

.portrait-shell {
    width: min(calc(100% - 48px), var(--portrait-shell));
    margin-inline: auto;
}


/* =========================================================
   HERO
   ========================================================= */

.portrait-hero {
    position: relative;
    min-height: 365px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #eef5f8;
}

.portrait-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.portrait-hero__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
    object-position: center;
}

/*
 * Gradient volontairement fort à gauche pour conserver
 * une excellente lisibilité du texte sur l'image.
 */
.portrait-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    /*background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(255, 255, 255, 0.95) 27%,
            rgba(255, 255, 255, 0.78) 47%,
            rgba(255, 255, 255, 0.20) 72%,
            rgba(255, 255, 255, 0.03) 100%
        );*/
        background: linear-gradient(90deg, rgb(197 230 252) 0%, rgb(190 227 252) 27%, rgb(194 228 249 / 87%) 47%, rgb(195 228 251 / 14%) 72%, rgb(195 229 252 / 3%) 100%);
}

.portrait-hero__inner {
    position: relative;
    z-index: 2;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 50px;
    align-items: center;

    padding-top: 45px;
    padding-bottom: 45px;
}

.portrait-hero__copy {
    max-width: 790px;
}

.portrait-hero__kicker {
    margin: 0 0 8px;

    color: var(--portrait-red);

    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portrait-hero__title {
    margin: 0;
    color: #101418;
    /*font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 4.3vw, 68px);*/
    font-size: clamp(42px, 4.8vw, 68px);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.portrait-hero__intro {
    max-width: 720px;
    margin: 20px 0 0;

    color: #252b31;

    font-size: 18px;
    line-height: 1.45;
}

.portrait-hero__notice {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin: 22px 0 0;
    padding: 0;

    color: #303840;

    font-size: 15px;
    line-height: 1.4;
}

.portrait-hero__notice-icon {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
}

.portrait-hero__event-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.portrait-hero__event-logo img {
    display: block;

    width: auto;
    max-width: 260px;
    max-height: 190px;

    object-fit: contain;
}


/* =========================================================
   CANDIDATS
   ========================================================= */

.portrait-candidates {
    padding: 34px 0 48px;
        background:linear-gradient(90deg, rgb(197 230 252) 0%, rgb(190 227 252) 27%, rgb(194 228 249 / 87%) 47%, rgb(195 228 251 / 64%) 72%, rgb(195 229 252 / 21%) 100%)
         /*linear-gradient(90deg, rgb(197 230 252) 0%, rgb(190 227 252) 27%, rgb(194 228 249 / 87%) 47%, rgb(195 228 251 / 14%) 72%, rgb(195 229 252 / 13%) 100%);*/
}

.portrait-section-title {
    margin: 0 0 24px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    line-height: 1.15;
    color: #161a1e;
}

/*
 * L'ordre des éléments est modifié par portrait-contest.js.
 */
.portrait-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.portrait-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--portrait-white);
    border: 1px solid var(--portrait-border);
    border-radius: 7px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 7px 20px rgba(15, 23, 42, 0.035);
}

.portrait-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9/*4/3*/;
    background: #e7ebee;
}
.portrait-card__region {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 2;
    padding: 7px;
    color: #fff;
    background: rgb(41 126 137 / 85%);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
.portrait-card__region{
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.portrait-card__icon {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portrait-card__icon svg {
    display: block;
}
.portrait-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .portrait-card:hover .portrait-card__media img {
        transform: scale(1.025);
    }
}

.portrait-card__content {
    flex: 1;

    display: flex;
    flex-direction: column;

    padding: 10px 14px 12px;
}

.portrait-card__name {
    color: #000;
    font-family: inherit;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.3;
    margin: 5px 0px;
    text-transform: uppercase;
}

.portrait-card__description {
    flex: 1;
    margin: 7px 0 14px;
    color: #343b42;
    font-size: 14px;
    line-height: 1.3;
}

.portrait-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;

    margin-top: auto;
}

.portrait-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.portrait-button:hover,
.portrait-button:focus {
    text-decoration: none;
}

.portrait-button:active {
    transform: translateY(1px);
}

.portrait-button--read {
    /*color: #222a31;
    background: #ffffff;
    border: 1px solid #aeb8c1;*/
    color: #22828a;
    background: #ffffff;
    border: 1px solid #22828a;
}

.portrait-button--read:hover,
.portrait-button--read:focus-visible {
    color: #111418;
    background: #f1f4f6;
    border-color: #6f7b85;
}

.portrait-button--vote {
    color: #ffffff;
    background: var(--portrait-red);
    border: 1px solid var(--portrait-red);
}

.portrait-button--vote:hover,
.portrait-button--vote:focus-visible {
    color: #ffffff;
    background: #e3013A;
    border-color: #e3013A;
}

.portrait-button:focus-visible {
    outline: 3px solid rgba(227, 6, 19, 0.24);
    outline-offset: 2px;
}
.portrait-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.portrait-button__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portrait-button__icon svg {
    display: block;
}
.portrait-empty {
    margin: 0;
    padding: 35px;

    background: #ffffff;
    border: 1px solid var(--portrait-border);
    border-radius: 6px;

    text-align: center;
}


/* =========================================================
   PARTENAIRES
   ========================================================= */

.portrait-partners {
    padding: 34px 0 46px;

    background: #ffffff;
    border-top: 1px solid #e3e7ea;
}

.portrait-partners__title {
    display: flex;
    align-items: center;
    gap: 24px;

    margin: 0 0 30px;

    color: #181c20;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    line-height: 1.2;
    text-align: center;
}

.portrait-partners__title::before,
.portrait-partners__title::after {
    content: "";

    flex: 1;

    height: 1px;
    background: #aeb6bd;
}

.portrait-partners__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 30px;

    align-items: center;
}

.portrait-partner {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 80px;
}

.portrait-partner a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.portrait-partner img {
    display: block;

    width: auto;
    max-width: 100%;
    max-height: 70px;

    object-fit: contain;

    transition: opacity 0.2s ease;
}

.portrait-partner a:hover img {
    opacity: 0.78;
}


/* =========================================================
   TABLETTE
   ========================================================= */

@media (max-width: 1100px) {

    .portrait-shell {
        width: min(calc(100% - 36px), var(--portrait-shell));
    }

    .portrait-hero__inner {
        grid-template-columns: minmax(0, 1fr) 210px;
        gap: 25px;
    }

    .portrait-hero__event-logo img {
        max-width: 200px;
        max-height: 150px;
    }

    .portrait-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portrait-partners__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width: 700px) {
  .portrait-button {
        gap: 4px;
    }
    .portrait-button__icon svg {
        width: 13px;
        height: 13px;
    }
    .portrait-shell {
        width: calc(100% - 24px);
    }

    /* ---------- Hero ---------- */
 .portrait-card__region {
        top: 0px;
        left: 0px;
        padding: 4px 7px;
        font-size: 9px;
    }
    .portrait-hero {
        min-height: 0;
        align-items: stretch;
    }

    .portrait-hero__media img {
        object-position: center bottom;
    }

    .portrait-hero__overlay {
        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, 0.98) 0%,
                rgba(255, 255, 255, 0.93) 53%,
                rgba(255, 255, 255, 0.60) 75%,
                rgba(255, 255, 255, 0.20) 100%
            );
    }

    .portrait-hero__inner {
        min-height: 430px;

        display: flex;
        flex-direction: column;
        align-items: flex-start;

        gap: 12px;

        padding-top: 26px;
        padding-bottom: 32px;
    }

    .portrait-hero__event-logo {
        order: -1;

        width: 100%;

        justify-content: center;

        margin-bottom: 4px;
    }

    .portrait-hero__event-logo img {
        max-width: 135px;
        max-height: 100px;
    }

    .portrait-hero__copy {
        max-width: 100%;
    }

    .portrait-hero__kicker {
        margin-bottom: 5px;

        font-size: 13px;
        letter-spacing: 0.07em;
    }

    .portrait-hero__title {
        max-width: 330px;

        font-size: clamp(37px, 11vw, 50px);
        line-height: 0.98;
    }

    .portrait-hero__intro {
        max-width: 340px;

        margin-top: 14px;

        font-size: 15px;
        line-height: 1.38;
    }

    .portrait-hero__notice {
        max-width: 340px;

        margin-top: 15px;

        font-size: 12px;
        line-height: 1.35;
    }

    .portrait-hero__notice-icon {
        font-size: 16px;
    }


    /* ---------- Candidats ---------- */

    .portrait-candidates {
        padding: 20px 0 32px;
    }

    .portrait-section-title {
        margin-bottom: 15px;

        font-size: 27px;
    }

    /*
     * Important : on conserve 2 colonnes sur mobile.
     */
    .portrait-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .portrait-card {
        border-radius: 6px;
    }

    .portrait-card__media {
        aspect-ratio: 4 / 3;
    }

    .portrait-card__content {
        padding: 8px;
    }

    .portrait-card__name {
        font-size: 17px;
        line-height: 1.05;
    }

    /*
     * Sur mobile on limite la description à 2 lignes pour que
     * les 24 candidats restent faciles à parcourir.
     */
    .portrait-card__description {
        display: -webkit-box;
        overflow: hidden;

        min-height: 32px;
        margin: 5px 0 9px;

        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;

        font-size: 12px;
        line-height: 1.3;
    }

    .portrait-card__actions {
        gap: 6px;
    }

    .portrait-button {
        min-width: 0;
        min-height: 35px;

        padding: 6px 4px;

        font-size: 10.5px;
        line-height: 1.05;

        white-space: nowrap;
    }


    /* ---------- Partenaires ---------- */

    .portrait-partners {
        padding: 27px 0 34px;
    }

    .portrait-partners__title {
        gap: 12px;

        margin-bottom: 22px;

        font-size: 20px;
    }

    .portrait-partners__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 24px;
    }

    .portrait-partner {
        min-height: 60px;
    }

    .portrait-partner img {
        max-height: 55px;
    }
}


/* =========================================================
   TRÈS PETITS ÉCRANS
   ========================================================= */

@media (max-width: 390px) {

    .portrait-shell {
        width: calc(100% - 18px);
    }

    .portrait-grid {
        gap: 8px;
    }

    .portrait-card__content {
        padding: 7px;
    }

    .portrait-card__name {
        font-size: 16px;
    }

    .portrait-card__description {
        font-size: 11.5px;
    }

    .portrait-button {
        font-size: 9.5px;
    }
}


/* =========================================================
   ACCESSIBILITÉ / MOUVEMENTS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .portrait-card__media img,
    .portrait-button,
    .portrait-partner img {
        transition: none;
    }
}

/* =========================================================
   FILTRE
   ========================================================= */

.portrait-candidates__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.portrait-candidates__header .portrait-section-title {
    margin: 0;
}

.portrait-filters {
    flex: 0 0 auto;
}

/*
 * Checkbox technique de l’accordéon mobile.
 * Elle reste accessible au navigateur mais invisible visuellement.
 */
.portrait-filters__state {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Le bouton/label n’est visible que sur mobile. */
.portrait-filters__toggle {
    display: none;
}

/* Desktop : filtres toujours visibles, en haut à droite. */
.portrait-filters__panel {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.portrait-filter-field {
    min-width: 190px;
}

.portrait-filter-field--search {
    min-width: 230px;
}

.portrait-filter-field label {
    display: block;
    margin: 0 0 5px;
    color: #3f464d;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.portrait-filter-field select,
.portrait-filter-field input {
    width: 100%;
    height: 40px;
    padding: 7px 11px;
    color: #252b30;
    background: #fff;
    border: 1px solid #cbd2d8;
    border-radius: 5px;
    font: inherit;
    font-size: 13px;
}

.portrait-filter-field select:focus-visible,
.portrait-filter-field input:focus-visible {
    outline: 3px solid rgba(227, 1, 58, 0.16);
    outline-offset: 1px;
    border-color: var(--portrait-red);
}

.portrait-filter-search {
    position: relative;
}

.portrait-filter-search__icon {
    position: absolute;
    top: 50%;
    left: 11px;
    display: flex;
    color: #69727a;
    transform: translateY(-50%);
    pointer-events: none;
}

.portrait-filter-search input {
    padding-left: 35px;
}

.portrait-filter-count {
    min-width: 76px;
    margin: 0 0 10px;
    color: var(--portrait-muted);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.portrait-filter-count strong {
    color: var(--portrait-red);
    font-size: 16px;
}

.portrait-filter-empty {
    margin: 18px 0 0;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--portrait-border);
    border-radius: 7px;
    text-align: center;
}

/* =========================================================
   FILTRE — MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .portrait-candidates__header {
        display: block;
        margin-bottom: 14px;
    }

    .portrait-candidates__header .portrait-section-title {
        margin-bottom: 14px;
    }

    .portrait-filters {
        width: 100%;
        background: #fff;
        border: 1px solid var(--portrait-border);
        border-radius: 6px;
        overflow: hidden;
    }

    /*
     * Le label pilote directement la checkbox.
     * Aucun JS n’est nécessaire pour ouvrir/fermer l’accordéon.
     */
    .portrait-filters__toggle {
        width: 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        color: #171b20;
        background: #fff;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
        user-select: none;
    }

    .portrait-filters__toggle:focus-visible {
        outline: 3px solid rgba(227, 1, 58, 0.18);
        outline-offset: -3px;
    }

    .portrait-filters__chevron {
        flex: 0 0 auto;
        display: flex;
        transition: transform 0.2s ease;
    }

    /* Fermé par défaut. */
    .portrait-filters__panel {
        display: none;
        padding: 14px;
        border-top: 1px solid #e5e8eb;
    }

    /* Ouverture 100 % CSS. */
    .portrait-filters__state:checked
    ~ .portrait-filters__panel {
        display: block;
    }

    .portrait-filters__state:checked
    + .portrait-filters__toggle
    .portrait-filters__chevron {
        transform: rotate(180deg);
    }

    .portrait-filter-field,
    .portrait-filter-field--search {
        width: 100%;
        min-width: 0;
    }

    .portrait-filter-field + .portrait-filter-field {
        margin-top: 14px;
    }

    .portrait-filter-count {
        margin: 16px 0 0;
        padding-top: 13px;
        border-top: 1px solid #e5e8eb;
    }
}
