/* --------------------------------------------------------------------------
   Cookie notice and settings dialog (views/partials/cookie-consent).
   A band along the bottom of the window in the site's night blue; it never
   covers the page's own controls on a phone for longer than one tap.
   -------------------------------------------------------------------------- */

.cc {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    padding: 16px var(--v2-gutter, 16px);
    background: var(--v2-night, #111c2b);
    color: var(--v2-ink-invert, #f6f4f0);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

.cc[hidden] {
    display: none;
}

.cc__inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: var(--v2-shell, 1280px);
    margin: 0 auto;
}

.cc__title {
    margin: 0 0 4px;
    font-family: var(--v2-head-font, sans-serif);
    font-weight: 700;
    font-size: 1rem;
}

.cc__text {
    margin: 0;
    max-width: 72ch;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #c9d0da;
}

.cc__text a,
.cc-dialog__more a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc__text a:hover,
.cc__text a:focus-visible {
    color: #fff;
}

.cc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Accept and reject are the same button: neither is the easy way out. */
.cc__btn {
    flex: 1 1 auto;
    min-height: 42px;
    padding: 0 18px;
    border: 1.5px solid var(--v2-accent, #a32b2c);
    background: var(--v2-accent, #a32b2c);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
}

.cc__btn:hover,
.cc__btn:focus-visible {
    background: var(--v2-accent-deep, #7e1f20);
    border-color: var(--v2-accent-deep, #7e1f20);
}

.cc__btn--ghost {
    background: transparent;
    border-color: currentColor;
    color: inherit;
}

.cc__btn--ghost:hover,
.cc__btn--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: currentColor;
}

.cc__btn:focus-visible,
.cc-dialog__close:focus-visible,
.cc-switch input:focus-visible + span {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .cc__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 32px;
    }

    .cc__btn {
        flex: none;
    }
}

/* The dialog -------------------------------------------------------------- */

.cc-dialog {
    width: min(100% - 32px, 720px);
    max-height: min(100% - 32px, 760px);
    padding: 0;
    border: 0;
    background: var(--v2-paper, #fbfaf7);
    color: var(--v2-ink, #131a24);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.cc-dialog::backdrop {
    background: rgba(17, 28, 43, 0.6);
}

.cc-dialog__form {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.cc-dialog__head,
.cc-dialog__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
}

.cc-dialog__head {
    justify-content: space-between;
    border-bottom: 1px solid var(--v2-rule, #dfdcd4);
}

.cc-dialog__head h2 {
    margin: 0;
    font-family: var(--v2-head-font, sans-serif);
    font-size: 1.25rem;
}

.cc-dialog__close {
    width: 36px;
    height: 36px;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.cc-dialog__body {
    overflow: auto;
    padding: 4px 20px 8px;
}

.cc-dialog__foot {
    flex-wrap: wrap;
    justify-content: flex-end;
    border-top: 1px solid var(--v2-rule, #dfdcd4);
}

.cc-dialog__foot .cc__btn--ghost {
    color: var(--v2-ink, #131a24);
}

.cc-dialog__more {
    margin: 16px 0 8px;
    font-size: 0.875rem;
}

.cc-cat {
    padding: 16px 0;
    border-bottom: 1px solid var(--v2-rule, #dfdcd4);
}

.cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cc-cat h3 {
    margin: 0;
    font-family: var(--v2-head-font, sans-serif);
    font-size: 1rem;
}

.cc-cat p {
    margin: 6px 0 10px;
    font-size: 0.875rem;
    color: var(--v2-ink-soft, #444d59);
}

.cc-cat__always {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--v2-accent, #a32b2c);
}

.cc-cat__table {
    overflow-x: auto;
}

.cc-cat table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.cc-cat th,
.cc-cat td {
    padding: 8px 10px 8px 0;
    border-top: 1px solid var(--v2-rule, #dfdcd4);
    text-align: left;
    vertical-align: top;
}

.cc-cat th {
    font-weight: 700;
    color: var(--v2-ink-mute, #757e8a);
}

.cc-cat code {
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* A switch for each optional category. */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex: none;
}

.cc-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.cc-switch span[aria-hidden] {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--v2-rule, #dfdcd4);
    transition: background 150ms;
    pointer-events: none;
}

.cc-switch span[aria-hidden]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 150ms;
}

.cc-switch input:checked + span {
    background: var(--v2-accent, #a32b2c);
}

.cc-switch input:checked + span::after {
    transform: translateX(20px);
}

.cc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The footer link that reopens the dialog looks like its neighbours. */
.v2-footer__cookies {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .cc-switch span[aria-hidden],
    .cc-switch span[aria-hidden]::after {
        transition: none;
    }
}
