/* Einwilligung (consent.js): Banner unten rechts + Zwei-Klick-Platzhalter für Karten/Videos.
   Farben aus main.css (--cf-dark-blue, --cf-light-blue, --cf-line, --cf-soft), mit Fallback. */

.consent {
    position: fixed;
    z-index: 1080;
    inset: auto 1rem 1rem auto;
    width: min(30rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #fff;
    color: #1f2a37;
    border: 1px solid var(--cf-line, #d8dee6);
    border-radius: .75rem;
    box-shadow: 0 1rem 3rem rgba(23, 55, 94, .18);
    font-size: .9375rem;
    line-height: 1.55;
}

.consent[hidden] {
    display: none;
}

.consent:focus {
    outline: none;
}

.consent:focus-visible {
    outline: 3px solid var(--cf-dark-blue, #17375E);
    outline-offset: 2px;
}

.consent--expanded {
    width: min(40rem, calc(100vw - 2rem));
}

.consent__panel {
    padding: 1.5rem;
}

.consent__title {
    margin: 0 0 .5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--cf-dark-blue, #17375E);
}

.consent__text {
    margin: 0 0 1.25rem;
}

.consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

/* "Einstellungen" bzw. "Auswahl speichern" über die ganze Breite, darunter die zwei gleichwertigen Entscheidungen */
.consent__actions .consent__btn--ghost {
    grid-column: 1 / -1;
}

.consent__btn {
    appearance: none;
    min-height: 2.75rem;
    padding: .625rem 1rem;
    border: 2px solid var(--cf-dark-blue, #17375E);
    border-radius: 999px;
    background: var(--cf-dark-blue, #17375E);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.consent__btn:hover {
    background: #0f2742;
    border-color: #0f2742;
}

.consent__btn--ghost {
    background: transparent;
    color: var(--cf-dark-blue, #17375E);
    border-color: var(--cf-line, #d8dee6);
}

.consent__btn--ghost:hover {
    background: var(--cf-soft, #f3f5f8);
    border-color: var(--cf-dark-blue, #17375E);
}

.consent__btn:focus-visible,
.consent-media button:focus-visible {
    outline: 3px solid var(--cf-light-blue, #C6D9F1);
    outline-offset: 2px;
}

.consent__btn[hidden] {
    display: none;
}

.consent__links {
    margin: 1rem 0 0;
    font-size: .8125rem;
    color: #5b6675;
}

.consent__links a,
.consent__text a {
    color: var(--cf-dark-blue, #17375E);
}

/* Einstellungen */
.consent__settings {
    margin: 0 0 1.25rem;
}

.consent__categories {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--cf-line, #d8dee6);
}

.consent-category {
    padding: 1rem 0;
    border-bottom: 1px solid var(--cf-line, #d8dee6);
}

.consent-category__text {
    margin: .375rem 0 .5rem 3.5rem;
    font-size: .875rem;
    color: #4a5563;
}

.consent-category__details {
    margin-left: 3.5rem;
    font-size: .8125rem;
}

.consent-category__details summary {
    cursor: pointer;
    color: var(--cf-dark-blue, #17375E);
    font-weight: 600;
}

.consent-table {
    overflow-x: auto;
    margin-top: .5rem;
}

.consent-table table {
    width: 100%;
    border-collapse: collapse;
}

.consent-table th,
.consent-table td {
    padding: .375rem .5rem .375rem 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--cf-line, #d8dee6);
}

.consent-table thead th {
    font-weight: 600;
    color: #5b6675;
}

/* Schalter */
.consent-switch {
    display: flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--cf-dark-blue, #17375E);
}

.consent-switch input {
    position: absolute;
    opacity: 0;
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
}

.consent-switch__track {
    position: relative;
    flex: 0 0 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #b8c2cf;
    transition: background-color .15s ease;
}

.consent-switch__track::after {
    content: "";
    position: absolute;
    top: .1875rem;
    left: .1875rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}

.consent-switch input:checked + .consent-switch__track {
    background: var(--cf-dark-blue, #17375E);
}

.consent-switch input:checked + .consent-switch__track::after {
    transform: translateX(1.25rem);
}

.consent-switch input:disabled + .consent-switch__track {
    opacity: .55;
}

.consent-switch input:disabled ~ .consent-switch__label {
    cursor: default;
}

.consent-switch input:focus-visible + .consent-switch__track {
    outline: 3px solid var(--cf-light-blue, #C6D9F1);
    outline-offset: 2px;
}

.consent-switch small {
    font-weight: 400;
    color: #5b6675;
}

@media (max-width: 575.98px) {
    .consent {
        inset: auto .5rem .5rem .5rem;
        width: auto;
    }

    .consent--expanded {
        width: auto;
    }

    .consent__panel {
        padding: 1.25rem;
    }

    .consent-category__text,
    .consent-category__details {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consent *,
    .consent-media * {
        transition: none !important;
    }
}

/* ---------- Zwei-Klick-Platzhalter (Google Maps, YouTube) ---------- */
.consent-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
    padding: 2rem 1.5rem;
    border-radius: .75rem;
    background:
        linear-gradient(rgba(243, 245, 248, .92), rgba(243, 245, 248, .92)),
        repeating-linear-gradient(45deg, #e6ebf1 0 1px, transparent 1px 24px),
        repeating-linear-gradient(-45deg, #e6ebf1 0 1px, transparent 1px 24px);
    border: 1px solid var(--cf-line, #d8dee6);
    text-align: center;
}

.consent-media__inner {
    max-width: 32rem;
}

.consent-media__title {
    margin: 0 0 .5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cf-dark-blue, #17375E);
}

.consent-media--maps .consent-media__title::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto .75rem;
    background: var(--cf-dark-blue, #17375E);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.consent-media__text {
    margin: 0 0 1.25rem;
    font-size: .9375rem;
    color: #4a5563;
}

.consent-media__text a {
    color: var(--cf-dark-blue, #17375E);
}

.consent-media__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem 1.5rem;
}

.consent-media__external {
    font-weight: 600;
    color: var(--cf-dark-blue, #17375E);
}

.consent-media__remember {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    font-size: .875rem;
    color: #4a5563;
    cursor: pointer;
}

.consent-media__remember input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--cf-dark-blue, #17375E);
}

iframe[data-src] {
    border: 0;
    border-radius: .75rem;
    display: block;
}

iframe[data-src][hidden] {
    display: none;
}

@media print {
    .consent {
        display: none !important;
    }
}
