/* BankBridge Demo theme — layout and components on top of theme.json tokens. */
:root {
	--bb-brand: var(--wp--preset--color--brand, #0a6cc8);
	--bb-brand-dark: var(--wp--preset--color--brand-dark, #0853a0);
	--bb-brand-soft: var(--wp--preset--color--brand-soft, #eaf3fd);
	--bb-ink: var(--wp--preset--color--ink, #0f172a);
	--bb-slate: var(--wp--preset--color--slate, #475569);
	--bb-line: var(--wp--preset--color--line, #e2e8f0);
	--bb-surface: var(--wp--preset--color--surface, #f8fafc);
	--bb-radius: 14px;
	--bb-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .18);
	--bb-shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 18px 40px -16px rgba(10, 108, 200, .35);
	--bb-gutter: clamp(16px, 4vw, 32px);
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > main, .wp-site-blocks > .bb-main, .wp-site-blocks > .wp-block-group.bb-home { flex: 1; }
.wp-site-blocks > * + * { margin-block-start: 0; }
:where(a) { text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--bb-brand); outline-offset: 2px; border-radius: 6px; }
.bb-wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--bb-gutter); }

/* Buttons ------------------------------------------------------------- */
.bb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 10px; background: var(--bb-brand); color: #fff !important; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: background .15s, transform .15s, box-shadow .15s; box-shadow: 0 6px 16px -8px rgba(10, 108, 200, .7); }
.bb-btn:hover { background: var(--bb-brand-dark); transform: translateY(-1px); }
.bb-btn--ghost { background: #fff; color: var(--bb-ink) !important; border-color: var(--bb-line); box-shadow: none; }
.bb-btn--ghost:hover { background: var(--bb-surface); border-color: #cbd5e1; }
.bb-btn--sm { min-height: 36px; padding: 0 14px; font-size: .9rem; box-shadow: none; }

/* Header -------------------------------------------------------------- */
.bb-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--bb-line); padding: 0 !important; }
.admin-bar .bb-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .bb-header { top: 0; position: relative; } }
.bb-header__inner { min-height: 68px; padding: 0 var(--bb-gutter); max-width: 1180px; margin: 0 auto !important; gap: 24px; }
.bb-header__nav { gap: 18px; align-items: center; }
.bb-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bb-ink); font-weight: 750; font-size: 1.08rem; letter-spacing: -.01em; white-space: nowrap; }
.bb-logo__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #0a6cc8, #0b8de0); box-shadow: 0 6px 14px -6px rgba(10, 108, 200, .8); }
.bb-logo em { font-style: normal; color: var(--bb-slate); font-weight: 500; }
.bb-nav .wp-block-navigation-item__content { color: var(--bb-ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.bb-nav .wp-block-navigation-item__content:hover { background: var(--bb-surface); color: var(--bb-brand); }
.bb-nav .current-menu-item > .wp-block-navigation-item__content, .bb-nav [aria-current="page"] { color: var(--bb-brand); }
.bb-nav .wp-block-navigation__submenu-container { border: 1px solid var(--bb-line) !important; border-radius: 12px; padding: 8px !important; box-shadow: var(--bb-shadow); min-width: 300px !important; background: #fff !important; }
.bb-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 10px 12px; }
.bb-nav.wp-block-navigation { gap: 4px; }
.bb-sandbox-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 7px var(--bb-gutter); background: #fff8e6; border-top: 1px solid #f6e3b0; color: #6b4a00; font-size: .85rem; text-align: center; }
.bb-sandbox-bar code { background: #fff; border: 1px solid #f1d58a; padding: 1px 6px; border-radius: 6px; font-size: .82rem; color: #4a3300; }
.bb-sandbox-bar a { color: #6b4a00; font-weight: 600; }
.bb-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #f6b100; color: #3a2800; font-weight: 700; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 860px) { .bb-header__nav .bb-btn { display: none; } }

/* Page heads ---------------------------------------------------------- */
.bb-main { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(48px, 7vw, 88px); }
.bb-page-head { margin-bottom: clamp(20px, 3vw, 32px); }
.bb-page-head .wp-block-post-title { margin: 6px 0 0; }
.bb-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--bb-slate); }
.bb-crumbs a { color: var(--bb-slate); text-decoration: none; }
.bb-crumbs a:hover { color: var(--bb-brand); }
.bb-crumbs span { color: #cbd5e1; }
.bb-main--hub .wp-block-post-content > p:first-child, .bb-lead { font-size: 1.2rem; color: var(--bb-slate); max-width: 760px; }

/* Home ---------------------------------------------------------------- */
.bb-hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px); background: radial-gradient(900px 420px at 85% -10%, #dbeafe 0%, rgba(219, 234, 254, 0) 70%), radial-gradient(700px 380px at -10% 110%, #e0f2fe 0%, rgba(224, 242, 254, 0) 70%), #fff; border-bottom: 1px solid var(--bb-line); }
.bb-hero__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.bb-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--bb-brand-soft); color: var(--bb-brand-dark); font-weight: 600; font-size: .85rem; }
.bb-hero h1 { font-size: var(--wp--preset--font-size--display); line-height: 1.06; letter-spacing: -.035em; margin: 18px 0 18px; }
.bb-hero__lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--bb-slate); max-width: 600px; margin: 0 0 28px; }
.bb-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.bb-login-card { background: #fff; border: 1px solid var(--bb-line); border-radius: 18px; padding: 24px; box-shadow: var(--bb-shadow); }
.bb-login-card__head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 14px; }
.bb-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 4px #dcfce7; }
.bb-login-card dl { margin: 0; display: grid; gap: 2px; }
.bb-login-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--bb-line); }
.bb-login-card dt { color: var(--bb-slate); }
.bb-login-card dd { margin: 0; font-weight: 600; }
.bb-login-card code, .bb-guide code, .bb-docs-body :not(pre) > code, .wp-block-post-content :not(pre) > code { background: var(--bb-surface); border: 1px solid var(--bb-line); padding: 1px 6px; border-radius: 6px; font-size: .88em; font-family: var(--wp--preset--font-family--mono); }
.bb-login-card p { margin: 14px 0 0; font-size: .9rem; color: var(--bb-slate); }
.bb-section { padding: clamp(48px, 7vw, 88px) 0; }
.bb-section--alt { background: var(--bb-surface); border-top: 1px solid var(--bb-line); border-bottom: 1px solid var(--bb-line); }
.bb-section__head { max-width: 680px; margin-bottom: 28px; }
.bb-section__head h2 { margin: 0 0 8px; font-size: var(--wp--preset--font-size--xx-large); }
.bb-section__head p { margin: 0; color: var(--bb-slate); font-size: 1.1rem; }
.bb-steps-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.bb-steps-row h3 { margin: 12px 0 6px; }
.bb-steps-row p { margin: 0; color: var(--bb-slate); }
.bb-step-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bb-brand); color: #fff; font-weight: 700; }
.bb-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.bb-panel { display: block; padding: 32px; border-radius: 18px; text-decoration: none; color: var(--bb-ink); border: 1px solid var(--bb-line); background: linear-gradient(180deg, #fff, var(--bb-surface)); transition: box-shadow .2s, transform .2s, border-color .2s; }
.bb-panel:hover { box-shadow: var(--bb-shadow-hover); transform: translateY(-2px); border-color: #bfdbfe; }
.bb-panel h2 { margin: 0 0 8px; }
.bb-panel p { color: var(--bb-slate); margin: 0 0 16px; }

/* Tiles (home + hubs) ------------------------------------------------- */
.bb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.bb-tile { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: var(--bb-radius); background: #fff; border: 1px solid var(--bb-line); text-decoration: none; color: var(--bb-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: box-shadow .2s, transform .2s, border-color .2s; }
.bb-tile:hover { box-shadow: var(--bb-shadow-hover); transform: translateY(-3px); border-color: #bfdbfe; }
.bb-tile h3 { margin: 14px 0 6px; font-size: 1.15rem; }
.bb-tile p { margin: 0 0 16px; color: var(--bb-slate); font-size: .96rem; flex: 1; }
.bb-tile__icon, .bb-tile__num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bb-brand-soft); color: var(--bb-brand); font-weight: 800; font-size: 1.15rem; }
.bb-tile__more { color: var(--bb-brand); font-weight: 600; font-size: .95rem; }
.bb-tile--wide { grid-column: 1 / -1; background: linear-gradient(120deg, #0a6cc8, #0b8de0); color: #fff; border: 0; }
.bb-tile--wide p, .bb-tile--wide .bb-tile__more { color: rgba(255, 255, 255, .92); }
.bb-tile--wide .bb-tile__icon { background: rgba(255, 255, 255, .18); color: #fff; }
.bb-tiles--hub { margin-top: 28px; }

/* Demo pages ---------------------------------------------------------- */
.bb-demo-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.bb-demo-guide { position: sticky; top: 140px; }
.bb-guide { background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: var(--bb-radius); padding: 22px 22px 8px; font-size: .97rem; }
.bb-guide > *:first-child { margin-top: 0; }
.bb-guide h2, .bb-guide h3 { font-size: 1.05rem; margin: 18px 0 8px; }
.bb-demo-stage { min-width: 0; }
.bb-demo-stage .wp-block-post-content { padding: clamp(16px, 3vw, 28px); border-radius: 18px; background: radial-gradient(600px 220px at 100% 0, #eff6ff, rgba(239, 246, 255, 0) 70%), #fff; border: 1px solid var(--bb-line); box-shadow: var(--bb-shadow); }
.bb-demo-stage .wp-block-post-content > * { max-width: none !important; }
.bb-more { margin-top: clamp(32px, 5vw, 56px); padding-top: 28px; border-top: 1px solid var(--bb-line); }
.bb-more h2 { font-size: 1.15rem; margin: 0 0 14px; }
.bb-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.bb-chip { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: var(--bb-brand-soft); color: var(--bb-brand-dark); text-decoration: none; font-weight: 600; font-size: .92rem; }
.bb-chip:hover { background: #dbeafe; }
.bb-chip--ghost { background: #fff; border: 1px solid var(--bb-line); color: var(--bb-ink); }
@media (max-width: 900px) { .bb-demo-layout { grid-template-columns: 1fr; } .bb-demo-guide { position: static; } }

/* Docs ---------------------------------------------------------------- */
.bb-docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.bb-docs-nav { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow: auto; padding-right: 8px; font-size: .94rem; }
.bb-docs-nav ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--bb-line); }
.bb-docs-nav li a { display: block; padding: 7px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--bb-slate); text-decoration: none; }
.bb-docs-nav li a:hover { color: var(--bb-ink); }
.bb-docs-nav a[aria-current="page"] { color: var(--bb-brand); font-weight: 600; border-left-color: var(--bb-brand); }
.bb-docs-nav__title { margin: 0 0 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.bb-docs-nav__title a { color: var(--bb-ink); text-decoration: none; }
.bb-docs-nav__switch { margin-top: 18px; font-size: .9rem; }
.bb-docs-body { min-width: 0; max-width: 820px; }
.bb-docs-body .wp-block-post-title { margin: 8px 0 18px; }
.bb-docs-body h2 { margin-top: 2.2em; padding-top: .4em; border-top: 1px solid var(--bb-line); }
.bb-docs-body h2:first-of-type { border-top: 0; }
.bb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.bb-pager a { display: block; padding: 16px 18px; border: 1px solid var(--bb-line); border-radius: 12px; text-decoration: none; color: var(--bb-ink); font-weight: 600; }
.bb-pager a:hover { border-color: #bfdbfe; box-shadow: var(--bb-shadow); }
.bb-pager span { display: block; font-size: .8rem; color: var(--bb-slate); font-weight: 500; }
.bb-pager__next { text-align: right; }
@media (max-width: 900px) { .bb-docs-layout { grid-template-columns: 1fr; } .bb-docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--bb-line); padding-bottom: 12px; } }

/* Content components (used by docs/testing/demo intros) ------------------- */
.bb-callout { border-radius: 12px; padding: 16px 18px !important; border: 1px solid #bfdbfe; background: #eff6ff; margin-block: 1.25rem; }
.bb-callout > *:first-child { margin-top: 0; }
.bb-callout > *:last-child { margin-bottom: 0; }
.bb-callout--warn { background: #fff8e6; border-color: #f6e3b0; }
.bb-callout--success { background: #ecfdf3; border-color: #bbf7d0; }
.bb-steps { counter-reset: bbstep; list-style: none; padding-left: 0 !important; }
.bb-steps > li { counter-increment: bbstep; position: relative; padding: 2px 0 12px 42px; }
.bb-steps > li::before { content: counter(bbstep); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bb-brand); color: #fff; font-weight: 700; font-size: .85rem; }
.bb-cards, .wp-block-group.bb-cards { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.bb-card { border: 1px solid var(--bb-line); border-radius: 12px; padding: 18px !important; background: #fff; transition: box-shadow .2s, border-color .2s; margin: 0 !important; }
.bb-card:hover { border-color: #bfdbfe; box-shadow: var(--bb-shadow); }
.bb-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.bb-card p { margin: 0; color: var(--bb-slate); font-size: .95rem; }
.bb-table table, .wp-block-table table { border-collapse: separate; border-spacing: 0; width: 100%; border: 1px solid var(--bb-line); border-radius: 12px; overflow: hidden; font-size: .94rem; }
.wp-block-table { overflow-x: auto; }
.wp-block-table th { background: var(--bb-surface); text-align: left; font-weight: 600; }
.wp-block-table th, .wp-block-table td { padding: 10px 14px; border: 0; border-bottom: 1px solid var(--bb-line); vertical-align: top; }
.wp-block-table tr:last-child td { border-bottom: 0; }
.wp-block-code { overflow-x: auto; }
.wp-block-details { border: 1px solid var(--bb-line); border-radius: 12px; padding: 14px 18px; margin-block: 10px; }
.wp-block-details summary { cursor: pointer; font-weight: 600; }
.wp-block-details[open] summary { margin-bottom: 8px; }
.bb-download .wp-block-button__link::before { content: "↓"; margin-right: 8px; }

/* WooCommerce polish -------------------------------------------------- */
.woocommerce .wp-block-woocommerce-product-collection .wc-block-components-product-image img, .wc-block-grid__product-image img { border-radius: 12px; }
.wc-block-checkout, .wc-block-cart { --wc-form-border-radius: 10px; }

/* Footer -------------------------------------------------------------- */
.bb-footer { background: #0b1220; color: #cbd5e1; padding: 56px 0 28px !important; margin-top: 0; }
.bb-footer__grid { max-width: 1180px; margin: 0 auto; padding: 0 var(--bb-gutter); display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.bb-footer .bb-logo { color: #fff; }
.bb-footer .bb-logo em { color: #94a3b8; }
.bb-footer p { color: #94a3b8; font-size: .92rem; max-width: 340px; }
.bb-footer h2 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 6px 0 12px; }
.bb-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bb-footer a { color: #cbd5e1; text-decoration: none; }
.bb-footer a:hover { color: #fff; }
.bb-footer__legal { max-width: 1180px !important; margin: 40px auto 0 !important; padding: 20px var(--bb-gutter) 0; border-top: 1px solid #1e293b; font-size: .82rem !important; }

/* Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
	.bb-hero__grid, .bb-split, .bb-steps-row { grid-template-columns: 1fr; }
	.bb-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .bb-footer__grid { grid-template-columns: 1fr; } .bb-pager { grid-template-columns: 1fr; } }

/* Fixes after first review ------------------------------------------- */
.bb-header > .bb-sandbox-bar { max-width: none !important; margin: 0 !important; }
.bb-header > .bb-header__inner { max-width: 1180px !important; }
.bb-main--hub .wp-block-post-content > * { margin-left: 0 !important; margin-right: 0 !important; }
.bb-main--hub .bb-callout { max-width: 1180px; }
.bb-main--hub .bb-callout > * { max-width: none !important; margin-left: 0 !important; }
.bb-tile .bb-tile__title { display: block; margin: 14px 0 6px; font-size: 1.15rem; font-weight: 700; }
.bb-footer ul { font-size: .95rem; }
.wp-block-table table { table-layout: auto; }
.wp-block-table td code, .wp-block-table th code { white-space: normal; word-break: break-word; }
.bb-docs-body .wp-block-table { max-width: 100%; }
