/*
 * Reqst cookie banner: the layout, timings and behaviour shared by every Reqst site.
 * Themes restyle it through the --reqst-consent-* properties, not by overriding rules.
 */
:root {
    --reqst-consent-bg: #fff;
    --reqst-consent-text: #131415;
    --reqst-consent-muted: rgba(19, 20, 21, .7);
    --reqst-consent-accent: #131415;
    --reqst-consent-accent-text: #fff;
    --reqst-consent-secondary-bg: #e5e5e8;
    --reqst-consent-secondary-text: #44444a;
    --reqst-consent-border: #e5e5e8;
    --reqst-consent-font: inherit;
    --reqst-consent-radius: 10px;
    --reqst-consent-button-radius: 7px;
    --reqst-consent-z: 10000;
    --reqst-consent-delay: 2s;
    /* Text sizes, to match the theme's scale; the -mobile ones apply under 600px. */
    --reqst-consent-title-size: 24px;
    --reqst-consent-title-size-mobile: 21px;
    --reqst-consent-subtitle-size: 18px;
    --reqst-consent-text-size: 16px;
    --reqst-consent-text-size-mobile: 14px;
    --reqst-consent-label-size: 17px;
    --reqst-consent-description-size: 14px;
    --reqst-consent-note-size: 13px;
    --reqst-consent-button-size: 16px;
    --reqst-consent-button-size-mobile: 14px;
    --reqst-consent-link-size: inherit;
}

.reqst-consent .banner {
    position: fixed;
    z-index: var(--reqst-consent-z);
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    width: 90%;
    max-width: 800px;
    max-height: 80dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 30px;
    border-radius: var(--reqst-consent-radius);
    background: var(--reqst-consent-bg);
    color: var(--reqst-consent-text);
    box-shadow: 0 8px 35px #0003;
    font-family: var(--reqst-consent-font);
    text-align: left;
    animation: reqst-consent-enter 1.5s var(--reqst-consent-delay) cubic-bezier(.22, 1, .36, 1) both;
}

.reqst-consent .banner[hidden],
.reqst-consent [hidden] { display: none; }
.reqst-consent .banner:focus { outline: none; }

.reqst-consent h2 { font-family: var(--reqst-consent-font); font-size: var(--reqst-consent-title-size); font-weight: 700; line-height: 1.3; letter-spacing: 0; color: inherit; margin: 0 0 20px; }
.reqst-consent h3 { font-family: var(--reqst-consent-font); font-size: var(--reqst-consent-subtitle-size); font-weight: 700; line-height: 1.4; letter-spacing: 0; color: inherit; margin: 24px 0 16px; }
.reqst-consent p { margin: 0; }
.reqst-consent a { color: var(--reqst-consent-muted); text-decoration: underline; }
.reqst-consent button,
.reqst-consent input { font: inherit; }
.reqst-consent button { cursor: pointer; border: 0; }
.reqst-consent button:focus-visible,
.reqst-consent a:focus-visible,
.reqst-consent input:focus-visible { outline: 3px solid var(--reqst-consent-accent); outline-offset: 4px; }
.reqst-consent input:focus-visible { outline-offset: -3px; }

.reqst-consent .reopened { animation-delay: 0s; }
.reqst-consent .closing { animation: reqst-consent-leave .75s ease-in-out both; }

@keyframes reqst-consent-enter {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes reqst-consent-leave {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(30px); }
}

.reqst-consent .body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--reqst-consent-accent) var(--reqst-consent-border);
}

.reqst-consent .intro { font-size: var(--reqst-consent-text-size); line-height: 1.55; }
.reqst-consent .settings { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .5s ease, opacity .5s ease; }
.reqst-consent .settings.open { grid-template-rows: 1fr; opacity: 1; }
.reqst-consent .preferences { overflow: hidden; min-height: 0; }

.reqst-consent .category { border-top: 1px solid var(--reqst-consent-border); padding: 16px 0; }
.reqst-consent .category label { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: var(--reqst-consent-label-size); font-weight: 700; cursor: pointer; }
.reqst-consent .category input { accent-color: var(--reqst-consent-accent); width: 20px; height: 20px; flex-shrink: 0; }
.reqst-consent .category p { margin-top: 8px; font-size: var(--reqst-consent-description-size); line-height: 1.5; }
.reqst-consent .providers,
.reqst-consent .retention { font-size: var(--reqst-consent-note-size); line-height: 1.5; color: var(--reqst-consent-muted); }
.reqst-consent .category .providers { margin-top: 6px; }

.reqst-consent .actions { flex-shrink: 0; background: var(--reqst-consent-bg); display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 15px; margin-top: 24px; }
.reqst-consent .customize { font-size: var(--reqst-consent-link-size); background: transparent; color: var(--reqst-consent-muted); padding: 14px 0; text-decoration: underline; }
.reqst-consent .accept,
.reqst-consent .refuse { align-self: stretch; padding: 16px 24px; min-width: 145px; border-radius: var(--reqst-consent-button-radius); font-size: var(--reqst-consent-button-size); }
.reqst-consent .accept { background: var(--reqst-consent-accent); color: var(--reqst-consent-accent-text); }
.reqst-consent .refuse { background: var(--reqst-consent-secondary-bg); color: var(--reqst-consent-secondary-text); }

@media (prefers-reduced-motion: reduce) {
    .reqst-consent .banner,
    .reqst-consent .closing { animation-duration: 1ms; animation-delay: 0s; }
    .reqst-consent .settings { transition: none; }
}

@media (max-width: 600px) {
    .reqst-consent .banner { width: 100%; bottom: 0; padding: 20px 15px; border-radius: var(--reqst-consent-radius) var(--reqst-consent-radius) 0 0; max-height: 85dvh; }
    .reqst-consent h2 { font-size: var(--reqst-consent-title-size-mobile); }
    .reqst-consent .intro { font-size: var(--reqst-consent-text-size-mobile); }
    .reqst-consent .actions { flex-direction: column; align-items: stretch; gap: 8px; }
    .reqst-consent .customize { width: 100%; }
    .reqst-consent .accept,
    .reqst-consent .refuse { width: 100%; min-width: 0; padding: 16px 10px; font-size: var(--reqst-consent-button-size-mobile); }
}

/* The "manage my cookies" links that reopen the banner, wherever they sit. */
button[data-cookie-open] {
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

button[data-cookie-open]:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
