/* Reset, base elements, layout primitives. */

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

html {
	font-size: 62.5%;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--white);
	color: var(--text-color);
	font-family: var(--font-display);
	font-size: var(--text-m);
	line-height: 1.5;
}

/* Heading defaults as on the Bricks/ACSS site; components override size and weight. */
h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--text-color);
	font-family: var(--font-display);
	line-height: 1.2;
}

h1 { font-size: var(--h1); font-weight: 400; }
h2 { font-size: var(--h2); font-weight: 700; }
h3 { font-size: var(--h3); font-weight: 700; }
h4 { font-size: var(--h4); font-weight: 350; }
h5 { font-size: var(--h5); font-weight: 700; }
h6 { font-size: var(--h6); font-weight: 700; }

/*
 * The Bricks "Single Post" templates (all single post types) carried page-wide custom CSS
 * h1–h6 { font-weight: 350; margin-bottom: 1rem } (its colour/size lost to ACSS). It hits every
 * heading without its own weight/margin — content headings and the footer titles alike — so it is
 * kept at element specificity here.
 */
:where(.single-post, .single-materiali_post_type, .single-promotions, .single-aprikojums_cpt, .single-seminari_cpt, .single-noderigi, .single-noderigi_cpt) :is(h1, h2, h3, h4, h5, h6) {
	font-weight: 350;
	margin-bottom: 1rem;
}

p,
ul,
ol,
figure {
	margin: 0;
}

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

/* Embeds keep their height attribute (the Mitto registration iframe sets it from postMessage). */
iframe {
	display: block;
	max-width: 100%;
}

a {
	color: var(--action);
	text-decoration: none;
	transition: color var(--transition);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--action);
	outline-offset: 2px;
}

/* Layout */

.container {
	width: 100%;
	max-width: calc(var(--width-content) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section {
	padding-block: var(--section-space-m);
}

.stack > * + * {
	margin-top: var(--content-gap);
}

/* Utilities */

.screen-reader-text:not(:focus) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link:focus {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 100;
	padding: 1rem 1.6rem;
	background: var(--white);
	color: var(--action);
}
