/* ==========================================================================
   layout.css — page container, grids, vertical rhythm, prose
   ========================================================================== */

/* Class-only on purpose: the page container is used on <div>, <section> and
   anything else that needs the site gutter. */
.page {
	width: min(92%, var(--page-max));
	margin-inline: auto;
}

main {
	display: block;
	padding-bottom: var(--s-8);
}

/* Consistent spacing between top-level bands. */
.section {
	margin-top: var(--s-8);
}

.section:first-child {
	margin-top: var(--s-7);
}

/* Heading row: title on the left, an action or control on the right. */
.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: var(--s-4);
	margin-bottom: var(--s-5);
}

.section-head__title {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
}

.section-head__title p {
	color: var(--ink-muted);
	font-size: var(--t-md);
	max-width: 46ch;
}

/* Auto-fitting card grid. Replaces the old 4/3/2/1 breakpoint ladder. */
.grid-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
	gap: var(--s-6) var(--s-5);
}

/* For short, fixed sets (services) — stretch to fill rather than leaving a
   trailing empty column. */
.grid-cards--fit {
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

/* Two-up grid for editorial pairings (image + copy). */
.grid-split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
	gap: var(--s-6);
	align-items: start;
}

/* Asymmetric detail layout: main column + sidebar. */
.layout-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--s-6);
	align-items: start;
}

@media (min-width: 62rem) {
	.layout-detail {
		grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
		gap: var(--s-6);
	}

	.layout-detail--wide-first {
		grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
	}

	.layout-detail__aside {
		position: sticky;
		top: var(--s-6);
	}
}

/* Long-form copy. */
.prose {
	max-width: var(--measure);
	color: var(--ink);
}

.prose> * + * {
	margin-top: var(--s-4);
}

.prose h2,
.prose h3 {
	margin-top: var(--s-6);
}

.prose ul,
.prose ol {
	padding-left: 1.35em;
}

.prose li + li {
	margin-top: var(--s-2);
}

.prose a {
	text-decoration: underline;
}

.prose a.btn,
.prose a.link-arrow {
	text-decoration: none;
}

/* Component lists inside prose keep their own layout. */
.prose .social {
	padding-left: 0;
}

.prose .social li + li {
	margin-top: 0;
}

/* Empty and error states. */
.state {
	grid-column: 1 / -1;
	max-width: 44rem;
	margin-inline: auto;
	padding: var(--s-8) var(--s-5);
	border: 1px dashed var(--line-strong);
	border-radius: var(--r-lg);
	background: var(--surface);
	text-align: center;
}

.state h3 {
	margin-bottom: var(--s-2);
}

.state p {
	color: var(--ink-muted);
	font-size: var(--t-md);
	margin-inline: auto;
	max-width: 40ch;
}

/* Panel: the generic soft surface everything else is built from. */
.panel {
	background: var(--surface);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.panel--mint {
	background: var(--mint);
	box-shadow: none;
}

.panel__body {
	padding: var(--s-5);
}

@media (min-width: 48rem) {
	.panel__body {
		padding: var(--s-6);
	}
}

/* ==========================================================================
   Legacy two-column primitive, still used by the events pages.
   ========================================================================== */

.flexpage {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-5);
	align-items: start;
}

.flexpage .left-container {
	flex: 1 1 22rem;
	padding: var(--s-5);
	background: var(--surface);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-sm);
}

.flexpage .right-container {
	flex: 1 1 18rem;
	padding: var(--s-5);
	background: var(--mint);
	border-radius: var(--r-lg);
}

/* ==========================================================================
   Modal overlay (driven by static/popup.js, shared with the admin UI)
   ========================================================================== */

.overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(0, 40, 15, .42);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.overlay .modal {
	display: none;
	width: min(92%, 26rem);
	margin: var(--s-6) auto;
	padding: var(--s-5);
	background: var(--surface);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-lg);
}
