/* ==========================================================================
   NOS SÉLECTIONS — rubriques PMB, page parente, /recommandations/
   (6 nov. 2026) — page-nos-selections.php, templates/selections-page.php
   Chargée après les feuilles des listes (grille .b612-listing-grid,
   titre .b612-selection__title en Formiga 900).
   ========================================================================== */

.b612-sel {
    --b612-sel-primary: var(--b612-next-color-primary, #28367f);
    --b612-sel-text: #25283a;
    --b612-sel-muted: #646d7f;
    --b612-sel-line: #e6e2d8;

    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 64px;

    color: var(--b612-sel-text);
    font-family: var(--b612-next-font-body, "Filson Pro", sans-serif);
}


/* ----------------------------------------------------------
   Fil d'Ariane et en-tête
   ---------------------------------------------------------- */

.b612-sel__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 22px;

    color: var(--b612-sel-muted);
    font-size: .85rem;
}

.b612-sel__breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.b612-sel__breadcrumb a:hover {
    color: var(--b612-sel-primary);
    text-decoration: underline;
}

.b612-sel__header {
    margin-bottom: 26px;
}

.b612-sel__header .b612-selection__title {
    margin: 6px 0 0;
}

.b612-sel__intro {
    max-width: 760px;
    margin-top: 16px;

    color: #44516b;
    font-size: 1.02rem;
    line-height: 1.65;
}

.b612-sel__intro p {
    margin: 0 0 .8em;
}


/* ----------------------------------------------------------
   Navigation entre rubriques
   ---------------------------------------------------------- */

.b612-sel__rubriques {
    margin: 0 0 22px;
}

.b612-sel__rubriques ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.b612-sel__rubriques a {
    display: inline-block;

    padding: 9px 16px;

    border: 1px solid var(--b612-sel-line);
    border-radius: 999px;

    background: #ffffff;
    color: var(--b612-sel-text);

    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.b612-sel__rubriques a:hover {
    border-color: var(--b612-sel-primary);
    color: var(--b612-sel-primary);
}

.b612-sel__rubriques a.is-current {
    border-color: var(--b612-sel-primary);
    background: var(--b612-sel-primary);
    color: #ffffff;
}


/* ----------------------------------------------------------
   Filtres cumulables (puces)
   ---------------------------------------------------------- */

.b612-sel__filters fieldset {
    margin: 0 0 30px;
    padding: 18px 20px;

    border: 0;
    border-radius: 16px;

    background: #ffffff;
    box-shadow: 0 5px 18px rgba(18, 31, 58, .06);
}

.b612-sel__filters legend {
    float: left;               /* légende dans le cadre */
    width: 100%;

    margin-bottom: 12px;
    padding: 0;

    color: #626c80;

    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.b612-sel__chips {
    clear: both;

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.b612-sel__chip {
    position: relative;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 14px;

    border: 1px solid var(--b612-sel-line);
    border-radius: 999px;

    background: #faf9f6;
    color: var(--b612-sel-text);

    font-size: .88rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;

    cursor: pointer;

    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.b612-sel__chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.b612-sel__chip small {
    padding: 2px 7px;

    border-radius: 999px;

    background: rgba(40, 54, 127, .08);
    color: var(--b612-sel-primary);

    font-size: .72rem;
    font-weight: 600;
}

.b612-sel__chip:hover {
    border-color: var(--b612-sel-primary);
}

.b612-sel__chip.is-active {
    border-color: var(--b612-sel-primary);
    background: var(--b612-sel-primary);
    color: #ffffff;
}

.b612-sel__chip.is-active small {
    background: rgba(255, 255, 255, .2);
    color: #ffffff;
}

/* Coche visible quand la sélection est choisie */
.b612-sel__chip.is-active::before {
    content: "";

    width: 5px;
    height: 9px;
    margin: -3px 2px 0 0;

    border-right: 2px solid #ffd500;
    border-bottom: 2px solid #ffd500;

    transform: rotate(45deg);
}

.b612-sel__chip:focus-within {
    outline: 2px solid var(--b612-sel-primary);
    outline-offset: 2px;
}

.b612-sel__apply {
    margin-top: 14px;
    padding: 10px 18px;

    border: 0;
    border-radius: 8px;

    background: var(--b612-sel-primary);
    color: #ffffff;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}

.b612-sel__apply[hidden] {
    display: none;
}


/* ----------------------------------------------------------
   Aperçu par sélection
   ---------------------------------------------------------- */

.b612-sel__blocks {
    display: grid;
    gap: 22px;
}

.b612-sel__block {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;

    padding: 22px;

    border-radius: 18px;

    background: #ffffff;
    box-shadow: 0 6px 22px rgba(18, 31, 58, .06);
}

.b612-sel__block--no-image {
    grid-template-columns: minmax(0, 1fr);
}

.b612-sel__block-image {
    display: block;
    overflow: hidden;

    align-self: start;

    border-radius: 12px;

    background: #f1efe8;
}

/* Image entière (bandeaux larges des sélections PMB : pas de rognage) */
.b612-sel__block-image img {
    display: block;

    width: 100%;
    height: auto;

    transition: transform .3s ease;
}

.b612-sel__block-image:hover img {
    transform: scale(1.03);
}

.b612-sel__block-title {
    margin: 0;

    color: #18233f;

    font-family: var(--b612-next-font-heading, "Formiga", serif);
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.15;
}

.b612-sel__block-title a {
    color: inherit;
    text-decoration: none;
}

.b612-sel__block-title a:hover {
    color: var(--b612-sel-primary);
}

.b612-sel__block-text {
    margin: 10px 0 0;

    color: #44516b;

    font-size: .95rem;
    line-height: 1.6;
}

/* Rangée de 6 documents */
.b612-sel__mini {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;

    margin: 18px 0 0;
    padding: 0;

    list-style: none;
}

.b612-sel__mini a {
    display: flex;
    flex-direction: column;
    gap: 6px;

    color: inherit;
    text-decoration: none;
}

.b612-sel__mini-cover {
    display: block;
    overflow: hidden;

    border-radius: 7px;

    background: #e9ecf2;
    box-shadow: 0 4px 12px rgba(18, 31, 58, .10);

    aspect-ratio: 2 / 3;

    transition: transform .2s ease, box-shadow .2s ease;
}

.b612-sel__mini-cover img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.b612-sel__mini a:hover .b612-sel__mini-cover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(18, 31, 58, .16);
}

.b612-sel__mini-title {
    display: -webkit-box;
    overflow: hidden;

    color: #18233f;

    font-size: .78rem;
    font-weight: 600;
    line-height: 1.3;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.b612-sel__mini-author {
    overflow: hidden;

    color: var(--b612-sel-muted);

    font-size: .7rem;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.b612-sel__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 16px;

    color: var(--b612-sel-primary);

    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.b612-sel__more:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ----------------------------------------------------------
   Une seule sélection choisie : image + texte complet
   ---------------------------------------------------------- */

.b612-sel__focus {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px;
    align-items: start;

    margin-bottom: 26px;
    padding: 22px;

    border-radius: 18px;

    background: #ffffff;
    box-shadow: 0 6px 22px rgba(18, 31, 58, .06);
}

.b612-sel__focus-image {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 12px;
}

.b612-sel__focus:not(:has(img)) {
    grid-template-columns: minmax(0, 1fr);
}


/* ----------------------------------------------------------
   Grille (réutilise .b612-listing-grid des listes)
   ---------------------------------------------------------- */

.b612-sel__grid {
    margin: 0;
    /* Calée sur le bandeau des filtres (10 nov. 2026) */
    padding-inline: 0;
}

.b612-sel__empty {
    padding: 24px;

    border-radius: 14px;

    background: #ffffff;
    color: var(--b612-sel-muted);
}


/* ----------------------------------------------------------
   Rubrique précédente / suivante
   ---------------------------------------------------------- */

.b612-sel__pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;

    margin-top: 40px;
    padding-top: 24px;

    border-top: 1px solid var(--b612-sel-line);
}

.b612-sel__pager a {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    color: #18233f;

    font-weight: 600;
    text-decoration: none;
}

.b612-sel__pager a > span:not([aria-hidden]) {
    display: flex;
    flex-direction: column;
}

.b612-sel__pager-next {
    margin-left: auto;
    text-align: right;
}

.b612-sel__pager small {
    color: var(--b612-sel-muted);

    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.b612-sel__pager a:hover {
    color: var(--b612-sel-primary);
}


/* ----------------------------------------------------------
   Page parente : cartes des rubriques
   ---------------------------------------------------------- */

.b612-sel__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.b612-sel__card {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    height: 100%;

    border-radius: 18px;

    background: #ffffff;
    color: inherit;
    box-shadow: 0 6px 22px rgba(18, 31, 58, .06);

    text-decoration: none;

    transition: transform .2s ease, box-shadow .2s ease;
}

.b612-sel__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(18, 31, 58, .12);
}

.b612-sel__card-image {
    display: block;

    background: #28367f;

    aspect-ratio: 16 / 9;
}

.b612-sel__card-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.b612-sel__card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;

    padding: 16px 18px 18px;
}

.b612-sel__card-body strong {
    color: #18233f;

    font-family: var(--b612-next-font-heading, "Formiga", serif);
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.15;
}

.b612-sel__card-body small {
    color: var(--b612-sel-muted);

    font-size: .82rem;
    line-height: 1.4;
}

.b612-sel__card-body em {
    color: var(--b612-sel-primary);

    font-size: .8rem;
    font-style: normal;
    font-weight: 600;
}


/* ==========================================================================
   TABLETTE
   ========================================================================== */

@media (max-width: 1040px) {

    .b612-sel__block {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 22px;
    }

    .b612-sel__mini {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .b612-sel__mini li:nth-child(n + 5) {
        display: none;
    }
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 767px) {

    .b612-sel {
        width: calc(100% - 32px);
        padding-top: 22px;
    }

    /* Rubriques : une ligne qui défile */
    .b612-sel__rubriques {
        margin-right: -16px;
        margin-left: -16px;
    }

    .b612-sel__rubriques ul {
        flex-wrap: nowrap;
        overflow-x: auto;

        padding: 2px 16px 6px;

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .b612-sel__rubriques ul::-webkit-scrollbar {
        display: none;
    }

    .b612-sel__filters fieldset {
        padding: 14px;
    }

    .b612-sel__chip {
        padding: 7px 12px;
        font-size: .84rem;
    }

    .b612-sel__block,
    .b612-sel__focus {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;

        padding: 16px;
    }


    .b612-sel__block-title {
        font-size: 1.3rem;
    }

    /* Documents : 3 par ligne, 6 au total */
    .b612-sel__mini {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .b612-sel__mini li:nth-child(n + 5) {
        display: block;
    }

    /* Rubrique précédente / suivante : deux cartes de même taille,
       côte à côte et en miroir (avant : empilées et décalées) */
    .b612-sel__pager {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        align-items: stretch;

        margin-top: 32px;
        padding-top: 20px;
    }

    .b612-sel__pager a {
        gap: 10px;

        min-width: 0;
        height: 100%;
        padding: 12px 14px;

        box-sizing: border-box;

        border: 1px solid var(--b612-sel-line);
        border-radius: 12px;

        background: #ffffff;

        font-size: .9rem;
        line-height: 1.25;
    }

    .b612-sel__pager a > span:not([aria-hidden]) {
        gap: 3px;
        min-width: 0;

        overflow-wrap: anywhere;
    }

    .b612-sel__pager small {
        font-size: .62rem;
    }

    /* « Précédente » / « Suivante » : une seule ligne des deux côtés */
    .b612-sel__pager-word {
        display: none;
    }

    .b612-sel__pager-prev {
        justify-content: flex-start;
    }

    .b612-sel__pager-next {
        grid-column: 2;
        justify-content: flex-end;

        margin-left: 0;
    }
}
