/* ─── Font size custom properties (WordPress omits slugs starting with digits) ── */

:root {
	--wp--preset--font-size--2xl: 1.5rem;
	--wp--preset--font-size--3xl: 1.875rem;
	--wp--preset--font-size--4xl: 2.25rem;
	--wp--preset--font-size--5xl: 3rem;
	--wp--preset--font-size--6xl: 3.75rem;
	--wp--preset--font-size--7xl: 4.5rem;
}

/* ─── Section label and step number (both sites, AT-876) ──────────────────── */

/* Section label: the small capitals above a heading. */
.cb-label {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* A label drawn as a pill with a border (the .com hero). */
p.cb-label-pill {
	display: inline-block;
	width: auto;
}

/* Step number: 01, 02, 03 above a step or service title. */
.cb-step-no {
	color: var(--wp--preset--color--accent);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

/* ─── Hero headline sizing ──────────────────────────────────────────────────── */

.wp-block-group .wp-block-heading[style*="font-weight:800"] {
	font-size: clamp(3rem, 7vw, 5.5rem);
}

/* ─── Outline button fix ────────────────────────────────────────────────────── */

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent !important;
	border: 1px solid #525252 !important;
	color: var(--wp--preset--color--text-primary) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--text-primary) !important;
}

/* ─── Stats numbers ─────────────────────────────────────────────────────────── */

.wp-block-columns .wp-block-heading[style*="color:var(--wp--preset--color--accent)"] {
	font-size: clamp(3rem, 7vw, 5.5rem) !important;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1;
}

/* ─── Section spacing — tighten all section paddings ───────────────────────── */

.wp-block-group.alignfull[style*="padding-top:var(--wp--preset--spacing--24)"] {
	padding-top: var(--wp--preset--spacing--20) !important;
	padding-bottom: var(--wp--preset--spacing--20) !important;
}

.wp-block-group.alignfull[style*="padding-top:var(--wp--preset--spacing--32)"] {
	padding-top: var(--wp--preset--spacing--16) !important;
	padding-bottom: var(--wp--preset--spacing--16) !important;
}

.wp-block-group.alignfull[style*="padding-top:var(--wp--preset--spacing--16)"] {
	padding-top: var(--wp--preset--spacing--12) !important;
	padding-bottom: var(--wp--preset--spacing--12) !important;
}

/* ─── FAQ — remove stray bullet ─────────────────────────────────────────────── */

.wp-block-details ~ .wp-block-paragraph,
.wp-block-group > .wp-block-paragraph {
	list-style: none;
}

.wp-block-group > .wp-block-paragraph::before {
	content: none !important;
}

/* ─── CTA section — surface lift ────────────────────────────────────────────── */

.wp-block-group.alignfull.has-surface-background-color {
	background-color: #1c1c1c !important;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

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

html {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text-primary);
}

.wp-block-group,
.wp-block-columns,
.wp-block-column {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* ─── Logo ──────────────────────────────────────────────────────────────────── */

.wp-block-site-title a {
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease;
}

.wp-block-site-title a:hover {
	opacity: 0.8;
	color: inherit;
}

/* ─── Navigation ────────────────────────────────────────────────────────────── */

.wp-block-navigation a {
	text-decoration: none;
	color: var(--wp--preset--color--text-secondary);
	transition: color 0.2s ease;
	position: relative;
}

.wp-block-navigation a:hover {
	color: var(--wp--preset--color--text-primary);
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
	text-decoration: none;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent-hover) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--text-secondary) !important;
	color: var(--wp--preset--color--white) !important;
}

/* ─── FAQ / Details accordion ───────────────────────────────────────────────── */

.wp-block-details {
	cursor: pointer;
}

.wp-block-details summary {
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	color: var(--wp--preset--color--text-primary);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--lg);
	transition: color 0.2s ease;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 300;
	line-height: 1;
	flex-shrink: 0;
	margin-left: var(--wp--preset--spacing--6);
	transition: transform 0.2s ease;
}

.wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

.wp-block-details summary:hover {
	color: var(--wp--preset--color--accent);
}

/* ─── Cards (service + testimonial) ────────────────────────────────────────── */

.cb-card {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0 !important;
	height: 100%;
	padding: var(--wp--preset--spacing--8);
	transition: border-color 0.2s ease;
}

.cb-card:hover {
	border-color: var(--wp--preset--color--accent);
}

.cb-card-row {
	align-items: stretch !important;
}

.cb-card-row .wp-block-column {
	display: flex;
	flex-direction: column;
}

.cb-card-row .wp-block-column > .wp-block-group {
	flex: 1;
}

.wp-block-group.has-surface-background-color {
	transition: border-color 0.2s ease;
}

.wp-block-group.has-surface-background-color:hover {
	border-color: var(--wp--preset--color--accent) !important;
}

/* ─── Links in body copy ────────────────────────────────────────────────────── */

.wp-block-post-content a,
.wp-block-paragraph a {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.wp-block-post-content a:hover,
.wp-block-paragraph a:hover {
	color: var(--wp--preset--color--accent-hover);
}

/* ─── Separator ─────────────────────────────────────────────────────────────── */

.wp-block-separator {
	border: none;
	border-top: 1px solid var(--wp--preset--color--border);
	margin: 0;
}

/* ─── CTA heading — force large display size ────────────────────────────────── */

.wp-block-group.alignfull.has-surface-background-color .wp-block-heading {
	font-size: clamp(2.25rem, 4.5vw, 4rem) !important;
	font-weight: 800 !important;
	letter-spacing: -0.03em !important;
	line-height: 1.1 !important;
}

/* ─── FAQ left-column heading — smaller than section headings ───────────────── */

.cb-faq-left .wp-block-heading {
	font-size: clamp(1.75rem, 3vw, 2.5rem) !important;
	line-height: 1.15 !important;
}

/* ─── Honeypot ──────────────────────────────────────────────────────────────── */

.cb-hp {
	position: absolute;
	left: -9999px;
	visibility: hidden;
	pointer-events: none;
}

/* ─── Contact form ──────────────────────────────────────────────────────────── */

.cb-contact-form {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--6);
}

.cb-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--6);
}

.cb-form-field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--2);
}

.cb-form-field label {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	color: var(--wp--preset--color--text-primary);
	letter-spacing: 0.01em;
}

.cb-form-field input,
.cb-form-field textarea {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--base);
	font-family: inherit;
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--5);
	transition: border-color 0.2s ease;
	width: 100%;
	outline: none;
	-webkit-appearance: none;
}

.cb-form-field input::placeholder,
.cb-form-field textarea::placeholder {
	color: var(--wp--preset--color--text-secondary);
	opacity: 0.6;
}

.cb-form-field input:focus,
.cb-form-field textarea:focus {
	border-color: var(--wp--preset--color--accent);
}

.cb-form-field textarea {
	resize: vertical;
	min-height: 160px;
	line-height: 1.6;
}

.cb-form-submit {
	align-self: flex-start;
	background-color: var(--wp--preset--color--accent);
	border: none;
	border-radius: 0;
	color: var(--wp--preset--color--background);
	cursor: pointer;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	letter-spacing: 0.01em;
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--10);
	transition: background-color 0.2s ease;
}

.cb-form-submit:hover {
	background-color: var(--wp--preset--color--accent-hover);
}

@media (max-width: 600px) {
	.cb-form-row {
		grid-template-columns: 1fr;
	}
}

/* ─── Contact form notices ──────────────────────────────────────────────────── */

.cb-form-notice {
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--5);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	border-left: 3px solid;
}

.cb-form-notice--success {
	border-color: #4ade80;
	color: #4ade80;
}

.cb-form-notice--error {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

/* ─── Mobile nav overlay ────────────────────────────────────────────────────── */

.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--background) !important;
	padding: var(--wp--preset--spacing--8) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--text-primary) !important;
	font-size: var(--wp--preset--font-size--2xl) !important;
	font-weight: 700 !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close svg {
	color: var(--wp--preset--color--text-primary) !important;
	fill: var(--wp--preset--color--text-primary) !important;
}

/* ─── Mobile ────────────────────────────────────────────────────────────────── */

@media (max-width: 782px) {
	header .wp-block-buttons {
		display: none;
	}

	.wp-block-group.alignfull,
	header > .wp-block-group,
	footer > .wp-block-group {
		padding-left: var(--wp--preset--spacing--8) !important;
		padding-right: var(--wp--preset--spacing--8) !important;
	}

	.cb-feature-cta-row,
	.cb-card.wp-block-group {
		flex-wrap: wrap !important;
	}

	.cb-card > .wp-block-buttons {
		width: 100%;
	}
}

/* ─── Admin bar offset ──────────────────────────────────────────────────────── */

.admin-bar .wp-block-group[style*="position:sticky"],
.admin-bar .wp-block-group[style*="position: sticky"] {
	top: 32px;
}

/* ─── Shared components (AT-872) ────────────────────────────────────────────────
 * Design only, no copy. A child theme gives the text and applies a component with
 * the block's Additional CSS class, or prints the markup from a shortcode.
 * Used by the landing page template (AT-873); the .ee home page uses none of them.
 */

/* Filled button outside the Button block (a link or a form button). The a/button selectors
   beat the accent link colour of page content (.wp-block-post-content a). */
.cb-btn,
a.cb-btn,
button.cb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 32px;
	border: 0;
	border-radius: 4px;
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--base);
	font-weight: 700;
	letter-spacing: 0.01em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.cb-btn:hover,
.cb-btn:focus-visible,
a.cb-btn:hover,
a.cb-btn:focus-visible {
	background-color: var(--wp--preset--color--accent-hover);
	color: var(--wp--preset--color--background);
}

/* Group calendar: a head row and one row per group, five columns. */
.cb-calendar {
	display: flex;
	flex-direction: column;
}

.cb-calendar-head,
.cb-calendar-row {
	display: grid;
	grid-template-columns: 120px minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 1fr) 150px;
	gap: var(--wp--preset--spacing--4);
	align-items: center;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.cb-calendar-head {
	padding-bottom: var(--wp--preset--spacing--3);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cb-calendar-row {
	padding: var(--wp--preset--spacing--5) 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.5;
}

.cb-calendar-row strong {
	color: var(--wp--preset--color--text-primary);
	font-weight: 700;
}

.cb-calendar-row a {
	color: var(--wp--preset--color--text-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.cb-calendar-row a:hover {
	color: var(--wp--preset--color--accent);
}

.cb-calendar-wide {
	grid-column: 1 / span 4;
}

/* Number row: three big numbers, each with a caption under it. */
.cb-numbers {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--6);
}

.cb-numbers > * {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--2);
	margin: 0;
	padding-top: var(--wp--preset--spacing--5);
	border-top: 1px solid var(--wp--preset--color--border);
}

.cb-numbers .cb-number {
	margin: 0;
	color: var(--wp--preset--color--accent);
	font-size: clamp(2.25rem, 4vw, 3.5rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1;
	white-space: nowrap;
}

.cb-numbers .cb-number-caption {
	margin: 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.5;
}

/* Price card for the side of a landing page hero. */
.cb-price {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
	max-width: 420px;
	padding: var(--wp--preset--spacing--8);
	border: 1px solid var(--wp--preset--color--border);
	background-color: var(--wp--preset--color--surface);
}

.cb-price > * {
	margin: 0;
}

.cb-price .cb-price-label {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cb-price .cb-price-title {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--2xl);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.cb-price .cb-price-meta {
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 600;
	line-height: 1.5;
}

.cb-price .cb-price-rows {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: var(--wp--preset--spacing--4) 0;
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
	list-style: none;
}

.cb-price .cb-price-rows li {
	display: flex;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--4);
	color: var(--wp--preset--color--text-secondary);
	font-size: 0.9375rem;
}

.cb-price .cb-price-rows strong {
	color: var(--wp--preset--color--text-primary);
}

.cb-price .cb-price-rows li:first-child strong {
	color: var(--wp--preset--color--accent);
}

.cb-price .cb-btn,
.cb-price .wp-block-buttons {
	align-self: flex-start;
}

@media (max-width: 782px) {
	.cb-calendar-head {
		display: none;
	}

	.cb-calendar-row {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--1);
	}

	.cb-calendar-row [data-label]:not(:empty)::before {
		content: attr(data-label) ": ";
		color: var(--wp--preset--color--text-secondary);
	}

	.cb-calendar-wide {
		grid-column: auto;
	}

	.cb-numbers {
		grid-template-columns: 1fr;
	}

	.cb-price {
		max-width: none;
	}
}

/* ─── Shared text and header sizes (AT-872) ─────────────────────────────────────
 * One look on both sites; a child theme sets none of this (Theme architecture, section 2).
 * Body text (base) 18 px and lead text (lg) 20 px come from theme.json; 17 px and 18 px on a phone.
 * Site name 24 px (20 px on a phone), menu 16 px (theme.json), language switcher 15 px.
 */

/* The wordmark: the Site Title block (theme.json), or a paragraph with the class cb-wordmark. */
.cb-wordmark {
	margin: 0;
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--2xl);
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
}

.cb-wordmark a {
	color: inherit;
	text-decoration: none;
}

/* Language switcher next to the menu: ET | EN on .ee, EN | ET on .com. */
.cb-lang-switch {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--sm);
	letter-spacing: 0.08em;
	white-space: nowrap;
}

header .cb-lang-switch {
	font-size: 0.9375rem;
}

.cb-lang-switch strong {
	color: var(--wp--preset--color--text-primary);
}

.cb-lang-switch a {
	color: var(--wp--preset--color--text-secondary);
	text-decoration: none;
}

.cb-lang-switch a:hover {
	color: var(--wp--preset--color--accent);
}

/* Filled and outline buttons: one size on every page. */
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	padding: 14px 32px;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

/* Space above a heading that follows text, a list, buttons, a table or another heading. A section label
   (a class with "label") or a small inline xs line keeps its heading close; a step number has its own gap. */
.wp-block-group > .wp-block-heading + .wp-block-heading,
.wp-block-group > .wp-block-list + .wp-block-heading,
.wp-block-group > .wp-block-paragraph:not([class*="label"]):not(.cb-step-no):not([style*="font-size--xs"]) + .wp-block-heading,
.wp-block-group > .wp-block-buttons + .wp-block-heading,
.wp-block-group > .wp-block-table + .wp-block-heading {
	margin-top: var(--wp--preset--spacing--10);
}

/* The title under a step number sits 12 px below it. In a flex group the group's gap is that space, so
   the margin goes; a .cb-card has a 16 px gap, so its title moves 4 px up. */
.wp-block-group > .cb-step-no + .wp-block-heading {
	margin-top: var(--wp--preset--spacing--3);
}

.wp-block-group.is-layout-flex > .cb-step-no + .wp-block-heading {
	margin-top: 0;
}

.wp-block-group.cb-card.is-layout-flex > .cb-step-no + .wp-block-heading {
	margin-top: calc(var(--wp--preset--spacing--3) - var(--wp--preset--spacing--4));
}

/* A card built as a flex group: its parts run top to bottom with even gaps. */
.wp-block-group.cb-card.is-layout-flex {
	gap: var(--wp--preset--spacing--4);
	align-items: stretch;
}

@media (max-width: 782px) {
	body {
		--wp--preset--font-size--base: 1.0625rem;
		--wp--preset--font-size--lg: 1.125rem;
	}

	header .wp-block-site-title,
	header .cb-wordmark {
		font-size: var(--wp--preset--font-size--xl) !important;
	}

	/* Phone title rule: a page title that carries its size inline shrinks to the screen, and long
	   words such as strateegiatöötuba break, so a title never makes the page scroll sideways. */
	h1.wp-block-heading {
		hyphens: auto;
		hyphenate-limit-chars: 12 5 5;
		overflow-wrap: break-word;
	}

	.wp-block-group h1.wp-block-heading[style*="font-size"] {
		font-size: clamp(2rem, 9.5vw, 3rem) !important; /* the title blocks carry their size inline */
	}

	.wp-block-group.cb-card {
		padding: var(--wp--preset--spacing--5);
	}
}
