/* ==========================================================
   B612 — PAGE CATALOGUE (/catalogue/)
   S'appuie sur authority.css (en-tête, pastilles, cartes)
   et pagination.css.
========================================================== */

.b612-catalogue .b612-authority__header {

    margin-bottom: 28px;
}


/* ==========================================================
   FORMULAIRE
========================================================== */

.b612-catalogue__form {

    margin: 0 0 22px;

    padding: 24px;

    border: 1px solid var(--b612-authority-line);

    border-radius: 18px;

    background: #ffffff;

    box-shadow: 0 6px 20px rgba(18, 31, 58, .05);
}

.b612-catalogue__fields {

    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 16px 18px;
}

.b612-catalogue__field {

    position: relative;

    display: flex;

    flex-direction: column;

    gap: 6px;

    min-width: 0;
}

.b612-catalogue__field--wide {

    grid-column: span 2;
}

.b612-catalogue__field label,
.b612-catalogue__label {

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

    font-size: 12px;

    font-weight: 600;

    letter-spacing: .06em;

    text-transform: uppercase;
}

.b612-catalogue__field input,
.b612-catalogue__field select {

    width: 100%;

    height: 46px;

    padding: 0 14px;

    box-sizing: border-box;

    border: 1px solid var(--b612-authority-line);

    border-radius: 10px;

    background: #fbfaf7;

    color: var(--b612-authority-ink);

    font-family: inherit;

    font-size: 15px;

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

.b612-catalogue__field input:focus,
.b612-catalogue__field select:focus {

    outline: none;

    border-color: var(--b612-authority-primary);

    background: #ffffff;

    box-shadow: 0 0 0 3px rgb(40 54 127 / 12%);
}

/* Menus déroulants : chevron dessiné, écarté du bord droit */
.b612-catalogue__field select,
.b612-catalogue__field select:focus {

    -webkit-appearance: none;

    appearance: none;

    padding-right: 44px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2325283a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    background-repeat: no-repeat;

    background-position: right 18px center;

    background-size: 12px 8px;

    cursor: pointer;
}

.b612-catalogue__years {

    display: flex;

    align-items: center;

    gap: 8px;
}

.b612-catalogue__years span {

    color: var(--b612-authority-muted);
}


/* Suggestions */

.b612-catalogue__suggestions {

    position: absolute;

    top: 100%;

    left: 0;

    right: 0;

    z-index: 20;

    max-height: 280px;

    margin: 6px 0 0;

    padding: 6px;

    overflow-y: auto;

    list-style: none;

    border: 1px solid var(--b612-authority-line);

    border-radius: 12px;

    background: #ffffff;

    box-shadow: 0 12px 30px rgba(6, 21, 45, .12);
}

.b612-catalogue__suggestions [role="option"] {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 9px 10px;

    border-radius: 8px;

    color: var(--b612-authority-ink);

    font-size: 14px;

    cursor: pointer;
}

.b612-catalogue__suggestions [role="option"]:hover,
.b612-catalogue__suggestions [role="option"].is-active {

    background: #f5f2e9;
}

.b612-catalogue__suggestion-count {

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

    font-size: 12px;
}

.b612-catalogue__suggestion-empty {

    padding: 9px 10px;

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

    font-size: 14px;
}


/* Ligne du bas : disponibilité + boutons */

.b612-catalogue__actions {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    justify-content: space-between;

    gap: 14px;

    margin-top: 20px;

    padding-top: 18px;

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

.b612-catalogue__check {

    display: inline-flex;

    align-items: center;

    gap: 10px;

    color: var(--b612-authority-ink);

    font-size: 15px;

    font-weight: 500;

    cursor: pointer;
}

.b612-catalogue__check input {

    width: 18px;

    height: 18px;

    accent-color: var(--b612-authority-primary);
}

.b612-catalogue__buttons {

    display: flex;

    align-items: center;

    gap: 14px;
}

.b612-catalogue__reset {

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

    font-size: 14px;

    text-decoration: underline;

    text-underline-offset: 3px;
}

.b612-catalogue__reset:hover {

    color: var(--b612-authority-primary);
}

.b612-catalogue__submit {

    height: 46px;

    padding: 0 28px;

    border: 0;

    border-radius: 999px;

    background: var(--b612-authority-primary);

    color: #ffffff;

    font-family: inherit;

    font-size: 15px;

    font-weight: 600;

    cursor: pointer;

    transition: background .2s ease;
}

.b612-catalogue__submit:hover {

    background: #1e2a66;
}

.b612-catalogue__submit:focus-visible,
.b612-catalogue__reset:focus-visible,
.b612-catalogue__active a:focus-visible {

    outline: 2px solid var(--b612-next-color-focus, #28367f);

    outline-offset: 3px;
}


/* Filtres actifs */

.b612-catalogue__active {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin: 0 0 22px;

    padding: 0;

    list-style: none;
}

.b612-catalogue__active a {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 7px 12px;

    border-radius: 999px;

    background: var(--b612-next-color-primary-soft, rgb(40 54 127 / 8%));

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

    font-size: 13px;

    font-weight: 600;

    text-decoration: none;
}

.b612-catalogue__active a span {

    opacity: .6;
}

.b612-catalogue__active a:hover span {

    opacity: 1;
}


/* ==========================================================
   NOTE DES LECTEURS (au-dessus des résultats, « en cascade »)
========================================================== */

.b612-catalogue__ratings {

    display: flex;

    align-items: center;

    gap: 14px;

    margin: 0 0 20px;

    padding: 14px 0;

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

    border-bottom: 1px solid var(--b612-authority-line);
}

.b612-catalogue__ratings-label {

    flex: none;

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

    font-size: 12px;

    font-weight: 600;

    letter-spacing: .06em;

    text-transform: uppercase;
}

.b612-catalogue__ratings ul {

    display: flex;

    gap: 8px;

    min-width: 0;

    margin: 0;

    padding: 0;

    list-style: none;

    overflow-x: auto;

    scrollbar-width: none;
}

.b612-catalogue__ratings ul::-webkit-scrollbar {

    display: none;
}

.b612-catalogue__ratings a {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 8px 14px;

    border: 1px solid var(--b612-authority-line);

    border-radius: 999px;

    background: #ffffff;

    color: var(--b612-authority-ink);

    font-size: 14px;

    font-weight: 600;

    text-decoration: none;

    white-space: nowrap;

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

.b612-catalogue__ratings a:hover {

    border-color: var(--b612-authority-primary);
}

.b612-catalogue__ratings a:focus-visible {

    outline: 2px solid var(--b612-next-color-focus, #28367f);

    outline-offset: 2px;
}

.b612-catalogue__ratings a.is-active {

    border-color: var(--b612-authority-primary);

    background: var(--b612-authority-primary);

    color: #ffffff;
}

.b612-catalogue__stars {

    color: #bc7e0c;

    font-size: 15px;

    letter-spacing: 1px;
}

.b612-catalogue__stars-off {

    /* RGAA 3.3 : étoiles « vides » contrastées à 3:1 sur le fond crème */
    color: #9f8761;
}

.b612-catalogue__ratings a.is-active .b612-catalogue__stars-off {

    color: rgb(255 255 255 / 30%);
}

.b612-catalogue__ratings-count {

    font-weight: 400;

    opacity: .65;
}


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

@media (max-width: 1100px) {

    .b612-catalogue__fields {

        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


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

@media (max-width: 700px) {

    .b612-catalogue__form {

        padding: 18px 16px;
    }

    .b612-catalogue__fields {

        grid-template-columns: 1fr;
    }

    .b612-catalogue__field--wide {

        grid-column: auto;
    }

    .b612-catalogue__actions {

        flex-direction: column;

        align-items: stretch;
    }

    .b612-catalogue__buttons {

        justify-content: space-between;
    }

    .b612-catalogue__submit {

        flex: 1;
    }

    /* Note des lecteurs : intitulé au-dessus, pastilles qui défilent */
    .b612-catalogue__ratings {

        flex-direction: column;

        align-items: stretch;

        gap: 10px;
    }
}


/* ==========================================================
   MOBILE — filtres avancés repliés (bouton « Plus de filtres »)
========================================================== */

.b612-catalogue__more {

    display: none;
}

@media (max-width: 700px) {

    .b612-catalogue__more {

        display: inline-flex;

        align-items: center;

        gap: 8px;

        margin-top: 14px;

        padding: 0;

        border: 0;

        background: none;

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

        font-family: inherit;

        font-size: 15px;

        font-weight: 600;

        cursor: pointer;
    }

    .b612-catalogue__more::after {

        content: "";

        width: 7px;

        height: 7px;

        margin-top: -4px;

        border-right: 2px solid currentColor;

        border-bottom: 2px solid currentColor;

        transform: rotate(45deg);

        transition: transform .2s ease;
    }

    .b612-catalogue__more[aria-expanded="true"]::after {

        margin-top: 4px;

        transform: rotate(-135deg);
    }

    /* Replié : seul le champ Titre reste visible */
    .b612-catalogue__form.is-collapsed .b612-catalogue__field:not(.b612-catalogue__field--wide) {

        display: none;
    }
}
