/* =====================================================================
   Cookie consent: full-width bar at the bottom in Car Stories colors
   (petrol background like the footer, ochre accents, Oswald title).
   Always dark (data-bs-theme="dark"), independent of the page theme.
   ===================================================================== */
.cookie-consent {
    /* Tokens used by .btn-cs-primary from site.css */
    --cs-signal: var(--car-stories-ochre, #D1AD5F);
    --cs-signal-hover: #BE9A4C;
    --cs-signal-ink: var(--car-stories-darkblue, #0F1944);

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 1.5rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0px));
    background: var(--car-stories-darkgreen, #34626E);
    color: rgba(255, 255, 255, .85);
    border-top: 3px solid var(--car-stories-ochre, #D1AD5F);
    box-shadow: 0 -.75rem 2rem rgba(15, 25, 68, .35);
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Closed after a decision; opened again via "#cookie-settings" (JS or :target) */
.cookie-consent--closed:not(:target),
.cookie-consent--dismissed {
    display: none !important;
}

.cookie-consent__inner {
    position: relative;
}

.cookie-consent a {
    color: var(--car-stories-ochre, #D1AD5F);
}

.cookie-consent :focus-visible {
    outline: 3px solid var(--car-stories-ochre, #D1AD5F);
    outline-offset: 2px;
}

/* Intro and main buttons side by side, stacked on small screens */
.cookie-consent__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2.5rem;
}

.cookie-consent__intro {
    flex: 1 1 32rem;
    padding-right: 2rem; /* room for the close button */
}

.cookie-consent__title {
    margin: 0 0 .5rem;
    font: 600 1.6rem/1.15 "Oswald", "Arial Narrow", system-ui, sans-serif;
    color: var(--car-stories-ochre, #D1AD5F);
}

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

.cookie-consent__text {
    max-width: 78ch;
    margin: 0;
    font-size: .95rem;
    line-height: 1.6;
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.cookie-consent__actions .btn {
    min-width: 13rem;
}

@media (max-width: 575.98px) {
    .cookie-consent__actions {
        flex: 1 1 100%;
    }

    .cookie-consent__actions .btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* Category settings */
.cookie-consent__details {
    margin-top: 1rem;
}

.cookie-consent__summary {
    width: fit-content;
    cursor: pointer;
    font-weight: 600;
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.cookie-consent__categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.cookie-consent__category {
    padding: .9rem 1rem;
    background: rgba(15, 25, 68, .28);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
}

.cookie-consent__category .form-check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
    margin: 0;
}

.cookie-consent__category .form-check-label {
    font-weight: 600;
    color: #FFFFFF;
}

/* The necessary switch is disabled, but its label should stay fully readable */
.cookie-consent__category .form-check-input:disabled ~ .form-check-label {
    opacity: 1;
}

.cookie-consent__category .form-check-input:checked {
    background-color: var(--car-stories-ochre, #D1AD5F);
    border-color: var(--car-stories-ochre, #D1AD5F);
}

.cookie-consent__category p {
    margin: .4rem 0 0;
    font-size: .875rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .72);
}

.cookie-consent__badge {
    padding: .1rem .5rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--car-stories-darkblue, #0F1944);
    background: var(--car-stories-ochre, #D1AD5F);
    border-radius: 999px;
}

.cookie-consent__save {
    margin-top: 1rem;
}

.cookie-consent__withdrawal {
    margin: 1rem 0 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .6);
}

/* Close button, only shown when reopened via "Cookie settings" */
.cookie-consent__close {
    position: absolute;
    top: -.75rem;
    right: .75rem;
    padding: .25rem .5rem;
    font-size: 1.75rem;
    line-height: 1;
    text-decoration: none;
    color: #FFFFFF !important;
}
