/* ─────────────────────────────────────────────────────────────────────────────
   One button system.
   Every button that used to end in an arrow ("Enrol Now →") now uses the main
   CTA pattern: pill + 24px badge with a dot; on hover/focus the dot becomes a
   chevron. Covers the design-system buttons (.sx-btn--primary/ghost/glass with
   an arrow span) and the legacy families that draw the arrow with ::after:
   .hb-btn (home), .sg-page .sg-btn (study groups), a.arrow-right-btn (legacy
   templates, bottom banners, ACF buttons). Loaded last (inc/assets.php).
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    --sxb-deep: #2f2753;
    --sxb-brand: #655899;
    --sxb-lime: #cbdc2c;
    --sxb-chev-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f2753' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 17 14.5 12 9.5 7'/%3E%3C/svg%3E");
    --sxb-chev-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 17 14.5 12 9.5 7'/%3E%3C/svg%3E");
}

/* ── Variables per look (set on the button; the badge reads them) ───────────── */

/* A. dark violet (main) */
.sx-btn--primary,
.hb-btn--primary, .hb-btn--dark,
.sg-page .sg-btn--primary,
a.arrow-right-btn {
    --_bg: linear-gradient(180deg, #5b4e93 0%, #2f2753 100%);
    --_fg: #fff;
    --_dot: var(--sxb-lime);
    --_badge: var(--sxb-lime);
    --_chev: var(--sxb-chev-dark);
    --_shadow: rgba(47, 39, 83, .85);
}

/* B. lime (accent) */
.hb-btn--lime,
a.arrow-right-btn.green-btn {
    --_bg: linear-gradient(180deg, #d9e84f 0%, #bfcf1d 100%);
    --_fg: #232323;
    --_dot: var(--sxb-deep);
    --_badge: var(--sxb-deep);
    --_chev: var(--sxb-chev-light);
    --_shadow: rgba(160, 175, 20, .7);
}

/* C. secondary on light backgrounds (outline / soft / white) */
.sx-btn--ghost,
.hb-btn--ghost, .hb-btn--soft, .hb-btn--light,
.sg-page .sg-btn--ghost, .sg-page .sg-btn--secondary, .sg-page .sg-btn--outline,
a.arrow-right-btn.transparent-btn {
    --_dot: var(--sxb-brand);
    --_badge: var(--sxb-deep);
    --_chev: var(--sxb-chev-light);
}

/* D. secondary on dark backgrounds (glass / outline-light) */
.sx-btn--glass,
.hb-btn--outline-light {
    --_dot: var(--sxb-lime);
    --_badge: var(--sxb-lime);
    --_chev: var(--sxb-chev-dark);
}

/* ── Look of the dark / lime variants ───────────────────────────────────────── */
.sx-btn--primary,
.hb-btn--primary, .hb-btn--dark, .hb-btn--lime,
.sg-page .sg-btn--primary {
    background: var(--_bg);
    color: var(--_fg) !important;
    border-color: rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 22px -12px var(--_shadow);
}
.sx-btn--primary:hover, .hb-btn--primary:hover, .hb-btn--dark:hover, .hb-btn--lime:hover, .sg-page .sg-btn--primary:hover {
    background: var(--_bg);
}

/* ── Badge: arrow span inside .sx-btn ───────────────────────────────────────── */
.sx-btn > span[aria-hidden="true"]:last-child:not(.sx-btn__badge):not(:has(*)) {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    color: transparent;
    background: radial-gradient(circle, var(--_dot, var(--sxb-brand)) 0 4px, color-mix(in srgb, var(--_dot, var(--sxb-brand)) 22%, transparent) 4.5px 7px, transparent 7.5px);
    transition: background-color .3s ease;
}
.sx-btn:is(:hover, :focus-visible) > span[aria-hidden="true"]:last-child:not(.sx-btn__badge):not(:has(*)) {
    background: var(--_badge, var(--sxb-deep)) var(--_chev, var(--sxb-chev-light)) center / 16px 16px no-repeat;
}
.sx-btn:has(> span[aria-hidden="true"]:last-child:not(.sx-btn__badge):not(:has(*))) { gap: 12px; padding-right: 13px; }

/* ── Badge: legacy ::after arrows ───────────────────────────────────────────── */
.hb-btn::after,
.sg-page .sg-btn::after,
a.arrow-right-btn::after {
    content: '';
    position: static;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0 0 0 4px;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    left: auto;
    top: auto;
    background: radial-gradient(circle, var(--_dot, var(--sxb-brand)) 0 4px, color-mix(in srgb, var(--_dot, var(--sxb-brand)) 22%, transparent) 4.5px 7px, transparent 7.5px);
    transform: none;
    transition: background-color .3s ease;
}
.hb-btn:is(:hover, :focus-visible)::after,
.sg-page .sg-btn:is(:hover, :focus-visible)::after,
a.arrow-right-btn:is(:hover, :focus-visible)::after {
    background: var(--_badge, var(--sxb-deep)) var(--_chev, var(--sxb-chev-light)) center / 16px 16px no-repeat;
    transform: none;
}

/* ── Legacy a.arrow-right-btn (bottom banners, ACF buttons) ─────────────────── */
a.arrow-right-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    height: auto;
    padding: 6px 13px 6px 22px !important;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: var(--_bg) !important;
    color: var(--_fg) !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    text-transform: none;
    text-decoration: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 22px -12px var(--_shadow, rgba(47, 39, 83, .6));
    transition: box-shadow .2s ease, transform .2s ease;
}
a.arrow-right-btn:hover { transform: translateY(-1px); filter: none !important; }
a.arrow-right-btn.transparent-btn {
    --_bg: transparent;
    --_fg: var(--sxb-deep);
    border: 1.5px solid #d5d8e6;
    box-shadow: none;
}
.universal-page .bottom-banner-section .banner-actions a.arrow-right-btn { transform: none; }
.universal-page .bottom-banner-section .banner-actions a.arrow-right-btn:hover { transform: translateY(-1px); }
.universal-page .bottom-banner-section .banner-actions a.arrow-right-btn::after { left: auto; top: auto; }

/* ── Legacy .hb-btn / .sg-btn sizing with the badge ─────────────────────────── */
.hb-btn { gap: 10px; padding-right: 14px; }
.sg-page .sg-btn { gap: 10px; }

/* Motion off when the visitor asks for it. */
@media (prefers-reduced-motion: reduce) {
    .sx-btn > span[aria-hidden="true"]:last-child:not(.sx-btn__badge),
    .hb-btn::after, .sg-page .sg-btn::after, a.arrow-right-btn::after { transition: none; }
}

/* ── Sidebar buttons (.sidebar-button-item): editor colours replaced by the system look ── */
.sidebar-buttons a.sidebar-button-item {
    --_bg: linear-gradient(180deg, #5b4e93 0%, #2f2753 100%);
    --_fg: #fff;
    --_dot: var(--sxb-lime);
    --_badge: var(--sxb-lime);
    --_chev: var(--sxb-chev-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 13px 10px 22px;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: 999px;
    background: var(--_bg) !important;
    color: var(--_fg) !important;
    font-size: 15px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-decoration: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 22px -12px rgba(47, 39, 83, .85);
}
.sidebar-buttons a.sidebar-button-item:not(.solid) {
    --_fg: var(--sxb-deep);
    --_dot: var(--sxb-brand);
    --_badge: var(--sxb-deep);
    --_chev: var(--sxb-chev-light);
    border: 1.5px solid #d5d8e6 !important;
    background: #fff !important;
    box-shadow: none;
}
.sidebar-buttons a.sidebar-button-item span {
    display: block;
    position: static;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transform: none;
    background: radial-gradient(circle, var(--_dot) 0 4px, color-mix(in srgb, var(--_dot) 22%, transparent) 4.5px 7px, transparent 7.5px);
    transition: background-color .3s ease;
}
.sidebar-buttons a.sidebar-button-item span::after { content: none; }
.sidebar-buttons a.sidebar-button-item:is(:hover, :focus-visible) span {
    background: var(--_badge) var(--_chev) center / 16px 16px no-repeat;
}
@media screen and (max-width: 1024px) {
    .sidebar-buttons a.sidebar-button-item { width: 100%; max-width: 420px; padding: 10px 13px 10px 22px; }
}

/* Primary/ghost buttons without any badge markup (arrow was typed in the label): add the badge. */
.sx-btn--primary:not(.sx-btn--sm):not(:has(> .sx-btn__badge, > span[aria-hidden="true"]))::after {
    content: '';
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--_dot) 0 4px, color-mix(in srgb, var(--_dot) 22%, transparent) 4.5px 7px, transparent 7.5px);
    transition: background-color .3s ease;
}
.sx-btn--primary:not(.sx-btn--sm):not(:has(> .sx-btn__badge, > span[aria-hidden="true"])):is(:hover, :focus-visible)::after {
    background: var(--_badge) var(--_chev) center / 16px 16px no-repeat;
}

/* Guide sidebar CTA ("Questions? Talk to us →"): same dot → chevron badge. */
.sxg-toc__cta {
    --_dot: var(--sxb-brand);
    --_badge: var(--sxb-deep);
    --_chev: var(--sxb-chev-light);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.sxg-toc__cta > span[aria-hidden="true"]:last-child {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    color: transparent;
    background: radial-gradient(circle, var(--_dot) 0 4px, color-mix(in srgb, var(--_dot) 22%, transparent) 4.5px 7px, transparent 7.5px);
    transition: background-color .3s ease;
}
.sxg-toc__cta:is(:hover, :focus-visible) > span[aria-hidden="true"]:last-child {
    background: var(--_badge) var(--_chev) center / 16px 16px no-repeat;
}
