/* The cookie notice: a card in the bottom-right corner, full width on phones.
   The corner is free because the template's floating back-to-top button,
   which sat there on every page but the homepage, is gone. Bring one back
   and the card covers it.

   Loaded by both layouts, which do not share a theme (the homepage's
   alt-home.css restyles bare h2, h3, p and a; the rest load the compiled
   theme), so the card sets its own type, colour and buttons rather than
   borrowing .btn-primary, which only one of the two ever styled. */

.cc {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    width: min(400px, calc(100vw - 24px));
    padding: 20px 20px 16px;
    background: #121a24;
    border: 1px solid rgba(226, 234, 245, .13);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    color: #e6edf6;
    font-family: Archivo, system-ui, sans-serif;
    text-align: left;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease;
}
.cc.is-open { opacity: 1; transform: none; }
.cc:focus { outline: none; }
/* `hidden` loses to any author display rule, so say it outright. */
.cc[hidden], .cc [hidden] { display: none !important; }

.cc .cc-title {
    margin: 0 0 6px;
    max-width: none;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    color: #e6edf6;
}
/* alt-home.css caps every bare p at 52ch; inside the card that holds the
   text short of the card's own edge. */
.cc .cc-text {
    margin: 0;
    max-width: none;
    font-size: .875rem;
    line-height: 1.55;
    color: #aab6c6;
}
.cc a { color: #e6edf6; text-decoration: underline; text-underline-offset: 2px; }
.cc a:hover { color: #fff; }

.cc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.cc-btn {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 7px;
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    text-transform: none;
    cursor: pointer;
}
/* The quiet button keeps the solid one's size and hit area: Preferences is
   where the opt-out lives, so it must be as easy to reach as Accept. */
.cc-btn-quiet { background: transparent; color: #e6edf6; border: 1px solid rgba(226, 234, 245, .28); }
.cc-btn-quiet:hover { background: rgba(226, 234, 245, .08); }
.cc-btn-solid { background: #e6edf6; color: #0b1017; border: 1px solid transparent; }
.cc-btn-solid:hover { background: #fff; }
.cc-btn:focus-visible, .cc-switch:focus-visible, .cc a:focus-visible {
    outline: 2px solid #e6edf6;
    outline-offset: 2px;
}

/* ---- preferences ---- */
.cc-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid rgba(226, 234, 245, .13);
}
.cc-row:first-of-type { margin-top: 12px; }
.cc .cc-row-title {
    margin: 0 0 2px;
    max-width: none;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    color: #e6edf6;
}
.cc-row .cc-text { font-size: .8125rem; }
.cc-always {
    flex: 0 0 auto;
    padding-top: 3px;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .6875rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #7b8797;
}

/* The switch draws a 40x22 track but is a 44x44 button, so it clears the
   touch minimum without pushing the row apart (the negative margin hands
   the extra back). */
.cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: -11px -2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    cursor: pointer;
}
.cc-switch::before, .cc-switch::after {
    content: "";
    position: absolute;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.cc-switch::before {
    left: 2px;
    top: 11px;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: transparent;
    border: 1px solid rgba(226, 234, 245, .28);
}
.cc-switch::after {
    left: 6px;
    top: 15px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #7b8797;
}
.cc-switch[aria-checked="true"]::before { background: #e6edf6; border-color: #e6edf6; }
.cc-switch[aria-checked="true"]::after { background: #0b1017; transform: translateX(18px); }

@media (max-width: 600px) {
    .cc { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 16px 16px 12px; }
    /* Same 44px floor the rest of the site uses. A privacy control is the
       last place to make someone aim. */
    .cc-btn { flex: 1 1 0; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .cc, .cc-switch::before, .cc-switch::after { transition: none; }
}
