/*
Theme Name: Carl Nielsen Selskabet
Theme URI: https://www.carlnielsen.dk/
Author: Tekst og data v/Adam Hvidt
Description: Eget tema til Carl Nielsen Selskabet. Erstatter Twenty Seventeen og de hjælpe-plugins, der formede det.
Version: 1.0.0-beta20
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: cn
*/

/* ---------- Fonts (self-hosted, OFL) ---------- */

@font-face {
	font-family: "Source Serif 4";
	src: url("assets/fonts/source-serif-4-normal.woff2") format("woff2");
	font-weight: 200 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Serif 4";
	src: url("assets/fonts/source-serif-4-italic.woff2") format("woff2");
	font-weight: 200 900;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Open Sans";
	src: url("assets/fonts/open-sans-normal.woff2") format("woff2");
	font-weight: 300 800;
	font-style: normal;
	font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
	--paper: #fbfaf7;
	--paper-deep: #f2eee6;
	--ink: #1f1c18;
	--ink-soft: #4a443c;
	--muted: #6f675c;
	--rule: #e3ddd1;
	--accent: #8b3220;
	--accent-ink: #6e2617;
	--surface: #fff;
	--nav-bg: rgb(251 250 247 / 0.94);
	--line-strong: #cfc5b4;

	color-scheme: light dark;

	--serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
	--sans: "Open Sans", "Helvetica Neue", Arial, sans-serif;

	--measure: 38rem;
	--wide: 72rem;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--nav-h: 3.75rem;
}

/* ---------- Base ---------- */

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--nav-h) + 1rem);
	-webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
	line-height: 1.65;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
	/* Old-style figures sit in running text like lower-case letters (1865 reads as a word). */
	font-variant-numeric: oldstyle-nums proportional-nums;
}

/* Where figures line up or stand alone, keep them lining. */
table,
.entry__kicker,
.card__meta,
.fader__item figcaption,
.pager,
.breadcrumb,
.site-footer,
.site-nav,
.slideshow__controls {
	font-variant-numeric: lining-nums tabular-nums;
}

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

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--accent-ink);
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0.5rem;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--ink);
	color: #fff;
	font-family: var(--sans);
}

.skip-link:focus {
	left: 0.5rem;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Hero (front page) ---------- */

.hero {
	position: relative;
	display: grid;
	min-height: clamp(22rem, 62vh, 40rem);
	background: #2a2622;
	color: #fff;
	overflow: hidden;
}

.hero__image {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 22%;
}

.hero::after {
	content: "";
	grid-area: 1 / 1;
	/* Above the photo, which is positioned (fixed) and would otherwise paint over it. */
	position: relative;
	z-index: 1;
	/* The photo is light at the bottom; darken enough for white text to read (WCAG AA). */
	background: linear-gradient(to top, rgb(20 17 14 / 0.9) 0%, rgb(20 17 14 / 0.72) 22%, rgb(20 17 14 / 0.35) 42%, transparent 65%);
}

.hero__text {
	grid-area: 1 / 1;
	position: relative;
	z-index: 2;
	align-self: end;
	display: flex;
	align-items: center;
	gap: 1.25rem;
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin: 0 auto;
	padding-bottom: clamp(1.5rem, 5vh, 3rem);
}

.hero .brand__logo {
	width: clamp(3.5rem, 8vw, 5rem);
	height: auto;
	filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.5)) drop-shadow(0 0 16px rgb(0 0 0 / 0.3));
}

.hero__title {
	margin: 0;
	color: #fff;
	font-family: var(--sans);
	font-weight: 700;
	font-size: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
	letter-spacing: 0.08em;
	line-height: 1.1;
	text-transform: uppercase;
	text-shadow: 0 1px 3px rgb(0 0 0 / 0.5), 0 0 24px rgb(0 0 0 / 0.35);
}

.hero__tagline {
	margin: 0.35rem 0 0;
	font-weight: 500;
	text-shadow: 0 1px 3px rgb(0 0 0 / 0.6), 0 0 18px rgb(0 0 0 / 0.4);
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
	font-style: italic;
	opacity: 0.92;
}

.hero--plain {
	min-height: 0;
	padding-top: 4rem;
}

/*
 * Front page scroll effect, as in Twenty Seventeen: the header photo fills
 * the screen and stays put while the page scrolls over it, and the panel
 * photos are full-height windows onto a fixed image. A fixed <img> inside a
 * clip-path container is used instead of background-attachment: fixed,
 * which iOS Safari does not support.
 */
@media (min-width: 48em) {
	.hero {
		height: calc(100vh - var(--nav-h));
		min-height: 30rem;
	}

	.admin-bar .hero {
		height: calc(100vh - var(--nav-h) - 32px);
	}

	.panel .panel__image {
		position: relative;
		height: 100vh;
		max-height: 1200px;
	}

	.panel__image::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(to bottom, transparent 0%, rgb(0 0 0 / 0.25) 100%);
		pointer-events: none;
	}
}

@media (min-width: 48em) and (prefers-reduced-motion: no-preference) {
	.hero,
	.panel__image {
		clip-path: inset(0);
	}

	.hero__image,
	.panel__image img {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100vh;
		object-fit: cover;
	}

	.panel__image img {
		object-position: center;
	}
}

.scroll-down {
	display: none;
}

@media (min-width: 961px) {
	.scroll-down {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		width: 2.25rem;
		height: 2.25rem;
		margin-left: 0.5rem;
		border: 1px solid var(--rule);
		border-radius: 50%;
		color: var(--ink-soft);
	}

	.scroll-down:hover {
		border-color: var(--accent);
		color: var(--accent);
	}
}

/* ---------- Navigation ---------- */

.site-nav {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--nav-bg);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--rule);
	font-family: var(--sans);
}

.admin-bar .site-nav {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-nav {
		top: 0;
	}
}

.site-nav__inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	width: min(100% - 2 * var(--gutter), var(--wide));
	min-height: var(--nav-h);
	margin: 0 auto;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--ink);
	text-decoration: none;
	flex-shrink: 0;
}

.brand:hover {
	color: var(--ink);
}

.brand .brand__logo {
	width: 2rem;
	height: 2rem;
	object-fit: contain;
	filter: invert(1);
}

.brand__name {
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.site-nav__panel {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-left: auto;
}

.site-nav .menu,
.site-nav .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav .menu {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.site-nav .menu > li {
	position: relative;
}

.site-nav .menu a {
	display: block;
	padding: 0.55rem 0.7rem;
	color: var(--ink-soft);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-decoration: none;
	text-transform: uppercase;
}

.site-nav .menu a:hover,
.site-nav .menu .current-menu-item > a,
.site-nav .menu .current-menu-ancestor > a {
	color: var(--accent);
}

.site-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 0.38em;
	height: 0.38em;
	margin-left: 0.45em;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-0.2em) rotate(45deg);
}

.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 15rem;
	padding: 0.4rem 0;
	background: var(--surface);
	border: 1px solid var(--rule);
	box-shadow: 0 12px 30px rgb(31 28 24 / 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.site-nav .menu > li:hover > .sub-menu,
.site-nav .menu > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.site-nav .sub-menu a {
	padding: 0.4rem 1rem;
	font-family: var(--serif);
	font-size: 0.98rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

/* Language switcher from WPGlobus: keep the flag compact. */
.site-nav .menu img {
	display: block;
	width: 18px;
	height: auto;
}

.site-nav .search-form {
	display: flex;
}

.site-nav .search-field {
	width: 9rem;
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--rule);
	border-radius: 2px;
	background: var(--surface);
	font: inherit;
	font-size: 0.85rem;
	transition: width 0.2s;
}

.site-nav .search-field:focus {
	width: 13rem;
}

.site-nav .search-submit {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.site-nav__toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
	padding: 0.5rem 0.25rem;
	border: 0;
	background: none;
	color: var(--ink);
	font: 600 0.78rem/1 var(--sans);
	letter-spacing: 0.09em;
	text-transform: uppercase;
	cursor: pointer;
}

.site-nav__toggle-bars,
.site-nav__toggle-bars::before,
.site-nav__toggle-bars::after {
	display: block;
	width: 1.1rem;
	height: 1.5px;
	background: currentColor;
	transition: transform 0.2s;
}

.site-nav__toggle-bars {
	position: relative;
}

.site-nav__toggle-bars::before,
.site-nav__toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.site-nav__toggle-bars::before {
	top: -5px;
}

.site-nav__toggle-bars::after {
	top: 5px;
}

@media (max-width: 960px) {
	.site-nav__toggle {
		display: flex;
	}

	.site-nav__panel {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		max-height: calc(100vh - var(--nav-h));
		overflow-y: auto;
		padding: 0.5rem var(--gutter) 1.5rem;
		background: var(--paper);
		border-bottom: 1px solid var(--rule);
		box-shadow: 0 16px 30px rgb(31 28 24 / 0.08);
	}

	.site-nav.is-open .site-nav__panel {
		display: flex;
	}

	.site-nav .menu {
		flex-direction: column;
		align-items: stretch;
	}

	.site-nav .menu > li {
		border-bottom: 1px solid var(--rule);
	}

	.site-nav .menu a {
		padding: 0.8rem 0;
	}

	.site-nav .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 0.5rem 1rem;
		border: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.site-nav .sub-menu a {
		padding: 0.35rem 0;
	}

	.site-nav .menu-item-has-children > a::after {
		display: none;
	}

	.site-nav .search-form {
		margin-top: 1rem;
	}

	.site-nav .search-form label {
		flex: 1;
	}

	.site-nav .search-field,
	.site-nav .search-field:focus {
		width: 100%;
		font-size: 1rem;
	}

	.site-nav.is-open .site-nav__toggle-bars {
		background: transparent;
	}

	.site-nav.is-open .site-nav__toggle-bars::before {
		transform: translateY(5px) rotate(45deg);
	}

	.site-nav.is-open .site-nav__toggle-bars::after {
		transform: translateY(-5px) rotate(-45deg);
	}
}

@media (max-width: 420px) {
	.brand__name {
		font-size: 0.72rem;
	}
}

/* Front page: the hero already shows logo and name, so the bar's brand
   appears only once the hero has scrolled out of view. */
.home .site-nav .brand {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s, visibility 0.25s;
}

.home .site-nav.is-past-hero .brand,
.home .site-nav.is-open .brand {
	opacity: 1;
	visibility: visible;
}

/* ---------- Layout ---------- */

.site-main {
	min-height: 50vh;
}

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 3rem;
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin: 0 auto;
	padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 6rem);
}

.layout > .entry,
.layout > .listing {
	width: 100%;
	max-width: var(--measure);
	margin: 0 auto;
}

@media (min-width: 961px) {
	.layout--aside {
		grid-template-columns: minmax(0, var(--measure)) minmax(14rem, 18rem);
		justify-content: center;
		column-gap: clamp(3rem, 6vw, 6rem);
	}

	.layout--aside > .entry {
		margin: 0;
	}

	.layout--aside .aside {
		position: sticky;
		top: calc(var(--nav-h) + 2rem);
		align-self: start;
		max-height: calc(100vh - var(--nav-h) - 3rem);
		overflow-y: auto;
	}

	.admin-bar .layout--aside .aside {
		top: calc(var(--nav-h) + 2rem + 32px);
	}
}

/* ---------- Entry ---------- */

.entry__header {
	margin-bottom: 2rem;
}

.entry__kicker {
	margin: 0 0 0.6rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.entry__title {
	margin: 0;
	font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.entry__image {
	margin: 0 0 2rem;
}

.entry__image img {
	display: block;
	width: 100%;
}

/* ---------- Prose ---------- */

/* The old editor left font-size: 1rem on spans pasted into the text; with this
   theme's larger body text they read as small print (Bjarne, 19/10). */
.prose [style*="font-size: 1rem"],
.prose [style*="font-size:1rem"] {
	font-size: inherit !important;
}

.prose > * + * {
	margin-top: 1.1em;
}

.prose p {
	margin: 0;
}

.prose * + p {
	margin-top: 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
	margin: 2em 0 0.6em;
	line-height: 1.25;
	text-wrap: balance;
}

.prose h2 {
	font-size: 1.5em;
	font-weight: 600;
}

.prose h3 {
	font-size: 1.2em;
	font-weight: 600;
}

.prose h4 {
	font-family: var(--sans);
	font-size: 0.8em;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

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

.prose li + li {
	margin-top: 0.3em;
}

.prose blockquote {
	margin: 1.6em 0;
	padding: 0 0 0 1.25em;
	border-left: 2px solid var(--accent);
	color: var(--ink-soft);
	font-style: italic;
}

.prose hr {
	margin: 2.5em 0;
	border: 0;
}

.prose table {
	width: 100%;
	margin: 1.6em 0;
	border-collapse: collapse;
	font-size: 0.88em;
	display: block;
	overflow-x: auto;
}

.prose th,
.prose td {
	padding: 0.45em 0.7em;
	border-bottom: 1px solid var(--rule);
	text-align: left;
	vertical-align: top;
}

.prose th {
	font-family: var(--sans);
	font-size: 0.85em;
	font-weight: 600;
}

/* Classic editor alignment and captions. */
.alignleft {
	float: left;
	margin: 0.35em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: 0.35em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.prose .alignleft,
.prose .alignright {
	max-width: 50%;
}

@media (max-width: 600px) {
	.prose .alignleft,
	.prose .alignright {
		float: none;
		max-width: 100%;
		margin: 1em 0;
	}
}

.wp-caption {
	max-width: 100%;
}

.wp-caption img {
	display: block;
}

.wp-caption-text,
.gallery-caption,
figcaption {
	margin-top: 0.5em;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.78rem;
	line-height: 1.45;
}

.prose::after {
	content: "";
	display: table;
	clear: both;
}

/* Core [gallery]. */
.gallery {
	display: grid;
	grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
	gap: 1rem;
	margin: 1.6em 0;
}

.gallery-columns-1 { --cols: 1; }
.gallery-columns-2 { --cols: 2; }
.gallery-columns-3 { --cols: 3; }
.gallery-columns-4 { --cols: 4; }

.gallery-item {
	margin: 0;
}

.gallery-item img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Slideshow (replaces MetaSlider). */
.slideshow {
	width: 100%;
	margin: 1.6em 0;
}

/* Floated in the content, as on "Om komponisten". */
.alignleft > .slideshow,
.alignright > .slideshow {
	width: min(17rem, 100%);
	margin: 0;
}

.slides {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.slides::-webkit-scrollbar {
	display: none;
}

.slides__item {
	margin: 0;
	scroll-snap-align: start;
}

/* Mixed portrait and landscape photos: show them whole on a fixed-height mat. */
.slides__item img {
	display: block;
	width: 100%;
	height: clamp(16rem, 34vw, 22rem);
	object-fit: contain;
	background: var(--paper-deep);
}

.slideshow__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.5rem;
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--muted);
}

.slideshow__button {
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--rule);
	border-radius: 50%;
	background: var(--surface);
	color: var(--ink);
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.slideshow__button:hover:not(:disabled) {
	border-color: var(--accent);
	color: var(--accent);
}

.slideshow__button:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (max-width: 600px) {
	.alignleft > .slideshow,
	.alignright > .slideshow {
		width: 100%;
	}

	.prose .alignleft:has(> .slideshow),
	.prose .alignright:has(> .slideshow) {
		width: 100%;
	}
}

/* Embeds. */
.embed,
.wp-embed-responsive .wp-has-aspect-ratio {
	margin: 1.6em 0;
}

.embed iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
}

.anchor {
	display: block;
	height: 0;
}

/* Portrait series: one picture at a time with a soft cross-fade, like the old MetaSlider box. */
.fader {
	width: 100%;
	margin: 1.6em 0;
}

.alignleft > .fader,
.alignright > .fader {
	width: min(17.875rem, 100%);
	margin: 0;
}

.fader__stage {
	display: grid;
}

.fader__item {
	grid-area: 1 / 1;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.fader__item.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.8s ease, visibility 0s;
}

.fader__item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 286 / 400;
	object-fit: cover;
	background: var(--paper-deep);
}

.fader__item figcaption {
	margin-top: 0.4rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
	.fader__item,
	.fader__item.is-active {
		transition: none;
	}
}

@media (max-width: 600px) {
	.prose .alignleft:has(> .fader),
	.prose .alignright:has(> .fader) {
		float: none;
		width: 100%;
		margin: 0 0 1.6em !important;
	}

	.alignleft > .fader,
	.alignright > .fader {
		width: min(17.875rem, 100%);
		margin-inline: auto;
	}
}

.site-main {
	overflow-x: clip;
}

/* Video card: the YouTube player loads only on click. */
.video {
	display: grid;
	place-content: center;
	gap: 0.75rem;
	aspect-ratio: 16 / 9;
	margin: 1.6em 0;
	padding: 1.5rem;
	background: #24201c;
	color: #f2eee6;
	text-align: center;
}

.video__title {
	margin: 0;
	font-size: 1.1rem;
}

.video__play {
	justify-self: center;
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: 2rem;
	background: #fff;
	color: var(--ink);
	font: 600 0.8rem var(--sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.video__play::before {
	content: "\25B6\FE0E";
	margin-right: 0.5em;
}

.video__play:hover {
	background: var(--paper-deep);
}

.video__note {
	margin: 0;
	color: #b3aa9c;
	font-family: var(--sans);
	font-size: 0.75rem;
}

.video__note a {
	color: #fff;
}

.video__frame {
	width: 100%;
	height: 100%;
	border: 0;
}

.video:has(.video__frame) {
	display: block;
	padding: 0;
}

.video__frame {
	display: block;
}

.link-card a {
	display: inline-block;
	padding: 0.8rem 1.1rem;
	border: 1px solid var(--rule);
	font-family: var(--sans);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
}

.link-card a:hover {
	border-color: var(--accent);
}

/* ---------- Aside ---------- */

.aside {
	font-size: 0.95rem;
}

.aside .widget + .widget {
	margin-top: 2rem;
}

.aside .widget-title {
	margin: 0 0 0.75rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.aside .widget_text {
	padding: 1rem 1.1rem;
	background: var(--paper-deep);
	color: var(--ink-soft);
	font-size: 0.88rem;
	line-height: 1.55;
}

.aside .widget_text p {
	margin: 0;
}

.aside .widget_text p + p {
	margin-top: 0.75em;
}

.aside ul,
.subnav__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-left: 1px solid var(--rule);
}

.aside li a,
.subnav__item a {
	display: block;
	margin-left: -1px;
	padding: 0.32rem 0 0.32rem 1rem;
	border-left: 2px solid transparent;
	color: var(--ink-soft);
	line-height: 1.35;
	text-decoration: none;
}

.aside li a:hover,
.subnav__item a:hover {
	color: var(--accent);
}

.aside .current-menu-item > a,
.subnav__item.is-current a {
	border-left-color: var(--accent);
	color: var(--ink);
	font-weight: 600;
}

@media (max-width: 960px) {
	.aside {
		max-width: var(--measure);
		width: 100%;
		margin: 0 auto;
		padding-top: 2rem;
		border-top: 1px solid var(--rule);
	}
}

/* Section submenu as tabs under the page title. */
.subnav--tabs {
	margin-top: 1.5rem;
}

.subnav--tabs .subnav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.6rem;
	padding-bottom: 0.6rem;
	border-left: 0;
	border-bottom: 1px solid var(--rule);
}

.subnav--tabs .subnav__item a {
	margin: 0 0 calc(-0.6rem - 1px);
	padding: 0.3rem 0 0.6rem;
	border-left: 0;
	border-bottom: 2px solid transparent;
	font-family: var(--sans);
	font-size: 0.88rem;
}

.subnav--tabs .subnav__item.is-current a {
	border-bottom-color: var(--accent);
}

/* ---------- Pager ---------- */

.pager,
.pager .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 3.5rem;
}

.pager .nav-links {
	grid-column: 1 / -1;
	margin-top: 0;
}

.pager__link,
.pager .nav-previous a,
.pager .nav-next a {
	display: block;
	padding: 1rem 1.1rem;
	border: 1px solid var(--rule);
	color: var(--ink);
	text-decoration: none;
	transition: border-color 0.15s;
}

.pager__link:hover,
.pager .nav-previous a:hover,
.pager .nav-next a:hover {
	border-color: var(--accent);
	color: var(--ink);
}

.pager__link--next,
.pager .nav-next {
	grid-column: 2;
	text-align: right;
}

.pager__label {
	display: block;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.pager__title {
	display: block;
	margin-top: 0.25rem;
	line-height: 1.3;
}

.pager .screen-reader-text {
	display: none;
}

/* ---------- Front page ---------- */

.front-intro {
	width: min(100% - 2 * var(--gutter), var(--measure));
	margin: 0 auto;
	padding: clamp(2.5rem, 7vw, 5rem) 0;
	font-size: 1.08em;
}

.panel {
	border-top: 1px solid var(--rule);
}

.panel__image {
	height: clamp(14rem, 40vw, 26rem);
	overflow: hidden;
}

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

.panel__body {
	width: min(100% - 2 * var(--gutter), var(--measure));
	margin: 0 auto;
	padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.panel__title {
	margin: 0 0 1.5rem;
	font-family: var(--sans);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.panel__title a {
	color: var(--ink);
	text-decoration: none;
}

.panel__title a:hover {
	color: var(--accent);
}

/* ---------- Listing ---------- */

.cards {
	margin: 0;
	padding: 0;
	list-style: none;
}

.card {
	padding: 1.6rem 0;
	border-top: 1px solid var(--rule);
}

.card__meta {
	margin: 0 0 0.3rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
}

.card__title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.25;
}

.card__title a {
	color: var(--ink);
	text-decoration: none;
}

.card__title a:hover {
	color: var(--accent);
}

.card__excerpt p {
	margin: 0;
	color: var(--ink-soft);
}

.pagination .nav-links {
	display: flex;
	gap: 0.5rem;
	margin-top: 2rem;
	font-family: var(--sans);
	font-size: 0.85rem;
}

.pagination .page-numbers {
	padding: 0.3rem 0.65rem;
	border: 1px solid var(--rule);
	text-decoration: none;
}

.pagination .current {
	border-color: var(--ink);
}

.listing .search-form {
	display: flex;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

.listing .search-field {
	flex: 1;
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--rule);
	font: inherit;
}

.listing .search-submit {
	padding: 0.5rem 1rem;
	border: 0;
	background: var(--ink);
	color: #fff;
	font: 600 0.8rem var(--sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

/* ---------- Breadcrumb ---------- */

.breadcrumb {
	margin: 0 0 0.9rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.breadcrumb a {
	color: var(--muted);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.breadcrumb .breadcrumb_last {
	color: var(--ink-soft);
}

/* ---------- Language switch ---------- */

/* WPGlobus' flag item in the menu is replaced by the text link below. */
.site-nav .menu_item_wpglobus_menu_switch {
	display: none;
}

.lang-switch {
	flex-shrink: 0;
	padding: 0.4rem 0.7rem;
	border: 1px solid var(--rule);
	border-radius: 2px;
	color: var(--ink-soft);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
}

.lang-switch:hover {
	border-color: var(--accent);
	color: var(--accent);
}

@media (max-width: 960px) {
	.lang-switch {
		align-self: flex-start;
		margin-top: 1rem;
	}
}

/* ---------- Front page news ---------- */

.news {
	background: var(--paper-deep);
	border-top: 1px solid var(--rule);
}

.news__inner {
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin: 0 auto;
	padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.news__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.news__item .card__title {
	font-size: 1.2rem;
}

.news__excerpt {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.95rem;
}

.news__more {
	margin: 2rem 0 0;
	font-family: var(--sans);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.news__more a {
	text-decoration: none;
}

/* ---------- Footer ---------- */

.site-footer {
	background: #24201c;
	color: #d8d1c5;
	font-family: var(--sans);
	font-size: 0.85rem;
	line-height: 1.6;
}

.site-footer__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 2rem;
	width: min(100% - 2 * var(--gutter), var(--wide));
	margin: 0 auto;
	padding: 3rem 0;
}

.site-footer a {
	color: #fff;
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

.site-footer__name {
	margin: 0;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.site-footer__tagline {
	margin: 0.3rem 0 0;
	color: #b3aa9c;
	font-family: var(--serif);
	font-style: italic;
}

.site-footer__widgets {
	margin-top: 1.5rem;
}

.site-footer__widgets img {
	max-width: 12rem;
	height: auto;
	/* The society's logo is dark on transparent; show it white on the dark footer. */
	filter: brightness(0) invert(1);
	opacity: 0.9;
}

.site-footer__links ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__links li + li {
	margin-top: 0.4rem;
}

.site-footer__contact {
	font-style: normal;
}

/* ---------- Teasers and thumbnails ---------- */

.panel__more {
	margin: 1.75rem 0 0;
	font-family: var(--sans);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.panel__more a {
	text-decoration: none;
}

.card--image {
	display: grid;
	grid-template-columns: 7rem 1fr;
	column-gap: 1.25rem;
	align-items: start;
}

.card--image > :not(.card__image) {
	grid-column: 2;
}

.card__image {
	grid-row: 1 / span 3;
}

.card__image img,
.news__image img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--paper-deep);
}

.news__image {
	display: block;
	margin-bottom: 0.9rem;
}

.news__image img {
	aspect-ratio: 3 / 2;
}

@media (max-width: 480px) {
	.card--image {
		grid-template-columns: 5rem 1fr;
		column-gap: 1rem;
	}
}

/* ---------- Print ---------- */

@media print {
	@page {
		margin: 2cm;
	}

	.site-nav,
	.hero,
	.aside,
	.pager,
	.breadcrumb,
	.site-footer,
	.slideshow__controls,
	.skip-link,
	.video__play,
	.scroll-down {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	.layout {
		display: block;
		width: auto;
		padding: 0;
	}

	.layout > .entry {
		max-width: none;
	}

	.prose a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
		color: #555;
		word-break: break-all;
	}

	.prose img {
		max-width: 50% !important;
		break-inside: avoid;
	}

	h1,
	h2,
	h3 {
		break-after: avoid;
	}
}

/* ---------- Book typography ---------- */

/* Biography chapters open like a printed book: a drop cap, the first line in small caps. */
.prose p.lead::first-letter {
	float: left;
	margin: 0.06em 0.09em 0 0;
	color: var(--accent);
	font-size: 3.55em;
	font-weight: 600;
	line-height: 0.82;
}

.prose p.lead::first-line {
	font-variant-caps: small-caps;
	letter-spacing: 0.03em;
}

/* Quotations in Nielsen's own words: set apart, with a hanging opening mark. */
.prose p.quote {
	position: relative;
	margin: 1.6em 0;
	padding-left: 1.6rem;
	color: var(--ink-soft);
	font-size: 1.04em;
	font-style: italic;
}

.prose p.quote em,
.prose p.quote i {
	font-style: inherit;
}

.prose .quote__mark {
	position: absolute;
	top: -0.12em;
	left: -0.1rem;
	color: var(--accent);
	font-size: 2.6em;
	font-style: normal;
	line-height: 1;
}

@media (max-width: 480px) {
	.prose p.lead::first-letter {
		font-size: 3.1em;
	}
}

/* ---------- Dark mode ---------- */

/* Follows the visitor's system setting. The old photographs sit well on a dark ground,
   and OLED screens spend less power on dark pixels. */
@media (prefers-color-scheme: dark) {
	:root {
		--paper: #181512;
		--paper-deep: #221e1a;
		--ink: #ece5d9;
		--ink-soft: #cdc4b6;
		--muted: #a59c8e;
		--rule: #38322b;
		--accent: #e3906f;
		--accent-ink: #f0a98b;
		--surface: #221e1a;
		--nav-bg: rgb(24 21 18 / 0.94);
		--line-strong: #5a5147;
	}

	/* The bar's small logo is drawn dark for the light theme; show it light. */
	.brand .brand__logo {
		filter: none;
	}

	.site-nav .sub-menu,
	.site-nav__panel {
		box-shadow: 0 12px 30px rgb(0 0 0 / 0.45);
	}

	/* Take the glare off photographs and scans. */
	.prose img,
	.entry__image img,
	.card__image img,
	.news__image img {
		filter: brightness(0.9);
	}

	.site-footer {
		background: #0f0d0b;
	}

	.listing .search-submit {
		background: var(--ink);
		color: var(--paper);
	}
}

/* ---------- Staff lines ---------- */

/* Five hairlines, like a stave, fading out to the right. Drawn with a gradient:
   no image, and it follows the light and dark colours. */
.entry__header::after,
.prose hr,
.panel__body::before,
.news__inner::before {
	content: "";
	display: block;
	width: 7rem;
	height: 17px;
	background: repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 4px);
	-webkit-mask-image: linear-gradient(to right, #000 55%, transparent);
	mask-image: linear-gradient(to right, #000 55%, transparent);
}

.entry__header::after {
	margin-top: 1.5rem;
}

.panel__body::before,
.news__inner::before {
	margin-bottom: 1.75rem;
}

.panel {
	border-top: 0;
}

/* ---------- Page transitions ---------- */

/* Pages fade into each other; the navigation bar stays put. Browsers without
   cross-document view transitions simply change page as before. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}

	.site-nav {
		view-transition-name: site-nav;
	}

	::view-transition-old(root),
	::view-transition-new(root) {
		animation-duration: 0.28s;
		animation-timing-function: ease-out;
	}
}
