/* Confort de navigation : réglages communs aux six pages. */
html[data-yc-affichage="gris"] {
    filter: grayscale(1);
}

/* Contraste renforcé : conserver les illustrations et les repères des activités. */
html[data-yc-affichage="contraste"] {
    filter: grayscale(1) contrast(1.6);
}
html[data-yc-affichage="contraste"] body,
html[data-yc-affichage="contraste"] body > header,
html[data-yc-affichage="contraste"] dialog,
html[data-yc-affichage="contraste"] .site-footer {
    background: #000 !important;
    color: #fff !important;
}
html[data-yc-affichage="contraste"] :is(a, button, summary, input, select, textarea):focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #000 !important;
}
html[data-yc-affichage="contraste"] main a:not([class]) {
    text-decoration: underline;
}

#yc-confort-bouton {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #71cce8;
    border-radius: 10px;
    background: #06284f;
    color: #fff;
    padding: 6px;
}
#yc-confort-bouton svg { width: 24px; height: 24px; }
#yc-confort-dialog {
    width: min(440px, 92vw);
    max-height: 85dvh;
    overflow: auto;
    background: #06284f;
    color: #fff;
    border: 1px solid #71cce8;
    padding: 24px;
}
#yc-confort-dialog h2 { margin: 0 0 16px; font-size: 23px; }
#yc-confort-dialog fieldset { border: 0; padding: 0; margin: 0; }
#yc-confort-dialog legend { color: #71cce8; font-weight: bold; margin-bottom: 12px; }
#yc-confort-dialog label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #71cce8;
    border-radius: 10px;
    cursor: pointer;
}
#yc-confort-dialog label:has(input:checked) { border-width: 2px; padding: 11px; }
#yc-confort-dialog input { accent-color: #dfff45; width: 18px; height: 18px; }
#yc-confort-dialog button {
    background: #155470;
    color: #fff;
    border: 1px solid #71cce8;
    border-radius: 8px;
    padding: 10px 14px;
}
#yc-confort-fermer { float: right; margin-left: 8px; }
#yc-confort-dialog p { line-height: 1.5; font-size: 14px; }
@media (max-width: 767px) {
    /* Bandeau compact sur une seule ligne. */
    body > header { gap: 5px; flex-wrap: nowrap; padding: 8px 10px; }
    body > header .brand { flex: 1 1 auto; gap: 5px; min-width: 0; }
    body > header .brand .brand-symbol { width: 32px; height: 32px; }
    body > header .brand .brand-wordmark { width: 100px; max-width: 100%; min-width: 0; }
    body > header #np-counter { margin-left: 0; min-height: 44px; padding: 4px; gap: 3px; font-size: 14px; }
    body > header #np-counter img { width: 22px; height: 22px; }
    body > header #np-challenge { min-width: 44px; padding: 4px; }
    body > header #menu { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; }
    #yc-confort-bouton { width: 44px; height: 44px; }
    body > header > nav { align-items: flex-start; gap: 0; padding: 8px 16px 12px; }
    body > header > nav > a:not(.contact) { display: flex; align-items: center; min-height: 44px; width: 100%; border-bottom: 1px solid #31536b; }
    body > header > nav > .contact { align-self: flex-start; margin-top: 8px; }
}
@media (max-width: 350px) {
    body > header { gap: 3px; padding-inline: 6px; }
    body > header .brand { gap: 3px; }
    body > header .brand .brand-symbol { width: 26px; height: 26px; }
    body > header #np-counter img { width: 18px; height: 18px; }
}

#yc-confort-bouton[hidden] { display: none; }

/* Le réglage reste à droite du bandeau, après le menu. */
#yc-confort-bouton { margin-left: 0; }

/* Sur mobile, le logotype suffit : libérer de la place pour les commandes. */
@media (max-width: 767px) {
    body > header .brand .brand-symbol { display: none; }
    body > header .brand .brand-wordmark { width: 98px; }
}

/* Dialogues modaux dans la couche superieure du navigateur. */
html[data-yc-affichage="gris"] dialog:modal { filter: grayscale(1); }
html[data-yc-affichage="gris"] dialog:modal::backdrop { filter: grayscale(1); }
