/*
 * What is left of this file after the banner took the original's looks.
 *
 * The box, its buttons, its checkboxes and the 550px column they sit in all
 * come from the consent stylesheet the build now carries — Borlabs' own,
 * renamed `_brlbs-` to `tkm-cc-` like every other ported prefix. Keeping a
 * second set of rules for the same elements would only have given the two
 * something to disagree about.
 *
 * These are the parts that were never the plugin's: the full-screen layer the
 * dialog sits on, and the placeholder that stands in for a blocked embed.
 */

.tkm-consent {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tkm-consent[hidden] {
    display: none;
}
.tkm-consent__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 45, 72, 0.45);
}

/* --- blocked embeds ----------------------------------------------------- */

/*
 * Shown in place of anything held back for want of consent, so a visitor can
 * see that something is there and load just that one item without agreeing to
 * the whole category.
 */
.tkm-consent-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 220px;
    padding: 24px;
    background: var(--tkm-global-color-e31f953, #f1ebe7);
    color: var(--tkm-global-color-primary, #002d48);
    text-align: center;
}

.tkm-consent-placeholder__text {
    margin: 0;
    font-size: 15px;
}

.tkm-consent-placeholder__button {
    padding: 0.6em 1.6em;
    border: 1px solid var(--tkm-global-color-secondary, #e30613);
    background: var(--tkm-global-color-secondary, #e30613);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}

/* The revoke link, wherever an editor puts it. */
.tkm-consent-revoke {
    cursor: pointer;
}

@media (max-width: 600px) {
    .tkm-consent__box {
        padding: 22px 18px;
    }

    .tkm-consent__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tkm-consent__settings {
        margin-left: 0;
        text-align: center;
    }
}

/* --- where the ported box meets this layer ------------------------------- */

/*
 * The design positions the dialog itself: its inner div is absolute with
 * `top: 50%`, measured against whatever is positioned above it. That was the
 * plugin's own full-screen element. Here the full-screen element is
 * `.tkm-consent` above, which already centres its child, so the two ways of
 * centring fought and the box landed half a screen right and low — measured at
 * 953px from the left on a 1920px window, with 550px of it off the edge.
 *
 * The layer wins, because it is the one that also draws the backdrop and holds
 * the dialog's hidden state. The ported rules keep everything else: the 550px
 * column, the white card, the green buttons, the checkbox indicators.
 */
.tkm-consent #tkm-consent-box {
    position: static;
    width: 100%;
    max-width: 550px;
}

.tkm-consent #tkm-consent-box > div {
    position: static;
    top: auto;
    width: 100%;
}

/* --- small screens -------------------------------------------------------- */

/*
 * The dialog is as tall as its content, and its content is a headline, a
 * sentence, two checkboxes and two buttons. On a short window — a phone in
 * landscape, or a browser with a lot of chrome — that is taller than the
 * screen, and a dialog whose buttons are past the bottom edge cannot be
 * answered at all.
 *
 * So it never exceeds the screen, and scrolls inside itself if it would.
 * `100dvh` rather than `100vh`: on a phone the address bar is part of `vh` and
 * is not part of what you can see.
 */
.tkm-consent {
    padding: 16px;
}

.tkm-consent #tkm-consent-box {
    max-height: calc(100dvh - 32px);
    display: flex;
}

.tkm-consent #tkm-consent-box > div,
.tkm-consent .tkm-cc-box-wrap,
.tkm-consent .tkm-cc-box {
    max-height: 100%;
}

.tkm-consent .tkm-cc-box {
    overflow-y: auto;
}

/* Below 480 the 20px the design keeps on either side of the card is a tenth of
   the screen. */
@media (max-width: 479px) {
    .tkm-consent {
        padding: 10px;
    }

    .tkm-consent #tkm-consent-box {
        max-height: calc(100dvh - 20px);
    }
}
