/* ─────────────────────────────────────────────────────────────────────────────
   Guide landing (page-templates/guide.php) — design system frame around
   unchanged editor content (Gutenberg + classic blocks).
   ───────────────────────────────────────────────────────────────────────────── */

.sxg { display: block; background: #fff; color: var(--sx-ink); font-family: var(--sx-font-body); }
.sxg *, .sxg *::before, .sxg *::after { box-sizing: border-box; }
.sxg-section { padding: clamp(56px, 7vw, 96px) 0; }
.sxg-head { max-width: 760px; margin-bottom: clamp(24px, 3vw, 36px); }
.sxg .sxg-h2 { margin: 0; color: var(--sx-ink); font-size: clamp(30px, 3.4vw, 46px); }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.sxg-hero { position: relative; isolation: isolate; padding: clamp(44px, 6vw, 88px) 0 clamp(52px, 6vw, 88px); background: var(--sx-canvas); }
.sxg-hero__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }

.sxg-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; color: var(--sx-muted); font-size: 13.5px; }
.sxg-crumbs a { color: var(--sx-muted) !important; text-decoration: none !important; }
.sxg-crumbs a:hover { color: var(--sx-brand) !important; }
.sxg-crumbs [aria-current] { color: var(--sx-ink); font-weight: 600; }

.sxg .sxg-hero__title { max-width: 980px; margin: 0 0 20px; color: var(--sx-ink); font-size: clamp(36px, 4.6vw, 68px); }
.sxg-hero__lead { max-width: 820px; color: var(--sx-muted); font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.65; }
.sxg-hero__lead p { margin: 0; }
.sxg-hero__lead a { color: var(--sx-brand); font-weight: 600; }

.sxg-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; margin-top: 26px; color: var(--sx-muted); font-size: 14px; }
.sxg-author { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(35, 28, 80, .05), 0 10px 20px -16px rgba(35, 28, 80, .45); color: var(--sx-muted) !important; text-decoration: none !important; }
.sxg-author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--sx-tint); }
.sxg-author strong { color: var(--sx-ink); }
.sxg-author:hover strong { color: var(--sx-brand); }
.sxg-meta__item { display: inline-flex; align-items: center; gap: 8px; }
.sxg-meta__item::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--sx-lime); }

.sxg-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.sxg-actions .sx-btn { height: 52px; font-size: 16px; }
.sxg-actions .sx-btn--main { padding: 0 15px 0 26px; font-weight: 700; }
.sxg-actions .sx-btn--ghost { padding: 0 24px; }

/* Key facts (optional field) */
.sxg-facts { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 980px; margin: 40px 0 0; padding: 0; list-style: none; }
.sxg-facts:has(> :nth-child(3):last-child) { --n: 3; }
.sxg-facts:has(> :nth-child(2):last-child) { --n: 2; }
.sxg-fact { display: grid; align-content: start; gap: 6px; margin: 0; padding: 20px 18px; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(35, 28, 80, .05), 0 14px 28px -22px rgba(35, 28, 80, .45); text-align: left; }
.sxg-fact__value { color: var(--sx-brand-deep); font-family: var(--sx-font-title); font-size: clamp(28px, 2.8vw, 38px); font-weight: 400; line-height: 1; }
.sxg-fact__label { color: var(--sx-muted); font-size: 14px; line-height: 1.45; }
@media (max-width: 900px) { .sxg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Link cards (routes / next steps) ────────────────────────────────────── */

.sxg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.sxg-cards li { margin: 0; }

.sxg-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
    padding: 20px;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-radius);
    background: #fff;
    color: inherit !important;
    text-decoration: none !important;
    transition: transform .25s var(--sx-ease), box-shadow .25s ease, border-color .25s ease;
}

.sxg-card:hover { transform: translateY(-3px); border-color: rgba(101, 88, 153, .45); box-shadow: 0 18px 40px -24px rgba(35, 28, 80, .45); }
.sxg-card__icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: var(--sx-tint); color: var(--sx-brand-deep); }
.sxg-card__icon svg { width: 22px; height: 22px; }
.sxg-card__body { display: grid; flex: 1; gap: 4px; min-width: 0; }
.sxg-card__title { color: var(--sx-ink); font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.sxg-card__text { color: var(--sx-muted); font-size: 14px; line-height: 1.5; }
.sxg-card__arrow { align-self: center; color: var(--sx-brand); font-size: 18px; transition: transform .25s var(--sx-ease); }
.sxg-card:hover .sxg-card__arrow { transform: translateX(4px); }
.sxg-next { background: var(--sx-canvas); }

/* ── Body: sticky TOC + content ──────────────────────────────────────────── */

.sxg-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.sxg-body { padding-top: clamp(24px, 3vw, 40px); }
/* No TOC (fewer than 3 H2s): one centred reading column. */
.sxg-layout--single { grid-template-columns: minmax(0, 1fr); }
.sxg-layout--single .sxg-prose { width: 100%; max-width: 820px; margin: 0 auto; }

.sxg-toc {
    position: sticky;
    top: calc(var(--sx-bar-h) + 24px);
    max-height: calc(100vh - var(--sx-bar-h) - 48px);
    overflow-y: auto;
    padding: 22px 20px;
    border: 1px solid var(--sx-line);
    border-radius: 20px;
    background: #fff;
    scrollbar-width: thin;
}

.sxg-toc__title { margin: 0 0 12px; color: var(--sx-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sxg-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.sxg-toc li { margin: 0; counter-increment: toc; }

.sxg-toc ol a {
    position: relative;
    display: block;
    padding: 8px 10px 8px 34px;
    border-radius: 10px;
    color: var(--sx-muted) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}

.sxg-toc ol a::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 10px; top: 9px; color: #b5b8c7; font-size: 11.5px; font-weight: 700; }
.sxg-toc ol a:hover { background: var(--sx-canvas); color: var(--sx-ink) !important; }
.sxg-toc ol a.is-active { background: var(--sx-tint); color: var(--sx-brand-deep) !important; }
.sxg-toc ol a.is-active::before { color: var(--sx-brand); }
.sxg-toc__cta { display: block; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sx-line); color: var(--sx-brand) !important; font-size: 14px; font-weight: 700; text-decoration: none !important; }

/* Content typography */
.sxg-prose { max-width: 780px; color: var(--sx-ink); font-size: 17px; line-height: 1.75; }
.sxg-prose > *:first-child { margin-top: 0; }
.sxg-prose p { margin: 0 0 18px; }
.sxg-prose a { color: var(--sx-brand); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(101, 88, 153, .35); text-underline-offset: 3px; transition: text-decoration-color .2s ease; }
.sxg-prose a:hover { text-decoration-color: currentColor; }
.sxg-prose strong, .sxg-prose b { color: var(--sx-ink); }

.sxg-prose h2 {
    scroll-margin-top: calc(var(--sx-bar-h) + 24px);
    margin: 56px 0 18px;
    padding-top: 28px;
    border-top: 1px solid var(--sx-line);
    font-family: var(--sx-font-title);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 400;
    line-height: 1.1;
    color: var(--sx-ink);
}

/* H3/H4 use the body font: the theme's global heading rule (Anton) + 700 renders as a smeared faux-bold. */
.sxg .sxg-prose h3 {
    scroll-margin-top: calc(var(--sx-bar-h) + 24px);
    position: relative;
    margin: 36px 0 14px;
    padding-left: 16px;
    font-family: var(--sx-font-body);
    font-size: clamp(19px, 1.6vw, 22px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    color: var(--sx-ink);
}

.sxg .sxg-prose h3::before { content: ''; position: absolute; top: .2em; bottom: .2em; left: 0; width: 4px; border-radius: 4px; background: var(--sx-lime); }
.sxg .sxg-prose h4 { margin: 26px 0 10px; font-family: var(--sx-font-body); font-size: 18px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--sx-ink); }

.sxg-prose ul { margin: 0 0 20px; padding: 0; list-style: none; }
.sxg-prose ul li { position: relative; margin: 0 0 10px; padding-left: 32px; }
.sxg-prose ul li::before { content: ''; position: absolute; top: 6px; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--sx-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f2753' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 11px no-repeat; }
.sxg-prose ol { margin: 0 0 20px; padding-left: 24px; }
.sxg-prose ol li { margin: 0 0 10px; padding-left: 6px; }
.sxg-prose ol li::marker { color: var(--sx-brand); font-weight: 700; }

/* Quotes → callouts */
.sxg-prose blockquote,
.sxg-prose .wp-block-quote {
    position: relative;
    margin: 28px 0;
    padding: 22px 24px 22px 28px;
    border: 0;
    border-left: 4px solid var(--sx-lime);
    border-radius: 0 18px 18px 0;
    background: var(--sx-canvas);
    color: var(--sx-ink);
    font-size: 17px;
    font-style: normal;
}

.sxg-prose blockquote p { margin: 0 0 10px; }
.sxg-prose blockquote p:last-child { margin-bottom: 0; }
.sxg-prose blockquote cite { display: block; margin-top: 8px; color: var(--sx-muted); font-size: 14px; font-style: normal; }

/* Media */
.sxg-prose img { max-width: 100%; height: auto; border-radius: 16px; }
.sxg-prose figure { margin: 28px 0; }
.sxg-prose figure.aligncenter, .sxg-prose .aligncenter { margin-inline: auto; text-align: center; }
.sxg-prose figcaption { margin-top: 8px; color: var(--sx-muted); font-size: 14px; text-align: center; }
.sxg-prose .wp-block-embed__wrapper { position: relative; }

.sxg-video { position: relative; display: block; margin: 28px 0; overflow: hidden; border-radius: 20px; background: #1c1830; aspect-ratio: 16 / 9; }
.sxg-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sxg-video__btn { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.sxg-video__btn img { display: block; width: 100%; height: 100%; margin: 0; border-radius: 0; object-fit: cover; }

.sxg-video .sxt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232f2753'%3E%3Cpath d='M8.6 6.9v10.2c0 1 1.1 1.6 1.9 1l7.4-5.1c.7-.5.7-1.5 0-2L10.5 5.9c-.8-.6-1.9 0-1.9 1z'/%3E%3C/svg%3E") 55% center / 30px no-repeat;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, .28), 0 12px 26px rgba(0, 0, 0, .25);
    transform: translate(-50%, -50%);
    transition: transform .25s var(--sx-ease), box-shadow .25s ease;
}

.sxg-video__btn:hover .sxt-play { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 12px rgba(203, 220, 44, .45), 0 12px 26px rgba(0, 0, 0, .25); }

/* Tables */
.sxg-table { margin: 28px 0; overflow-x: auto; border: 1px solid var(--sx-line); border-radius: 18px; }
.sxg-prose table { width: 100%; min-width: 560px; margin: 0; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.sxg-prose th, .sxg-prose td { padding: 14px 16px; border: 0; border-bottom: 1px solid var(--sx-line); text-align: left; vertical-align: top; }
.sxg-prose tr:first-child td, .sxg-prose th { background: var(--sx-canvas); color: var(--sx-ink); font-weight: 700; }
.sxg-prose tr:last-child td { border-bottom: 0; }
.sxg-prose .wp-block-table { margin: 0; }

/* Contextual course CTA */
.sxg-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px 28px;
    align-items: center;
    margin: 40px 0 8px;
    padding: 28px 30px;
    border-radius: 24px;
    background: radial-gradient(120% 140% at 0% 0%, #6d5fae 0%, var(--sx-brand-mid) 35%, var(--sx-brand-deep) 100%);
    color: #fff;
}

.sxg-prose .sxg-cta p { margin: 0; }
.sxg-cta__eyebrow { margin-bottom: 6px !important; color: var(--sx-lime); font-size: 12px; font-weight: 700; letter-spacing: .14em; line-height: 1.3; text-transform: uppercase; }
.sxg-cta__title { margin-bottom: 8px !important; font-family: var(--sx-font-title); font-size: 26px; line-height: 1.1; color: #fff; }
.sxg-cta__text { color: rgba(255, 255, 255, .8); font-size: 15px; line-height: 1.55; }
.sxg-cta__actions { display: grid; gap: 10px; }
.sxg-prose .sxg-cta a { text-decoration: none; }
.sxg-cta__actions .sx-btn { height: 48px; justify-content: center; font-size: 15px; }
.sxg-cta__actions .sx-btn--main { justify-content: space-between; padding: 0 12px 0 22px; font-weight: 700; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .sxg-layout { grid-template-columns: minmax(0, 1fr); }
    .sxg-toc { position: static; max-height: none; }
    .sxg-toc ol { columns: 2 260px; column-gap: 16px; }
    .sxg-toc li { break-inside: avoid; }
    .sxg-prose { max-width: none; }
}

@media (max-width: 900px) {
    .sxg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sxg-cta { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .sxg-cards { grid-template-columns: minmax(0, 1fr); }
    .sxg-prose { font-size: 16.5px; }
    .sxg-cta { padding: 24px 20px; }
    .sxg-actions { flex-direction: column; align-self: stretch; }
    .sxg-actions .sx-btn { width: 100%; justify-content: center; }
    .sxg-actions .sx-btn--main { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
    .sxg * { transition: none !important; }
}
