/*
 * Base: design tokens from theme.json mapped onto the variable names stored content still uses (from the
 * Blocksy era: --theme-*), plus page structure (container, boxed article, hero, vertical spacing).
 * Change design values in theme.json / Global Styles, not here.
 */

:root {
	--true: initial;
	--false: "";
	--theme-palette-color-1: var(--wp--preset--color--palette-color-1);
	--theme-palette-color-2: var(--wp--preset--color--palette-color-2);
	--theme-palette-color-3: var(--wp--preset--color--palette-color-3);
	--theme-palette-color-4: var(--wp--preset--color--palette-color-4);
	--theme-palette-color-5: var(--wp--preset--color--palette-color-5);
	--theme-palette-color-6: var(--wp--preset--color--palette-color-6);
	--theme-text-color: var(--wp--preset--color--body-text);
	--theme-link-initial-color: var(--theme-palette-color-1);
	--theme-link-hover-color: var(--theme-palette-color-3);
	--theme-headings-color: var(--theme-palette-color-1);
	--theme-border-color: var(--theme-palette-color-5);
	--theme-font-family: var(--wp--preset--font-family--montserrat);
	--theme-font-size: 14px;
	--theme-line-height: 1.6;
	--theme-content-spacing: var(--wp--custom--content--spacing);
	--theme-normal-container-max-width: var(--wp--custom--site--max-width);
	--theme-narrow-container-max-width: var(--wp--custom--site--narrow-width);
	--theme-wide-offset: var(--wp--custom--site--wide-offset);
	--theme-container-edge-spacing: var(--wp--custom--site--edge-spacing);
	--theme-container-width-base: var(--theme-container-edge-spacing);
	--theme-container-width: min(100%, var(--theme-container-width-base));
	--theme-block-max-width: var(--theme-normal-container-max-width);
	--theme-block-wide-max-width: calc(var(--theme-normal-container-max-width) + var(--theme-wide-offset) * 2);
	--theme-content-vertical-spacing: var(--wp--custom--content--vertical-spacing);
	--theme-button-min-height: var(--wp--custom--button--min-height);
	--theme-button-padding: var(--wp--custom--button--padding);
	--theme-button-border-radius: var(--wp--custom--button--radius);
	--theme-button-font-size: var(--wp--custom--button--font-size);
	--theme-button-font-weight: var(--wp--custom--button--font-weight);
	--theme-button-text-initial-color: #ffffff;
	--theme-button-text-hover-color: #ffffff;
	--theme-button-background-initial-color: var(--theme-palette-color-1);
	--theme-button-background-hover-color: var(--theme-palette-color-3);
	--theme-list-indent: 2.5em;
	--theme-form-field-border-radius: 35px;
	--theme-form-field-height: 40px;
	--theme-form-font-size: 13px;
	--theme-form-text-initial-color: var(--theme-palette-color-5);
	--theme-form-field-border-initial-color: var(--theme-palette-color-5);
	--theme-form-field-border-focus-color: var(--theme-palette-color-1);
	--theme-boxed-content-border-radius: var(--wp--custom--box--radius);
	--theme-boxed-content-box-shadow: var(--wp--custom--box--shadow);
	--theme-boxed-content-spacing: var(--wp--custom--box--padding-page);
	--hp-breakpoint-note: "tablet <= 999.98px, mobile <= 689.98px";
}

@media (max-width: 999.98px) {
	:root {
		--theme-content-vertical-spacing: var(--wp--custom--content--vertical-spacing-tablet);
		--theme-boxed-content-spacing: var(--wp--custom--box--padding-page-tablet);
	}
}

@media (max-width: 689.98px) {
	:root {
		--theme-content-vertical-spacing: var(--wp--custom--content--vertical-spacing-mobile);
		--theme-container-edge-spacing: var(--wp--custom--site--edge-spacing-mobile);
		--theme-boxed-content-spacing: var(--wp--custom--box--padding-page-mobile);
	}
}

/* Typography per element through the Blocksy variables (sizes per device from theme.json settings.custom.heading). */
:root {
	--theme-font-weight: 400;
	--theme-text-transform: none;
	--theme-text-decoration: none;
	--theme-letter-spacing: 0rem;
	--theme-selection-text-color: var(--theme-palette-color-3);
	--theme-selection-background-color: var(--theme-palette-color-5);
	--theme-table-font-size: inherit;
}
h1, h2, h3, h4, h5, h6 {
	--theme-font-family: var(--wp--preset--font-family--montserrat);
	--theme-font-weight: var(--wp--custom--heading--weight);
}
h1 { --theme-font-size: var(--wp--custom--heading--h-1--size); --theme-line-height: var(--wp--custom--heading--h-1--line-height); }
h2 { --theme-font-size: var(--wp--custom--heading--h-2--size); --theme-line-height: var(--wp--custom--heading--h-2--line-height); }
h3 { --theme-font-size: var(--wp--custom--heading--h-3--size); --theme-line-height: var(--wp--custom--heading--h-3--line-height); }
h4 { --theme-font-size: var(--wp--custom--heading--h-4--size); --theme-line-height: var(--wp--custom--heading--h-4--line-height); }
h5 { --theme-font-size: var(--wp--custom--heading--h-5--size); --theme-line-height: var(--wp--custom--heading--h-5--line-height); }
h6 { --theme-font-size: var(--wp--custom--heading--h-6--size); --theme-line-height: var(--wp--custom--heading--h-6--line-height); }
.wp-block-pullquote { --theme-font-family: Georgia; --theme-font-weight: 600; --theme-font-size: 25px; }
pre, code, samp, kbd { --theme-font-family: monospace; --theme-font-weight: 400; --theme-font-size: 16px; }
figcaption { --theme-font-size: 14px; }
form textarea { --theme-form-field-height: 170px; }

@media (max-width: 999.98px) {
	h1 { --theme-font-size: var(--wp--custom--heading--h-1--size-tablet); }
	h2 { --theme-font-size: var(--wp--custom--heading--h-2--size-tablet); }
	h3 { --theme-font-size: var(--wp--custom--heading--h-3--size-tablet); }
	h4 { --theme-font-size: var(--wp--custom--heading--h-4--size-tablet); }
}

@media (max-width: 689.98px) {
	h1 { --theme-font-size: var(--wp--custom--heading--h-1--size-mobile); --theme-line-height: var(--wp--custom--heading--h-1--line-height-mobile); }
	h2 { --theme-font-size: var(--wp--custom--heading--h-2--size-mobile); }
	h3 { --theme-font-size: var(--wp--custom--heading--h-3--size-mobile); }
	h4 { --theme-font-size: var(--wp--custom--heading--h-4--size-mobile); }
}

body {
	margin: 0;
}

/* Structural wrappers from the templates: no flow gaps between them. */
.wp-site-blocks > *,
.site-main,
.site-main > *,
.hp-container-full > *,
.hp-article > * {
	margin-block: 0;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1 0 auto;
}

.hp-container {
	width: var(--theme-container-width);
	max-width: var(--theme-normal-container-max-width);
	margin-inline: auto;
}

/* Page structure (Blocksy "type-4": full-width container, article boxed or wide). */
.hp-container-full.has-vspace-top { padding-top: var(--theme-content-vertical-spacing); }
.hp-container-full.has-vspace-bottom { padding-bottom: var(--theme-content-vertical-spacing); }

/*
 * Article box logic as in Blocksy: --has-boxed / --has-wide hold var(--true) (= initial, the var() fallback applies)
 * or var(--false) (= "", the fallback is skipped). The template sets .is-boxed or .is-wide on the article.
 */
.hp-article.is-boxed { --has-boxed: var(--true); --has-wide: var(--false); }
.hp-article.is-wide { --has-boxed: var(--false); --has-wide: var(--true); }

.hp-container-full.is-normal > .hp-article {
	--theme-block-width: var(--has-wide, var(--theme-container-width));
	--theme-block-max-width: var(--has-wide, var(--theme-normal-container-max-width));
	--theme-block-wide-max-width: var(--has-wide, calc(var(--theme-normal-container-max-width) + var(--theme-wide-offset) * 2));
	--theme-boxed-content-max-width: var(--theme-normal-container-max-width);
}
.hp-container-full.is-narrow > .hp-article {
	--theme-block-width: var(--has-wide, var(--theme-container-width));
	--theme-block-max-width: var(--has-wide, var(--theme-narrow-container-max-width));
	--theme-block-wide-max-width: var(--has-wide, calc(var(--theme-narrow-container-max-width) + var(--theme-wide-offset) * 2));
	--theme-boxed-content-max-width: var(--theme-narrow-container-max-width);
}

.hp-container-full > .hp-article {
	--has-background: var(--has-boxed);
	--has-boxed-structure: var(--has-boxed);
	--wp--style--global--content-size: var(--theme-block-max-width);
	--wp--style--global--wide-size: var(--theme-block-wide-max-width);
	border: var(--has-boxed, var(--theme-boxed-content-border));
	padding: var(--has-boxed, var(--theme-boxed-content-spacing));
	box-shadow: var(--has-boxed, var(--theme-boxed-content-box-shadow));
	border-radius: var(--has-boxed, var(--theme-boxed-content-border-radius));
	margin-inline: var(--has-boxed-structure, auto);
	width: var(--has-boxed-structure, var(--theme-container-width));
	max-width: var(--has-boxed-structure, var(--theme-boxed-content-max-width));
	background-color: var(--has-background, var(--theme-palette-color-6));
}

/* Content links underlined (Blocksy link type 2). */
:where(.entry-content :where(p, em, strong) > a, .entry-content :where(ul, ol) a, .wp-block-table a):not(:hover) {
	--theme-text-decoration: underline;
}

/* Hero (page title). */
.hero-section {
	display: flow-root;
	margin-bottom: 40px;
}
.hero-section .page-title {
	font-size: 30px;
	margin: 0 0 calc(0.3em + 10px);
}
.hero-section.is-centered {
	text-align: center;
}
.hero-section.is-centered .page-title {
	font-size: 32px;
}
@media (max-width: 999.98px) {
	.hero-section.is-centered .page-title { font-size: 30px; }
}
@media (max-width: 689.98px) {
	.hero-section.is-centered .page-title { font-size: 25px; }
}

/* Visible focus for keyboard users. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--theme-palette-color-5);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip-path: none;
	width: auto;
	height: auto;
	z-index: 100000;
}

/* Landing page box variants (Blocksy per-page "boxed" with transparent background, radius 3, wide on mobile / desktop). */
.hp-container-full > .hp-article.is-clear {
	background-color: transparent;
	border-radius: var(--has-boxed, 3px);
}
@media (max-width: 689.98px) {
	.hp-article.is-boxed.is-wide-mobile { --has-boxed: var(--false); --has-wide: var(--true); }
}
@media (min-width: 1000px) {
	.hp-article.is-boxed.is-wide-desktop { --has-boxed: var(--false); --has-wide: var(--true); }
}
