/* cloudbee.ee child theme: only the layouts of its own pages. Text sizes, the site name, the menu,
 * the language switcher, buttons, section labels, step numbers and the phone title rule come from the parent cloudbee 2.4.0
 * (Theme architecture, section 2); tests/theme-test.php fails when a shared rule comes back here. */

/* E-mail address and phone number: inline SVG drawings from inc/contact.php, sized like the text around them. */
.cb-contact {
	color: var(--wp--preset--color--text-primary);
	white-space: nowrap;
}

.cb-contact-svg {
	display: inline-block;
	width: auto;
	height: 1.21em;
	vertical-align: -0.241em;
}

/* cloudbee.ee child theme: rules for the elements the parent design does not know.
 * The group calendar grid is the parent component .cb-calendar; only its status label is here. */

.cb-next-group,
.cb-status {
	color: var(--wp--preset--color--text-primary);
}
.cb-status {
	display: inline-block;
	margin-top: var(--wp--preset--spacing--2);
	padding: 2px 10px;
	border: 1px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.cb-calculator a:not(.wp-element-button) {
	color: var(--wp--preset--color--accent);
}
.cb-next-group {
	font-weight: 600;
}

.cb-calculator {
	max-width: 520px;
	padding: var(--wp--preset--spacing--6);
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
}
.cb-calculator label {
	display: block;
	margin-bottom: var(--wp--preset--spacing--2);
	color: var(--wp--preset--color--text-primary);
	font-weight: 600;
}
.cb-calculator input[type="number"] {
	width: 120px;
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--lg);
}
.cb-calc-result {
	list-style: none;
	margin: var(--wp--preset--spacing--5) 0;
	padding: 0;
	color: var(--wp--preset--color--text-secondary);
	line-height: 1.9;
}
.cb-calc-result strong {
	color: var(--wp--preset--color--text-primary);
}
.cb-form-note {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.6;
}
.cb-form-note a {
	color: var(--wp--preset--color--accent);
}

.cb-form-field select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text-primary);
	font: inherit;
}

.cb-table table {
	width: 100%;
	border-collapse: collapse;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.6;
}
.cb-table th,
.cb-table td {
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--border);
	vertical-align: top;
	text-align: left;
}
.cb-table th {
	color: var(--wp--preset--color--text-primary);
	background: var(--wp--preset--color--surface);
}

/* ─── Front page and the other .ee layouts (AT-872) ─────────────────────────────
 * Typography and spacing come from classes, not from inline block styles, so the parent's
 * rules that match inline styles (hero heading size, section padding) do not apply here.
 */

.wp-block-group.cb-ee-section {
	padding: var(--wp--preset--spacing--24) var(--wp--preset--spacing--8);
}

.wp-block-group.cb-ee-band {
	background-color: var(--wp--preset--color--surface);
}

.wp-block-group.cb-ee-hero {
	padding-top: 11rem;
	padding-bottom: 10.5rem;
}

.wp-block-group.cb-ee-cta {
	padding-top: var(--wp--preset--spacing--32);
	padding-bottom: var(--wp--preset--spacing--32);
}

/* The label style is the parent .cb-label; here only its place in the .ee layout. */
.cb-ee-label {
	margin: 0;
}

.wp-block-group.cb-ee-wrap > * {
	margin-top: 0;
	margin-bottom: 0;
}

.wp-block-group.cb-ee-wrap > * + * {
	margin-top: var(--wp--preset--spacing--6);
}

.wp-block-group.cb-ee-wrap > .cb-ee-label + .wp-block-heading,
.cb-ee-split-text > .cb-ee-label + .wp-block-heading {
	margin-top: var(--wp--preset--spacing--3);
}

.cb-ee-h1 {
	max-width: 16ch;
	color: var(--wp--preset--color--text-primary);
	font-size: clamp(2.625rem, 5.6vw, 4.5rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.02;
}

.cb-ee-h2 {
	max-width: 24ch;
	color: var(--wp--preset--color--text-primary);
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.cb-ee-h3 {
	margin: 0;
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.cb-ee-lead {
	max-width: 46ch;
	color: var(--wp--preset--color--text-secondary);
	font-size: clamp(1.125rem, 1.8vw, 1.375rem);
	line-height: 1.7;
}

.cb-ee-text {
	max-width: 60ch;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.7;
}

.cb-ee-text-sm {
	margin: 0;
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.7;
}

.cb-ee-more {
	margin: 0;
}

.cb-ee-more a,
.wp-block-paragraph.cb-ee-more a {
	color: var(--wp--preset--color--text-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.cb-ee-more a:hover,
.wp-block-paragraph.cb-ee-more a:hover {
	color: var(--wp--preset--color--accent);
}

.wp-block-group.cb-ee-grid {
	display: grid;
	gap: var(--wp--preset--spacing--6);
}

.wp-block-group.cb-ee-wrap > .cb-ee-grid {
	margin-top: var(--wp--preset--spacing--10);
}

.wp-block-group.cb-ee-grid > * {
	margin: 0;
}

.cb-ee-grid-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cb-ee-grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cb-ee-grid > .cb-ee-wide {
	grid-column: 1 / -1;
}

.cb-card > .cb-ee-text-sm {
	flex: 1;
}

.cb-ee-step {
	padding-top: var(--wp--preset--spacing--5);
	border-top: 1px solid var(--wp--preset--color--border);
}

.wp-block-group.cb-ee-step > * + * {
	margin-top: var(--wp--preset--spacing--3);
}

/* The number style is the parent .cb-step-no. */
.cb-ee-step-no {
	margin: 0;
}

.wp-block-group.cb-ee-split {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--12);
	align-items: stretch;
}

.wp-block-group.cb-ee-split > * {
	margin: 0;
}

.cb-ee-split-text {
	flex: 1 1 440px;
	min-width: 0;
}

.wp-block-group.cb-ee-split-text > * + * {
	margin-top: var(--wp--preset--spacing--5);
}

.cb-ee-photo {
	display: flex;
	flex: 1 1 360px;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 320px;
	padding: var(--wp--preset--spacing--6);
	border: 1px solid var(--wp--preset--color--border);
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--sm);
	text-align: center;
}

/* With the photo in it the frame has no padding, and the photo fills it. */
.cb-ee-photo:has(img) {
	padding: 0;
}

.wp-block-group.cb-ee-photo > .wp-block-image {
	width: 100%;
	height: 100%;
	margin: 0;
}

.cb-ee-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cb-ee-ticks {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--3);
	padding: 0;
	list-style: none;
	color: var(--wp--preset--color--text-primary);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.6;
}

.cb-ee-ticks li {
	padding-left: var(--wp--preset--spacing--5);
	border-left: 2px solid var(--wp--preset--color--accent);
}

.cb-ee-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--3);
	padding: 0;
	list-style: none;
}

.cb-ee-chips li {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
	border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-primary);
	font-size: 0.9375rem;
	font-weight: 600;
}

.wp-block-group.cb-ee-comline {
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--8);
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.cb-ee-comline-row > p {
	margin: 0;
}

@media (max-width: 900px) {
	.cb-ee-grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 782px) {
	.wp-block-group.alignfull.cb-ee-section,
	.wp-block-group.alignfull.cb-ee-comline {
		padding-left: var(--wp--preset--spacing--4) !important;
		padding-right: var(--wp--preset--spacing--4) !important;
	}

	.wp-block-group.cb-ee-section {
		padding-top: var(--wp--preset--spacing--12);
		padding-bottom: var(--wp--preset--spacing--12);
	}

	.wp-block-group.cb-ee-hero {
		padding-top: 5.5rem;
		padding-bottom: 5rem;
	}

	.wp-block-group.cb-ee-cta {
		padding-top: var(--wp--preset--spacing--16);
		padding-bottom: var(--wp--preset--spacing--16);
	}

	.cb-ee-hero .wp-block-button,
	.cb-ee-cta .wp-block-button {
		width: 100%;
	}

	.cb-ee-hero .wp-block-button__link,
	.cb-ee-cta .wp-block-button__link {
		justify-content: center;
		width: 100%;
	}
}

@media (max-width: 600px) {
	.cb-ee-grid-4,
	.cb-ee-grid-2 {
		grid-template-columns: 1fr;
	}
}

/* ─── Landing pages (AT-873) ────────────────────────────────────────────────────
 * Template landing-*, Kodulehe struktuur section 13. The price card .cb-price and the number row
 * .cb-numbers are parent components; here only their place in the .ee layout.
 */

.wp-block-group.cb-ee-lp-hero {
	padding-top: var(--wp--preset--spacing--16);
}

.wp-block-group.cb-ee-lp-hero .cb-ee-split-text > .cb-ee-ticks {
	margin-top: var(--wp--preset--spacing--8);
}

.cb-ee-split > .cb-price {
	flex: 0 1 380px;
	align-self: flex-start;
}

.cb-ee-split > .cb-price .cb-price-rows strong {
	white-space: nowrap;
}

.cb-ee-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cb-ee-lp-form .cb-contact-form {
	max-width: 640px;
}

@media (max-width: 782px) {
	.wp-block-group.cb-ee-lp-hero {
		padding-top: var(--wp--preset--spacing--10);
	}

	.cb-ee-split > .cb-price {
		flex-basis: 100%;
		max-width: none;
	}

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