/*
Theme Name: Toeta last
Description: toetalast.ee – SOS Lasteküla jõulukampaania plokiteema.
Version: 0.5.18
Requires at least: 7.0
Requires PHP: 8.4
Author: toetalast.ee
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toetalast
*/

/* Small layout rules theme.json cannot express. */
.wp-element-button {
	white-space: nowrap;
}

.toetalast-logo img {
	width: clamp(120px, 32vw, 168px) !important; /* Overrides the image block's inline width. */
	height: auto;
}

@media (max-width: 480px) {
	header .wp-block-button__link {
		padding: 0.55rem 1.1rem;
	}
}

/* "Kuidas see toimib" steps (pattern toetalast/kuidas-see-toimib): numbered columns. */
.toetalast-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: var(--wp--preset--spacing--40);
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.toetalast-steps li {
	counter-increment: step;
}

.toetalast-steps li::before {
	content: counter(step);
	display: block;
	margin-bottom: 0.3rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 600;
	line-height: 1;
	color: var(--wp--preset--color--primary);
}

/* Stacked variant (front page, next to the video): one step per row, number on the left. */
.toetalast-steps--stacked {
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--30);
}

.toetalast-steps--stacked li {
	position: relative;
	min-height: 2.5rem;
	padding-left: 3.25rem;
}

.toetalast-steps--stacked li::before {
	position: absolute;
	top: 0;
	left: 0;
	margin: 0;
}

/* Flat illustrations next to a heading (e.g. "Aita rohkem"). */
.toetalast-illustration img {
	display: block;
	width: 100%;
	max-width: 520px;
	margin-inline: auto;
}

/* FAQ (core/details with class toetalast-faq) */
.toetalast-faq {
	margin-block: 0;
	padding: var(--wp--preset--spacing--30) 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--secondary) 15%, transparent);
}

.toetalast-faq summary {
	font-weight: 600;
	cursor: pointer;
}

.toetalast-faq p {
	margin-bottom: 0;
}

/* Content pages: more air above section headings. */
.wp-block-post-content > h2 {
	margin-top: var(--wp--preset--spacing--50);
}

/* Short pages (cart, a wish, Meist): main grows so the footer stays at the bottom of the screen. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main {
	flex-grow: 1;
}

/* Footer link lists: no bullets, a little air between rows. */
.toetalast-footer-links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.toetalast-footer-links li + li {
	margin-top: var(--wp--preset--spacing--20);
}

.toetalast-footer-bottom {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--white) 20%, transparent);
}

.toetalast-footer-bottom p {
	margin: 0;
}

/* Footer sits flush against the last section (e.g. the pink thank-you band on the front page). */
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

/*
 * Front page video (pattern "kuidas-see-toimib", right column): portrait 9:16, never taller than ~75% of the screen,
 * centred in its column; poster (frame at 0:20, a bauble on the fir) shown until the visitor presses play.
 */
.toetalast-video {
	margin: 0;
}

.toetalast-video video {
	display: block;
	width: 100%;
	max-width: min(100%, calc(75svh * 9 / 16));
	height: auto;
	aspect-ratio: 9 / 16;
	margin-inline: auto;
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--contrast);
	object-fit: cover;
	box-shadow: 0 1rem 2.5rem color-mix(in srgb, var(--wp--preset--color--contrast) 35%, transparent);
}
