/**
 * Cookie-consent banner — PlastoriaPrivacyBundle.
 *
 * Ships a complete, neutral look so the banner is usable the moment it is included, with no
 * stylesheet to write. It is a bottom sheet on the page ground, NOT an overlay: it must not
 * block reading (see the template for why a cookie wall invalidates the consent it collects).
 *
 * ── Restyling ──────────────────────────────────────────────────────────────────────────────
 *
 * Everything visual is a custom property declared on `.pv-consent` below. Redefine the ones
 * you care about and leave the rest:
 *
 *     .pv-consent {
 *         --pv-consent-surface: var(--c-surface);
 *         --pv-consent-ink: var(--c-ink);
 *         --pv-consent-radius: 0;
 *     }
 *
 * ⚠️ Load order decides the winner, because those defaults sit on the same one-class selector
 * your override does. Two supported setups:
 *
 *  · ZERO CONFIG — the template emits this file itself. It is then the only stylesheet
 *    touching the banner, so nothing can conflict.
 *  · YOU RESTYLE — pass `assets: false` to the include and link this file from your <head>
 *    BEFORE your own stylesheet. Yours then comes later and wins.
 *
 * Structural changes beyond the properties are fair game on the same classes (same rule). If
 * you end up rewriting more than a handful, override the template instead — the script only
 * needs the `data-consent-*` hooks, not this markup.
 */

.pv-consent {
    /* Surfaces and text */
    --pv-consent-surface: #ffffff;
    --pv-consent-ink: #16181d;
    --pv-consent-text: #5b6068;
    --pv-consent-hairline: #e4e6ea;

    /* Buttons */
    --pv-consent-primary-bg: #16181d;
    --pv-consent-primary-ink: #ffffff;
    --pv-consent-outline-ink: #16181d;
    --pv-consent-outline-border: #c9ccd2;

    /* Frame */
    --pv-consent-max-width: 1180px;
    --pv-consent-gutter: 24px;
    --pv-consent-radius: 0;
    --pv-consent-shadow: 0 -2px 24px rgba(16, 18, 22, 0.08);
    /* Above a sticky header; below a modal, if the app has one. */
    --pv-consent-z-index: 100;

    /* Type — inherits the page font by default rather than imposing one. */
    --pv-consent-font: inherit;
    --pv-consent-title-size: 16px;
    --pv-consent-text-size: 14px;

    position: fixed;
    inset: auto 0 0 0;
    z-index: var(--pv-consent-z-index);
    box-sizing: border-box;
    font-family: var(--pv-consent-font);
    background: var(--pv-consent-surface);
    border-top: 1px solid var(--pv-consent-hairline);
    border-radius: var(--pv-consent-radius);
    box-shadow: var(--pv-consent-shadow);
}

.pv-consent *,
.pv-consent *::before,
.pv-consent *::after {
    box-sizing: inherit;
}

/* `hidden` is how the server marks an answered banner and how the script re-opens it — a
   `display` rule elsewhere in the page must not win over it. */
.pv-consent[hidden] {
    display: none;
}

.pv-consent__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    max-width: var(--pv-consent-max-width);
    margin: 0 auto;
    padding: 26px var(--pv-consent-gutter);
}

.pv-consent__body {
    flex: 1 1 420px;
    min-width: 0;
}

.pv-consent__title {
    margin: 0 0 8px;
    font-size: var(--pv-consent-title-size);
    font-weight: 600;
    line-height: 1.35;
    color: var(--pv-consent-ink);
}

.pv-consent__text {
    max-width: 62em;
    margin: 0;
    font-size: var(--pv-consent-text-size);
    line-height: 1.65;
    color: var(--pv-consent-text);
}

.pv-consent__text a {
    color: var(--pv-consent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Per-purpose panel ------------------------------------------------------------------ */

.pv-consent__custom {
    margin-top: 14px;
}

.pv-consent__summary {
    display: inline-block;
    cursor: pointer;
    font-size: 13px;
    color: var(--pv-consent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pv-consent__purposes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin: 20px 0;
    padding-top: 20px;
    border-top: 1px solid var(--pv-consent-hairline);
}

.pv-consent__purpose {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.pv-consent__purpose input {
    flex: none;
    margin-top: 3px;
}

/* The always-on "strictly necessary" box: shown ticked, but not a live control. */
.pv-consent__purpose input:disabled {
    cursor: default;
}

.pv-consent__purpose-name {
    display: block;
    margin-bottom: 3px;
    font-size: 13.5px;
    color: var(--pv-consent-ink);
}

.pv-consent__purpose-text {
    display: block;
    font-size: 13px;
    line-height: 1.55;
    color: var(--pv-consent-text);
}

/* Nothing to say about a purpose is not a reason to leave a gap under its name. */
.pv-consent__purpose-text:empty {
    display: none;
}

/* --- Actions ---------------------------------------------------------------------------- */
/* Both buttons carry the same weight and sit side by side: refusing must be exactly as easy
   as accepting. Do not make one of them quieter. */

.pv-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: none;
}

.pv-consent__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: 2px;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    background: none;
}

.pv-consent__btn--primary {
    background: var(--pv-consent-primary-bg);
    color: var(--pv-consent-primary-ink);
}

.pv-consent__btn--outline {
    border-color: var(--pv-consent-outline-border);
    color: var(--pv-consent-outline-ink);
}

.pv-consent__btn:focus-visible {
    outline: 2px solid var(--pv-consent-ink);
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .pv-consent__inner {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .pv-consent__actions {
        width: 100%;
    }

    .pv-consent__btn {
        flex: 1 1 auto;
    }
}

/* A banner that slides or fades is still a banner; one that animates on every page load is an
   irritation. Nothing here animates — this only guards the scroll the script performs. */
@media (prefers-reduced-motion: reduce) {
    .pv-consent {
        scroll-behavior: auto;
    }
}
