/* Resources and native WordPress posts. Scoped; inherits the A-LIFE palette. */
.ag-editorial {
	--ag-editorial-measure: 760px;
}

.ag-editorial-heading {
	max-width: 940px;
}

.ag-editorial .ag-page-title h1 {
	max-width: 24ch;
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.16;
	overflow-wrap: anywhere;
}

.ag-editorial-date {
	color: var(--ag-muted);
	font-size: 0.8125rem;
	line-height: 1.6;
}

.ag-editorial-hero {
	width: min(1020px, calc(100% - 80px));
	margin: clamp(2rem, 4vw, 3.25rem) auto 0;
}

.ag-editorial-hero img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 640px;
	object-fit: contain;
	border-radius: var(--ag-radius);
}

.ag-editorial-body,
.ag-editorial-back {
	width: min(var(--ag-editorial-measure), calc(100% - 80px));
	min-width: 0;
	margin-inline: auto;
}

.ag-editorial-body {
	padding-block: clamp(2rem, 4vw, 3.25rem) 1rem;
	color: var(--ag-ink);
	font-size: 1.0625rem;
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.ag-editorial-body > * {
	max-width: 100%;
	margin-block: 0 1.5rem;
}

.ag-editorial-body :where(h2, h3, h4, h5, h6) {
	color: var(--ag-ink);
	line-height: 1.3;
	letter-spacing: -0.025em;
	margin-block: 2.25rem 1rem;
	scroll-margin-top: 120px;
}

.ag-editorial-body h2 {
	font-size: clamp(1.625rem, 2.8vw, 2rem);
}

.ag-editorial-body h3 {
	font-size: clamp(1.3rem, 2.2vw, 1.5rem);
}

.ag-editorial-body :where(ul, ol) {
	padding-inline-start: 1.5rem;
}

.ag-editorial-body li + li {
	margin-top: 0.5rem;
}

.ag-editorial-body :where(a),
.ag-editorial-back a,
.ag-editorial-empty a {
	color: var(--ag-accent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

.ag-editorial-body a:hover,
.ag-editorial-back a:hover,
.ag-editorial-empty a:hover {
	color: var(--ag-ink);
}

.ag-editorial :where(a, summary):focus-visible,
.ag-editorial-resources a:focus-visible {
	outline: 3px solid var(--ag-accent);
	outline-offset: 4px;
}

.ag-editorial-body :where(img, video, iframe, embed, object) {
	max-width: 100%;
}

.ag-editorial-body :where(img, video) {
	height: auto;
}

.ag-editorial-body :where(figure, .wp-block-image, .wp-block-embed, .wp-block-columns, .wp-block-column) {
	min-width: 0;
	max-width: 100%;
}

.ag-editorial-body .alignleft,
.ag-editorial-body .alignright {
	max-width: min(45%, 340px);
}

.ag-editorial-body .alignwide,
.ag-editorial-body .alignfull {
	width: 100%;
	max-width: 100%;
	margin-inline: 0;
}

.ag-editorial-body :where(pre, .wp-block-table) {
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
}

.ag-editorial-body pre {
	padding: 1.25rem;
	background: var(--ag-tint);
	font-size: 0.875rem;
}

.ag-editorial-body table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.ag-editorial-body :where(th, td) {
	padding: 0.8rem;
	border: 1px solid var(--ag-line);
	text-align: start;
	vertical-align: top;
}

.ag-editorial-body blockquote {
	margin-inline: 0;
	padding: 1rem 1.5rem;
	border-inline-start: 3px solid var(--ag-accent);
	background: var(--ag-tint);
}

.ag-editorial-body figcaption {
	margin-top: 0.75rem;
	color: var(--ag-muted);
	font-size: 0.8125rem;
	line-height: 1.6;
}

.ag-editorial-back {
	padding-block: 1.5rem 4rem;
	border-top: 1px solid var(--ag-line);
	font-size: 0.9375rem;
}

.ag-editorial-resources {
	padding-block: clamp(2.75rem, 5vw, 5rem);
	border-top: 1px solid var(--ag-line);
	background: var(--ag-white);
}

.ag-editorial-resources h2 {
	margin: 0 0 2rem;
	color: var(--ag-ink);
	font-size: clamp(1.875rem, 3.2vw, 2.5rem);
	line-height: 1.2;
}

.ag-editorial-resources .ag-editorial-posts.wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.ag-editorial-posts > li {
	min-width: 0;
	margin: 0;
}

.ag-editorial-card {
	height: 100%;
	min-width: 0;
	border: 1px solid var(--ag-line);
	border-radius: var(--ag-radius);
	background: var(--ag-white);
	overflow-wrap: anywhere;
}

.ag-editorial-card .wp-block-post-featured-image {
	margin: 0;
}

.ag-editorial-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--ag-radius) var(--ag-radius) 0 0;
}

.ag-editorial-card-copy {
	padding: 24px;
}

.ag-editorial-card .wp-block-post-title {
	margin: 0.65rem 0 0.9rem;
	font-size: 1.25rem;
	line-height: 1.4;
	color: var(--ag-ink);
}

.ag-editorial-card .wp-block-post-title a {
	text-decoration: none;
}

.ag-editorial-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.ag-editorial-card .wp-block-post-excerpt {
	color: var(--ag-muted);
	font-size: 0.9375rem;
	line-height: 1.75;
}

.ag-editorial-card .wp-block-post-excerpt p,
.ag-editorial-empty p {
	margin: 0;
}

.ag-editorial-empty {
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid var(--ag-line);
	border-radius: var(--ag-radius);
	background: var(--ag-tint);
	color: var(--ag-muted);
}

.ag-editorial-pagination {
	gap: 12px;
	margin-top: 2rem;
	font-size: 0.9375rem;
}

.ag-editorial-pagination :where(a, .page-numbers) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 8px 12px;
}

.ag-editorial-pagination .current {
	background: var(--ag-tint);
	color: var(--ag-ink);
	border: 1px solid var(--ag-line);
	border-radius: 4px;
}

@media (max-width: 900px) {
	.ag-editorial-resources .ag-editorial-posts.wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ag-editorial-body,
	.ag-editorial-back,
	.ag-editorial-hero {
		width: min(var(--ag-editorial-measure, 760px), calc(100% - 48px));
	}
}

@media (max-width: 600px) {
	.ag-editorial-resources .ag-editorial-posts.wp-block-post-template {
		grid-template-columns: minmax(0, 1fr);
	}
	.ag-editorial-body,
	.ag-editorial-back,
	.ag-editorial-hero {
		width: calc(100% - 36px);
	}
	.ag-editorial-body {
		font-size: 1rem;
		line-height: 1.8;
	}
	.ag-editorial-body .alignleft,
	.ag-editorial-body .alignright {
		float: none;
		width: auto;
		max-width: 100%;
		margin-inline: 0;
	}
	.ag-editorial-card-copy {
		padding: 20px;
	}
	.ag-editorial-pagination {
		justify-content: flex-start;
	}
}
