/**
 * Site styles: document, accessibility, page layout, header, menu, listings,
 * forms and footer, with the approved visual identity (D-021, applied in
 * Stage 8, D-030).
 *
 * Loaded only on the site, never in the editor. Content styles shared with the
 * editor are in content.css; token aliases in tokens.css. Every value comes
 * from theme.json through tokens.css: this file must not introduce colors or
 * fonts of its own, and uses colors by role (text, heading, link, accent…).
 */

/* ---------- Document ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* The footer stays at the bottom of short pages. */
body {
	display: flex;
	flex-direction: column;
	margin: 0;
	min-height: 100vh;
	overflow-wrap: break-word;
}

.site-main {
	flex: 1 0 auto;
}

svg {
	max-width: 100%;
}

/* ---------- Accessibility ---------- */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Skip link: hidden until it receives keyboard focus. */
.skip-link:focus {
	background-color: var(--carolsaling-color-inverse-background);
	border-radius: var(--carolsaling-radius-small);
	clip-path: none;
	color: var(--carolsaling-color-inverse-text);
	font-weight: var(--carolsaling-weight-cta);
	height: auto;
	left: 0.5rem;
	margin: 0;
	padding: 0.75rem 1rem;
	top: 0.5rem;
	width: auto;
	z-index: 100000;
}

/* Visible focus for keyboard users, on every interactive element: brand blue
 * on light areas (9.68:1 on ivory, 6.61:1 on peach), ivory on dark areas
 * (tokens.css). */
:focus-visible {
	outline: var(--carolsaling-focus-width) solid var(--carolsaling-color-focus);
	outline-offset: var(--carolsaling-focus-offset);
}

/* The skip link target receives focus programmatically; no outline needed there. */
#main:focus {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---------- Page layout ----------
 *
 * Header and footer use the wide width. The main area spans the whole window
 * minus the gutter; its children are centred in the content column, so wide
 * and full-width blocks can grow without negative margins based on 100vw
 * (which overflow when the browser shows a vertical scrollbar).
 */

.site-header__inner,
.site-footer__inner {
	margin-inline: auto;
	max-width: calc(var(--carolsaling-wide-width) + 2 * var(--carolsaling-gutter));
	padding-inline: var(--carolsaling-gutter);
}

.site-main {
	padding: calc(2 * var(--carolsaling-space)) var(--carolsaling-gutter) var(--carolsaling-section-space);
}

/* The content column. A single post or page (.entry-singular) is not limited
 * itself, so its blocks can use the wide and full alignments. */
.site-main > :where(:not(.entry-singular)),
.entry-singular > :where(:not(.entry-content)),
.entry-content > * {
	margin-inline: auto;
	max-width: var(--carolsaling-content-width);
}

.entry-content > .alignwide {
	max-width: var(--carolsaling-wide-width);
}

/* Full width: cancel the gutter of .site-main, nothing more. */
.entry-content > .alignfull {
	margin-inline: calc(-1 * var(--carolsaling-gutter));
	max-width: none;
}

/* A full-width group keeps its inner content off the screen edges. */
.entry-content > .alignfull.is-layout-constrained {
	padding-inline: var(--carolsaling-gutter);
}

/*
 * Sections of the home page (patterns/home-*.php, D-029): bands of color from
 * edge to edge, also on pages built with the Stage 7 patterns, whose sections
 * were not marked "full width". The first band touches the header and the
 * last one the footer.
 */
.entry-content > .carolsaling-section {
	margin-block: 0;
	margin-inline: calc(-1 * var(--carolsaling-gutter));
	max-width: none;
	padding-inline: var(--carolsaling-gutter);
}

.site-main:has(> .entry-singular > .entry-content > .carolsaling-section:first-child) {
	padding-top: 0;
}

.site-main:has(> .entry-singular > .entry-content > .carolsaling-section:last-child) {
	padding-bottom: 0;
}

.entry-singular > .entry-content:has(> .carolsaling-section:first-child) {
	margin-top: 0;
}

/* Floats stay on the edges of the content column. */
.entry-content > .alignleft {
	float: left;
	margin-inline: max(0px, (100% - var(--carolsaling-content-width)) / 2) var(--carolsaling-space);
	max-width: 50%;
}

.entry-content > .alignright {
	float: right;
	margin-inline: var(--carolsaling-space) max(0px, (100% - var(--carolsaling-content-width)) / 2);
	max-width: 50%;
}

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

/* On small screens floated blocks would leave a narrow strip of text: stack them. */
@media (max-width: 30rem) {

	.entry-content > .alignleft,
	.entry-content > .alignright {
		float: none;
		margin-inline: auto;
		max-width: 100%;
	}
}

/* Classic editor alignments (content not made with blocks). */
.alignleft {
	float: left;
	margin: 0.25rem var(--carolsaling-space) 1rem 0;
}

.alignright {
	float: right;
	margin: 0.25rem 0 1rem var(--carolsaling-space);
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

/* ---------- Header and menu ---------- */

.site-header {
	background-color: var(--carolsaling-color-background);
	border-bottom: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	padding-block: 1.125rem;
}

/*
 * Header grid (Stage 8 review). The language switcher has its own cell in the
 * top right corner, in every language and on every screen: the name of the
 * site is on the left, the menu takes the space between them and wraps inside
 * its own cell. Before, the header was a wrapping flex row, and a longer menu
 * (English) or a longer switcher pushed the switcher to a new line, on the
 * left.
 *
 * Large screens: "brand nav lang" in one row.
 * Up to 64rem: "brand lang" on the first row, the menu below.
 */
.site-header__inner {
	align-items: start;
	display: grid;
	gap: 0.75rem 2rem;
	grid-template-areas: "brand nav lang";
	grid-template-columns: auto minmax(0, 1fr) auto;
}

.site-branding {
	grid-area: brand;
	min-width: 0;
}

.site-nav {
	grid-area: nav;
	min-width: 0;
}

.language-switcher {
	grid-area: lang;
}

@media (max-width: 64rem) {

	.site-header__inner {
		grid-template-areas:
			"brand lang"
			"nav nav";
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

.site-branding {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: var(--carolsaling-touch-target);
}

/*
 * Site name. It is plain text, never a drawing of the logo (D-021): the
 * original logo, when uploaded in Appearance → Customize → Site Identity,
 * takes its place (carolsaling_site_title()).
 */
.site-title {
	font-family: var(--carolsaling-font-text);
	font-size: 1.25rem;
	font-weight: var(--carolsaling-weight-cta);
	letter-spacing: 0.01em;
	line-height: 1.2;
	margin: 0;
}

.site-title a {
	color: var(--carolsaling-color-heading);
	display: inline-flex;
	align-items: center;
	min-height: var(--carolsaling-touch-target);
	text-decoration: none;
}

.site-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

/* Original logo (custom-logo): its own proportions, limited height. */
.site-title .custom-logo {
	display: block;
	height: auto;
	max-height: 3.5rem;
	width: auto;
}

.site-description {
	color: var(--carolsaling-color-muted);
	font-size: var(--carolsaling-font-size-small);
	margin: 0;
}

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

/* Large screens: the links end next to the switcher and wrap when needed. */
.site-nav__list {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.5rem;
	justify-content: flex-end;
}

@media (max-width: 64rem) {

	.site-nav__list {
		justify-content: flex-start;
	}
}

/* Every link is at least as tall as a comfortable touch target. Links in the
 * menu are recognised by their place; the underline shows on hover and marks
 * the current page (not only a color). */
.site-nav a {
	align-items: center;
	color: var(--carolsaling-color-text);
	display: inline-flex;
	font-weight: var(--carolsaling-weight-navigation);
	min-height: var(--carolsaling-touch-target);
	text-decoration: none;
}

.site-nav a:hover {
	color: var(--carolsaling-color-link);
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}

.site-nav a[aria-current="page"],
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a {
	color: var(--carolsaling-color-link);
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.35em;
}

/*
 * Optional button in the menu (home page review, D-031): a menu item with the
 * CSS class "menu-button" (Appearance → Menus → Screen Options → CSS Classes)
 * is drawn as a pill outline, as the call to action of the header. Its text
 * and address are those of the menu item.
 */
.site-nav .menu-button > a {
	border: 2px solid var(--carolsaling-color-link);
	border-radius: var(--carolsaling-radius-pill);
	color: var(--carolsaling-color-link);
	font-weight: var(--carolsaling-weight-cta);
	padding-inline: 1.125rem;
}

.site-nav .menu-button > a:hover,
.site-nav .menu-button > a[aria-current="page"],
.site-nav .menu-button.current-menu-item > a {
	background-color: var(--carolsaling-color-link);
	color: var(--carolsaling-color-background);
	text-decoration: none;
}

@media (max-width: 48rem) {

	.site-nav--js.is-open .site-nav__list .menu-button > a {
		border: 0;
		border-radius: 0;
		padding-inline: 0;
	}

	.site-nav--js.is-open .site-nav__list .menu-button > a:hover {
		background: none;
		color: var(--carolsaling-color-link);
	}
}

/* Sub-items stay visible below their parent (no hover-only menus). */
.site-nav .sub-menu {
	font-size: var(--carolsaling-font-size-small);
	padding-inline-start: 1rem;
}

/* Small screens: the menu takes the full width, one link per line. */
@media (max-width: 48rem) {

	.site-nav__list {
		display: grid;
		gap: 0 1rem;
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
	}
}

/*
 * Open/close button (Stage 7, assets/js/navigation.js). Shown only below
 * 48rem and only after the script ran (.site-nav--js); without JavaScript the
 * button keeps its hidden attribute and every link stays visible. It sits
 * below the language switcher, at the end of the row; the list opens below,
 * one link per line. (It is not placed on the first row: at 320px the name of
 * the site, the switcher and the button do not fit side by side.)
 */
.site-nav__toggle {
	display: none;
}

@media (max-width: 48rem) {

	/*
	 * .carolsaling-js (set on <html> by a few bytes of inline script in
	 * <head>, inc/assets.php) draws the closed menu from the first paint,
	 * before navigation.js runs, so the page does not jump up when the menu
	 * closes (layout shift measured in Stage 9). Without JavaScript the class
	 * never exists; if navigation.js does not run, the class is removed at
	 * "load" and every link shows again.
	 */
	.site-nav--js,
	.carolsaling-js .site-nav {
		display: flex;
		flex-direction: column;
	}

	.site-nav--js .site-nav__toggle,
	.carolsaling-js .site-nav .site-nav__toggle {
		align-self: flex-end;
		align-items: center;
		background: transparent;
		border: 2px solid var(--carolsaling-color-link);
		border-radius: var(--carolsaling-radius-small);
		color: var(--carolsaling-color-link);
		cursor: pointer;
		display: inline-flex;
		font: inherit;
		font-weight: var(--carolsaling-weight-cta);
		gap: 0.5em;
		min-height: var(--carolsaling-touch-target);
		padding: 0 1rem;
	}

	.site-nav--js .site-nav__toggle:hover,
	.site-nav--js.is-open .site-nav__toggle {
		background-color: var(--carolsaling-color-link);
		color: var(--carolsaling-color-background);
	}

	/* A +/− sign, drawn with text; screen readers get aria-expanded. */
	.site-nav--js .site-nav__toggle::after,
	.carolsaling-js .site-nav .site-nav__toggle::after {
		content: "+";
		font-size: 1.25em;
		line-height: 1;
	}

	.site-nav--js.is-open .site-nav__toggle::after {
		content: "\2212";
	}

	.site-nav--js:not(.is-open) .site-nav__list,
	.carolsaling-js .site-nav:not(.is-open) .site-nav__list {
		display: none;
	}

	.site-nav--js.is-open .site-nav__list {
		border-top: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
		display: block;
		margin-top: 0.75rem;
		padding-top: 0.25rem;
	}

	.site-nav--js.is-open .site-nav__list > li {
		border-bottom: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	}

	.site-nav--js.is-open .site-nav__list a {
		display: flex;
		font-size: 1.0625rem;
		width: 100%;
	}
}

/* ---------- Language switcher (D-023, refined in Stage 8) ----------
 * Compact: the language codes (PT, EN) are visible and the full names are
 * read by screen readers ("Português (PT)", so the visible text is part of
 * the accessible name). Both items have the same width, so the switcher keeps
 * its size and place in every language, with or without the "home page" note
 * (read by screen readers only). The current language is a filled pill marked
 * with aria-current, not only by color. Touch target of 44px, visible focus,
 * reachable with the keyboard in reading order.
 */

.language-switcher__list {
	border: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	border-radius: var(--carolsaling-radius-pill);
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}

.language-switcher__link,
.language-switcher__current {
	align-items: center;
	border-radius: var(--carolsaling-radius-pill);
	display: inline-flex;
	font-size: var(--carolsaling-font-size-small);
	font-weight: var(--carolsaling-weight-navigation);
	inline-size: calc(var(--carolsaling-touch-target) + 0.25rem);
	justify-content: center;
	letter-spacing: 0.04em;
	min-height: var(--carolsaling-touch-target);
}

.language-switcher__link {
	color: var(--carolsaling-color-link);
	text-decoration: none;
}

.language-switcher__link:hover {
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

.language-switcher__current {
	background-color: var(--carolsaling-color-inverse-background);
	color: var(--carolsaling-color-inverse-text);
}

/* ---------- Internal pages: header band (internal pages review) ----------
 *
 * Every internal page opens like the home page (D-031): a light band on the
 * surface tone, from edge to edge, with the content centred: a short line
 * (eyebrow) when there is one, the <h1>, and what belongs to the page header
 * (date and author, archive description, categories, the search form).
 * Listings (.page-header) and single posts, resources and pages
 * (.entry-singular > .entry-header) share it. Inside the band, muted text is
 * graphite (tokens.css), as in the light sections of the home page.
 */

.site-main > .page-header,
.entry-singular > .entry-header {
	background-color: var(--carolsaling-color-surface);
	margin: 0 calc(-1 * var(--carolsaling-gutter)) clamp(2rem, 1rem + 3vw, 3.5rem);
	max-width: none;
	padding: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) var(--carolsaling-gutter);
	text-align: center;
}

.site-main > .page-header > *,
.entry-singular > .entry-header > * {
	margin-inline: auto;
	max-width: 48rem;
}

.site-main > .page-header > :last-child,
.entry-singular > .entry-header > :last-child {
	margin-bottom: 0;
}

/* The band touches the header of the site. */
.site-main:has(> .page-header:first-child),
.site-main:has(> .entry-singular:first-child > .entry-header:first-child) {
	padding-top: 0;
}

/* A page whose content starts with a band of the home page patterns: the two
 * bands touch. */
.entry-singular > .entry-header:has(+ .entry-content > .carolsaling-section:first-child) {
	margin-bottom: 0;
}

/* Titles: Newsreader, brand blue (theme.json), balanced lines. Without a
 * short line above, a short terracotta rule (a detail, not text) marks the
 * start, centred. */
.page-title,
.entry-singular > .entry-header > .entry-title {
	font-size: var(--carolsaling-font-size-xx-large);
	line-height: 1.1;
	margin-block: 0 1rem;
	text-wrap: balance;
}

/* Posts and resources: long titles, one size smaller. */
.single .entry-singular > .entry-header > .entry-title {
	font-size: var(--carolsaling-font-size-x-large);
	line-height: var(--carolsaling-line-height-heading);
}

.page-title::before,
.entry-singular > .entry-header > .entry-title::before {
	background-color: var(--carolsaling-color-accent);
	content: "";
	display: block;
	height: 3px;
	margin: 0 auto 1.25rem;
	width: 3rem;
}

.page-title:has(> .page-title__prefix)::before,
.entry-singular > .entry-header:has(> .entry-eyebrow) > .entry-title::before {
	display: none;
}

/* The short line above a title: the prefix of an archive title ("Category",
 * "Tag", "Author"), the categories of a post, the list of a resource. Same
 * look as .carolsaling-eyebrow of the home page: small capitals in Manrope
 * 600, with terracotta rules on both sides in the centred band. */
.page-title__prefix,
.entry-eyebrow,
.author-box__eyebrow {
	align-items: center;
	color: var(--carolsaling-color-muted);
	display: flex;
	flex-wrap: wrap;
	font-family: var(--carolsaling-font-text);
	font-size: 0.8125rem;
	font-weight: var(--carolsaling-weight-cta);
	gap: 0.25rem 0.75rem;
	justify-content: center;
	letter-spacing: 0.12em;
	line-height: 1.4;
	margin-block: 0 1.25rem;
	text-transform: uppercase;
}

.page-title__prefix::before,
.page-title__prefix::after,
.entry-singular > .entry-header > .entry-eyebrow::before,
.entry-singular > .entry-header > .entry-eyebrow::after,
.author-box__eyebrow::before {
	background-color: var(--carolsaling-color-accent);
	content: "";
	flex: none;
	height: 2px;
	width: 2rem;
}

.page-title__name {
	display: block;
}

.entry-eyebrow a {
	align-items: center;
	color: var(--carolsaling-color-muted);
	display: inline-flex;
	min-height: var(--carolsaling-touch-target);
	text-decoration: none;
}

.entry-eyebrow a:hover {
	color: var(--carolsaling-color-link);
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

.entry-title {
	margin-block: 0 0.5rem;
}

.entry-title a {
	color: var(--carolsaling-color-heading);
	text-decoration: none;
}

.entry-title a:hover,
.entry-title a:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
}

.entry-meta {
	color: var(--carolsaling-color-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: var(--carolsaling-font-size-small);
	gap: 0 1rem;
	margin: 0;
}

.entry-singular > .entry-header > .entry-meta,
.page-header .search-results-count {
	justify-content: center;
}

/* Category, tag and author descriptions written in the admin panel. */
.archive-description {
	color: var(--carolsaling-color-muted);
	font-size: 1.125rem;
	max-width: 40rem;
}

.archive-description > :first-child {
	margin-top: 0;
}

.archive-description > :last-child,
.search-results-count {
	margin-bottom: 0;
}

.search-results-count {
	color: var(--carolsaling-color-muted);
	margin-top: 0;
}

.entry-content {
	margin-top: var(--carolsaling-space);
}

.sticky,
.bypostauthor {
	display: block;
}

/* Long words and addresses in titles, search terms and comments wrap instead
 * of overflowing. */
.page-title,
.entry-title,
.post-navigation__title,
.comment-content {
	overflow-wrap: anywhere;
}

/* ---------- Single posts, resources and pages ---------- */

/* The featured image is wider than the text, with the rounded corners of the
 * home page photo. */
.entry-singular > .entry-thumbnail {
	margin-block: 0 calc(1.5 * var(--carolsaling-space));
	max-width: min(100%, 56rem);
}

.entry-singular > .entry-thumbnail img {
	border-radius: var(--carolsaling-radius-large);
	display: block;
	height: auto;
	width: 100%;
}

.entry-singular > .entry-thumbnail .wp-element-caption {
	text-align: center;
}

/* Tags below the content, as small pills. */
.entry-footer {
	border-top: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	font-size: var(--carolsaling-font-size-small);
	margin-top: calc(2 * var(--carolsaling-space));
	padding-top: var(--carolsaling-space);
}

.entry-taxonomy {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
}

.entry-taxonomy__label {
	color: var(--carolsaling-color-muted);
	font-weight: 600;
	margin-inline-end: 0.25rem;
}

.entry-taxonomy--tags a {
	align-items: center;
	border: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	border-radius: var(--carolsaling-radius-pill);
	display: inline-flex;
	min-height: var(--carolsaling-touch-target);
	padding: 0 1rem;
	text-decoration: none;
}

.entry-taxonomy--tags a:hover {
	border-color: var(--carolsaling-color-link);
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
}

/* Author of a post (carolsaling_author_box()): a card like those of the home
 * page, with the profile from Users → Profile. */
.author-box {
	background-color: var(--carolsaling-color-surface);
	border-radius: var(--carolsaling-radius-large);
	margin-top: calc(2 * var(--carolsaling-space));
	padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
}

.author-box__eyebrow {
	justify-content: flex-start;
	margin-bottom: 0.75rem;
}

.author-box__name {
	font-size: var(--carolsaling-font-size-large);
	margin: 0 0 0.75rem;
}

.author-box__bio > :first-child {
	margin-top: 0;
}

.author-box__bio > :last-child {
	margin-bottom: 0;
}

.author-box .profile-links {
	margin-top: 1.25rem;
}

.author-box__more {
	margin: 1rem 0 0;
}

.author-box__more a {
	align-items: center;
	display: inline-flex;
	font-weight: var(--carolsaling-weight-cta);
	gap: 0.5rem;
	min-height: var(--carolsaling-touch-target);
	text-decoration: none;
}

.author-box__more a::after {
	content: "\2192";
}

.author-box__more a:hover {
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-underline-offset: 0.25em;
}

/* ---------- Listings: cards (articles, categories, resources, search) ----------
 *
 * The summaries of a listing are cards in a grid, as the lists of the home
 * page (D-031): surface tone, large rounded corners, featured image on top
 * from edge to edge (3:2, cut in the centre), categories, title, date,
 * excerpt and the "read" link at the bottom. One card per row on phones.
 */

.site-main > .entry-list {
	display: grid;
	gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
	max-width: var(--carolsaling-wide-width);
}

.entry-summary-card {
	background-color: var(--carolsaling-color-surface);
	border-radius: var(--carolsaling-radius-large);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 1.75rem;
}

.entry-summary-card .entry-thumbnail {
	display: block;
	margin: -1.75rem -1.75rem 1.5rem;
	order: -1;
}

.entry-summary-card .entry-thumbnail img {
	aspect-ratio: 3 / 2;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.entry-summary-card .entry-eyebrow {
	gap: 0.25rem 0.5rem;
	justify-content: flex-start;
	letter-spacing: 0.08em;
	margin-bottom: 0.25rem;
}

.entry-summary-card .entry-title {
	font-size: 1.375rem;
	line-height: 1.25;
}

.entry-summary-card .entry-meta {
	margin-bottom: 0.5rem;
}

.entry-excerpt {
	font-size: 1rem;
}

.entry-excerpt > :first-child {
	margin-top: 0.25rem;
}

.entry-excerpt > :last-child {
	margin-bottom: 0;
}

/* "Read" link at the bottom of each card, with an arrow drawn in CSS. */
.entry-read-more {
	align-items: center;
	align-self: flex-start;
	display: inline-flex;
	font-weight: var(--carolsaling-weight-cta);
	gap: 0.5rem;
	margin-top: auto;
	min-height: var(--carolsaling-touch-target);
	padding-top: 0.75rem;
	text-decoration: none;
}

.entry-read-more::after {
	content: "\2192";
}

.entry-read-more:hover {
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
	text-underline-offset: 0.25em;
}

/* ---------- Messages: nothing found, 404 ---------- */

.no-results,
.not-found {
	background-color: var(--carolsaling-color-surface);
	border-radius: var(--carolsaling-radius-large);
	padding: clamp(1.75rem, 1rem + 3vw, 3rem) clamp(1.25rem, 0.5rem + 3vw, 3rem);
	text-align: center;
}

.site-main > .no-results,
.site-main > .not-found {
	max-width: 44rem;
}

.no-results > :first-child,
.not-found > :first-child {
	margin-top: 0;
}

.no-results > :last-child,
.not-found > :last-child {
	margin-bottom: 0;
}

.no-results__title,
.not-found__title {
	font-size: var(--carolsaling-font-size-large);
	margin-top: 0;
}

.not-found__title {
	margin-top: calc(1.5 * var(--carolsaling-space));
}

.no-results .search-form,
.not-found .search-form {
	margin-inline: auto;
	max-width: 32rem;
}

.not-found__home {
	margin-top: calc(1.5 * var(--carolsaling-space));
}

/* A link drawn as the pill button of the home page (404: back to the home
 * page). Same colors as the Button block. */
.button-link {
	align-items: center;
	background-color: var(--carolsaling-color-button);
	border: 2px solid var(--carolsaling-color-button);
	border-radius: var(--carolsaling-radius-pill);
	color: var(--carolsaling-color-button-text);
	display: inline-flex;
	font-weight: var(--carolsaling-weight-cta);
	justify-content: center;
	min-height: var(--carolsaling-touch-target);
	padding: 0.5rem 1.625rem;
	text-decoration: none;
}

.button-link:hover {
	background-color: var(--carolsaling-color-button-hover);
	border-color: var(--carolsaling-color-button-hover);
	color: var(--carolsaling-color-button-text);
}

/* Lattes and ORCID links (author archive, About page, author of a post):
 * outline pills, as the outline buttons of the home page. */
/* Only the block margins: inside the content of a page (shortcode), the list
 * keeps the centred column of .entry-content. */
.profile-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	list-style: none;
	margin-block: var(--carolsaling-space) 0;
	padding: 0;
}

.page-header .profile-links {
	justify-content: center;
}

.profile-links__link {
	align-items: center;
	border: 2px solid var(--carolsaling-color-link);
	border-radius: var(--carolsaling-radius-pill);
	color: var(--carolsaling-color-link);
	display: inline-flex;
	font-weight: var(--carolsaling-weight-cta);
	min-height: var(--carolsaling-touch-target);
	padding: 0 1.25rem;
	text-decoration: none;
}

.profile-links__link:hover {
	background-color: var(--carolsaling-color-link);
	color: var(--carolsaling-color-background);
}

/* Categories of the posts page (carolsaling_category_nav(), Stage 7): pills,
 * centred in the band; the current one filled. */
.category-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	list-style: none;
	margin: calc(1.5 * var(--carolsaling-space)) 0 0;
	padding: 0;
}

.category-nav a {
	align-items: center;
	background-color: var(--wp--preset--color--ivory);
	border: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	border-radius: var(--carolsaling-radius-pill);
	display: inline-flex;
	font-size: var(--carolsaling-font-size-small);
	font-weight: var(--carolsaling-weight-navigation);
	min-height: var(--carolsaling-touch-target);
	padding: 0 1.125rem;
	text-decoration: none;
}

.category-nav a:hover {
	border-color: var(--carolsaling-color-link);
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
}

.category-nav .current-cat > a {
	background-color: var(--carolsaling-color-inverse-background);
	border-color: var(--carolsaling-color-inverse-background);
	color: var(--carolsaling-color-inverse-text);
}

/* ---------- Pagination and search ---------- */

.pagination,
.page-links {
	margin-top: calc(2 * var(--carolsaling-space));
}

.site-main > .pagination {
	max-width: var(--carolsaling-wide-width);
}

/* Pages of a post split with the Page Break block. */
.page-links {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.page-links .post-page-numbers {
	align-items: center;
	border: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	border-radius: var(--carolsaling-radius-pill);
	display: inline-flex;
	justify-content: center;
	min-height: var(--carolsaling-touch-target);
	min-width: var(--carolsaling-touch-target);
	padding: 0 0.75rem;
}

.page-links .current {
	background-color: var(--carolsaling-color-inverse-background);
	border-color: var(--carolsaling-color-inverse-background);
	color: var(--carolsaling-color-inverse-text);
	font-weight: 600;
}

/* Previous and next post: two cards side by side (one under the other on
 * phones), each with its label and the title. */
.post-navigation {
	margin-top: calc(2 * var(--carolsaling-space));
}

.post-navigation .nav-links {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.post-navigation .nav-next {
	grid-column: -2;
	text-align: end;
}

.post-navigation a {
	background-color: var(--carolsaling-color-surface);
	border: var(--carolsaling-border-thin) solid transparent;
	border-radius: var(--carolsaling-radius-large);
	display: block;
	height: 100%;
	padding: 1.25rem 1.5rem;
	text-decoration: none;
}

.post-navigation a:hover {
	border-color: var(--carolsaling-color-link);
}

.post-navigation__title {
	color: var(--carolsaling-color-heading);
	font-family: var(--carolsaling-font-heading);
	font-size: 1.25rem;
	font-weight: var(--carolsaling-weight-heading);
	line-height: var(--carolsaling-line-height-heading);
}

.post-navigation a:hover .post-navigation__title,
.post-navigation a:focus-visible .post-navigation__title {
	text-decoration: underline;
	text-decoration-color: var(--carolsaling-color-accent);
}

.post-navigation__label {
	color: var(--carolsaling-color-muted);
	display: block;
	font-size: 0.8125rem;
	font-weight: var(--carolsaling-weight-cta);
	letter-spacing: 0.08em;
	margin-bottom: 0.375rem;
	text-transform: uppercase;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.pagination .page-numbers {
	align-items: center;
	border: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	border-radius: var(--carolsaling-radius-pill);
	display: inline-flex;
	justify-content: center;
	min-height: var(--carolsaling-touch-target);
	min-width: var(--carolsaling-touch-target);
	padding: 0.25rem 0.875rem;
	text-decoration: none;
}

.pagination a.page-numbers:hover {
	border-color: var(--carolsaling-color-link);
	text-decoration: underline;
}

.pagination .page-numbers.current {
	background-color: var(--carolsaling-color-inverse-background);
	border-color: var(--carolsaling-color-inverse-background);
	color: var(--carolsaling-color-inverse-text);
	font-weight: 600;
}

.pagination .page-numbers.dots {
	border-color: transparent;
}

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

.page-header .search-form {
	max-width: 36rem;
}

.search-form label {
	flex: 1 1 14rem;
}

.search-field,
.search-submit {
	font: inherit;
	min-height: var(--carolsaling-touch-target);
}

.search-field {
	padding: 0.5rem 1.125rem;
	width: 100%;
}

/* ---------- Forms: password-protected posts and comments ---------- */

/* Fields: ivory background, support blue border (5.65:1, above the 3:1 asked
 * for the border of a field) and a thicker border on focus, besides the
 * focus ring. */
.search-field,
.post-password-form input[type="password"],
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="date"],
.wpcf7-form select,
.wpcf7-form textarea {
	background-color: var(--carolsaling-color-background);
	border: var(--carolsaling-border-thin) solid var(--carolsaling-color-field-border);
	border-radius: var(--carolsaling-radius-small);
	color: var(--carolsaling-color-text);
}

.search-field:focus,
.post-password-form input[type="password"]:focus,
.comment-form :is(input, textarea):focus,
.wpcf7-form :is(input, select, textarea):focus {
	border-color: var(--carolsaling-color-link);
	box-shadow: inset 0 0 0 1px var(--carolsaling-color-link);
}

/* The search field is a pill, as the buttons beside it. */
.search-field {
	border-radius: var(--carolsaling-radius-pill);
}

/* Submit buttons of WordPress and plugin forms look like the Button block:
 * pills, as on the home page. */
.search-submit,
.post-password-form input[type="submit"],
.comment-form input[type="submit"],
.wpcf7-form input[type="submit"] {
	background-color: var(--carolsaling-color-button);
	border: 2px solid var(--carolsaling-color-button);
	border-radius: var(--carolsaling-radius-pill);
	color: var(--carolsaling-color-button-text);
	cursor: pointer;
	font-weight: var(--carolsaling-weight-cta);
	padding: 0.5rem 1.625rem;
}

.search-submit:hover,
.post-password-form input[type="submit"]:hover,
.comment-form input[type="submit"]:hover,
.wpcf7-form input[type="submit"]:hover {
	background-color: var(--carolsaling-color-button-hover);
	border-color: var(--carolsaling-color-button-hover);
}

.post-password-form input[type="password"],
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	font: inherit;
	max-width: 100%;
	min-height: var(--carolsaling-touch-target);
	padding: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	display: block;
	width: 100%;
}

.post-password-form input[type="submit"],
.comment-form input[type="submit"] {
	font: inherit;
	font-weight: var(--carolsaling-weight-cta);
	min-height: var(--carolsaling-touch-target);
}

.comment-form label,
.wpcf7-form label {
	font-weight: 600;
}

.comment-form-cookies-consent label,
.wpcf7-form .wpcf7-list-item label {
	font-weight: 400;
}

/* The checkbox and its label stay on one line. */
.comment-form-cookies-consent {
	align-items: flex-start;
	display: flex;
	gap: 0.5rem;
}

.comment-form-cookies-consent input {
	flex: none;
	margin-top: 0.3em;
}

/* Forms inside the content (password, contact) sit in a card, as the cards
 * of the home page: surface tone and large rounded corners. Fields keep the
 * ivory background (field border support blue: above 3:1 on both). */
.entry-content .post-password-form,
.entry-content .wpcf7,
.comment-respond {
	background-color: var(--carolsaling-color-surface);
	border-radius: var(--carolsaling-radius-large);
	padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.entry-content .post-password-form > :first-child,
.entry-content .wpcf7 .wpcf7-form > p:first-of-type,
.comment-respond > :first-child {
	margin-top: 0;
}

.entry-content .post-password-form > :last-child,
.entry-content .wpcf7 .wpcf7-form > :last-child {
	margin-bottom: 0;
}

.post-password-form-invalid-password {
	border-inline-start: var(--carolsaling-border-thick) solid var(--carolsaling-color-accent);
	padding-inline-start: 1rem;
}

/* ---------- Forms: Contact Form 7 ----------
 * Layout, touch targets and the colors of the theme (fields and button share
 * the rules above). Contact Form 7's own stylesheet, loaded only on pages
 * with a form, still lays out its messages; the theme only recolors them so
 * every message keeps the contrast (text in the text color, with a terracotta
 * or support blue mark beside it: the color is never the only signal). */

.wpcf7-form label {
	display: block;
}

.wpcf7-form .wpcf7-form-control-wrap {
	display: block;
	margin-top: 0.25rem;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="date"],
.wpcf7-form select,
.wpcf7-form textarea {
	box-sizing: border-box;
	display: block;
	font: inherit;
	max-width: 100%;
	min-height: var(--carolsaling-touch-target);
	padding: 0.5rem;
	width: 100%;
}

.wpcf7-form input[type="submit"] {
	font: inherit;
	font-weight: var(--carolsaling-weight-cta);
	min-height: var(--carolsaling-touch-target);
}

/* Field errors: text in the text color, bold, with a terracotta mark; the
 * field gets a terracotta border (4.40:1, above 3:1 for non-text). */
.wpcf7-form .wpcf7-not-valid-tip {
	border-inline-start: var(--carolsaling-border-thick) solid var(--carolsaling-color-accent);
	color: var(--carolsaling-color-text);
	font-size: var(--carolsaling-font-size-small);
	font-weight: 600;
	margin-top: 0.375rem;
	padding-inline-start: 0.5rem;
}

.wpcf7-form :is(input, select, textarea).wpcf7-not-valid {
	border-color: var(--carolsaling-color-accent);
	box-shadow: inset 0 0 0 1px var(--carolsaling-color-accent);
}

/* The message below the form (sent, errors, spam). The doubled class beats
 * the colored borders of the plugin stylesheet (yellow, red, green), whose
 * contrast on ivory is not guaranteed. */
.wpcf7 .wpcf7-form.wpcf7-form .wpcf7-response-output {
	border: 0;
	border-inline-start: var(--carolsaling-border-thick) solid var(--carolsaling-color-accent);
	border-radius: 0;
	color: var(--carolsaling-color-text);
	margin: var(--carolsaling-space) 0 0;
	padding: 0.5rem 0 0.5rem 1rem;
}

.wpcf7 .wpcf7-form.wpcf7-form.sent .wpcf7-response-output {
	border-color: var(--carolsaling-color-muted);
}

/* Checkboxes (consent, acceptance): box and text on one line. */
.wpcf7-form .wpcf7-list-item {
	margin: 0;
}

.wpcf7-form .wpcf7-list-item label {
	align-items: flex-start;
	display: flex;
	gap: 0.5rem;
	min-height: var(--carolsaling-touch-target);
}

.wpcf7-form .wpcf7-list-item input {
	flex: none;
	margin-top: 0.3em;
}

/* Notice about the form, shown only to people who can edit (inc/contact.php). */
.form-notice {
	border-inline-start: var(--carolsaling-border-thick) solid var(--carolsaling-color-accent);
	padding-inline-start: 1rem;
}

/* ---------- Comments ---------- */

.comments-area {
	margin-top: calc(2.5 * var(--carolsaling-space));
}

.comments-title {
	font-size: var(--carolsaling-font-size-large);
}

.comment-respond {
	margin-top: var(--carolsaling-space);
}

.comment-reply-title {
	font-size: var(--carolsaling-font-size-large);
}

.comments-title,
.comment-reply-title {
	margin-top: 0;
}

.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list {
	margin-bottom: calc(2 * var(--carolsaling-space));
}

/* Replies are indented, but never so much that the text gets too narrow. */
.comment-list .children {
	padding-inline-start: clamp(0.75rem, 4vw, 2rem);
}

.comment-body {
	border-bottom: var(--carolsaling-border-thin) solid var(--carolsaling-color-border);
	padding-block: var(--carolsaling-space);
}

.comment-meta {
	font-size: var(--carolsaling-font-size-small);
}

.comment-author .avatar {
	border-radius: 50%;
	float: left;
	margin-inline-end: 0.75rem;
}

.comment-author .fn {
	font-weight: 600;
}

.comment-metadata {
	color: var(--carolsaling-color-muted);
}

.comment-metadata::after {
	clear: both;
	content: "";
	display: table;
}

.comment-awaiting-moderation {
	color: var(--carolsaling-color-muted);
	font-style: italic;
}

.comment-content {
	margin-top: 0.75rem;
}

.comment-reply-link,
#cancel-comment-reply-link {
	align-items: center;
	display: inline-flex;
	font-size: var(--carolsaling-font-size-small);
	min-height: var(--carolsaling-touch-target);
}

.comments-closed {
	color: var(--carolsaling-color-muted);
}

.comment-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	justify-content: space-between;
	margin-bottom: var(--carolsaling-space);
}

/* ---------- Footer ----------
 * Brand blue band with ivory text (9.68:1); links and focus switch to ivory
 * through the roles of tokens.css. */

.site-footer {
	background-color: var(--carolsaling-color-background);
	color: var(--carolsaling-color-text);
	padding-block: calc(1.5 * var(--carolsaling-space));
}

.site-footer a {
	color: var(--carolsaling-color-link);
}

.site-footer a:hover {
	text-decoration-color: var(--carolsaling-color-accent);
}

.site-info {
	font-size: var(--carolsaling-font-size-small);
	margin: 0;
}

/* Link to the privacy policy (Settings → Privacy), when that page is published. */
.site-footer__inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.5rem;
	justify-content: space-between;
}

.site-privacy {
	font-size: var(--carolsaling-font-size-small);
	margin: 0;
}

.site-info a,
.site-privacy a {
	align-items: center;
	display: inline-flex;
	min-height: var(--carolsaling-touch-target);
}
