/*
 * Bandeau d'avertissement du site (20/11/2026) : resources/views/partials/site-notice.blade.php.
 * Chargé par le partiel lui-même, sur toutes les pages (gabarits du site, de l'élève, du back-office, de la
 * connexion, pages autonomes) : il ne dépend d'aucun thème ni d'aucun jeton, et ses sélecteurs à deux classes
 * (0,2,0) battent les règles globales du thème et du bloc typographique généré (.btn, button : capitales,
 * interlettrage ; a : couleur du thème). Aucun !important.
 *
 * Contrastes mesurés (WCAG 2.1) :
 *   texte #1F2430 sur jaune #FFD84D ............ 11,2:1 (AA et AAA)
 *   bouton : libellé #FFFFFF sur #1F2430 ....... 15,5:1 ; bouton #1F2430 sur le jaune : 11,2:1 (≥ 3:1)
 *   croix #1F2430 sur jaune .................... 11,2:1 ; anneau de focus #1F2430 : 11,2:1
 *   liseré du haut #B88A00 sur blanc ........... 3,15:1 (sépare le bandeau d'une page blanche)
 */
.site-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* Sous les fenêtres Bootstrap (voile 1050, fenêtre 1055) et les toasts, au-dessus du contenu et de la
       barre latérale du back-office (ramenée à 1030 par admin-extra.css). */
    z-index: 1035;
    background: #FFD84D;
    color: #1F2430;
    border-top: 2px solid #B88A00;
    box-shadow: 0 -4px 16px rgba(31, 36, 48, .18);
    font-family: "Nunito Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.site-notice[hidden],
.site-notice .site-notice__inner [hidden] { display: none; }

.site-notice .site-notice__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 12px 10px 20px;
}

.site-notice .site-notice__icon { flex: 0 0 auto; }

.site-notice .site-notice__text {
    flex: 1 1 320px;
    min-width: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1F2430;
    text-transform: none;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.site-notice .site-notice__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 8px;
    background: #1F2430;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    transition: background-color .2s ease-out;
}

.site-notice .site-notice__cta:hover,
.site-notice .site-notice__cta:focus { background: #000000; color: #FFFFFF; text-decoration: underline; }

.site-notice .site-notice__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1F2430;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
}

.site-notice .site-notice__close:hover { background: rgba(31, 36, 48, .12); }

.site-notice .site-notice__cta:focus-visible,
.site-notice .site-notice__close:focus-visible {
    outline: 3px solid #1F2430;
    outline-offset: 2px;
}

/* Au doigt : 44 px. */
@media (pointer: coarse) {
    .site-notice .site-notice__cta { min-height: 44px; }
    .site-notice .site-notice__close { width: 44px; height: 44px; }
}

/* Téléphone : la phrase sur toute la largeur, le bouton et la croix dessous. */
@media (max-width: 575.98px) {
    .site-notice .site-notice__inner { padding: 8px 8px 8px 14px; gap: 6px 10px; }
    .site-notice .site-notice__icon { display: none; }
    .site-notice .site-notice__text { flex-basis: calc(100% - 54px); font-size: 14px; }
    .site-notice .site-notice__cta { flex: 1 1 auto; font-size: 14px; }
}

/* RTL : la croix passe à gauche. */
.direction-rtl .site-notice .site-notice__inner,
[dir="rtl"] .site-notice .site-notice__inner { padding: 10px 20px 10px 12px; }
.direction-rtl .site-notice .site-notice__close,
[dir="rtl"] .site-notice .site-notice__close { margin: 0 auto 0 0; }

/* Le bandeau ne masque pas le bas de la page : réserve de sa hauteur (ajustée par site-notice.js),
   et le bandeau des témoins, lui aussi fixé en bas, remonte au-dessus. */
body:has(> .site-notice:not([hidden])) { padding-bottom: var(--site-notice-h, 64px); }
body:has(> .site-notice:not([hidden])) .cookie-consent { bottom: calc(var(--site-notice-h, 64px) + 5px); }
/* La barre d'enregistrement collante du back-office (.bo-savebar, admin-extra.css) se pose au-dessus du bandeau. */
body:has(> .site-notice:not([hidden])) .bo-savebar { bottom: var(--site-notice-h, 64px); }

/* Le contenu qui reprend le focus après la croix ne s'entoure pas d'un anneau. */
[data-site-notice-focus]:focus { outline: none; }

/* Aperçu de l'écran de réglage : même dessin, dans le flux. */
.site-notice.site-notice--apercu {
    position: static;
    z-index: auto;
    border-radius: 8px;
    border: 2px solid #B88A00;
    box-shadow: none;
}
.site-notice.site-notice--apercu .site-notice__close { cursor: default; }

@media print {
    .site-notice { display: none; }
    body:has(> .site-notice) { padding-bottom: 0; }
}
