/**
 * Builder Theme Bridge — maps the visual-builder runtime output (.builder-runtime
 * / .builder-node--*) onto the --inv-* design tokens, so builder-authored pages
 * are driven by the active theme just like the rest of the site.
 *
 * The builder applies some defaults as INLINE styles (e.g. button colors), so
 * those overrides use !important; layout/spacing the user sets per-node still wins
 * where it isn't a hardcoded default.
 */

.builder-runtime {
	font-family: var(--inv-font-sans);
	color: var(--inv-color-fg);
}

/* Headings → theme display font + token scale (level = element tag) */
.builder-runtime .builder-node--heading {
	font-family: var(--inv-font-heading, var(--inv-font-serif));
	color: var(--inv-color-fg);
	line-height: var(--inv-line-height-tight);
}
h1.builder-node--heading { font-size: var(--inv-font-size-4xl); font-weight: var(--inv-font-weight-extrabold); }
h2.builder-node--heading { font-size: var(--inv-font-size-3xl); font-weight: var(--inv-font-weight-bold); }
h3.builder-node--heading { font-size: var(--inv-font-size-2xl); font-weight: var(--inv-font-weight-bold); }
h4.builder-node--heading { font-size: var(--inv-font-size-xl); font-weight: var(--inv-font-weight-semibold); }

/* Body text */
.builder-runtime .builder-node--paragraph {
	color: var(--inv-color-fg-muted);
	line-height: var(--inv-line-height-relaxed);
	font-size: var(--inv-font-size-base);
}

/* Buttons — builder hardcodes inline colors, so override with !important */
.builder-runtime .builder-node--button {
	background-color: var(--inv-color-brand) !important;
	border-color: var(--inv-color-brand) !important;
	color: var(--inv-color-brand-fg) !important;
	border-radius: var(--inv-radius-md) !important;
	font-weight: var(--inv-font-weight-bold) !important;
	transition: background-color var(--inv-transition-fast);
}
.builder-runtime .builder-node--button:hover {
	background-color: var(--inv-color-brand-hover) !important;
}

/* Links inside content */
.builder-runtime a:not(.builder-node--button) { color: var(--inv-color-accent); }

/* Lists */
.builder-runtime .builder-node--list { color: var(--inv-color-fg-muted); }

/* Images get a sane radius unless the author set one */
.builder-runtime img { max-width: 100%; height: auto; }

/* Section/container surface variants if the author tags them */
.builder-runtime .builder-node--container[data-surface="muted"] { background: var(--inv-color-bg-muted); }
.builder-runtime .builder-node--container[data-surface="dark"] { background: var(--inv-color-dark); color: var(--inv-color-dark-fg); }
.builder-runtime .builder-node--container[data-surface="brand"] { background: var(--inv-color-brand); color: var(--inv-color-brand-fg); }
