/*
 * GDPR multisite presentation layer.
 *
 * Every popup receives:
 * .gdpr-cookie-consent
 * .gdpr-site-{site-handle}
 */


/* ================================================================
 * Shared
 * ================================================================ */

.gdpr-cookie-consent {
    box-sizing: border-box;
    font-family: inherit;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
}

.gdpr-cookie-consent *,
.gdpr-cookie-consent *::before,
.gdpr-cookie-consent *::after {
    box-sizing: border-box;
}

.gdpr-cookie-consent .cc-message {
    margin: 0;
    line-height: 1.5;
}

.gdpr-cookie-consent .cc-link {
    padding: 0;
    text-underline-offset: 0.18em;
}

.gdpr-cookie-consent .cc-compliance {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gdpr-cookie-consent .cc-highlight .cc-btn + .cc-btn {
    margin-left: 0;
}


/* ================================================================
 * Hypersquare Design
 * ================================================================ */

.gdpr-cookie-consent.gdpr-site-hypersquare {
    /*
     * Keep this above the fixed Hypersquare copyright overlay.
     */
    z-index: 2147483647 !important;

    color: var(--color-text-main);

    font-family:
        'Montserrat',
        Arial,
        Helvetica,
        sans-serif;
}


/* ================================================================
 * DESKTOP / TABLET
 *
 * Restore the original bottom-centered horizontal banner.
 *
 * We deliberately normalize both .cc-banner and .cc-floating because
 * CookieConsent can choose either class depending on its configuration
 * and user agent.
 * ================================================================ */

.gdpr-cookie-consent.gdpr-site-hypersquare.cc-banner,
.gdpr-cookie-consent.gdpr-site-hypersquare.cc-floating {
    position: fixed;
    z-index: 3147483660;

    top: auto !important;
    right: auto !important;
    bottom: 16px !important;
    left: 50% !important;

    display: flex;

    flex-direction: row;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: space-between;

    width: calc(100% - 32px);
    max-width: 1200px;

    margin: 0;

    padding: 18px 18px 18px 32px;

    gap: 18px;

    transform: translateX(-50%);

    /*
     * Same geometry as extending a normal Hypersquare pill button.
     */
    border-radius: var(--hypersquare-button-radius);

    text-align: left;

    overflow: hidden;
}


/* ------------------------------------------------
 * Message
 * ------------------------------------------------ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-message {
    flex: 1 1 auto;

    min-width: 0;

    margin: 0 !important;

    text-align: left;
}


/* ------------------------------------------------
 * Compliance / button group
 * ------------------------------------------------ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-compliance {
    display: flex;

    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: flex-end;

    width: auto;

    gap: 8px;
}


/* ------------------------------------------------
 * Links
 * ------------------------------------------------ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-link,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-link:active,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-link:visited {
    color: var(--color-text-link);

    opacity: 1;

    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;

    transition:
        color 160ms ease,
        text-decoration-color 160ms ease;
}

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-link:hover,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-link:focus-visible {
    color: var(--color-primary-soft);
    text-decoration-color: var(--color-primary-soft);
}


/* ================================================================
 * Buttons
 *
 * Type:
 * primary / secondary
 *
 * Size:
 * small
 * ================================================================ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn {
    appearance: none;

    position: relative;

    display: inline-flex;

    flex: 0 0 auto;

    align-items: center;
    justify-content: center;

    width: auto;
    min-width: 0;
    min-height: var(--hypersquare-button-small-height, 40px);

    margin: 0;

    padding:
        0
        var(--hypersquare-button-small-padding-inline, 14px);

    gap: var(
        --hypersquare-button-small-gap,
        var(--hypersquare-button-gap)
    );

    border: 0;
    border-radius: var(--hypersquare-button-radius);

    font-family:
        'Montserrat',
        Arial,
        Helvetica,
        sans-serif;

    font-size: var(
        --hypersquare-button-small-font-size,
        13px
    );

    font-weight: 600;
    line-height: 1;

    letter-spacing: 0.045em;

    text-transform: uppercase;
    text-decoration: none;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 160ms ease,
        color 160ms ease;
}


/* ------------------------------------------------
 * Primary
 * ------------------------------------------------ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-allow,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-dismiss {
    border-color: transparent;

    background: var(--color-text-soft);
    color: var(--color-bg-deep);
}

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-allow:hover,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-allow:focus-visible,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-dismiss:hover,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-dismiss:focus-visible {
    background: var(--color-text-heading);
    color: var(--color-bg-deep);

    text-decoration: none;
}


/* ------------------------------------------------
 * Secondary
 * ------------------------------------------------ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-deny {
    border-color: transparent;

    background: transparent;
    color: var(--color-text-soft);
}

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-deny:hover,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn.cc-deny:focus-visible {
    background:
        color-mix(
            in srgb,
            var(--color-text-heading) 20%,
            transparent
        );

    color: var(--color-text-heading);

    text-decoration: none;
}


/* ------------------------------------------------
 * Focus
 * ------------------------------------------------ */

.gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn:focus-visible,
.gdpr-cookie-consent.gdpr-site-hypersquare .cc-link:focus-visible {
    outline: 2px solid var(--color-primary-soft);
    outline-offset: 2px;
}


/* ================================================================
 * MOBILE
 *
 * Only the major content groups stack:
 *
 * MESSAGE
 * BUTTON GROUP
 *
 * Buttons themselves remain in one row until they physically
 * cannot fit. Then flex-wrap moves one naturally to the next line.
 * ================================================================ */

@media (max-width: 800px) {

    .gdpr-cookie-consent.gdpr-site-hypersquare.cc-banner,
    .gdpr-cookie-consent.gdpr-site-hypersquare.cc-floating {
        top: auto !important;
        right: auto !important;
        bottom: 10px !important;
        left: 50% !important;

        flex-direction: column;
        flex-wrap: nowrap;

        align-items: center;
        justify-content: center;

        width: calc(100% - 20px);
        max-width: none;
        min-width: 260px;

        padding: 16px;

        gap: 12px;

        transform: translateX(-50%);

        /*
         * Use the visible curvature of the small button here.
         *
         * Do NOT use 999px on a tall stacked card.
         */
        border-radius:
            calc(
                var(--hypersquare-button-small-height, 56px)
                / 2
            );

        text-align: center;
    }

    .gdpr-cookie-consent.gdpr-site-hypersquare .cc-message {
        flex: 0 1 auto;

        width: 100%;

        margin: 12px !important;

        text-align: center;
    }

    .gdpr-cookie-consent.gdpr-site-hypersquare .cc-compliance {
        display: flex;

        flex: 0 1 auto;
        flex-direction: row;
        flex-wrap: wrap;

        align-items: center;
        justify-content: center;

        width: auto;
        max-width: 100%;

        gap: 8px;
    }

    .gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn {
        flex: 0 0 auto;

        width: auto;

        min-width: 0;
        min-height:
            var(
                --hypersquare-button-small-height,
                40px
            );

        margin: 0;
    }

    .gdpr-cookie-consent.gdpr-site-hypersquare .cc-btn + .cc-btn {
        margin-left: 0;
    }
}