/*
 * Ultra Editorial — the shared newsroom design system.
 *
 * One framework, five websites. This file owns *structure, rhythm and behaviour*: the
 * featured story, the post card, the grid, the sidebar, the article column, the table of
 * contents, the pagination. It owns no brand: every colour, font and radius arrives from
 * the theme through the `--ed-*` custom properties below, so APOG-K stays an association
 * journal, Pumwani stays a hospital, Greysand stays a consultancy — without any of them
 * copying another's look.
 *
 * Rules this file keeps:
 *   - Nothing here is loaded with a hard-coded brand colour. Missing tokens fall back to
 *     neutral, readable greys, never to another site's palette.
 *   - Images always fill a fixed ratio box (`aspect-ratio` + `object-fit: cover`), so a
 *     portrait upload cannot distort a card or shift a row.
 *   - One breakpoint set for the whole family: 1180 / 960 / 720 / 520.
 *   - Text is never smaller than 0.78rem, and every interactive element is at least 24px
 *     in its shortest dimension (WCAG 2.2, target size minimum).
 *
 * Synced into every theme by tools/sync-shared-framework.py; edit the canonical copy in
 * shared/ and re-run the tool.
 */

/* ------------------------------------------------------------------ tokens */
.apog-ed,
.ud-ed {
	--ed-ink: #1c2b24;
	--ed-body: #3f4a45;
	--ed-muted: #6d7873;
	--ed-line: #e3e0d8;
	--ed-surface: #ffffff;
	--ed-tint: #f5f3ee;
	--ed-accent: #b5441f;
	--ed-accent-ink: #ffffff;
	--ed-radius: 12px;
	--ed-radius-sm: 8px;
	--ed-shadow: 0 1px 2px rgba(20, 40, 29, .06), 0 8px 24px rgba(20, 40, 29, .06);
	--ed-shadow-hover: 0 2px 4px rgba(20, 40, 29, .08), 0 14px 34px rgba(20, 40, 29, .12);
	--ed-font-head: inherit;
	--ed-font-body: inherit;
	--ed-gap: 28px;
	--ed-side: 320px;
	--ed-measure: 68ch;
	color: var(--ed-body);
	font-family: var(--ed-font-body);
}

/* ------------------------------------------------------------------ layout */
.apog-ed-shell {
	padding-block: clamp(28px, 4vw, 52px);
}

.apog-ed-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(28px, 3.4vw, 44px);
	align-items: start;
}

@media (min-width: 1180px) {
	.apog-ed-layout.has-side {
		grid-template-columns: minmax(0, 1fr) var(--ed-side);
	}
}

.apog-ed-main {
	min-width: 0;
}

/* ------------------------------------------------------------------- trail */
/* Icons travel as bare SVGs, so without a size they inherit the width of whatever box
   they land in — which is how a magnifier ends up 90px wide. One default, overridden
   where a component wants something else (the meta row asks for 14px).
   A *drawing* is not an icon: a page hero's curve, a divider, an illustration opts out
   with `data-ed-decor`, because an 18px-wide curve is an invisible curve. */
.apog-ed svg:not([data-ed-decor]) {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.apog-ed svg[data-ed-decor] {
	width: auto;
	height: auto;
	flex: 0 0 auto;
}

.apog-ed-trail {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: .82rem;
	color: var(--ed-muted);
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}

.apog-ed-trail a {
	color: var(--ed-muted);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.apog-ed-trail a:hover,
.apog-ed-trail a:focus-visible {
	color: var(--ed-accent);
	border-bottom-color: currentColor;
}

.apog-ed-trail li + li::before {
	content: "›";
	margin-right: 8px;
	color: var(--ed-line);
}

.apog-ed-trail [aria-current="page"] {
	color: var(--ed-ink);
	font-weight: 600;
}

/* --------------------------------------------------------------- filter bar */
/* The categories sit in one card, the way a menu sits on a table: a single white
   surface with the current channel filled in, rather than a scatter of loose pills
   that reads as tags. Everything below it — fields, then tools — is the same surface. */
.apog-ed-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	padding: 8px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	background: var(--ed-surface);
	margin: 0 0 14px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.apog-ed-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	max-width: 100%;
}

.apog-ed-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 38px;
	padding: 8px 10px;
	border: 0;
	border-radius: calc(var(--ed-radius) - 4px);
	background: transparent;
	color: var(--ed-ink);
	font-size: .82rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .16s ease, color .16s ease;
}

.apog-ed-pill:hover,
.apog-ed-pill:focus-visible {
	background: var(--ed-tint);
	color: var(--ed-ink);
}

.apog-ed-pill[aria-current="page"],
.apog-ed-pill.is-on {
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
}

.apog-ed-pill b {
	font-weight: 600;
	font-size: .76em;
	opacity: .65;
	font-variant-numeric: tabular-nums;
}

/* Layout and order share a row of their own: what the page looks like on the left,
   how it is ordered on the right. They are choices, so they are drawn as choices. */
.apog-ed-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 18px;
	margin: 0 0 24px;
}

.apog-ed-views {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	border: 1px solid var(--ed-line);
	border-radius: 999px;
	background: var(--ed-surface);
	font-size: .84rem;
	color: var(--ed-muted);
}

.apog-ed-views > span {
	padding: 0 8px 0 10px;
	font-weight: 600;
}

.apog-ed-views a {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 5px 14px;
	border-radius: 999px;
	color: var(--ed-ink);
	font-weight: 600;
	text-decoration: none;
	transition: background-color .16s ease, color .16s ease;
}

.apog-ed-views a.is-active {
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
	font-weight: 700;
}

.apog-ed-views a:hover,
.apog-ed-views a:focus-visible {
	background: var(--ed-tint);
	color: var(--ed-ink);
}

.apog-ed-views a.is-active:hover,
.apog-ed-views a.is-active:focus-visible {
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
}

.apog-ed-sort {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-size: .84rem;
	color: var(--ed-muted);
	font-weight: 600;
}

.apog-ed-sort > span {
	white-space: nowrap;
}

.apog-ed-sort select {
	min-height: 40px;
	padding: 0 34px 0 14px;
	border: 1px solid var(--ed-line);
	border-radius: 999px;
	background: var(--ed-surface);
	color: var(--ed-ink);
	font: inherit;
	font-weight: 600;
}

/* One row of fields on desktop, each one named above the box it labels — a reader
   should not have to guess which date box is "from". The search field takes the room
   the others do not need; the button sits at the end of the row. */
/* `auto-fit` rather than a fixed column count: the newsroom's main column is as wide as
   the sidebar leaves it, not as wide as the window, so a viewport media query would break
   either the wide layouts or the narrow ones. The search field takes two columns; the rest
   share what is left and wrap when they must, without a field ever being clipped. */
.apog-ed-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
	gap: 10px;
	align-items: end;
	margin: 0 0 16px;
}

.apog-ed-field.is-search {
	grid-column: span 2;
}

.apog-ed-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	color: var(--ed-muted);
	font-size: .86rem;
}

.apog-ed-label {
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--ed-muted);
}

/* The control is a wrapper when there is an icon to place, and a bare input or select
   when there is not, so both shapes have to look the same. */
.apog-ed-control,
.apog-ed-field > input,
.apog-ed-field > select {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 13px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius-sm);
	background: var(--ed-surface);
	color: var(--ed-muted);
	font: inherit;
	width: 100%;
}

.apog-ed-control:focus-within,
.apog-ed-field > input:focus,
.apog-ed-field > select:focus {
	border-color: var(--ed-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-accent) 18%, transparent);
	outline: none;
}

.apog-ed-control input,
.apog-ed-control select {
	border: 0;
	background: transparent;
	color: var(--ed-ink);
	font: inherit;
	min-height: 44px;
	padding: 0;
	width: 100%;
	outline-offset: 2px;
}

.apog-ed-field > input,
.apog-ed-field > select {
	color: var(--ed-ink);
}

.apog-ed-field input::placeholder {
	color: var(--ed-muted);
}

.apog-ed-filters .apog-ed-btn {
	min-height: 46px;
}

.apog-ed-filters .apog-ed-btn--ghost {
	min-height: 46px;
}

.apog-ed-btn {
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: var(--ed-radius-sm);
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
	font: inherit;
	font-weight: 700;
	font-size: .88rem;
	text-decoration: none;
	cursor: pointer;
	transition: filter .16s ease, transform .16s ease;
}

.apog-ed-btn:hover,
.apog-ed-btn:focus-visible {
	filter: brightness(.94);
}

.apog-ed-btn--ghost {
	background: transparent;
	border-color: var(--ed-line);
	color: var(--ed-ink);
}

.apog-ed-btn--ghost:hover,
.apog-ed-btn--ghost:focus-visible {
	border-color: var(--ed-accent);
	color: var(--ed-accent);
	filter: none;
}

/* ------------------------------------------------------------------- chips */
.apog-ed-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 11px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ed-accent) 12%, transparent);
	color: color-mix(in srgb, var(--ed-accent) 88%, #000);
	font-size: .74rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.2;
}

.apog-ed-chip:hover,
.apog-ed-chip:focus-visible {
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
}

.apog-ed-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	font-size: .8rem;
	color: var(--ed-muted);
}

.apog-ed-meta > span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.apog-ed-meta svg {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	opacity: .8;
}

/* --------------------------------------------------------------- featured */
.apog-ed-featured {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
	background: var(--ed-surface);
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	overflow: hidden;
	margin: 0 0 clamp(30px, 4vw, 46px);
}

@media (min-width: 860px) {
	.apog-ed-featured {
		grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
	}
}

.apog-ed-featured-media {
	position: relative;
	display: block;
	background: var(--ed-tint);
}

.apog-ed-featured-media img {
	width: 100%;
	height: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	display: block;
}

.apog-ed-featured-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.apog-ed-featured-body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: clamp(22px, 2.6vw, 34px);
}

.apog-ed-featured-body h2 {
	font-family: var(--ed-font-head);
	font-size: clamp(1.35rem, 2.3vw, 1.9rem);
	line-height: 1.22;
	margin: 0;
	color: var(--ed-ink);
	letter-spacing: -.01em;
}

.apog-ed-featured-body h2 a {
	color: inherit;
	text-decoration: none;
}

.apog-ed-featured-body h2 a:hover,
.apog-ed-featured-body h2 a:focus-visible {
	color: var(--ed-accent);
}

.apog-ed-featured-body p {
	margin: 0;
	color: var(--ed-body);
	line-height: 1.62;
	font-size: .95rem;
	max-width: 46ch;
	/* Equal-height cards: an excerpt stops at three lines rather than deciding the height
	   of the whole row, which is what makes a grid of news look ragged. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.apog-ed-featured-body .apog-ed-btn {
	align-self: flex-start;
	margin-top: auto;
}

/* ------------------------------------------------------------- section head */
.apog-ed-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--ed-ink);
}

.apog-ed-head h2 {
	font-family: var(--ed-font-head);
	font-size: clamp(1.25rem, 2vw, 1.6rem);
	margin: 0;
	color: var(--ed-ink);
	letter-spacing: -.01em;
}

.apog-ed-head a {
	font-size: .84rem;
	font-weight: 700;
	color: var(--ed-accent);
	text-decoration: none;
	white-space: nowrap;
}

.apog-ed-head a:hover,
.apog-ed-head a:focus-visible {
	text-decoration: underline;
}

/* ------------------------------------------------------------------- cards */
/* Three across is the reference layout and the reason the cards stay card-sized instead of
   stretching into banners. The main column is narrower than the page once a sidebar is
   present, so the count is fixed by breakpoint rather than left to auto-fill. */
.apog-ed-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(20px, 2.4vw, var(--ed-gap));
	margin: 0;
	padding: 0;
	list-style: none;
}

.apog-ed-card {
	display: flex;
	flex-direction: column;
	background: var(--ed-surface);
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	overflow: hidden;
	height: 100%;
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.apog-ed-card:hover,
.apog-ed-card:focus-within {
	box-shadow: var(--ed-shadow-hover);
	border-color: color-mix(in srgb, var(--ed-accent) 30%, var(--ed-line));
	transform: translateY(-2px);
}

.apog-ed-card-media {
	position: relative;
	display: block;
	background: var(--ed-tint);
	overflow: hidden;
}

.apog-ed-card-media > a {
	display: block;
}

.apog-ed-card-media img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}

.apog-ed-card:hover .apog-ed-card-media img {
	transform: scale(1.03);
}

.apog-ed-card-media .apog-ed-chip {
	position: absolute;
	left: 12px;
	bottom: 12px;
	background: var(--ed-surface);
	color: var(--ed-ink);
	box-shadow: 0 1px 6px rgba(0, 0, 0, .16);
}

.apog-ed-card-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 18px 20px;
	flex: 1 1 auto;
}

.apog-ed-card-body h3 {
	font-family: var(--ed-font-head);
	font-size: 1.06rem;
	line-height: 1.32;
	margin: 0;
	color: var(--ed-ink);
	letter-spacing: -.005em;
}

.apog-ed-card-body h3 a {
	color: inherit;
	text-decoration: none;
}

.apog-ed-card-body h3 a:hover,
.apog-ed-card-body h3 a:focus-visible {
	color: var(--ed-accent);
}

.apog-ed-card-body p {
	margin: 0;
	font-size: .88rem;
	line-height: 1.58;
	color: var(--ed-body);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.apog-ed-card-foot {
	margin-top: auto;
	padding-top: 6px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.apog-ed-more {
	font-size: .82rem;
	font-weight: 800;
	color: var(--ed-accent);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.apog-ed-more:hover,
.apog-ed-more:focus-visible {
	text-decoration: underline;
}

.apog-ed-read {
	font-size: .76rem;
	color: var(--ed-muted);
	white-space: nowrap;
}

/* a small flag on a card image ("Video", "Gallery") */
.apog-ed-flag {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(12, 20, 16, .78);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .04em;
}

.apog-ed-flag svg {
	width: 12px;
	height: 12px;
}

/* horizontal card — the list view, and "recent" in a sidebar or a block */
.apog-ed-row {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
	padding: 14px 0;
	border-bottom: 1px solid var(--ed-line);
}

.apog-ed-row:last-child {
	border-bottom: 0;
}

.apog-ed-row img {
	width: 112px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--ed-radius-sm);
	display: block;
}

.apog-ed-row h3 {
	font-family: var(--ed-font-head);
	font-size: .95rem;
	line-height: 1.34;
	margin: 0 0 6px;
}

.apog-ed-row h3 a {
	color: var(--ed-ink);
	text-decoration: none;
}

.apog-ed-row h3 a:hover,
.apog-ed-row h3 a:focus-visible {
	color: var(--ed-accent);
}

/* -------------------------------------------------------------- empty state */
.apog-ed-empty {
	border: 1px dashed var(--ed-line);
	border-radius: var(--ed-radius);
	padding: clamp(28px, 5vw, 52px);
	text-align: center;
	background: var(--ed-tint);
}

.apog-ed-empty h2,
.apog-ed-empty h3 {
	margin: 0 0 8px;
	color: var(--ed-ink);
	font-family: var(--ed-font-head);
}

.apog-ed-empty p {
	margin: 0 auto 18px;
	max-width: 52ch;
	color: var(--ed-body);
}

/* -------------------------------------------------------------- pagination */
.apog-ed-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
	margin: clamp(26px, 3vw, 40px) 0 0;
	padding: 0;
	list-style: none;
}

.apog-ed-pager a,
.apog-ed-pager span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 0 12px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius-sm);
	background: var(--ed-surface);
	color: var(--ed-ink);
	font-size: .88rem;
	font-weight: 600;
	text-decoration: none;
}

.apog-ed-pager a:hover,
.apog-ed-pager a:focus-visible {
	border-color: var(--ed-accent);
	color: var(--ed-accent);
}

.apog-ed-pager [aria-current="page"] {
	background: var(--ed-accent);
	border-color: var(--ed-accent);
	color: var(--ed-accent-ink);
}

.apog-ed-pager .is-gap {
	border: 0;
	background: transparent;
	color: var(--ed-muted);
}

/* results count / load-more row */
.apog-ed-meta-bar {
	flex-wrap: wrap;
	gap: 10px 18px;
	white-space: nowrap;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 18px;
	font-size: .84rem;
	color: var(--ed-muted);
}

.apog-ed-meta-bar .apog-inf-toggle,
.apog-inf-toggle {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 38px;
	padding: 6px 14px;
	border: 1px solid var(--ed-line);
	border-radius: 999px;
	background: var(--ed-surface);
	color: var(--ed-ink);
	font-weight: 600;
	cursor: pointer;
}

.apog-ed-meta-bar .apog-inf-toggle input,
.apog-inf-toggle input {
	accent-color: var(--ed-accent);
}

.apog-ed-meta-bar strong {
	color: var(--ed-ink);
	font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- sidebar */
.apog-ed-side {
	display: grid;
	gap: 22px;
	align-content: start;
}

/* A sidebar card reads as a card, not as a list with a title: the heading is a band
   across the top of it, in the site's deep colour, and the contents sit under it. The band
   is pulled out to the card's edges with negative margins so nothing has to be wrapped in
   another element just to hold a background. `--ed-band` is the brand's deep colour; it
   falls back to the ink so a theme that defines nothing still looks deliberate. */
.apog-ed-widget {
	background: var(--ed-surface);
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	padding: 0 20px 20px;
	overflow: hidden;
}

.apog-ed-widget > h2,
.apog-ed-widget > h3 {
	margin: 0 -20px 16px;
	padding: 13px 20px;
	background: var(--ed-band, var(--ed-ink));
	border: 0;
	border-radius: 0;
	font-family: var(--ed-font-head);
	font-size: 1.02rem;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -.005em;
	display: flex;
	align-items: center;
	gap: 8px;
}

.apog-ed-widget > h2 svg,
.apog-ed-widget > h3 svg {
	color: #ffffff;
}

.apog-ed-widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.apog-ed-widget li + li {
	margin-top: 12px;
}

.apog-ed-widget a {
	color: var(--ed-ink);
	text-decoration: none;
}

.apog-ed-widget a:hover,
.apog-ed-widget a:focus-visible {
	color: var(--ed-accent);
}

.apog-ed-side-search {
	display: flex;
	gap: 8px;
}

.apog-ed-side-search input {
	flex: 1 1 auto;
	min-height: 42px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius-sm);
	padding: 0 12px;
	font: inherit;
	color: var(--ed-ink);
	background: var(--ed-surface);
}

.apog-ed-side-search button {
	min-height: 42px;
	min-width: 42px;
	border: 0;
	border-radius: var(--ed-radius-sm);
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
	cursor: pointer;
}

/* featured posts: thumb + title */
.apog-ed-side-post {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}

.apog-ed-side-post img {
	width: 76px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--ed-radius-sm);
	display: block;
}

.apog-ed-side-post h3 {
	margin: 0 0 4px;
	font-size: .88rem;
	line-height: 1.35;
	font-family: var(--ed-font-head);
}

.apog-ed-side-post time {
	font-size: .76rem;
	color: var(--ed-muted);
}

/* popular: numbered */
.apog-ed-pop {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.apog-ed-pop b {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background: var(--ed-tint);
	color: var(--ed-accent);
	font-size: .82rem;
	font-weight: 800;
}

.apog-ed-pop h3 {
	margin: 0 0 3px;
	font-size: .88rem;
	line-height: 1.35;
	font-family: var(--ed-font-head);
}

.apog-ed-pop span {
	font-size: .75rem;
	color: var(--ed-muted);
}

/* events: date chip + title */
.apog-ed-event {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	padding: 12px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius-sm);
}

.apog-ed-event + .apog-ed-event {
	margin-top: 10px;
}

.apog-ed-event-date {
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
	border-radius: var(--ed-radius-sm);
	text-align: center;
	padding: 6px 0;
	line-height: 1.1;
}

.apog-ed-event-date span {
	display: block;
	font-size: .62rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	font-weight: 700;
}

.apog-ed-event-date b {
	display: block;
	font-size: 1.15rem;
	font-weight: 800;
}

.apog-ed-event h3 {
	margin: 0 0 4px;
	font-size: .88rem;
	line-height: 1.35;
	font-family: var(--ed-font-head);
}

.apog-ed-event p {
	margin: 0;
	font-size: .76rem;
	color: var(--ed-muted);
}

/* resources: file-type rows */
.apog-ed-doc {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: .86rem;
}

.apog-ed-doc svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	color: var(--ed-accent);
}

/* follow: icon buttons */
.apog-ed-social {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.apog-ed-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	border: 1px solid var(--ed-line);
	color: var(--ed-ink);
}

.apog-ed-social a:hover,
.apog-ed-social a:focus-visible {
	background: var(--ed-ink);
	border-color: var(--ed-ink);
	color: #fff;
}

.apog-ed-social svg {
	width: 18px;
	height: 18px;
}

/* ------------------------------------------------------------ single article */
.apog-ed-article {
	max-width: var(--ed-measure);
}

.apog-ed-article-head {
	margin: 0 0 26px;
}

.apog-ed-article-head h1 {
	font-family: var(--ed-font-head);
	font-size: clamp(1.7rem, 3.4vw, 2.7rem);
	line-height: 1.14;
	letter-spacing: -.02em;
	color: var(--ed-ink);
	margin: 12px 0 14px;
	max-width: 24ch;
}

.apog-ed-article-head .apog-ed-standfirst {
	font-size: clamp(1rem, 1.3vw, 1.12rem);
	line-height: 1.6;
	color: var(--ed-body);
	margin: 0 0 18px;
	max-width: 62ch;
}

.apog-ed-byline span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.apog-ed-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	padding: 14px 0;
	border-top: 1px solid var(--ed-line);
	border-bottom: 1px solid var(--ed-line);
	font-size: .84rem;
	color: var(--ed-muted);
}

.apog-ed-byline .apog-ed-avatar {
	width: 34px;
	height: 34px;
	border-radius: 999px;
	object-fit: cover;
}

.apog-ed-hero {
	margin: 0 0 8px;
	border-radius: var(--ed-radius);
	overflow: hidden;
	background: var(--ed-tint);
}

.apog-ed-hero img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

.apog-ed-figcap {
	font-size: .78rem;
	color: var(--ed-muted);
	margin: 8px 0 28px;
}

/* prose */
.apog-ed-prose {
	font-size: 1.02rem;
	line-height: 1.72;
	/* A 70-character measure is where a long article stops being tiring. The column can be
	   wider than that — the hero image uses the full width — but the text does not follow it. */
	max-width: 70ch;
	color: var(--ed-body);
}

.apog-ed-prose > * + * {
	margin-top: 1.15em;
}

.apog-ed-prose h2,
.apog-ed-prose h3,
.apog-ed-prose h4 {
	font-family: var(--ed-font-head);
	color: var(--ed-ink);
	line-height: 1.28;
	letter-spacing: -.01em;
	scroll-margin-top: 96px;
}

.apog-ed-prose h2 {
	font-size: clamp(1.3rem, 2vw, 1.6rem);
	margin-top: 2em;
}

.apog-ed-prose h3 {
	font-size: clamp(1.1rem, 1.6vw, 1.28rem);
	margin-top: 1.7em;
}

.apog-ed-prose a {
	color: var(--ed-accent);
	text-underline-offset: 2px;
}

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

.apog-ed-prose li + li {
	margin-top: .45em;
}

.apog-ed-prose blockquote {
	margin: 1.6em 0;
	padding: 6px 0 6px 22px;
	border-left: 3px solid var(--ed-accent);
	color: var(--ed-ink);
	font-family: var(--ed-font-head);
	font-size: 1.12rem;
	line-height: 1.55;
	font-style: italic;
}

.apog-ed-prose blockquote cite {
	display: block;
	margin-top: 10px;
	font-size: .82rem;
	font-style: normal;
	color: var(--ed-muted);
}

.apog-ed-prose figure {
	margin: 1.8em 0;
}

.apog-ed-prose img,
.apog-ed-prose iframe,
.apog-ed-prose video {
	max-width: 100%;
	height: auto;
	border-radius: var(--ed-radius-sm);
}

.apog-ed-prose iframe {
	aspect-ratio: 16 / 9;
	width: 100%;
	border: 0;
}

.apog-ed-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: .92rem;
	display: block;
	overflow-x: auto;
}

.apog-ed-prose th,
.apog-ed-prose td {
	border: 1px solid var(--ed-line);
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
}

.apog-ed-prose th {
	background: var(--ed-tint);
	color: var(--ed-ink);
	font-weight: 700;
}

.apog-ed-prose code {
	background: var(--ed-tint);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: .9em;
}

.apog-ed-prose hr {
	border: 0;
	border-top: 1px solid var(--ed-line);
	margin: 2.2em 0;
}

/* key highlights — the "checklist" band the reference uses */
.apog-ed-highlights {
	margin: 1.8em 0;
	padding: 20px 22px;
	background: var(--ed-tint);
	border-radius: var(--ed-radius);
}

.apog-ed-highlights h2,
.apog-ed-highlights h3 {
	margin: 0 0 12px;
	font-size: 1.05rem;
}

.apog-ed-highlights ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.apog-ed-highlights li {
	position: relative;
	padding-left: 30px;
	font-size: .94rem;
	line-height: 1.55;
}

.apog-ed-highlights li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	width: 18px;
	height: 18px;
	border-radius: 999px;
	background: var(--ed-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* table of contents */
/* The table of contents is a sidebar instrument on a wide screen — where it can stay in
   view while the reader scrolls — and an inline block on a phone, where there is no
   sidebar to put it in. One component, two placements, no duplicated markup logic. */
.apog-ed-toc--inline {
	display: none;
}

@media (max-width: 960px) {
	.apog-ed-toc--inline {
		display: block;
	}

	.apog-ed-side .apog-ed-toc {
		display: none;
	}
}

.apog-ed-toc {
	margin: 0 0 26px;
	padding: 18px 20px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	background: var(--ed-surface);
}

.apog-ed-toc h2 {
	margin: 0 0 10px;
	font-size: .82rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ed-muted);
	font-family: var(--ed-font-body);
}

.apog-ed-toc ol {
	margin: 0;
	padding-left: 1.2em;
	font-size: .9rem;
	line-height: 1.5;
}

.apog-ed-toc li + li {
	margin-top: 6px;
}

.apog-ed-toc a {
	color: var(--ed-ink);
	text-decoration: none;
}

.apog-ed-toc a:hover,
.apog-ed-toc a:focus-visible {
	color: var(--ed-accent);
	text-decoration: underline;
}

/* tags + share */
.apog-ed-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	margin: 34px 0 0;
	padding: 18px 0;
	border-top: 1px solid var(--ed-line);
	border-bottom: 1px solid var(--ed-line);
}

.apog-ed-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.apog-ed-tags a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--ed-tint);
	color: var(--ed-ink);
	font-size: .78rem;
	font-weight: 600;
	text-decoration: none;
}

.apog-ed-tags a:hover,
.apog-ed-tags a:focus-visible {
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
}

.apog-ed-share {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .8rem;
	color: var(--ed-muted);
}

.apog-ed-share a,
.apog-ed-share button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	min-height: 38px;
	border-radius: 999px;
	border: 1px solid var(--ed-line);
	background: var(--ed-surface);
	color: var(--ed-ink);
	cursor: pointer;
	text-decoration: none;
}

.apog-ed-share a:hover,
.apog-ed-share a:focus-visible,
.apog-ed-share button:hover,
.apog-ed-share button:focus-visible {
	background: var(--ed-ink);
	border-color: var(--ed-ink);
	color: #fff;
}

.apog-ed-share svg {
	width: 17px;
	height: 17px;
}

/* prev / next */
.apog-ed-adjacent {
	display: grid;
	gap: 14px;
	margin: 30px 0 0;
}

@media (min-width: 720px) {
	.apog-ed-adjacent {
		grid-template-columns: 1fr 1fr;
	}
}

.apog-ed-adjacent a {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	background: var(--ed-surface);
	text-decoration: none;
	color: var(--ed-ink);
	min-height: 96px;
}

.apog-ed-adjacent a:hover,
.apog-ed-adjacent a:focus-visible {
	border-color: var(--ed-accent);
	box-shadow: var(--ed-shadow);
}

.apog-ed-adjacent span {
	font-size: .74rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ed-muted);
	font-weight: 700;
}

.apog-ed-adjacent strong {
	font-family: var(--ed-font-head);
	font-size: .98rem;
	line-height: 1.35;
	font-weight: 700;
}

.apog-ed-adjacent .is-next {
	text-align: right;
}

.apog-ed-adjacent a:only-child {
	grid-column: 1 / -1;
}

.apog-ed-return {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 24px;
	margin: 6px 0 0;
}

.apog-ed-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
	font-size: .86rem;
	font-weight: 700;
	color: var(--ed-accent);
	text-decoration: none;
}

.apog-ed-back:hover,
.apog-ed-back:focus-visible {
	text-decoration: underline;
}

/* comments — WordPress renders the form, so the framework only has to make it look like it
   belongs to the article rather than to a different website */
.apog-ed-comments {
	margin: clamp(28px, 3vw, 44px) 0 0;
	padding-top: clamp(20px, 2.4vw, 30px);
	border-top: 1px solid var(--ed-line);
}

.apog-ed-comments .comment-reply-title,
.apog-ed-comments .comments-title,
.apog-ed-comments h2,
.apog-ed-comments h3 {
	font-family: var(--ed-font-head);
	font-size: 1.2rem;
	color: var(--ed-ink);
	margin: 0 0 14px;
	letter-spacing: -.01em;
}

.apog-ed-comments .comment-list {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: grid;
	gap: 16px;
}

.apog-ed-comments .comment-body {
	background: var(--ed-surface);
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	padding: 16px 18px;
}

.apog-ed-comments .comment-meta,
.apog-ed-comments .comment-metadata {
	font-size: .8rem;
	color: var(--ed-muted);
	margin-bottom: 8px;
}

.apog-ed-comments label {
	display: block;
	font-size: .82rem;
	font-weight: 700;
	color: var(--ed-ink);
	margin-bottom: 6px;
}

.apog-ed-comments input[type="text"],
.apog-ed-comments input[type="email"],
.apog-ed-comments input[type="url"],
.apog-ed-comments textarea {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius-sm);
	background: var(--ed-surface);
	color: var(--ed-ink);
	font: inherit;
}

.apog-ed-comments textarea {
	min-height: 130px;
}

.apog-ed-comments .form-submit input,
.apog-ed-comments button[type="submit"] {
	min-height: 44px;
	padding: 10px 20px;
	border: 0;
	border-radius: var(--ed-radius-sm);
	background: var(--ed-accent);
	color: var(--ed-accent-ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.apog-ed-comments .comment-form > p {
	margin: 0 0 14px;
}

/* related strip */
.apog-ed-related {
	margin: clamp(34px, 4vw, 56px) 0 0;
}

/* attachments / downloads inside an article */
.apog-ed-files {
	margin: 1.6em 0;
	border: 1px solid var(--ed-line);
	border-radius: var(--ed-radius);
	padding: 16px 18px;
}

.apog-ed-files h2,
.apog-ed-files h3 {
	margin: 0 0 10px;
	font-size: .95rem;
}

.apog-ed-files ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.apog-ed-files li + li {
	margin-top: 8px;
}

.apog-ed-files a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: .9rem;
	font-weight: 600;
	color: var(--ed-ink);
	text-decoration: none;
}

.apog-ed-files a:hover,
.apog-ed-files a:focus-visible {
	color: var(--ed-accent);
	text-decoration: underline;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 960px) {
	.apog-ed-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.apog-ed-layout.has-side {
		grid-template-columns: minmax(0, 1fr);
	}

	.apog-ed-side {
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	}
}

@media (max-width: 720px) {
	.apog-ed-pills {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.apog-ed-featured {
		margin-bottom: 26px;
	}

	.apog-ed-filters {
		gap: 8px;
	}

	.apog-ed-field.is-search {
		flex-basis: 100%;
	}

	.apog-ed-article-head h1 {
		max-width: none;
	}

	.apog-ed-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
}

@media (max-width: 600px) {
	.apog-ed-grid,
	.apog-ed-related-grid,
	.apog-ed-side {
		grid-template-columns: minmax(0, 1fr);
	}

	/* A phone is where "no horizontal scrolling" is decided: the filters, the toolbar and
	   the meta bar all have to fit a 360px screen without being pushed by a long label. */
	.apog-ed-meta-bar {
		white-space: normal;
	}

	.apog-ed-filters {
		grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	}

	.apog-ed-toolbar {
		align-items: stretch;
	}

	.apog-ed-views,
	.apog-ed-sort {
		width: 100%;
	}

	.apog-ed-sort select {
		flex: 1 1 auto;
	}

	.apog-ed-card-body {
		padding: 16px 16px 18px;
	}
}

/* Print: the article, without the furniture. */
@media print {
	.apog-ed-side,
	.apog-ed-tools,
	.apog-ed-adjacent,
	.apog-ed-related,
	.apog-ed-trail,
	header,
	footer {
		display: none !important;
	}

	.apog-ed-layout.has-side {
		grid-template-columns: minmax(0, 1fr);
	}

	.apog-ed-prose {
		font-size: 11pt;
	}
}
