/* ==========================================================================
   O'Gemme — boutons flottants (cookies, accessibilité) + panneau
   d'accessibilité + effets des réglages.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Boutons ronds flottants
   -------------------------------------------------------------------------- */
.og-fab {
    --fab: 58px;
    position: fixed;
    bottom: 22px;
    z-index: 9990;
    width: var(--fab);
    height: var(--fab);
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #f3e6c8;
    background:
        radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(150deg, #5d5145 0%, #3a332b 100%);
    box-shadow:
        0 0 0 1px rgba(181, 147, 78, .55),
        0 0 0 5px rgba(247, 243, 236, .55),
        0 12px 28px -6px rgba(30, 26, 22, .55);
    cursor: pointer;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1.2), box-shadow .3s ease, color .3s ease;
    -webkit-tap-highlight-color: transparent;
}
.og-fab[hidden] { display: none; }
.og-fab--cookie { left: 22px; }
.og-fab--a11y   { right: 22px; }

.og-fab:hover,
.og-fab:focus-visible,
.og-fab.is-active {
    transform: translateY(-3px) scale(1.04);
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(216, 184, 120, .9),
        0 0 0 6px rgba(181, 147, 78, .28),
        0 18px 34px -8px rgba(30, 26, 22, .6);
}
.og-fab:focus-visible { outline: 3px solid #b5934e; outline-offset: 6px; }
.og-fab:active { transform: scale(.96); }
.og-fab__icon { display: block; transition: transform .45s cubic-bezier(.2, .8, .2, 1.2); }

/* Cookie : pâte dorée, pépites chocolat */
.og-cookie__dough { fill: #d8b878; }
.og-cookie__chip  { fill: #4a3a2a; }
.og-cookie__crumb { fill: #d8b878; opacity: .85; }
.og-fab--cookie:hover .og-fab__icon,
.og-fab--cookie:focus-visible .og-fab__icon { transform: rotate(-18deg) scale(1.06); }

/* Accessibilité : petit balancement au survol */
.og-fab--a11y:hover .og-fab__icon,
.og-fab--a11y:focus-visible .og-fab__icon { transform: scale(1.08); }
.og-fab--a11y.is-active .og-fab__icon { transform: rotate(360deg); }

/* Pastille « réglages actifs » */
.og-fab--a11y::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #b5934e;
    box-shadow: 0 0 0 2px #f7f3ec;
    transform: scale(0);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1.4);
}
.og-fab--a11y.has-prefs::after { transform: scale(1); }

/* Infobulle (souris uniquement) */
@media (hover: hover) {
    .og-fab::before {
        content: attr(data-tip);
        position: absolute;
        bottom: 50%;
        transform: translateY(50%) translateX(var(--tip-x, 0)) scale(.9);
        padding: 7px 12px;
        border-radius: 999px;
        background: #3a332b;
        color: #f7f3ec;
        font: 500 12px/1 "Montserrat", sans-serif;
        letter-spacing: .06em;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease, transform .25s ease;
        box-shadow: 0 6px 18px rgba(30, 26, 22, .25);
    }
    .og-fab--cookie::before { left: calc(100% + 12px); --tip-x: -6px; }
    .og-fab--a11y::before   { right: calc(100% + 12px); --tip-x: 6px; }
    .og-fab:hover::before,
    .og-fab:focus-visible::before { opacity: 1; transform: translateY(50%) translateX(0) scale(1); }
    .og-fab--a11y.is-active::before { opacity: 0; }
}

@media (max-width: 620px) {
    .og-fab { --fab: 50px; bottom: 16px; }
    .og-fab--cookie { left: 14px; }
    .og-fab--a11y   { right: 14px; }
    .og-fab__icon { width: 24px; height: 24px; }
}

/* --------------------------------------------------------------------------
   2. Panneau
   -------------------------------------------------------------------------- */
.og-a11y {
    position: fixed;
    right: 22px;
    bottom: 96px;
    z-index: 9991;
    width: 372px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    display: flex;
    flex-direction: column;
    background: #fbf9f4;
    color: #3a332b;
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(58, 51, 43, .08), 0 30px 70px -12px rgba(30, 26, 22, .45);
    overflow: hidden;
    font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transition: opacity .22s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.og-a11y[hidden] { display: none; }
.og-a11y.is-open { opacity: 1; transform: none; }

.og-a11y__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px 20px 20px;
    color: #f7f3ec;
    background:
        radial-gradient(140% 160% at 100% 0%, rgba(216, 184, 120, .35) 0%, rgba(216, 184, 120, 0) 55%),
        linear-gradient(150deg, #5d5145 0%, #3a332b 100%);
}
.og-a11y__badge {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(247, 243, 236, .12);
    color: #d8b878;
    box-shadow: inset 0 0 0 1px rgba(247, 243, 236, .18);
}
.og-a11y__titles { flex: 1; min-width: 0; }
.og-a11y__title { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: .02em; line-height: 1.2; color: #fff; }
.og-a11y__subtitle { margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: rgba(247, 243, 236, .75); }
.og-a11y__close {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(247, 243, 236, .12);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, transform .3s ease;
}
.og-a11y__close svg { pointer-events: none; }
.og-a11y__close:hover { background: rgba(247, 243, 236, .24); transform: rotate(90deg); }
.og-a11y__close:focus-visible { outline: 2px solid #d8b878; outline-offset: 2px; }

.og-a11y__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 16px 10px;
    scrollbar-width: thin;
}
.og-a11y__group { padding: 14px 0 6px; }
.og-a11y__group + .og-a11y__group { border-top: 1px solid #ece5d9; }
.og-a11y__label {
    margin: 0 4px 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #9a7d3f;
}

/* Taille du texte */
.og-a11y__stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 0 0 1px #ece5d9;
}
.og-a11y__step {
    flex: none;
    width: 50px;
    height: 46px;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 1px;
    padding-top: 10px;
    border: 0;
    border-radius: 12px;
    background: #f3eee5;
    color: #3a332b;
    font: 500 16px/1 "Montserrat", sans-serif;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.og-a11y__step--big { font-size: 22px; padding-top: 7px; }
.og-a11y__step small { font-size: 13px; }
.og-a11y__step:hover:not(:disabled) { background: #b5934e; color: #fff; }
.og-a11y__step:disabled { opacity: .35; cursor: default; }
.og-a11y__step:focus-visible { outline: 2px solid #b5934e; outline-offset: 2px; }
.og-a11y__meter { flex: 1; text-align: center; }
.og-a11y__value { display: block; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.og-a11y__dots { display: inline-flex; gap: 5px; margin-top: 6px; }
.og-a11y__dots i { width: 18px; height: 4px; border-radius: 4px; background: #e4ddd1; transition: background .2s ease; }
.og-a11y__dots i.is-on { background: #b5934e; }

/* Tuiles */
.og-a11y__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.og-a11y__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 96px;
    padding: 14px 14px 13px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 0 0 1px #ece5d9;
    color: #3a332b;
    font: 500 13.5px/1.3 "Montserrat", sans-serif;
    text-align: left;
    cursor: pointer;
    transition: box-shadow .2s ease, background .2s ease, color .2s ease, transform .15s ease;
}
.og-a11y__tile:hover { box-shadow: 0 0 0 1px #d8b878, 0 8px 18px -10px rgba(58, 51, 43, .35); }
.og-a11y__tile:active { transform: scale(.98); }
.og-a11y__tile:focus-visible { outline: 2px solid #b5934e; outline-offset: 2px; }
.og-a11y__tile-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f3eee5;
    color: #6d5d4e;
    transition: background .2s ease, color .2s ease;
}
.og-a11y__tile-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px #d9d0c2;
    transition: background .2s ease, box-shadow .2s ease;
}
.og-a11y__tile[aria-pressed="true"] {
    background: linear-gradient(150deg, #5d5145 0%, #3a332b 100%);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(30, 26, 22, .7);
}
.og-a11y__tile[aria-pressed="true"] .og-a11y__tile-icon { background: rgba(247, 243, 236, .14); color: #d8b878; }
.og-a11y__tile[aria-pressed="true"] .og-a11y__tile-check {
    background: #b5934e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8.5 2.6 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
    box-shadow: none;
}

.og-a11y__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 14px;
    border-top: 1px solid #ece5d9;
    background: #f7f3ec;
}
.og-a11y__reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #3a332b;
    color: #fff;
    font: 500 13px/1 "Montserrat", sans-serif;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background .2s ease;
}
.og-a11y__reset:hover { background: #9a7d3f; }
.og-a11y__reset:focus-visible { outline: 2px solid #b5934e; outline-offset: 2px; }
.og-a11y__statement { font-size: 12.5px; color: #6d5d4e; text-decoration: underline; text-underline-offset: 3px; }
.og-a11y__statement:hover { color: #3a332b; }

@media (max-width: 620px) {
    .og-a11y {
        left: 10px;
        right: 10px;
        bottom: 78px;
        width: auto;
        max-height: calc(100vh - 96px);
        max-height: calc(100dvh - 96px);
        border-radius: 20px;
        transform-origin: bottom center;
    }
    .og-a11y__tile { min-height: 88px; }
}

/* Guide de lecture */
.og-a11y-guide {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9989;
    height: 44px;
    pointer-events: none;
    display: none;
    background: rgba(181, 147, 78, .14);
    border-top: 3px solid #b5934e;
    border-bottom: 3px solid #b5934e;
    box-shadow: 0 0 0 100vmax rgba(20, 17, 14, .38);
}
.og-a11y-guide.is-on { display: block; }

/* --------------------------------------------------------------------------
   3. Effets des réglages (classes posées sur <html>)
   Le panneau et les boutons flottants sont exclus pour rester utilisables.
   -------------------------------------------------------------------------- */

/* Contraste renforcé : fond noir, texte blanc, liens jaunes */
html.a11y-contrast body,
html.a11y-contrast body *:not(.og-a11y):not(.og-a11y *):not(.og-fab):not(.og-fab *):not(svg):not(svg *):not(img):not(.og-a11y-guide) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
html.a11y-contrast body a:not(.og-a11y *),
html.a11y-contrast body a *:not(svg):not(svg *) { color: #ffe14d !important; }
html.a11y-contrast body .btn { border: 2px solid #ffe14d !important; }
html.a11y-contrast .hero__bg::before,
html.a11y-contrast .hero__bg::after { opacity: .25 !important; }

/* Niveaux de gris */
html.a11y-mono body > *:not(.og-a11y):not(.og-fab):not(.og-a11y-guide):not(#tarteaucitronRoot) { filter: grayscale(1) !important; }

/* Masquer les images (le logo reste visible) */
html.a11y-images img:not(.site-brand__logo img):not(.custom-logo),
html.a11y-images picture,
html.a11y-images video,
html.a11y-images iframe { visibility: hidden !important; }
html.a11y-images .hero__bg::before,
html.a11y-images .hero__bg { background-image: none !important; }

/* Stopper les animations */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
}
html.a11y-motion .cursor { display: none !important; }

/* Police dyslexie */
html.a11y-dyslexia body,
html.a11y-dyslexia body *:not(svg):not(svg *) { font-family: "OpenDyslexic", "Comic Sans MS", sans-serif !important; }

/* Espacer le texte (critères WCAG 1.4.12) */
html.a11y-spacing body *:not(.og-a11y *):not(.og-fab *):not(svg):not(svg *) {
    letter-spacing: .12em !important;
    word-spacing: .16em !important;
}
html.a11y-spacing body p,
html.a11y-spacing body li,
html.a11y-spacing body dd,
html.a11y-spacing body blockquote { line-height: 1.9 !important; }
html.a11y-spacing body p { margin-bottom: 2em; }

/* Repérer les titres */
html.a11y-headings body :is(h1, h2, h3, h4, h5, h6):not(.og-a11y *) {
    outline: 3px dashed #b5934e !important;
    outline-offset: 6px !important;
    background-color: rgba(181, 147, 78, .14) !important;
    border-radius: 4px;
}

/* Souligner les liens */
html.a11y-links body a:not(.og-a11y *) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
}
html.a11y-links body a:not(.og-a11y *):is(:hover, :focus-visible) {
    outline: 3px solid #b5934e !important;
    outline-offset: 2px;
    background-color: #fff3c4 !important;
    color: #000 !important;
}

/* Grand curseur */
html.a11y-cursor,
html.a11y-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2.5 19.5 14.8l-6.4.7 3.8 7-3 1.6-3.8-7.1L5 21.6Z' fill='%23000' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 10 5, auto !important;
}
html.a11y-cursor .cursor { display: none !important; }

/* Contraste renforcé : logo noir rendu lisible sur fond noir */
html.a11y-contrast .site-brand__logo img,
html.a11y-contrast .custom-logo,
html.a11y-contrast .hero__logo img { filter: invert(1) brightness(1.6) !important; }

/* Texte agrandi : le menu passe sur plusieurs lignes au lieu de déborder */
html.a11y-scaled .main-nav ul { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
html.a11y-scaled .site-header__inner { gap: 16px; }
