/* ==========================================================================
   One block per section partial, in the same order as template-parts/sections/.
   ========================================================================== */

/* ---------- hero ---------- */

.hero { position: relative; }

.hero__inner { max-width: 1100px; }

.hero__title {
	font-size: var(--step-display);
	font-weight: 500;
	line-height: 1.06;
	letter-spacing: -0.03em;
}

.hero__lede {
	max-width: 58ch;
	margin-top: 1.25rem;
	font-size: var(--step-lede);
	line-height: 1.45;
	color: var(--muted);
}

.hero__link { margin-top: 1.75rem; }

/* With a photograph behind it the opening becomes a dark panel, so the text
   switches to the bone colour rather than the teal it uses on the page. */
.hero--photo {
	display: grid;
	min-height: min(70vh, 640px);
	align-items: end;
	color: var(--bg);
	isolation: isolate;
}

.hero--photo > * { grid-area: 1 / 1; }

.hero--photo .hero__media {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius-media);
}

.hero--photo .hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero--photo .hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(0 42 50 / 0.78), rgb(0 42 50 / 0.15) 60%, transparent);
}

.hero--photo .hero__inner { position: relative; z-index: 1; padding-block: clamp(2rem, 5vw, 4rem); }
.hero--photo .hero__lede { color: inherit; opacity: 0.88; }

/* ---------- masthead ---------- */

/* The front page's opening, and a companion to .hero rather than a variant of
   it. A hero is one statement given a screen; this is an identity line given a
   strip about a sixth the height, because on a page led by news the reader
   should reach a headline without scrolling past a mission statement first.

   Deliberately not a .section: the padding is roughly a third of --section-y,
   and it is the hairline underneath - not a band of empty page - that separates
   it from the news. */
.masthead {
	padding-block: clamp(1.75rem, 3.5vw, 3rem);
	border-bottom: 1px solid var(--rule);
}

/* Title left, strap right, sharing one baseline. Below roughly 700px they wrap
   onto separate lines and the row gap takes over from the column gap. */
.masthead__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem clamp(1.5rem, 4vw, 3.5rem);
	align-items: baseline;
	justify-content: space-between;
}

.masthead__title {
	max-width: 22ch;
	font-size: var(--step-h2);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.masthead__strap {
	max-width: 34ch;
	color: var(--muted);
	font-size: var(--step-small);
	line-height: 1.5;
}

/* ---------- text-media ---------- */

/* A wider gutter than --gap, and the photograph given slightly more room than
   the text beside it. */
.text-media__grid {
	display: grid;
	gap: clamp(2rem, 6vw, 7rem);
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr);
	align-items: start;
}

.text-media__grid--center { align-items: center; }

.text-media--mirror .text-media__media { order: 2; }

.text-media__media { border-radius: var(--radius-media); overflow: hidden; }
.text-media__media:empty { display: none; }
.text-media__media img { width: 100%; }

@media (max-width: 860px) {
	.text-media__grid { grid-template-columns: minmax(0, 1fr); }
	.text-media--mirror .text-media__media { order: 0; }
}

/* ---------- text-media, stacked ---------- */

/* The photograph runs past the reading wrap while the text stays inside it, so
   the band is the width of the page and the prose is still the width of a
   sentence. The gutter is repeated here because this sits outside `.wrap`. */
.text-media__bleed {
	width: 100%;
	padding-inline: var(--gutter);
}

.text-media--stacked .text-media__media {
	max-width: var(--wrap-wide);
	margin-inline: auto;
}

/* A height cap rather than a fixed aspect-ratio crop. The band wants to read
   wide and shallow, but these are landscape photographs of a fjord and a ratio
   tight enough to look like a hero on a 3:2 source would cut the horizon out of
   a portrait one. Capping the height gets the same band from a wide image and
   degrades gracefully instead of beheading a tall one; a narrow screen never
   reaches the cap and keeps the photograph's own proportions. */
.text-media--stacked .text-media__media img {
	display: block;
	width: 100%;
	max-height: min(48vh, 420px);
	object-fit: cover;
	object-position: center;
}

/* Desktop gets a taller band. At 420px against a 1360px width the crop was
   3.2:1, which reads as a letterbox strip rather than a photograph; 520px
   brings it to about 2.6:1, where the fjord still has sky and water either side
   of the ridge. The vh half of the cap is what keeps it honest on a short
   laptop screen, and 520 is deliberately the height that leaves the band ending
   right about the fold on a 900px viewport, so it stays one unit with the
   headline rather than pushing the introduction out of sight. */
@media (min-width: 1024px) {
	.text-media--stacked .text-media__media img {
		max-height: min(58vh, 520px);
	}
}

.text-media--stacked .text-media__text {
	margin-top: clamp(1.75rem, 4vw, 3rem);
}

/* Straight after the hero, the band belongs to the headline rather than to a
   section of its own, so the two full section paddings that would otherwise
   stack up between them collapse to one small gap. Browsers without :has()
   simply keep the roomier default. */
.hero + .text-media--stacked { padding-top: 0; }

.hero:has(+ .text-media--stacked) {
	padding-bottom: clamp(1.5rem, 3vw, 2.75rem);
}

.text-media--stacked .text-media__text .h2 {
	max-width: 22ch;
	margin-bottom: 1rem;
}

/* .prose caps at 65ch, which is the right intent but not the right number here.
   `ch` is the advance of "0", and DM Sans sets that wider than its average
   glyph, so 65ch renders as about 87 characters - and at lede size across a
   1240px wrap that is a hard line to track back from. Measured: 50ch lands at
   roughly 67 characters, inside the comfortable 55-75 band, and Icelandic's
   longer words make the upper half of that band the one to aim for. */
.text-media--stacked .text-media__text .prose {
	max-width: 50ch;
}

/* ---------- intro ---------- */

/* Two blocks of text, deliberately not matched. The left says what the
   association is for and sets at lede size; the right says how, at reading size
   in the muted tone. Treating them alike would ask the page to be read twice. */
.intro { padding-top: clamp(2.5rem, 5vw, 4.5rem); }

.intro__heading {
	margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
	font-size: var(--step-h3);
	font-weight: 500;
	letter-spacing: -0.01em;
}

.intro__grid {
	display: grid;
	gap: var(--gap) clamp(2rem, 6vw, 6rem);
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
	/* The photograph is much the taller of the two now, so the text is centred
	   against it rather than hung from its top edge, where it would sit high and
	   leave the panel bottom-heavy. */
	align-items: center;
}

/* No photograph, no second column - and nothing to centre against, so the text
   goes back to starting at the top. */
.intro__grid--plain {
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}

/* .prose caps at 65ch, which is the right intent and the wrong number in DM
   Sans: `ch` is the advance of "0", and this face sets that wider than its
   average glyph, so 65ch renders near 87 characters. 34ch at lede size lands
   around 45 - short lines, because this is the paragraph read first. */
.intro__lede {
	max-width: 34ch;
	font-size: var(--step-lede);
	line-height: 1.4;
	letter-spacing: -0.01em;
}

/* 50ch is about 67 characters here: inside the comfortable 55-75 band and at
   the upper half of it, which is where Icelandic wants to sit. */
.intro__body .prose {
	max-width: 50ch;
	color: var(--muted);
}

/* The two voices now stack, so what separates them is space rather than a column.
   Enough to read as a second thought, not so much as to read as a second block -
   the optical nudge that used to level this with the lede's first baseline went
   with the side-by-side arrangement it was correcting. */
.intro__body { margin-top: clamp(1.5rem, 3vw, 2.25rem); }

.intro__link { margin-top: 1.4rem; }

/* An upright panel rather than a picture the height of the paragraph beside it.
   Set as a height rather than an aspect ratio because the text block's own height
   barely moves above 1000px - the lede is capped at 34ch - so a ratio would track
   the column width and drift against it. At the 1240px wrap this lands near 3:4. */
.intro__media {
	position: relative;
	height: clamp(32rem, 52vw, 44rem);
	/* Same 4px as every other photograph on the site. The overflow is what makes it
	   hold: the tint is a positioned box of its own and would square off the corners
	   the image has just rounded. */
	border-radius: var(--radius-media);
	overflow: hidden;
	/* Keeps the tint and the mark stacking against each other rather than against
	   whatever the page puts behind this section. */
	isolation: isolate;
}

.intro__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The association's green over the photograph, so the panel reads as the brand's
   rather than as a window. Multiplied rather than laid flat on top: a flat wash at
   this strength greys the midtones, where multiply keeps the water and the hillside
   telling each other apart underneath it. */
.intro__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--accent);
	opacity: 0.72;
	mix-blend-mode: multiply;
}

/* ::after is the figure's last box whatever the markup order, so the mark needs a
   layer of its own to sit over the tint rather than under it. */
.intro__mark {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	color: #fff;
}

.intro__mark-svg {
	width: clamp(4.5rem, 9vw, 7.5rem);
	height: auto;
}

@media (max-width: 860px) {
	.intro__grid {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}
	.intro__lede { max-width: 40ch; }
	.intro__media { height: clamp(18rem, 58vw, 26rem); }
}

/* ---------- stats ---------- */

.stats__heading { max-width: 18ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

/* The argument sits in a narrow measure on the left; the evidence gets the
   rest. Roughly 30/70 - a symmetrical split makes the figures look cramped
   and the paragraph uncomfortably wide. */
.stats__grid {
	display: grid;
	gap: var(--gap);
	grid-template-columns: minmax(0, 0.43fr) minmax(0, 1fr);
	align-items: start;
}

.stats__intro { font-size: var(--step-lede); line-height: 1.45; }

.stats__list {
	display: grid;
	/* A little more air than --gap: these columns carry display-sized numerals,
	   and at the point the grid stacks they would otherwise read as one string. */
	gap: clamp(1.5rem, 3.5vw, 3rem);
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* The figures and their conclusion are one column of the outer grid rather than
   two children of it. As two children the conclusion would start a second row,
   and the row above is as tall as the argument on the left - so it would clear
   the bottom of that paragraph and leave the space under the figures empty,
   which is the hole this column exists to close. */
.stats__evidence { display: flex; flex-direction: column; }

/* Reading size under the lede-sized argument, so the order of the section reads
   heading, argument, evidence, conclusion. The hairline is what ties it to the
   figures: without it the sentence reads as a separate thought that happens to
   sit nearby. */
.stats__closing {
	margin-top: clamp(2rem, 4vw, 3rem);
	padding-top: clamp(1.25rem, 2.5vw, 2rem);
	border-top: 1px solid var(--rule);
}

.stat__figure {
	font-size: var(--step-figure);
	font-weight: 500;
	line-height: 0.95;
	letter-spacing: -0.04em;
	/* These sit in a row and should align on the digit, not on whatever width
	   the proportional figures happen to be. */
	font-variant-numeric: tabular-nums;
}

.stat__label {
	margin-top: 0.75rem;
	max-width: 32ch;
	font-size: var(--step-small);
	line-height: 1.45;
}

.stat__source {
	margin-top: 0.5rem;
	color: var(--muted);
	font-size: var(--step-small);
}

@media (max-width: 1000px) {
	.stats__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
	.stats__list { grid-template-columns: minmax(0, 1fr); }
	.stat + .stat { padding-top: var(--gap); border-top: 1px solid var(--rule); }
}

/* ---------- members ---------- */

/* Name on the left, the line that introduces the register on the right, both on
   one baseline. Roughly 45/55, which is the proportion the design draws and the
   one that lets a long Icelandic heading keep its own line. Stacking them would
   make two openings out of one. */
.members__head {
	display: grid;
	gap: 0.75rem clamp(2rem, 6vw, 6rem);
	grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
	align-items: baseline;
}

/* Short enough that the heading cannot run into the column beside it; long
   enough for "Aðildarfélög" and anything of its length to stay on one line. */
.members__heading { max-width: 14ch; }

/* Beside a heading the line is supporting text, not the opening, so it drops to
   reading size and the muted tone - the same division of labour as `intro`. Its
   column is already the measure, so the lede's own cap would only fight it. */
.members__head .members__lede {
	max-width: none;
	color: var(--muted);
	font-size: var(--step-body);
	line-height: 1.55;
	letter-spacing: 0;
}

/* Standing alone, the opening line names the list, so it is set at lede size and
   kept to a measure: it is an introduction, not a paragraph of body copy. */
.members__lede {
	max-width: 52ch;
	font-size: var(--step-lede);
	line-height: 1.45;
	letter-spacing: -0.01em;
}

/* Three columns, because Icelandic company names run long - "Hraðfrystihúsið
   - Gunnvör hf." is a line on its own at four. The hairline tops make this a
   ruled register rather than sixteen cards; same treatment as the news index,
   for the same reason. */
.members__grid {
	display: grid;
	margin-top: clamp(2rem, 4vw, 3rem);
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: clamp(1.5rem, 4vw, 3.5rem);
}

.member {
	position: relative;
	padding-block: 1rem;
	border-top: 1px solid var(--rule);
}

.member__name {
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.3;
}

.member__place {
	margin-top: 0.2rem;
	color: var(--muted);
	font-size: var(--step-small);
}

/* Stretched over the cell, so the place is part of the target too. The name
   keeps the accessible name short. */
.member__link { text-decoration: none; }
.member__link::after { content: ""; position: absolute; inset: 0; }
.member__link:hover { text-decoration: underline; text-underline-offset: 0.16em; }
.member__link:focus-visible { outline: none; }
.member:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.members__source {
	margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
	color: var(--muted);
	font-size: var(--step-small);
}

@media (max-width: 860px) {
	.members__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	/* Narrow enough that two columns leave the heading nothing to sit in, so the
	   two parts stack. The line keeps the muted reading-size treatment: it is
	   still the heading's supporting text, only now beneath it. */
	.members__head { grid-template-columns: minmax(0, 1fr); }
	.members__heading { max-width: none; }
	.members__head .members__lede { max-width: 56ch; }
}

@media (max-width: 520px) {
	.members__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- news front ---------- */

/* A date, sometimes with a label before it, above a headline. The lead and
   every row of the index use it, so it is defined once rather than per block. */
.meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.6rem;
	align-items: baseline;
	color: var(--muted);
	font-size: var(--step-small);
}

/* The only uppercase on the page, and the only place the brand green appears
   outside the header. It marks exactly one story, which is what keeps it
   meaning "newest" rather than decorating a heading. */
.meta__kicker {
	color: var(--accent);
	font-weight: 500;
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* The masthead has already given the top of the page its own padding and a
   rule, so the first-child section padding on top of that is a screen of
   nothing. Written against .site-main so it still wins when the news section
   does start the page. */
.site-main > .section.news {
	padding-top: clamp(2rem, 4vw, 3.25rem);
	padding-bottom: clamp(2.25rem, 4.5vw, 3.75rem);
}

/* The lead sits beside its photograph rather than under a full-width band. The
   source images are 900px wide: sharp at the ~620px this column gives them, and
   visibly soft stretched across a 1240px page. */
.lead {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: center;
}

.lead__media {
	overflow: hidden;
	border-radius: var(--radius-media);
	background: var(--surface);
}

.lead__media img,
.lead__placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	transition: transform 400ms ease;
}

.lead:hover .lead__media img { transform: scale(1.03); }

.lead__title {
	margin-top: 0.6rem;
	font-size: var(--step-h2);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

/* The same technique as the post card: the headline carries the link and
   stretches its hit area over the whole lead, so the accessible name stays the
   headline alone while the excerpt is still selectable text. An anchor laid
   over the lead would cover both and take the selection with it. */
.lead__link { text-decoration: none; }
.lead__link::after { content: ""; position: absolute; inset: 0; }
.lead__link:hover { text-decoration: underline; text-underline-offset: 0.14em; }
.lead__link:focus-visible { outline: none; }
.lead:focus-within { outline: 2px solid var(--accent); outline-offset: 8px; }

.lead__excerpt {
	margin-top: 0.9rem;
	max-width: 46ch;
	color: var(--muted);
	line-height: 1.55;
}

/* Not a link - the headline above already is one - so it has no hover of its
   own and borrows the lead's. */
.lead__cta { margin-top: 1.4rem; }
.lead:hover .lead__cta { border-color: currentColor; }
.lead:hover .lead__cta .icon { transform: translateX(3px); }

@media (max-width: 860px) {
	.lead { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}

/* The stories below the lead are ordinary post cards; the rule above them is
   what marks the step down from one story to several. */
.news__cards {
	margin-top: clamp(2.5rem, 5vw, 4rem);
	padding-top: clamp(2.5rem, 5vw, 4rem);
	border-top: 1px solid var(--rule);
}

/* ---------- news index ---------- */

/* The rest of the archive. Dates sit in a fixed gutter so every headline starts
   on the same line down the page, and that alignment is what makes a list this
   long scannable. No thumbnails: the page already carries four photographs, and
   a column of stamps under them would read as texture rather than content. */
.index__head {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: baseline;
	justify-content: space-between;
	margin-top: clamp(3rem, 6vw, 5rem);
	margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.index__heading {
	font-size: var(--step-h3);
	font-weight: 500;
	letter-spacing: -0.01em;
}

/* The arrow link carries a top margin for use at the end of a block; here it is
   on a baseline with the heading. */
.index__all { margin-top: 0; }

.index__row {
	position: relative;
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	gap: 1rem;
	align-items: baseline;
	padding-block: 1.1rem;
	border-top: 1px solid var(--rule);
}

.index__row:last-child { border-bottom: 1px solid var(--rule); }

.index__date { white-space: nowrap; }

/* Between body and h3: large enough to read as a headline in a list, small
   enough that twenty of them do not compete with the cards above. */
.index__title {
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.35;
}

.index__link { text-decoration: none; }
.index__link::after { content: ""; position: absolute; inset: 0; }
.index__link:hover { text-decoration: underline; text-underline-offset: 0.16em; }
.index__link:focus-visible { outline: none; }
.index__row:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Below about 640px the fixed date gutter costs more width than the alignment
   buys, so the date moves above the headline. */
@media (max-width: 640px) {
	.index__row { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
}

/* ---------- posts ---------- */

.posts__head {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.posts__all { margin-top: 0; }

/* ---------- newsletter ---------- */

/* The close of the news section's argument rather than a chapter of its own, so
   it gives up most of its top padding to sit nearer what it follows. */
.newsletter { padding-top: calc(var(--section-y) * 0.55); }

/* A band the width of the reading wrap: the ask on the left, the field on the
   right. It replaced a narrow centred panel that left the form floating in the
   middle of an otherwise full-width page. */
.newsletter__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--gap) clamp(2rem, 5vw, 5rem);
	align-items: center;
	padding: clamp(1.75rem, 4vw, 3rem);
	border: 1px solid var(--rule);
	border-radius: var(--radius-media);
	background: var(--surface);
}

.newsletter__text {
	margin-top: 0.65rem;
	max-width: 38ch;
	color: var(--muted);
}

/* No endpoint configured, so there is no field to sit opposite the ask. One
   column, and the mailto follows the text instead of floating beside it. */
.newsletter__inner--plain { grid-template-columns: minmax(0, 1fr); }
.newsletter__inner--plain .newsletter__action { margin-top: 0.35rem; }

.newsletter__form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: end;
}

.newsletter__field { flex: 1 1 16rem; }

.newsletter__field label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: var(--step-small);
	font-weight: 500;
}

.newsletter__field input {
	width: 100%;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--rule-strong);
	border-radius: var(--radius);
	background: var(--bg);
	color: inherit;
	/* 16px on phones or Mobile Safari zooms the page on focus. */
	font-family: inherit;
	font-size: max(1rem, var(--step-body));
}

.newsletter__field input:focus-visible { border-color: var(--accent); outline-offset: 1px; }

/* Shown under the form as an alternative, and on its own when no endpoint is
   configured - in which case it is the only way to sign up, so it is never
   allowed to disappear. */
.newsletter__fallback {
	margin-top: 1rem;
	color: var(--muted);
	font-size: var(--step-small);
}

.newsletter__fallback a {
	text-decoration: none;
	border-bottom: 1px solid var(--rule-strong);
	transition: border-color 150ms ease;
}

.newsletter__fallback a:hover { border-color: currentColor; }

@media (max-width: 760px) {
	.newsletter__inner { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- rich-text ---------- */

.rich-text__inner--narrow { max-width: var(--wrap-narrow); }
.rich-text__inner--wide { max-width: var(--wrap); }

/* A prose block directly under the masthead is the page's opening statement, not a
   closing note, so it reads as the page's lede: aligned with the title rather than
   centred under it, and at lede size above the reading-size prose that follows. The
   narrow width is what centres the block - it is the wrap's own auto margins doing
   it - so the measure moves off the wrapper and onto the prose, where 52ch matches
   the member lede further down and holds the line to about seventy characters. */
.masthead + .rich-text .rich-text__inner { max-width: var(--wrap); }

.masthead + .rich-text .prose {
	max-width: 52ch;
	font-size: var(--step-lede);
	line-height: 1.45;
	letter-spacing: -0.01em;
}

