/* Curator Consent — DSGVO cookie banner.
   Theme-aware via CSS custom properties: when the active theme defines
   --paper / --ink / --accent / --border etc. (e.g. Maschinenraum), those
   values cascade in. Otherwise the fallbacks keep the plugin standalone. */

.curator-consent {
    /* ---------- Tokens (override via theme on :root or body) ---------- */
    --cc-bg:            var(--surface, #ffffff);
    --cc-page-bg:       var(--bg, #f7f7f6);
    --cc-text:          var(--ink, #1a2032);
    --cc-text-muted:    var(--text-muted, #5d6373);
    --cc-text-soft:     var(--muted, #74777d);
    --cc-border:        var(--border, rgba(196, 198, 205, 0.6));
    --cc-border-strong: var(--border-strong, rgba(135, 138, 148, 0.55));
    --cc-paper-2:       var(--paper-2, #f0f0ee);
    --cc-accent:        var(--text, #1a2032);
    --cc-accent-hover:  var(--accent-ink, #2c44a0);
    --cc-accent-soft:   var(--accent-soft, rgba(80, 110, 200, 0.12));
    --cc-overlay:       color-mix(in oklab, var(--ink, #0c1426) 70%, transparent);

    /* Backdrop-filter sometimes fails when color-mix is unsupported.
       Fallback overlay: */
    @supports not (background: color-mix(in oklab, red, blue)) {
        --cc-overlay: rgba(15, 22, 40, 0.65);
    }

    --cc-radius-card:   12px;
    --cc-radius-pill:   999px;

    --cc-shadow:        0 1px 0 rgba(255,255,255,0.6) inset,
                        0 18px 48px rgba(15, 30, 60, 0.18);

    --cc-t-fast:        160ms cubic-bezier(.2,.7,.2,1);

    /* ---------- Layout ---------- */
    position: fixed;
    inset: 0;
    z-index: 100000;
    color: var(--cc-text);
    font-family: inherit;
    pointer-events: none;
}

.curator-consent[hidden] {
    display: none !important;
}

.curator-consent__overlay {
    position: absolute;
    inset: 0;
    background: var(--cc-overlay);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    pointer-events: auto;
    animation: cc-overlay-in 240ms ease both;
}

@keyframes cc-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.curator-consent__panel {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    margin: 0 auto;
    max-width: 580px;
    width: auto;
    background: var(--cc-bg);
    border: 1px solid var(--cc-border-strong);
    border-radius: var(--cc-radius-card);
    padding: 28px 28px 24px;
    box-shadow: var(--cc-shadow);
    pointer-events: auto;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    animation: cc-panel-in 360ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes cc-panel-in {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@media (min-width: 768px) {
    .curator-consent__panel {
        bottom: 32px;
        left: 32px;
        right: 32px;
        margin: auto;
        max-width: 540px;
        padding: 30px 32px 26px;
    }
}

/* ---------- Eyebrow + title ---------- */
.curator-consent__panel::before {
    content: "Datenschutz · Einwilligung";
    display: block;
    font-family: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cc-accent-hover);
    margin-bottom: 12px;
}

.curator-consent__title {
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 12px;
    color: var(--cc-text);
}

.curator-consent__text {
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 20px;
    color: var(--cc-text-muted);
}

.curator-consent__link {
    color: var(--cc-accent-hover);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
    text-underline-offset: 3px;
    margin-left: 4px;
    transition: color var(--cc-t-fast), text-decoration-color var(--cc-t-fast);
}
.curator-consent__link:hover {
    color: var(--cc-text);
    text-decoration-color: currentColor;
}

/* ---------- Categories (settings panel) ---------- */
.curator-consent__categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
    margin: 0 0 20px;
    border-top: 1px solid var(--cc-border);
    border-bottom: 1px solid var(--cc-border);
}
.curator-consent__categories[hidden] {
    display: none;
}

.curator-consent__category {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    cursor: pointer;
    align-items: start;
}
.curator-consent__category input[type="checkbox"] {
    grid-row: 1 / span 2;
    margin-top: 4px;
    accent-color: var(--cc-accent);
    width: 16px;
    height: 16px;
}
.curator-consent__category input[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}
.curator-consent__category-name {
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--cc-text);
}
.curator-consent__category-desc {
    font-size: 13px;
    color: var(--cc-text-muted);
    line-height: 1.55;
    grid-column: 2;
}

/* ---------- Buttons ---------- */
.curator-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.curator-consent__btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--cc-radius-pill);
    padding: 9px 18px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    line-height: 1.2;
    transition: background-color var(--cc-t-fast),
                color var(--cc-t-fast),
                border-color var(--cc-t-fast),
                transform var(--cc-t-fast);
}

.curator-consent__btn--primary {
    background: var(--cc-accent);
    color: var(--cc-bg);
    border-color: var(--cc-accent);
}
.curator-consent__btn--primary:hover {
    background: var(--cc-accent-hover);
    border-color: var(--cc-accent-hover);
    transform: translateY(-1px);
}

.curator-consent__btn--secondary {
    background: transparent;
    color: var(--cc-text-muted);
    border-color: var(--cc-border);
}
.curator-consent__btn--secondary:hover {
    color: var(--cc-text);
    border-color: var(--cc-border-strong);
    background: var(--cc-paper-2);
}

.curator-consent__btn:focus-visible {
    outline: 2px solid var(--cc-accent-hover);
    outline-offset: 2px;
}

/* ---------- Floating "re-open" widget ---------- */
.curator-consent-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--surface, #ffffff);
    color: var(--accent-ink, var(--ink, #1a2032));
    border: 1px solid var(--border-strong, rgba(135, 138, 148, 0.5));
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(15, 30, 60, 0.10);
    transition: transform 200ms cubic-bezier(.2,.7,.2,1),
                box-shadow 200ms,
                color 160ms;
}
.curator-consent-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 30, 60, 0.16);
    color: var(--accent, var(--ink, #1a2032));
}
.curator-consent-widget:focus-visible {
    outline: 2px solid var(--accent, currentColor);
    outline-offset: 3px;
}
.curator-consent-widget svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* ---------- Reduced-motion: drop the entrance animations ---------- */
@media (prefers-reduced-motion: reduce) {
    .curator-consent__panel,
    .curator-consent__overlay {
        animation: none;
    }
    .curator-consent__btn:hover,
    .curator-consent-widget:hover {
        transform: none;
    }
}
