/*
 * Base layout for the page markup: reset, the flow / flex spacing, and the generic
 * blocks (group, columns, buttons, image, gallery, table, video, audio).
 * The design itself lives in additional.css, which loads after this file.
 */

/* Reset */
html {
	box-sizing: border-box;
}

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

body {
	margin: 0;
}

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

img:is([sizes="auto" i], [sizes^="auto," i]) {
	contain-intrinsic-size: 3000px 1500px;
}

:where(figure) {
	margin: 0 0 1em;
}

summary {
	cursor: pointer;
}

/* Flow: children stack with a 24px gap */
:root :where(.lr-flow) > * {
	margin-block: 24px 0;
}

:root :where(.lr-flow) > :first-child {
	margin-block-start: 0;
}

:root :where(.lr-flow) > :last-child {
	margin-block-end: 0;
}

/* Flex: a wrapping row with a 24px gap */
body .lr-flex {
	display: flex;
}

.lr-flex {
	flex-wrap: wrap;
	align-items: center;
}

:root :where(.lr-flex) {
	gap: 24px;
}

.lr-flex > :is(*, div) {
	margin: 0;
}

/* Columns: side by side from 782px, stacked below */
.lr-columns {
	display: flex;
	flex-wrap: wrap !important;
	align-items: normal !important;
}

:where(.lr-columns) {
	margin-bottom: 1.75em;
}

.lr-column {
	flex-grow: 1;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: break-word;
}

/*
 * `:not(.lr-columns--no-stack)` is an opt-out for columns that should stay side by side on
 * narrow screens; it also keeps these rules above single-class overrides in additional.css.
 */
@media (min-width: 782px) {
	.lr-columns {
		flex-wrap: nowrap !important;
	}

	.lr-columns:not(.lr-columns--no-stack) > .lr-column {
		flex-basis: 0;
		flex-grow: 1;
	}
}

@media (max-width: 781px) {
	.lr-columns:not(.lr-columns--no-stack) > .lr-column {
		flex-basis: 100% !important;
	}
}

/* Buttons */
.lr-buttons > .lr-button {
	display: inline-block;
	margin: 0;
}

.lr-buttons .lr-button__link {
	width: 100%;
}

.lr-button__link {
	display: inline-block;
	height: 100%;
	align-content: center;
	cursor: pointer;
	text-align: center;
	word-break: break-word;
}

:root :where(.lr-button__link) {
	padding: calc(.667em + 2px) calc(1.333em + 2px);
	border-width: 0;
	border-radius: 9999px;
	background-color: #32373c;
	box-shadow: none;
	color: #fff;
	font: inherit;
	letter-spacing: inherit;
	text-decoration: none;
	text-transform: inherit;
}

/* Image */
.lr-image > a,
.lr-image > figure > a {
	display: inline-block;
}

.lr-image img {
	max-width: 100%;
	height: auto;
	vertical-align: bottom;
}

.lr-image :where(figcaption) {
	margin-top: .5em;
	margin-bottom: 1em;
}

/*
 * Gallery: two cropped images per row.
 * `:not(#lr-gallery)` lifts these to ID specificity on purpose, so the cropping and the
 * two-up width win over per-page image rules in additional.css.
 */
figure.lr-gallery {
	align-items: normal;
}

.lr-gallery figure.lr-image {
	position: relative;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	justify-content: center;
	max-width: 100%;
}

.lr-gallery figure.lr-image img {
	display: block;
	max-width: 100% !important;
}

.lr-gallery figure.lr-image:not(#lr-gallery) {
	align-self: inherit;
	width: calc(50% - 12px);
	margin: 0;
}

.lr-gallery figure.lr-image:not(#lr-gallery) a,
.lr-gallery figure.lr-image:not(#lr-gallery) img {
	flex: 1 0 0%;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Table */
.lr-table {
	overflow-x: auto;
}

.lr-table table {
	width: 100%;
	border-collapse: collapse;
}

.lr-table td,
.lr-table th {
	padding: .5em;
	border: 1px solid;
}

/* Video / audio */
.lr-video video {
	width: 100%;
	height: auto;
	vertical-align: middle;
}

.lr-audio :where(figcaption) {
	margin-top: .5em;
	margin-bottom: 1em;
}

.lr-audio audio {
	width: 100%;
	min-width: 300px;
}
