/**
 * Gutenberg page track — base styles.
 * Font files live in the classic theme assets/fonts/ (shared, not duplicated).
 */

/*
 * Spacing tokens for Spacer clamps (stkcentrum / Figma scale).
 * Used by theme.json settings.blocks.core/spacer.spacingSizes.
 */
:root {
	--spacing-xxs: 0.125rem;
	--spacing-xs: 0.25rem;
	--spacing-sm: 0.375rem;
	--spacing-md: 0.5rem;
	--spacing-lg: 0.75rem;
	--spacing-xl: 1rem;
	--spacing-2xl: 1.25rem;
	--spacing-3xl: 1.5rem;
	--spacing-4xl: 2rem;
	--spacing-5xl: 2.5rem;
	--spacing-6xl: 3rem;
	--spacing-7xl: 4rem;
	--spacing-8xl: 5rem;
	--spacing-9xl: 6rem;
	--spacing-10xl: 8rem;

	/* Prose sibling rhythm (heading / paragraph / list only). */
	--lg-prose-title-body: 0.75rem;
	--lg-prose-body: 1rem;
	--lg-prose-after-body: 1.5rem;
}

/*
 * Spacer uses the same preset slugs as padding/margin, but a taller scale
 * (stkcentrum pattern). Scope overrides so height: var(--wp--preset--spacing--*)
 * on .wp-block-spacer resolves to section rhythm, not the global gap scale.
 */
.wp-block-spacer {
	--wp--preset--spacing--none: 0;
	--wp--preset--spacing--xs: clamp(var(--spacing-3xl), 1rem + 2.5vw, var(--spacing-5xl));
	--wp--preset--spacing--sm: clamp(var(--spacing-4xl), 1.25rem + 3vw, var(--spacing-6xl));
	--wp--preset--spacing--md: clamp(var(--spacing-5xl), 1.5rem + 4vw, var(--spacing-7xl));
	--wp--preset--spacing--lg: clamp(var(--spacing-6xl), 1.75rem + 5vw, var(--spacing-8xl));
	--wp--preset--spacing--xl: clamp(var(--spacing-7xl), 2.5rem + 5.5vw, var(--spacing-9xl));
	--wp--preset--spacing--xxl: clamp(var(--spacing-8xl), 3rem + 7vw, var(--spacing-10xl));
}

/*
 * Single family + weight map (matches Figma). Avoids Regular+600 faux-bold
 * that happened when each cut used a different font-family name.
 */
@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_Rg.woff") format("woff");
}

@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_Lt.woff") format("woff");
}

@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_Md.woff") format("woff");
}

@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_SBd.woff") format("woff");
}

@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_Bd.woff") format("woff");
}

@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: italic;
	font-weight: 300;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_LtIt.woff") format("woff");
}

@font-face {
	font-family: "Objektiv Mk1 Trial";
	font-style: italic;
	font-weight: 100;
	font-display: swap;
	src: url("../../../assets/fonts/ObjektivMk1_Trial_ThIt.woff") format("woff");
}

body.legalion-gutenberg,
.editor-styles-wrapper {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 400;
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Paragraphs stay Regular (400). */
body.legalion-gutenberg :is(p, .wp-block-paragraph),
.editor-styles-wrapper :is(p, .wp-block-paragraph) {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 400;
}

/*
 * Heading scale — desktop 48 / 36, fluid down for tablet & mobile (2:1.5).
 * h1: 32→48px · h2: 24→36px · SemiBold (600) to match Figma display.
 */
body.legalion-gutenberg h1.wp-block-heading,
.editor-styles-wrapper h1.wp-block-heading {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-size: clamp(2rem, 1.25rem + 2.5vw, 3rem);
	font-weight: 600;
	line-height: 1.2;
}

body.legalion-gutenberg h2.wp-block-heading,
.editor-styles-wrapper h2.wp-block-heading {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-size: clamp(1.5rem, 0.9375rem + 1.875vw, 2.25rem);
	font-weight: 600;
	line-height: 1.222;
}

body.legalion-gutenberg :is(h3, h4, h5, h6).wp-block-heading,
.editor-styles-wrapper :is(h3, h4, h5, h6).wp-block-heading {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 600;
}

body.legalion-gutenberg :is(hr, .wp-block-separator),
.editor-styles-wrapper :is(hr, .wp-block-separator) {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

/* Fluent Forms — Regular face for all form UI (labels, inputs, checks, submit). */
body.legalion-gutenberg :is(.fluentform, .frm-fluent-form, [class*="fluentform_wrapper_"]),
body.legalion-gutenberg :is(.fluentform, .frm-fluent-form, [class*="fluentform_wrapper_"]) :is(
	label,
	input,
	select,
	textarea,
	button,
	.ff-el-input--label,
	.ff-el-form-control,
	.ff-el-form-check-label,
	.ff_t_c,
	.ff_t_c a,
	.ff-btn-submit
) {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 400;
}

/* Field focus — brand-800 (same as primary buttons). */
body.legalion-gutenberg :is(.fluentform, .frm-fluent-form, [class*="fluentform_wrapper_"]) :is(
	.ff-el-form-control,
	select.ff-el-form-control,
	textarea.ff-el-form-control
):focus {
	border-color: var(--wp--preset--color--brand-800, #633e8b);
	outline: none;
	box-shadow: 0 0 0 2px rgba(99, 62, 139, 0.22);
}

body.legalion-gutenberg {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.legalion-gutenberg__main {
	flex: 1 0 auto;
}

/* Opt-in weight utilities (same class names as classic theme). */
.legalion-gutenberg .font-objektiv-regular,
.editor-styles-wrapper .font-objektiv-regular {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 400;
	font-style: normal;
}

.legalion-gutenberg .font-objektiv-light,
.editor-styles-wrapper .font-objektiv-light {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 300;
	font-style: normal;
}

.legalion-gutenberg .font-objektiv-medium,
.editor-styles-wrapper .font-objektiv-medium {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 500;
	font-style: normal;
}

.legalion-gutenberg .font-objektiv-semi-bold,
.editor-styles-wrapper .font-objektiv-semi-bold {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 600;
	font-style: normal;
}

.legalion-gutenberg .font-objektiv-bold,
.editor-styles-wrapper .font-objektiv-bold {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 700;
	font-style: normal;
}

.legalion-gutenberg .font-objektiv-light-italic,
.editor-styles-wrapper .font-objektiv-light-italic {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 300;
	font-style: italic;
}

.legalion-gutenberg .font-objektiv-thin-italic,
.editor-styles-wrapper .font-objektiv-thin-italic {
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 100;
	font-style: italic;
}

/*
 * Equal-height cards: Columns already stretch; make the inner card Group
 * (background = card surface) fill the column. No editor classes needed.
 */
body.legalion-gutenberg .wp-block-columns > .wp-block-column {
	display: flex;
	flex-direction: column;
}

body.legalion-gutenberg .wp-block-columns > .wp-block-column > .wp-block-group.has-background {
	height: 100%;
	box-sizing: border-box;
}

/*
 * Primary fill button (Figma Buttons/Button Hierarchy=Primary, site override
 * bg-brand-section). Default + hover live in theme CSS — block color UI has
 * no hover state. Trailing arrow via currentColor mask.
 *
 * Default / Focused: brand-800 (#633e8b)
 * Hover / Active:    brand-900 (#513370)
 * Disabled:          same fill, 50% opacity
 */
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link,
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link,
body.legalion-gutenberg .pricing-tables__cta,
body.legalion-gutenberg .ff-btn-submit,
body.legalion-gutenberg button.ff-btn-submit,
body.legalion-gutenberg .site-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	box-sizing: border-box;
	/* SemiBold cut via weight 600 on the unified family. */
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-weight: 600;
	transition: background-color 0.15s ease, color 0.15s ease;
}

/* Unstyled core buttons → brand fill (leave CTA / outline alone). */
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]),
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]) {
	background-color: var(--wp--preset--color--brand-800, #633e8b);
	color: var(--wp--preset--color--text-on-brand, #fff);
	border-radius: 9999px;
	padding: 0.75rem 1.125rem;
	font-size: 1rem;
	line-height: 1.5rem;
	text-decoration: none;
	box-shadow: none;
}

body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]):hover,
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]):focus-visible,
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]):active,
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]):hover,
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="-background-color"]):focus-visible {
	background-color: var(--wp--preset--color--brand-900, #513370);
	color: var(--wp--preset--color--text-on-brand, #fff);
}

/* brand-800 picked in the editor still needs a theme hover (no block hover UI). */
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-brand-800-background-color:hover,
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-brand-800-background-color:focus-visible,
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-brand-800-background-color:active,
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-brand-800-background-color:hover,
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-brand-800-background-color:focus-visible {
	background-color: var(--wp--preset--color--brand-900, #513370) !important;
	color: var(--wp--preset--color--text-on-brand, #fff) !important;
}

body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link:disabled,
body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link[aria-disabled="true"],
body.legalion-gutenberg .ff-btn-submit:disabled,
body.legalion-gutenberg button.ff-btn-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

body.legalion-gutenberg .wp-block-button:not(.is-style-outline) .wp-block-button__link::after,
.editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link::after,
body.legalion-gutenberg .ff-btn-submit::after,
body.legalion-gutenberg button.ff-btn-submit::after {
	content: "";
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	flex: 0 0 auto;
	background-color: currentColor;
	opacity: 0.6;
	mask: url("../img/icon-arrow-right-mask.svg") center / contain no-repeat;
	-webkit-mask: url("../img/icon-arrow-right-mask.svg") center / contain no-repeat;
}

/*
 * Prose sibling rhythm — space between consecutive text blocks only.
 * Parent :is() covers both .entry-content itself and nested Groups without
 * blockGap (core paragraphs are bare <p>). data-block-gap / flex / grid opt out.
 */
body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading, p, .wp-block-paragraph, ul, ol, .wp-block-list),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading, p, .wp-block-paragraph, ul, ol, .wp-block-list) {
	margin-block: 0;
}

body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) + :is(p, .wp-block-paragraph),
body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) + :is(ul, ol, .wp-block-list),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) + :is(p, .wp-block-paragraph),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) + :is(ul, ol, .wp-block-list) {
	margin-block-start: var(--lg-prose-title-body);
}

body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(p, .wp-block-paragraph) + :is(p, .wp-block-paragraph),
body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(p, .wp-block-paragraph) + :is(ul, ol, .wp-block-list),
body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(ul, ol, .wp-block-list) + :is(p, .wp-block-paragraph),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(p, .wp-block-paragraph) + :is(p, .wp-block-paragraph),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(p, .wp-block-paragraph) + :is(ul, ol, .wp-block-list),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(ul, ol, .wp-block-list) + :is(p, .wp-block-paragraph) {
	margin-block-start: var(--lg-prose-body);
}

body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(p, .wp-block-paragraph) + :is(h1, h2, h3, h4, h5, h6, .wp-block-heading),
body.legalion-gutenberg :is(.entry-content, .entry-content :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(ul, ol, .wp-block-list) + :is(h1, h2, h3, h4, h5, h6, .wp-block-heading),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(p, .wp-block-paragraph) + :is(h1, h2, h3, h4, h5, h6, .wp-block-heading),
:is(.editor-styles-wrapper, .editor-styles-wrapper :not([data-block-gap]):not(.is-layout-flex):not(.is-layout-grid)) > :is(ul, ol, .wp-block-list) + :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) {
	margin-block-start: var(--lg-prose-after-body);
}
