/*
 * CryptoPay core Gutenberg design system.
 * Shared by published page/post content and the block-editor canvas.
 * Scope prevents changing the already-approved coded landing pages.
 */
:is(.cp-gutenberg, .editor-styles-wrapper) {
    --cp-bg: var(--wp--preset--color--background, #1b1717);
    --cp-surface: var(--wp--preset--color--surface, #272626);
    --cp-surface-raised: var(--wp--preset--color--surface-raised, #32302f);
    --cp-foreground: var(--wp--preset--color--foreground, #f2fafa);
    --cp-muted: var(--wp--preset--color--muted, #b8b5b5);
    --cp-accent: var(--wp--preset--color--accent, #f27457);
    --cp-border: #ffffff26;
    --cp-radius: 20px;
    color: var(--cp-muted);
    font-family: 'Questrial', sans-serif;
    font-size: 18px;
    line-height: 1.75;
    overflow-wrap: break-word;
}

:is(.cp-gutenberg, .editor-styles-wrapper) :where(*, *::before, *::after) {
    box-sizing: border-box;
}

:is(.cp-gutenberg, .editor-styles-wrapper) :where(h1, h2, h3, h4, h5, h6) {
    color: var(--cp-foreground);
    font-family: 'Switzer-Variable', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

:is(.cp-gutenberg, .editor-styles-wrapper) h1 { font-size: clamp(2.25rem, 5vw, 4.5rem); }
:is(.cp-gutenberg, .editor-styles-wrapper) h2 { font-size: clamp(2rem, 4vw, 3rem); }
:is(.cp-gutenberg, .editor-styles-wrapper) h3 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
:is(.cp-gutenberg, .editor-styles-wrapper) h4 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); }
:is(.cp-gutenberg, .editor-styles-wrapper) h5 { font-size: 1.25rem; }
:is(.cp-gutenberg, .editor-styles-wrapper) h6 { font-size: 1rem; }

:is(.cp-gutenberg, .editor-styles-wrapper) :where(p, li, figcaption, cite, small):not(.has-text-color) {
    color: inherit;
}
:is(.cp-gutenberg, .editor-styles-wrapper) a:not(.wp-block-button__link):not(.has-text-color) {
    color: var(--cp-accent);
    text-underline-offset: 3px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) a:not(.wp-block-button__link):hover {
    text-decoration: underline;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(strong, b) { color: inherit; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(mark:not(.has-inline-color)) {
    color: var(--cp-foreground);
    background: var(--cp-surface-raised);
    border-radius: 4px;
    padding-inline: 3px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(ul, ol) {
    padding-inline-start: 1.7em;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(li + li) {
    margin-block-start: 0.35em;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(li::marker) {
    color: var(--cp-accent);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(img, svg, video, iframe) { max-width: 100%; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(img) { height: auto; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(figure) { max-width: 100%; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(figcaption, .wp-element-caption) {
    color: var(--cp-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-block-start: 12px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(code, kbd, samp) {
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 0.88em;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(:not(pre) > code) {
    color: var(--cp-foreground);
    background: var(--cp-surface);
    border-radius: 5px;
    padding: 0.12em 0.35em;
}

/* Respect native theme.json typography, spacing and color utility classes. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.has-background) {
    border-radius: 12px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.has-text-align-center) { text-align: center; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.has-text-align-right) { text-align: right; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.has-text-align-left) { text-align: left; }

/* Paragraphs, headings, lists and nested groups use Gutenberg's native gaps. */
.cp-page__content > * + * { margin-block-start: 24px; }
.cp-page__content > :is(h2, h3, h4, h5, h6) { margin-block-start: 48px; }
.cp-page__content > :first-child { margin-block-start: 0; }
.cp-page__content :where(.wp-block-group, .wp-block-columns) > * { min-width: 0; }

/* Images, galleries, media, audio and video. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-image img, .wp-block-gallery img, .wp-block-media-text img, .wp-block-post-featured-image img) {
    border-radius: var(--cp-radius);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-image.is-style-rounded img, .wp-block-image.is-style-cp-rounded img) { border-radius: 24px; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-gallery, .wp-block-columns) { gap: clamp(16px, 3vw, 30px); }
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-gallery figure.wp-block-image figcaption {
    margin-block: 0;
    border-radius: 0 0 var(--cp-radius) var(--cp-radius);
    background: linear-gradient(0deg, #1b1717d9, transparent);
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-media-text {
    gap: clamp(20px, 4vw, 45px);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-audio audio, .wp-block-video video) {
    display: block;
    width: 100%;
    border-radius: var(--cp-radius);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-embed.is-type-video iframe) {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--cp-radius);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-file) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-file__button) {
    background: var(--cp-accent);
    color: var(--cp-bg);
    border-radius: 10px;
    padding: 10px 20px;
    text-decoration: none;
}

/* Dark panels, cards, groups, rows and stack layouts. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-group.is-style-cp-panel:not(.has-background)) {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    padding: clamp(24px, 5vw, 48px);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-group.is-style-cp-panel) :where(h2, h3, h4) {
    margin-block-start: 0;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-cover {
    border-radius: var(--cp-radius);
    overflow: hidden;
    padding: clamp(30px, 5vw, 64px);
    min-height: 320px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-cover__inner-container :where(p, h1, h2, h3, h4, h5, h6):not(.has-text-color) {
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-cover__inner-container a:not(.wp-block-button__link) {
    color: var(--cp-foreground);
    text-decoration: underline;
}

/* Buttons: default accent, outline, soft and Gutenberg's existing outline style. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-buttons) {
    gap: 12px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 28px;
    background: var(--cp-accent);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--cp-bg);
    font-family: 'Switzer-Variable', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: normal;
    transition: background-color 0.2s, border-color 0.2s, filter 0.2s;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-button__link:hover {
    filter: brightness(1.12);
    text-decoration: none;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :is(.wp-block-button.is-style-outline, .wp-block-button.is-style-cp-ghost) > .wp-block-button__link:not(.has-background) {
    background: transparent;
    border-color: var(--cp-accent);
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-button.is-style-cp-soft > .wp-block-button__link:not(.has-background) {
    background: var(--cp-surface-raised);
    color: var(--cp-foreground);
    border-color: var(--cp-border);
}

/* Quotes, pullquotes, verse and preformatted/code blocks. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-quote, blockquote.wp-block-quote) {
    background: var(--cp-surface);
    border-inline-start: 3px solid var(--cp-accent);
    border-radius: 0 var(--cp-radius) var(--cp-radius) 0;
    padding: clamp(20px, 3vw, 32px);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-quote.is-style-cp-card) {
    background: var(--cp-surface-raised);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-quote cite, .wp-block-pullquote cite) {
    display: block;
    color: var(--cp-muted);
    font-size: 0.85rem;
    margin-block-start: 14px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-pullquote {
    border-block: 2px solid var(--cp-accent);
    border-inline: 0;
    color: var(--cp-foreground);
    padding: clamp(30px, 5vw, 60px) 20px;
    text-align: center;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-pullquote p) {
    color: var(--cp-foreground);
    font-family: 'Switzer-Variable', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-code, .wp-block-preformatted, pre.wp-block-verse) {
    max-width: 100%;
    overflow-x: auto;
    background: var(--cp-surface);
    color: var(--cp-foreground);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    padding: 22px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 0.85rem;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-code code {
    background: transparent;
    color: inherit;
    padding: 0;
    white-space: inherit;
}

/* Tables, separators and details / accordions. */
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    color: var(--cp-muted);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-table :where(th, td) {
    min-width: 80px;
    padding: 14px 18px;
    border: 1px solid var(--cp-border);
    text-align: start;
    vertical-align: top;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-table th {
    background: var(--cp-surface);
    color: var(--cp-foreground);
    font-weight: 600;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background: var(--cp-surface);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-table.is-style-cp-card table {
    border: 1px solid var(--cp-border);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-separator) {
    border: 0;
    border-top: 1px solid var(--cp-border);
    opacity: 1;
    margin-block: 40px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-separator.is-style-cp-accent {
    border-top: 3px solid var(--cp-accent);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-separator.is-style-dots::before {
    color: var(--cp-accent);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-details {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 12px;
    padding: 18px 24px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-details summary {
    cursor: pointer;
    font-family: 'Switzer-Variable', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-details[open] summary {
    color: var(--cp-accent);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-details > :not(summary) {
    margin-block-start: 16px;
}

/* Search, login, comment, navigation and post-loop form/utility core blocks. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(input:not([type='checkbox']):not([type='radio']), textarea, select) {
    max-width: 100%;
    min-height: 46px;
    padding: 12px 16px;
    border: 1px solid var(--cp-border);
    border-radius: 10px;
    background: var(--cp-surface);
    color: var(--cp-foreground);
    font: inherit;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(textarea) {
    width: 100%;
    min-height: 120px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(input::placeholder, textarea::placeholder) {
    color: var(--cp-muted);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(button:not(.components-button), input[type='submit'], .wp-block-search__button) {
    background: var(--cp-accent);
    color: var(--cp-bg);
    border: 0;
    border-radius: 10px;
    padding: 11px 20px;
    font: 600 16px 'Switzer-Variable', sans-serif;
    cursor: pointer;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-search__inside-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-search__input {
    flex: 1 1 220px;
    min-width: 0;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-latest-posts, .wp-block-categories-list, .wp-block-archives-list, .wp-block-rss, .wp-block-page-list) {
    padding-inline-start: 1.5rem;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-latest-posts li, .wp-block-rss li, .wp-block-categories-list li) {
    margin-block-end: 12px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-latest-posts__post-date, .wp-block-latest-comments__comment-date, .wp-block-post-date, .wp-block-post-author__byline) {
    color: var(--cp-muted);
    font-size: 0.82rem;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-post-template {
    gap: 24px;
    padding: 0;
    list-style: none;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-post-template > li {
    min-width: 0;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-post-template > li > .wp-block-group:not(.has-background) {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    background: var(--cp-surface);
    padding: 24px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-query-pagination, .wp-block-comments-pagination) {
    gap: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-calendar table, .wp-block-calendar th, .wp-block-calendar td) {
    border-color: var(--cp-border);
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-calendar th {
    background: var(--cp-surface);
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-social-links) { gap: 12px; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-social-link) { border-radius: 50%; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-navigation a) {
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-avatar img) { border-radius: 50%; }
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-loginout a) {
    color: var(--cp-accent);
}


/* Additional core widgets and post templates inherit the same dark controls. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-tag-cloud) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-tag-cloud a {
    display: inline-block;
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    padding: 5px 12px;
    text-decoration: none;
    font-size: 0.85rem;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-footnotes) {
    border-block-start: 1px solid var(--cp-border);
    padding-block-start: 20px;
    font-size: 0.86rem;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-footnotes li) {
    color: var(--cp-muted);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-post-title, .wp-block-query-title, .wp-block-site-title) {
    color: var(--cp-foreground);
    font-family: 'Switzer-Variable', sans-serif;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-post-excerpt, .wp-block-post-author, .wp-block-site-tagline, .wp-block-term-description) {
    color: var(--cp-muted);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-read-more, .wp-block-post-excerpt__more-link, .wp-block-comment-reply-link a) {
    color: var(--cp-accent);
    font-family: 'Switzer-Variable', sans-serif;
    font-weight: 600;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-comments-title, .wp-block-post-comments-title, .wp-block-post-comments-form .comment-reply-title) {
    color: var(--cp-foreground);
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-comment-template, .wp-block-latest-comments) {
    list-style: none;
    padding-inline-start: 0;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-comment-template > li, .wp-block-latest-comments > li) {
    border-block-end: 1px solid var(--cp-border);
    padding-block: 20px;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-shortcode, .wp-block-html) {
    max-width: 100%;
    overflow-wrap: anywhere;
}
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-spacer) {
    pointer-events: none;
}
@media (max-width: 767px) {
    :is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-media-text.is-stacked-on-mobile) {
        grid-template-columns: 100%;
    }
}

/* Inline links and inputs must remain keyboard-visible on dark backgrounds. */
:is(.cp-gutenberg, .editor-styles-wrapper) :where(a, button, input, select, textarea, summary):focus-visible,
:is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-button__link):focus-visible {
    outline: 2px solid var(--cp-accent);
    outline-offset: 4px;
}

/* Only direct top-level blocks can break out of the reading column. */
.cp-page__content {
    width: min(100%, 820px);
    margin-inline: auto;
}
.cp-page__content > .alignwide {
    width: min(1120px, calc(100vw - 32px));
    max-width: none;
    margin-inline: calc((100% - min(1120px, calc(100vw - 32px))) / 2);
}
.cp-page__content > .alignfull {
    width: 100vw;
    max-width: none;
    margin-inline: calc((100% - 100vw) / 2);
}
.cp-page__content > .alignleft { float: left; margin: 0 24px 24px 0; }
.cp-page__content > .alignright { float: right; margin: 0 0 24px 24px; }
.cp-page__content::after { content: ''; display: table; clear: both; }

/* Uncoded WordPress pages use the same dark hero language as About and Blog. */
.cp-page__hero.mil-banner-inner {
    min-height: 0;
    padding: clamp(150px, 16vw, 210px) 0 clamp(60px, 7vw, 100px);
    background: radial-gradient(ellipse at top right, #643c303d, transparent 65%);
}
.cp-page .cp-page__eyebrow {
    color: var(--wp--preset--color--accent, #f27457);
}
.cp-page__title {
    color: #f2fafa;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
    margin: 0;
}
.cp-page__summary {
    max-width: 750px;
    margin: 24px auto 0;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #b8b5b5;
    line-height: 1.65;
}
.cp-page__breadcrumbs {
    margin-block-start: 32px;
    padding: 0;
    flex-wrap: wrap;
    gap: 4px 0;
}
.cp-page__breadcrumbs > li:last-child {
    opacity: 1;
    color: #b8b5b5;
    cursor: default;
}
.cp-page__body {
    padding: 50px 0 130px;
}
.cp-page__cover {
    margin: 0 auto 56px;
    max-width: 1120px;
}
.cp-page__featured-image {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    border-radius: 24px;
}
.cp-page__content .cp-post-pages {
    margin-block-start: 40px;
}

/* Explicit foreground for text in core cover and user-chosen color utility classes. */
.cp-inner .cp-gutenberg .wp-block-cover__inner-container :is(p, h1, h2, h3, h4, h5, h6):not(.has-text-color) {
    color: #f2fafa;
}
.cp-inner .cp-gutenberg .wp-block-button__link:not(.has-text-color) {
    color: #f2fafa;
}

@media (max-width: 767px) {
    :is(.cp-gutenberg, .editor-styles-wrapper) {
        font-size: 16px;
    }
    .cp-page__hero.mil-banner-inner { padding: 130px 0 60px; }
    .cp-page__body { padding: 30px 0 90px; }
    .cp-page__breadcrumbs { justify-content: center; }
    .cp-page__content > :is(.alignleft, .alignright) {
        float: none;
        margin-inline: auto;
        max-width: 100%;
    }
    :is(.cp-gutenberg, .editor-styles-wrapper) :where(.wp-block-quote, .wp-block-code, .wp-block-preformatted) {
        padding: 18px;
    }
}
@media (prefers-reduced-motion: reduce) {
    :is(.cp-gutenberg, .editor-styles-wrapper) .wp-block-button__link {
        transition: none;
    }
}
