/*
 * Site Builder 1.6.0 — page templates on foreign themes (Site_Builder_Page_Templates).
 * Everything is scoped to #sb-main / .sbx. Typography comes from the theme;
 * colours from the theme's own variables or measured link colour.
 */

/* ---- Colours: theme first, then neutral ---------------------------------- */
.sbx {
    --sbx-accent: var(--sbx-js-accent,
        var(--wp--preset--color--primary,
        var(--ast-global-color-0,
        var(--global-palette1,
        var(--accent, #2563eb)))));
    /* the block styles (sb-blocks) read these */
    --sb-color-link: var(--sbx-accent);
    --sb-color-accent: var(--sbx-accent);
    --sb-color-text: currentColor;
    --sb-color-muted: color-mix(in srgb, currentColor 68%, transparent);
    --sb-color-border: color-mix(in srgb, currentColor 16%, transparent);
    --sb-color-bg-alt: color-mix(in srgb, currentColor 5%, transparent);
    --sb-color-bg: transparent;
}

/* ---- Isolation from the theme's global rules ------------------------------
 * Themes style bare tags ("article { padding-left: 200px }",
 * "aside { display: flex }"). (0,1,0) beats those; our own block rules come
 * later with the same weight and win. */
.sbx,
.sbx :where(article, aside, section, nav, figure, header, footer, main) {
    display: block;
    float: none;
    position: static;
    width: auto;
    max-width: 100%;
    flex: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}
.sbx { width: 100%; margin: 0; padding: 0; }
.sbx *, .sbx *::before, .sbx *::after { box-sizing: border-box; }

.sbx .sbx-inner {
    max-width: min(100%, 960px);
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ---- Breadcrumbs, title, text --------------------------------------------- */
.sbx .sbx-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    font-size: .88em;
    color: var(--sb-color-muted);
}
.sbx .sbx-crumbs a { color: inherit; text-decoration: none; }
.sbx .sbx-crumbs a:hover { color: var(--sbx-accent); }
.sbx .sbx-crumbs-sep { opacity: .6; }
.sbx .sbx-title { margin: 0 0 24px; }
.sbx .sbx-content { display: block; }
.sbx .sbx-content img { max-width: 100%; height: auto; }
.sbx .sbx-content figure { margin: 0 0 1.5em; }
.sbx .sbx-content > :first-child { margin-top: 0; }

/* white text on the accent background: readable on light accents too */
.sbx .sb-block-step-num,
.sbx .sb-block-hero-label { color: var(--sbx-on-accent, #fff); }

/* ---- Cards (sections, hub) ------------------------------------------------- */
.sbx .sbx-block { margin: 40px 0 0; }
.sbx .sbx-h2 { margin: 0 0 16px; }
.sbx .sbx-h2 a { color: inherit; text-decoration: none; }
.sbx .sbx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.sbx a.sbx-card,
.sbx a.sbx-card:hover,
.sbx a.sbx-card:focus-visible {
    text-decoration: none !important;
    box-shadow: none;
}
.sbx a.sbx-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sb-color-border);
    border-radius: 10px;
    background: var(--sb-color-bg-alt);
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.sbx a.sbx-card:hover,
.sbx a.sbx-card:focus-visible {
    border-color: var(--sbx-accent);
    color: inherit;
    transform: translateY(-2px);
}
.sbx .sbx-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--sb-color-border);
}
.sbx .sbx-card-media img,
.sbx .sbx-card-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    margin: 0;
    border: 0;
    border-radius: 0;
}
.sbx .sbx-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}
.sbx .sbx-card-title { font-weight: 700; line-height: 1.3; color: var(--sbx-accent); }
.sbx .sbx-card-text { font-size: .9em; line-height: 1.5; color: var(--sb-color-muted); }
.sbx .sbx-card-meta { font-size: .8em; color: var(--sb-color-muted); }

/* ---- Pagination ------------------------------------------------------------ */
.sbx .sbx-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin: 28px 0 0;
}
.sbx .sbx-pager-link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--sb-color-border);
    border-radius: 6px;
    color: var(--sbx-accent);
    background: transparent;
    text-decoration: none !important;
}
.sbx a.sbx-pager-link:hover { border-color: var(--sbx-accent); }
.sbx .sbx-pager-link.is-disabled { color: var(--sb-color-muted); opacity: .5; }
.sbx .sbx-pager-pos { color: var(--sb-color-muted); }

@media (max-width: 560px) {
    .sbx .sbx-inner { padding: 16px 12px 32px; }
    .sbx .sbx-grid { grid-template-columns: minmax(0, 1fr); }
}
