/*
Theme Name: Unicus
Theme URI: https://unicusglobalconsulting.com
Author: UniCus Global Consulting
Description: Block theme for UniCus Global Consulting, built from the ucb/ section library.
Version: 0.1.0
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: unicus
*/

/*
 * Global layer only: token overrides, resets, typography base and the shared primitives
 * (container, section, eyebrow, buttons, placeholder). Every section's own rules live in its block.
 * Media-query widths are the one place literal px values are allowed: CSS variables cannot be used there.
 * Breakpoints: 1140 (nav to burger), 1000, 900, 760 (token swap), 620, 560.
 */

/* Mobile token swap, from the export's @media (max-width:760px) :root block. html:root outranks the :root
   block WordPress prints for the presets, whichever stylesheet loads last. */
@media (max-width: 760px) {

	html:root {
		--wp--preset--font-size--heading-1: 32px;
		--wp--custom--line-height--heading-1: 40px;
		--wp--preset--font-size--heading-2: 27px;
		--wp--custom--line-height--heading-2: 34px;
		--wp--preset--font-size--heading-3: 21px;
		--wp--custom--line-height--heading-3: 28px;
		--wp--preset--font-size--lead: 18px;
		--wp--custom--line-height--lead: 28px;
		--wp--preset--font-size--stat: 32px;
		--wp--custom--line-height--stat: 40px;
		--wp--custom--section--pad-y: 56px;
		--wp--custom--gutter: 20px;
		--wp--custom--stat-overlap: 24px;
		--wp--custom--header--height: 64px;
		--wp--custom--header--height-compact: 56px;
		--wp--custom--logo--height: 32px;
		--wp--custom--logo--height-compact: 28px;
	}
}

[hidden] {
	display: none !important;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	text-wrap: pretty;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	text-wrap: balance;

	/* German compounds ("Datenschutzerklärung") are wider than a phone at heading sizes: hyphenate them by
	   the page's lang, and break them where the browser has no hyphenation dictionary. */
	hyphens: auto;
	overflow-wrap: break-word;
}

p {
	margin: 0;
}

/*
 * Links inside running text are underlined: colour alone does not mark a link (WCAG 2.1, 1.4.1), and the
 * theme.json link style takes the underline away. Only bare links in the page content and the cookie banner:
 * menus, buttons and card links carry a class and keep their own look, and the footer's contact lines are
 * links on their own, not inside text.
 */
:where(main, .ucb-cookie)
:where(p, td, th, dd, figcaption, blockquote, .wp-block-list > li, .ucb-form__consent-text)
a:not([class]) {
	text-decoration: underline;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

button {
	font: inherit;
}

:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--brand-accent);
	outline-offset: var(--wp--custom--focus--offset);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}


/* Layout primitives */

.ucb-container {
	width: 100%;
	max-width: var(--wp--custom--measure--content);
	margin: 0 auto;
	padding-left: var(--wp--custom--gutter);
	padding-right: var(--wp--custom--gutter);
}

.ucb-section {
	padding-top: var(--wp--custom--section--pad-y);
	padding-bottom: var(--wp--custom--section--pad-y);
}

.ucb-eyebrow {
	display: block;
	margin-bottom: var(--wp--preset--spacing--3);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--eyebrow);
	line-height: var(--wp--custom--line-height--eyebrow);
	font-weight: var(--wp--custom--font-weight--semibold);
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow);
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-primary);
}

.ucb-lead {
	font-size: var(--wp--preset--font-size--lead);
	line-height: var(--wp--custom--line-height--lead);
}

/* Buttons: solid and outline, plus outline-light for navy bands. */

.ucb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--2);
	padding: var(--wp--custom--button--pad-y) var(--wp--custom--button--pad-x);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--button);
	line-height: var(--wp--custom--line-height--button);
	font-weight: var(--wp--custom--font-weight--semibold);
	text-align: center;
	border: var(--wp--custom--border-width--strong) solid transparent;
	border-radius: var(--wp--custom--radius--control);
	cursor: pointer;
	transition:
		background var(--wp--custom--transition),
		color var(--wp--custom--transition),
		border-color var(--wp--custom--transition);
}

.ucb-btn:hover {
	text-decoration: none;
}

.ucb-btn--solid {
	background: var(--wp--preset--color--brand-primary);
	border-color: var(--wp--preset--color--brand-primary);
	color: var(--wp--preset--color--text-on-deep);
}

.ucb-btn--solid:hover {
	background: var(--wp--preset--color--brand-primary-hover);
	border-color: var(--wp--preset--color--brand-primary-hover);
	color: var(--wp--preset--color--text-on-deep);
}

.ucb-btn--outline {
	background: transparent;
	border-color: var(--wp--preset--color--brand-primary);
	color: var(--wp--preset--color--brand-primary);
}

.ucb-btn--outline:hover {
	background: var(--wp--preset--color--brand-primary);
	color: var(--wp--preset--color--text-on-deep);
}

.ucb-btn--outline-light {
	background: transparent;
	border-color: var(--wp--preset--color--text-on-deep);
	color: var(--wp--preset--color--text-on-deep);
}

.ucb-btn--outline-light:hover {
	background: var(--wp--preset--color--text-on-deep);
	color: var(--wp--preset--color--brand-deep);
}

.ucb-btn--small {
	padding: var(--wp--custom--button--pad-y-small) var(--wp--custom--button--pad-x-small);
}

.ucb-link {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--label);
	line-height: var(--wp--custom--line-height--label);
	font-weight: var(--wp--custom--font-weight--semibold);
	color: var(--wp--preset--color--brand-primary);
}

/*
 * Body text inside a section (the core paragraph, list and heading blocks a ucb/ block holds).
 * Bullets are 8px primary squares with a 24px indent and 12px between items, as in most of the
 * export's lists (.ucb-list, .ucb-bullets).
 */
.ucb-prose > * + * {
	margin-top: var(--wp--preset--spacing--4);
}

.ucb-prose > h3,
.ucb-prose > h4 {
	margin-top: var(--wp--preset--spacing--5);
}

.ucb-prose strong {
	color: var(--wp--preset--color--brand-deep);
}

.ucb-prose ul {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
}

.ucb-prose ul > li {
	position: relative;
	padding-left: var(--wp--preset--spacing--5);
}

.ucb-prose ul > li::before {
	content: "";
	position: absolute;
	top: calc((1lh - var(--wp--custom--bullet--size)) / 2);
	left: 0;
	width: var(--wp--custom--bullet--size);
	height: var(--wp--custom--bullet--size);
	background: var(--wp--preset--color--brand-primary);
}

.ucb-prose ol {
	padding-left: var(--wp--preset--spacing--5);
	list-style: decimal;
}

.ucb-prose ol > li + li {
	margin-top: var(--wp--preset--spacing--2);
}

/* "To be confirmed" marker (the ucb/tbc text format): flags placeholder values in any text, amber like the
   under-construction notices, as on the export's legal pages. */
.ucb-tbc {
	padding: var(--wp--custom--tbc--pad-y) var(--wp--custom--tbc--pad-x);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--eyebrow);
	line-height: var(--wp--custom--line-height--eyebrow);
	color: var(--wp--preset--color--notice-text);
	background: var(--wp--preset--color--notice-bg);
	border: var(--wp--custom--border-width--hairline) solid var(--wp--preset--color--notice-border);
	border-radius: var(--wp--custom--radius--control);
}

/* Long email addresses and URLs must wrap instead of widening the layout. */
.ucb-break {
	overflow-wrap: anywhere;
}

/* Image placeholder at the exact slot size, labelled with its dimensions (editor and empty previews). */

.ucb-ph {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: var(--wp--preset--color--placeholder);
	border: var(--wp--custom--border-width--hairline) solid var(--wp--preset--color--border);
}

.ucb-ph__label {
	padding: var(--wp--preset--spacing--3);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--eyebrow);
	line-height: var(--wp--custom--line-height--eyebrow);
	letter-spacing: var(--wp--custom--letter-spacing--label);
	color: var(--wp--preset--color--placeholder-ink);
	text-align: center;
}

.ucb-ph--card {
	border-radius: var(--wp--custom--radius--card);
}
