/*
 * Cookie banner (CookieConsent v3, web/js/satrunner-cookie-consent.js) in the Satrunner look.
 * Desktop and tablet: a floating bar 48px from the bottom and sides, at most 1372px wide (the site
 * container) and centred. Phones (448px and narrower): a full-screen window with a 16px gutter over a dimmed page.
 * Selectors start with #cc-main to win over the library's own stylesheet; some of its phone rules
 * use !important, so the matching rules here do too.
 */
#cc-main {
    --cc-font-family: 'Montserrat', sans-serif;
    --cc-bg: #ffffff;
    --cc-primary-color: #1f2328;
    --cc-secondary-color: #555555;
    --cc-link-color: #f26a21;
    --cc-btn-border-radius: 4px;
    --cc-modal-border-radius: 8px;
    --cc-separator-border-color: #e5e5e5;
    --cc-btn-primary-bg: #1f2328;
    --cc-btn-primary-color: #ffffff;
    --cc-btn-primary-border-color: #1f2328;
    --cc-btn-primary-hover-bg: #f26a21;
    --cc-btn-primary-hover-color: #ffffff;
    --cc-btn-primary-hover-border-color: #f26a21;
    --cc-btn-secondary-bg: #ffffff;
    --cc-btn-secondary-color: #1f2328;
    --cc-btn-secondary-border-color: #1f2328;
    --cc-btn-secondary-hover-bg: #f6f6f6;
    --cc-btn-secondary-hover-color: #1f2328;
    --cc-btn-secondary-hover-border-color: #1f2328;
    --cc-toggle-on-bg: #f26a21;
    --cc-footer-bg: #ffffff;
    --cc-footer-border-color: #e5e5e5;
    --cc-footer-color: #555555;
    --cc-overlay-bg: rgba(0, 0, 0, 0.55);
}

/* ---------- Bar (449px and wider) ---------- */
#cc-main .cm.cm--bar {
    right: max(48px, calc((100% - 1372px) / 2));
    bottom: 48px;
    left: max(48px, calc((100% - 1372px) / 2));
    width: auto !important;
    max-width: none !important;
    border: 1px solid #e5e5e5;
    border-radius: var(--cc-modal-border-radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

#cc-main .cm--bar.cm--inline .cm__body,
#cc-main .cm--bar .cm__footer {
    box-sizing: border-box;
    max-width: none;
    padding-right: 32px;
    padding-left: 32px;
}

#cc-main .cm--bar.cm--inline .cm__body {
    align-items: center;
    gap: 32px;
    padding-top: 28px;
    padding-bottom: 16px;
}

#cc-main .cm--bar .cm__texts {
    padding: 0;
}

#cc-main .cm--bar .cm__title,
#cc-main .cm--bar .cm__desc {
    padding: 0;
}

#cc-main .cm--bar .cm__title {
    margin-bottom: 4px;
    font-family: 'Barlow', sans-serif;
    font-size: 2rem;
    font-weight: 600;
}

#cc-main .cm--bar .cm__desc {
    max-width: 72ch;
    font-size: 1.6rem;
    line-height: 1.6;
}

#cc-main .cm--bar.cm--inline .cm__btns {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    max-width: none;
    padding: 0;
}

#cc-main .cm--bar .cm__btn-group {
    display: flex;
    gap: 8px;
}

#cc-main .cm--bar .cm__btn,
#cc-main .cm--bar .cm__btn + .cm__btn,
#cc-main .cm--bar .cm__btn-group + .cm__btn-group {
    margin: 0;
    white-space: nowrap;
}

#cc-main .cm--bar .cm__footer {
    padding-top: 0;
    padding-bottom: 24px;
    border-top: 0;
}

/* The library keeps the links in a narrower centred box of their own; line them up with the text */
#cc-main .cm--bar .cm__links {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Tablet: text above, buttons below, so nothing gets squeezed */
@media (max-width: 1023px) and (min-width: 449px) {
    #cc-main .cm--bar.cm--inline .cm__body {
        flex-direction: column !important;
        align-items: stretch;
        gap: 16px;
    }

    #cc-main .cm--bar.cm--inline .cm__btns {
        flex-direction: row !important;
        justify-content: flex-start;
        padding: 0 !important;
        border-top: 0 !important;
    }
}

/* ---------- Phones (448px and narrower): full-screen window with a 16px gutter ---------- */
@media (max-width: 448px) {
    .show--consent #cc-main::before {
        content: '';
        position: fixed;
        inset: 0;
        background: var(--cc-overlay-bg);
    }

    #cc-main .cm.cm--bar {
        top: 16px;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto !important;
        max-width: none !important;
        border: 0;
        overflow-y: auto;
    }

    #cc-main .cm--bar.cm--inline .cm__body {
        flex: 1;
        flex-direction: column !important;
        justify-content: space-between;
        gap: 24px;
        padding: 24px 20px 16px !important;
    }

    /* Text from the top, buttons at the bottom */
    #cc-main .cm--bar .cm__texts {
        justify-content: flex-start;
    }

    #cc-main .cm--bar .cm__title,
    #cc-main .cm--bar .cm__desc {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    #cc-main .cm--bar .cm__title {
        font-size: 2.4rem;
    }

    #cc-main .cm--bar.cm--inline .cm__btns,
    #cc-main .cm--bar .cm__btn-group {
        flex-direction: column !important;
        align-items: stretch;
        width: 100%;
        padding: 0 !important;
        border-top: 0 !important;
    }

    #cc-main .cm--bar .cm__btn {
        width: 100%;
    }

    #cc-main .cm--bar .cm__footer {
        padding: 0 20px 20px;
    }
}
