/* Only the <button> variant is reset; the default <a> inherits the theme's link styles. */
button.ccgk-settings-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.ccgk-embed {
    width: 100%;
}

/*
 * Core's responsive embed block reserves the ratio with ::before padding and expects an absolutely positioned
 * iframe. Our placeholder (data-autoscale) and the fallback link are in normal flow -> drop the reserved space.
 * The leading .wp-embed-responsive keeps our selector more specific than core's, whatever the stylesheet order.
 */
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:has(> .ccgk-embed)::before,
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:has(> .ccgk-embed-fallback)::before,
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:has(> .ccgk-gated)::before {
    display: none;
}

#cc-main .pm__section-desc [data-ccgk-id] {
    font-family: monospace;
    word-break: break-all;
}

/*
 * Consent placeholder for content rendered by JavaScript (ccgk_placeholder()) and for held-back "Other embeds".
 * Same look as the iframemanager placeholders of videos and maps: their CSS variables (--im-*, set under
 * Appearance -> Placeholders), with the library defaults as fallback. It fills its container; give the container a
 * height (a map usually has one anyway).
 *
 * The markup sits in the theme's content, so general theme rules (".entry-content p", "button { … }") would leak in.
 * Like iframemanager, the parts are reset with "all: initial" and styled again; the doubled class keeps the rules
 * above typical theme selectors. To restyle on purpose, use the variables or these classes with more specificity.
 */
.ccgk-placeholder.ccgk-placeholder,
.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__notice,
.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__buttons,
.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__button {
    all: initial;
    box-sizing: border-box;
    font-family: var(--im-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
    line-height: 1.4;
}

.ccgk-placeholder.ccgk-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1em;
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 1.5em;
    background: var(--im-bg, #0b1016);
    color: var(--im-color, #fff);
    font-size: 15px;
    text-align: center;
}

.ccgk-placeholder.ccgk-placeholder[hidden] {
    display: none;
}

.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__notice {
    display: block;
    max-width: 32em;
    margin: 0;
    color: inherit;
    font-size: 0.9em;
}

.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6em;
    margin: 0;
}

.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__button {
    display: inline-block;
    padding: 0.75em 1.2em;
    border-radius: 0.4em;
    background: var(--im-btn-bg, rgba(0, 102, 219, 0.84));
    color: var(--im-btn-color, #fff);
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
}

.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__button:hover {
    background: var(--im-btn-hover-bg, rgba(9, 80, 161, 0.89));
}

.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__button:focus-visible {
    outline: 2px solid var(--im-btn-color, #fff);
    outline-offset: 2px;
}

/* "Always allow" next to "Load content": the secondary style of the iframemanager placeholders. */
.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__button--secondary {
    background: var(--im-btn-s-bg, rgba(225, 239, 255, 0.8));
    color: var(--im-btn-s-color, #0b1016);
}

.ccgk-placeholder.ccgk-placeholder .ccgk-placeholder__button--secondary:hover {
    background: var(--im-btn-s-hover-bg, rgba(225, 239, 255, 0.95));
}

/* Held-back "Other embeds" code: the placeholder takes the place of the embed. */
.ccgk-gated {
    width: 100%;
}
