/* Consent banner, preferences dialog and blocked-embed placeholders.
   Uses the tokens from style.css so the banner reads as part of the site
   rather than a bolted-on vendor widget. */

/* ============================ banner ============================ */

.cc-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9000;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
    box-shadow: 0 -12px 40px rgba(10, 14, 39, .12);
    font-family: var(--f-sans);
    color: var(--c-text);
    animation: cc-rise .28s ease-out;
}
.cc-banner[hidden] { display: none; }

@keyframes cc-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .cc-banner { animation: none; } }

.cc-banner-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.cc-banner-copy { flex: 1 1 auto; min-width: 0; }

.cc-banner-title {
    font-size: var(--fs-h4);
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -.01em;
}

.cc-banner-text {
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--c-text-soft);
    margin: 0;
    max-width: 78ch;
}
.cc-banner-text a { color: var(--c-grad-from); font-weight: 500; }
.cc-banner-text a:hover { text-decoration: underline; }

.cc-banner-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================ buttons ===========================
   Accept and Reject share one class on purpose. A reject button that is
   quieter than accept is the single most-cited banner defect in EU
   enforcement decisions, so the styling must not drift apart. */

.cc-btn {
    font-family: inherit;
    font-size: var(--fs-small);
    font-weight: 600;
    line-height: 1;
    padding: 13px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.cc-btn:focus-visible { outline: 2px solid var(--c-grad-to); outline-offset: 2px; }
.cc-btn:hover { transform: translateY(-1px); }

.cc-btn-solid {
    background: var(--c-bg-dark);
    color: #fff;
}
.cc-btn-solid:hover { box-shadow: var(--shadow-md); background: #141a3d; }

.cc-btn-ghost {
    background: transparent;
    color: var(--c-text-soft);
    border-color: var(--c-border);
}
.cc-btn-ghost:hover { border-color: var(--c-text-muted); color: var(--c-text); }

/* ======================= preferences dialog ===================== */

.cc-modal {
    width: min(680px, calc(100vw - 32px));
    max-height: min(86vh, 900px);
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--c-bg);
    color: var(--c-text);
    box-shadow: var(--shadow-lg);
    font-family: var(--f-sans);
}
.cc-modal::backdrop { background: rgba(10, 14, 39, .55); }

.cc-modal-form {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    overflow: hidden;
}

.cc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 26px 14px;
    border-bottom: 1px solid var(--c-border-soft);
}

.cc-modal-title { font-size: var(--fs-h3); font-weight: 700; margin: 0; }

.cc-modal-close {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: transparent;
    color: var(--c-text-soft);
    cursor: pointer;
}
.cc-modal-close svg { width: 16px; height: 16px; }
.cc-modal-close:hover { color: var(--c-text); border-color: var(--c-text-muted); }

.cc-modal-intro {
    margin: 0;
    padding: 16px 26px 4px;
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--c-text-soft);
}
.cc-modal-intro a { color: var(--c-grad-from); font-weight: 500; }

.cc-cats {
    list-style: none;
    margin: 0;
    padding: 12px 26px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.cc-cat {
    padding: 18px 0;
    border-bottom: 1px solid var(--c-border-soft);
}
.cc-cat:last-child { border-bottom: none; }

.cc-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cc-cat-title { font-size: var(--fs-body); font-weight: 600; }

.cc-cat-badge {
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-text-muted);
}

.cc-cat-desc,
.cc-cat-legal {
    margin: 8px 0 0;
    font-size: var(--fs-small);
    line-height: 1.6;
    color: var(--c-text-soft);
}
.cc-cat-legal { color: var(--c-text-muted); font-size: var(--fs-eyebrow); }

/* --- toggle --- */

.cc-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.cc-switch-locked { cursor: default; }

.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 44px; height: 26px;
    margin: 0;
    cursor: inherit;
}

.cc-switch-track {
    flex: 0 0 auto;
    width: 44px; height: 26px;
    border-radius: var(--radius-pill);
    background: #D6D8E0;
    display: block;
    position: relative;
    transition: background-color .18s ease;
}
.cc-switch-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(10, 14, 39, .3);
    transition: transform .18s ease;
}
.cc-switch input:checked + .cc-switch-track { background: var(--c-grad-from); }
.cc-switch input:checked + .cc-switch-track .cc-switch-thumb { transform: translateX(18px); }
.cc-switch input:disabled + .cc-switch-track { background: var(--c-text-muted); opacity: .55; }
.cc-switch input:focus-visible + .cc-switch-track { outline: 2px solid var(--c-grad-to); outline-offset: 3px; }

/* --- per-service disclosure --- */

.cc-cat-more { margin-top: 12px; }
.cc-cat-more summary {
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--c-grad-from);
    cursor: pointer;
    list-style: none;
}
.cc-cat-more summary::-webkit-details-marker { display: none; }
.cc-cat-more summary::before { content: "+ "; }
.cc-cat-more[open] summary::before { content: "– "; }

.cc-svc-list { list-style: none; margin: 12px 0 0; padding: 0; }
.cc-svc {
    padding: 14px 16px;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border-soft);
    border-radius: var(--radius);
    margin-bottom: 10px;
}
.cc-svc-name { margin: 0 0 4px; font-size: var(--fs-small); font-weight: 700; }
.cc-svc-desc,
.cc-svc-meta {
    margin: 0 0 6px;
    font-size: var(--fs-eyebrow);
    line-height: 1.6;
    color: var(--c-text-soft);
}
.cc-svc-meta strong { color: var(--c-text); }

.cc-ck-list {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: var(--fs-eyebrow);
    line-height: 1.7;
    color: var(--c-text-soft);
}
.cc-ck-list code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 1px 5px;
}
.cc-ck-list em { color: var(--c-text-muted); font-style: normal; }

.cc-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 16px 26px 22px;
    border-top: 1px solid var(--c-border-soft);
    background: var(--c-bg-soft);
}

/* ==================== blocked embed placeholder ==================
   Shown in place of a third-party iframe until the visitor allows it.
   It has to name the provider, otherwise the click that loads it is not
   informed consent. */

.cc-embed-block {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 22px;
    text-align: center;
    background: var(--c-bg-dark);
    color: var(--c-text-light);
}
.cc-embed-block.cc-embed-loaded { display: block; padding: 0; }

.cc-embed-icon { width: 28px; height: 28px; opacity: .7; }

.cc-embed-note {
    margin: 0;
    font-size: var(--fs-eyebrow);
    line-height: 1.6;
    color: rgba(232, 234, 240, .78);
    max-width: 34ch;
}

.cc-embed-btn {
    font-family: inherit;
    font-size: var(--fs-small);
    font-weight: 600;
    padding: 11px 18px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--c-btn-grad);
    color: #fff;
    cursor: pointer;
}
.cc-embed-btn:hover { box-shadow: var(--shadow-blue); }
.cc-embed-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cc-embed-link {
    font-size: var(--fs-eyebrow);
    color: rgba(232, 234, 240, .7);
    text-decoration: underline;
}
.cc-embed-link:hover { color: #fff; }

.cc-embed-block iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ============================ mobile ============================ */

@media (max-width: 860px) {
    .cc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
        max-height: 82vh;
        overflow-y: auto;
    }
    .cc-banner-actions { gap: 8px; }
    .cc-banner-actions .cc-btn { flex: 1 1 140px; text-align: center; }
    .cc-modal { width: calc(100vw - 20px); }
    .cc-modal-head, .cc-modal-intro, .cc-cats, .cc-modal-actions { padding-left: 18px; padding-right: 18px; }
    .cc-modal-actions .cc-btn { flex: 1 1 140px; }
}
