/* Cookie consent banner (js/consent.js) — loaded by the build when deploy.env has CONSENT_BANNER=1.
   Colours and fonts come from the site's own :root variables with neutral fallbacks, so the banner follows the
   site without the site knowing about it. Edit freely: this file belongs to the site. */

.consent { position: fixed; inset: auto 0 0 0; z-index: 2147483000; padding: 0 12px 12px; display: none; font-family: var(--font-body, system-ui, sans-serif); color: var(--text, #111); }
.consent--open { display: block; }
.consent__box { max-width: 760px; margin: 0 auto; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; background: #fff; border: 1px solid var(--border, var(--line, #d9dee5)); border-radius: var(--radius-lg, var(--radius, 14px)); box-shadow: 0 18px 50px rgba(0, 0, 0, .22); padding: 22px 24px 20px; }
.consent__title { margin: 0 0 10px; font-family: var(--font-head, inherit); font-size: 20px; line-height: 1.25; }
.consent__intro { font-size: 13px; line-height: 1.55; color: var(--muted, #4b5563); }
.consent__intro p { margin: 0 0 8px; }
.consent__link { color: var(--link, var(--blue, var(--accent, #1d4ed8))); text-decoration: underline; }

.consent__settings { margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--border, var(--line, #e5e7eb)); }
.consent__settings-title { margin: 0 0 12px; font-family: var(--font-head, inherit); font-size: 16px; }
.consent__settings-title:focus { outline: none; }
.consent__category { margin: 0 0 12px; }
.consent__switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 600; font-size: 14px; line-height: 1.35; }
.consent__check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent__slider { flex: 0 0 auto; position: relative; width: 42px; height: 24px; margin-top: 1px; border-radius: 999px; background: #c4c9d2; transition: background .2s; }
.consent__slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.consent__check:checked + .consent__slider { background: var(--green, var(--blue, var(--accent, #16a34a))); }
.consent__check:checked + .consent__slider::after { transform: translateX(18px); }
.consent__check:disabled + .consent__slider { opacity: .6; cursor: default; }
.consent__check:focus-visible + .consent__slider { outline: 2px solid var(--link, var(--blue, #1d4ed8)); outline-offset: 2px; }
.consent__always { font-weight: 400; color: var(--muted, #6b7280); }
.consent__category-text { margin: 6px 0 0 54px; font-size: 12px; line-height: 1.5; color: var(--muted, #4b5563); }

.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.consent__btn { font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; padding: 11px 18px; border-radius: var(--pill, var(--radius, 10px)); border: 2px solid var(--blue, var(--accent, #1d4ed8)); background: #fff; color: var(--blue, var(--accent, #1d4ed8)); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.consent__btn:hover, .consent__btn:focus-visible { background: var(--light, #eef2f7); }
.consent__btn--primary { background: var(--blue, var(--accent, #1d4ed8)); color: #fff; }
.consent__btn--primary:hover, .consent__btn--primary:focus-visible { background: var(--blue-hover, var(--blue-deep, var(--blue, var(--accent, #1e40af)))); border-color: var(--blue-hover, var(--blue-deep, var(--blue, var(--accent, #1e40af)))); color: #fff; }
.consent__btn--quiet { border-color: transparent; color: var(--muted, #4b5563); margin-left: auto; }
.consent__btn--quiet:hover, .consent__btn--quiet:focus-visible { background: var(--light, #eef2f7); color: var(--text, #111); }
.consent__btn:focus-visible { outline: 2px solid var(--link, var(--blue, #1d4ed8)); outline-offset: 2px; }
.consent__btn[hidden] { display: none; }

/* footer link appended by js/consent.js when the page has no [data-consent-open] of its own */
.consent-footer { margin: 8px 0 0; font-size: 12px; text-align: center; }
.consent-footer__link { color: inherit; opacity: .75; text-decoration: underline; }
.consent-footer__link:hover { opacity: 1; }

@media (max-width: 600px) {
    .consent { padding: 0; }
    .consent__box { border-radius: var(--radius-lg, var(--radius, 14px)) var(--radius-lg, var(--radius, 14px)) 0 0; padding: 18px 16px 16px; max-height: 88vh; max-height: 88dvh; }
    .consent__title { font-size: 18px; }
    .consent__btn { flex: 1 1 100%; text-align: center; }
    .consent__btn--quiet { margin-left: 0; }
    .consent__category-text { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .consent__slider, .consent__slider::after, .consent__btn { transition: none; }
}

/* staging: the Review Mode toolbar (tools/feedback/staging-feedback.js) sits at the bottom too — lift the banner above it */
html:has(#staging-feedback-root) .consent { padding-bottom: 72px; }
@media (max-width: 600px) { html:has(#staging-feedback-root) .consent__box { margin-bottom: 0; } html:has(#staging-feedback-root) .consent { padding-bottom: 96px; } }
