/* Cookie consent bar (includes/cookie-consent.html), in the Ink & Signal
 * system: white, an ink rule on top, ink buttons, square corners.
 * Plain CSS rather than Tailwind so the bar keeps its look even if the
 * compiled stylesheet is stale. Colours are the brand tokens
 * (docs/design-docs/brand-and-design-system.md).
 *
 * A slim bar along the bottom edge (60 px on desktop, about 130 px on a
 * phone) instead of a card: a first visitor still sees the hero's search and
 * call to action. "Customize" opens the categories inside the bar. */

.cc-panel {
    position: fixed;
    z-index: 9998;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    overflow-y: auto;
    background: #FFFFFF;
    color: #121110;
    border-top: 1px solid #121110;
    box-shadow: 0 -8px 28px rgba(18, 17, 16, .10);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.cc-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    gap: 10px;
}
.cc-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #121110;
}
.cc-link {
    display: inline;
    padding: 0;
    margin-left: 6px;
    background: none;
    border: 0;
    font: inherit;
    color: #121110;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.cc-link:hover { color: #5E5B57; }
/* Touch screens: a 40 px tall hit area; inline padding leaves the line as is. */
@media (pointer: coarse) { .cc-link { padding-block: 11px; } }
.cc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cc-actions .btn { white-space: nowrap; }
.cc-customize {
    border-top: 1px solid #E6E4E1;
    padding-top: 6px;
}
.cc-customize fieldset { margin: 0; padding: 0; border: 0; }

@media (min-width: 768px) {
    .cc-panel { padding: 10px 40px; }
    .cc-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 32px;
    }
    .cc-text { flex: 1 1 0; min-width: 0; }
    .cc-text p { font-size: 14px; }
    .cc-actions { display: flex; flex: none; gap: 8px; }
    .cc-actions .btn { min-width: 140px; }
    .cc-customize { order: 3; flex-basis: 100%; }
    .cc-customize fieldset {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0 32px;
    }
    .cc-customize .cc-option + .cc-option { border-top: 0; }
    .cc-customize #cookie-save-preferences { width: auto; min-width: 200px; }
}
@media (min-width: 1280px) {
    .cc-panel { padding-left: 56px; padding-right: 56px; }
}

.cc-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
}
.cc-option + .cc-option { border-top: 1px solid #E6E4E1; }
.cc-option input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: #121110;
    cursor: pointer;
}
.cc-option input:disabled { cursor: not-allowed; }
.cc-option label { cursor: pointer; }
.cc-option input:disabled + label { cursor: not-allowed; }

/* One bottom-of-screen question at a time. While the cookie bar is open the
 * first-visit audience question waits (site.js shows it once consent is
 * given; consent also reloads the page). It also steps aside while the
 * mobile menu drawer is open. */
body:has(#cookie-consent-banner:not([style*="none"])) #audience-banner,
html.menu-open #audience-banner { display: none !important; }

/* The audience bar carries `hidden` until site.js decides to show it, but its
 * `flex` utility outranks Tailwind's `[hidden]` rule, so it never hid (nor
 * closed on dismiss). Restore the attribute's meaning. */
#audience-banner[hidden] { display: none !important; }
