/* ==========================================================
   Cookie / consent banner — shared by index and legal pages.
   (Moved out of style.css in Phase 02; visual direction unchanged,
   except that "accept" and "decline" now have equal visual weight.)
========================================================== */

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;

    background: rgba(255, 252, 247, 0.98);
    backdrop-filter: blur(14px);

    border: 1px solid rgba(93, 111, 82, .25);
    border-radius: 20px;
    box-shadow: 0 18px 60px rgba(48, 55, 42, .18);

    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    text-align: left;
}

.cookie-banner:focus {
    outline: none;
}

.cookie-banner:focus-visible {
    outline: 3px solid #3f5036;
    outline-offset: 3px;
}

.cookie-banner__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.cookie-banner__text {
    max-width: 760px;
}

.cookie-banner h2 {
    margin: 0 0 10px;
    color: #3f4f38;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.cookie-banner p {
    margin: 0;
    color: #4f5549;
    line-height: 1.7;
    font-size: 15px;
}

.cookie-banner p + p {
    margin-top: 8px;
}

.cookie-banner__status {
    font-weight: 600;
}

.cookie-banner__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
}

.cookie-banner__links a {
    color: #3f5036;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner__links a:hover {
    text-decoration-thickness: 2px;
}

.cookie-banner__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* Both choices are intentionally identical in size, colour and weight. */
.cookie-button {
    padding: 13px 24px;
    border-radius: 12px;
    border: 1.5px solid #5f6e57;
    background: #ffffff;
    color: #33422c;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    transition: background-color .25s ease;
}

.cookie-button:hover {
    background: #eef2ea;
}

.cookie-button:focus-visible,
.cookie-banner__links a:focus-visible,
.footer-cookie-settings:focus-visible {
    outline: 3px solid #3f5036;
    outline-offset: 3px;
}

.cookie-button--text {
    border-color: transparent;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Footer trigger (button that looks like the neighbouring footer links) */
.footer-cookie-settings {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 18px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .cookie-banner__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .cookie-banner__actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-button {
        width: 100%;
    }

    .cookie-banner h2 {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-button {
        transition: none;
    }
}

/* Author display rules must not defeat the HTML [hidden] attribute. */
.footer-cookie-settings[hidden],
.footer-legal .footer-cookie-settings[hidden] {
    display: none !important;
}

/* Narrow phones (320-420px): the banner must never be wider than the viewport. */
.cookie-banner__content,
.cookie-banner__text { min-width: 0; }
.cookie-banner__links a { overflow-wrap: anywhere; }
.cookie-button { white-space: normal; text-align: center; }
@media (max-width: 480px) {
    .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px; border-radius: 14px; max-height: calc(100vh - 16px); }
    .cookie-banner__content { gap: 12px; }
    .cookie-banner h2 { font-size: 17px; margin-bottom: 4px; }
    .cookie-banner p { font-size: 13px; line-height: 1.45; }
    .cookie-banner p + p { margin-top: 4px; }
    .cookie-banner__links { margin-top: 8px; gap: 4px 14px; font-size: 13px; }
    /* the two equal choices sit side by side; the optional "close" stays full width */
    .cookie-banner__actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .cookie-banner__actions .cookie-button { flex: 1 1 calc(50% - 4px); width: auto; padding: 10px 8px; font-size: 13.5px; border-radius: 10px; }
    .cookie-banner__actions .cookie-button--text { flex-basis: 100%; padding: 6px; }
}
