/**
 * SRD Profiles — front-end styles.
 *
 * Deliberately theme-neutral: colours and type inherit from the active theme
 * and everything tunable is a custom property, so a site can restyle profiles
 * without overriding selectors. (The dark "Precision Architect" palette in
 * docs/design.md is scoped to plugin admin screens — see §11 — and would fight
 * with client themes out here.)
 */

/*
 * Design tokens.
 *
 * Declared on both top-level wrappers rather than on :root, so nothing leaks
 * into the rest of the theme and a page can carry a profile list and a single
 * profile with different values. `.srdp-single` is not a descendant of
 * `.srdp-profiles` — it is appended to the_content on its own — so leaving it
 * out here left every var() below it invalid at computed-value time.
 */
.srdp-profiles,
.srdp-single {
	--srdp-gap: 32px;
	--srdp-radius: 4px;

	/*
	 * Type scale.
	 *
	 * Every size on the front end is a multiple of one base, so a site moves
	 * the whole thing together instead of setting thirteen sizes by hand —
	 * which is the reason there is no per-element font size setting and should
	 * not be one. The multipliers are exactly the values these elements were
	 * hardcoded to before the scale existed, so a base of 1rem renders
	 * identically to 1.10.0.
	 *
	 * `rem`, not `em`: nesting must not compound. A field label inside a
	 * repeater inside a timeline would otherwise shrink three times over.
	 */
	--srdp-text-base: 16px;
	--srdp-text-xs:  calc( var(--srdp-text-base) * 0.75 );
	--srdp-text-sm:  calc( var(--srdp-text-base) * 0.875 );
	--srdp-text-md:  calc( var(--srdp-text-base) * 0.9375 );
	--srdp-text-lg:  calc( var(--srdp-text-base) * 1.125 );
	--srdp-text-xl:  calc( var(--srdp-text-base) * 1.25 );
	--srdp-text-2xl: calc( var(--srdp-text-base) * 1.5 );

	/*
	 * Labels, dates and positions only — the places the plugin hardcodes a
	 * weight. Headings deliberately have no weight of their own: they are h1
	 * to h3 and follow the theme, which is the whole theme-neutral premise.
	 * A `font-weight: inherit` on them would take the *parent's* weight rather
	 * than the heading's, which is how that well-meant idea breaks.
	 */
	--srdp-label-weight: 600;

	/*
	 * Secondary text. Still a mix against currentColor rather than a colour of
	 * its own, so dimming stays relative to whatever the theme is using and
	 * works on light and dark alike.
	 */
	--srdp-muted-strength: 62%;
	--srdp-muted: color-mix( in srgb, currentColor var(--srdp-muted-strength), transparent );
	--srdp-faint: color-mix( in srgb, currentColor 12%, transparent );

	/* Current-state indicators: timeline markers, the current page number. */
	--srdp-accent: currentColor;

	--srdp-photo-ratio: 1;
}

/*
 * Cards square the photo off so a grid row lines up whatever shape the
 * uploads are. The single view has no row to align with, so it keeps the 4:5
 * that SRDP_Images::PHOTO_SIZE crops to. Overriding here rather than changing
 * the shared default keeps both surfaces rendering exactly as they did before
 * the token reached `.srdp-single`.
 */
.srdp-single {
	--srdp-photo-ratio: 4 / 5;
}

.srdp-profiles {
	margin: 0 0 var(--srdp-gap);
}

/* ------------------------------------------------------------------ */
/* Layouts                                                             */
/* ------------------------------------------------------------------ */

/*
 * `--srdp-gap-row` and `--srdp-gap-column` are Listing Page → Layout → Row Gap and
 * Column Gap, and both fall back to the shared `--srdp-gap`. Undeclared until a
 * site sets one, so an unconfigured listing keeps the 2rem above and its step
 * down to 1.5rem below 600px; a number set there replaces it at every width.
 *
 * Their own names rather than overriding `--srdp-gap` itself: that token also
 * draws the space between a list card's photo and its text, the margin under a
 * set, and the slider's column arithmetic — none of which a listing gap should
 * move. See SRDP_Frontend::archive_columns_css().
 */
.srdp-grid,
.srdp-cards {
	display: grid;
	gap: var(--srdp-gap-row, var(--srdp-gap)) var(--srdp-gap-column, var(--srdp-gap));
	grid-template-columns: repeat( var(--srdp-columns, 3), minmax( 0, 1fr ) );
}

.srdp-cols-1 { --srdp-columns: 1; }
.srdp-cols-2 { --srdp-columns: 2; }
.srdp-cols-3 { --srdp-columns: 3; }
.srdp-cols-4 { --srdp-columns: 4; }
.srdp-cols-5 { --srdp-columns: 5; }
.srdp-cols-6 { --srdp-columns: 6; }

/* A single column, so only the row gap can do anything here — the column value
   is inert rather than wrong, and stating both keeps one shorthand across all
   three layouts. */
.srdp-list {
	display: flex;
	flex-direction: column;
	gap: var(--srdp-gap-row, var(--srdp-gap)) var(--srdp-gap-column, var(--srdp-gap));
}

/* Deliberately still the shared token: this is the space between one card's
   photo and its own text, not the space between two profiles. */
.srdp-list .srdp-profile {
	display: grid;
	grid-template-columns: minmax( 120px, 220px ) 1fr;
	gap: var(--srdp-gap);
	align-items: start;
}

/*
 * The Cards layout's panel. Every value here is a setting with the old
 * hardcoded value as its fallback, so an unconfigured site renders unchanged
 * and ships no inline CSS.
 *
 * No padding, and nothing inside it carries a margin either. The panel held
 * 1.5rem until 1.30.7, which the photo then cancelled with a matching negative
 * margin to reach the panel's edges, and the photo held 1.25rem below itself —
 * three numbers in two rules that had to stay in step with each other, and not
 * one of them a setting. The panel is now a plain box: the photo fills the width
 * it is given and sits flush against the text, and every inset a card has comes
 * from Listing's Profile Cards → Padding.
 *
 * That is why `.srdp-cards .srdp-photo` no longer exists as a rule. `.srdp-photo`
 * declares no margin of its own, so deleting it *is* setting it to 0, and a rule
 * restating a value nothing else sets would be dead weight.
 *
 * `overflow: hidden` is load-bearing: the photo runs to the panel's edges, so
 * without clipping it keeps square corners inside a rounded card. At the 0.25rem
 * this used to be pinned to that was invisible; at the "Very rounded" the radius
 * setting now offers it is the whole difference between a card and a mistake.
 *
 * `box-sizing` for the border: the panel is a grid item, and a border on a
 * content-box would push its track wider than the column it was given.
 */
.srdp-cards .srdp-profile {
	box-sizing: border-box;
	overflow: hidden;
	padding: 0;
	border: var(--srdp-card-border, none );
	border-radius: var(--srdp-card-radius, var(--srdp-radius) );
	background: var(--srdp-card-bg, color-mix( in srgb, currentColor 4%, transparent ) );
}

/* ------------------------------------------------------------------ */
/* Profile                                                             */
/* ------------------------------------------------------------------ */

.srdp-profile {
	margin: 0;
	min-width: 0;
}

/*
 * Every listed profile, in all four layouts, on request (2.3.21). Two classes
 * and after `.srdp-cards .srdp-profile`, so it replaces that panel's `0` on
 * source order. The Cards photo therefore no longer reaches the panel's edges,
 * and Listing's Profile Cards → Padding adds to this rather than replacing it.
 */
.srdp-profiles .srdp-profile {
	box-sizing: border-box;
	padding: 10px 10px 20px;
}

/*
 * The text block beside or beneath the photo — name, position, subtitle,
 * biography, fields, timeline, social.
 *
 * No padding of its own until a site asks for one, so this rule is inert on an
 * unconfigured install. In the Cards layout that is now the panel's whole inset
 * — the panel itself is at 0 — so the value set is the value seen, rather than
 * adding to 1.5rem the stylesheet held back.
 *
 * `inherit` rather than `left` or `start` for the alignment, and the reason is
 * that `text-align` inherits where `justify-content` does not. Naming any value
 * here would cut the block off from whatever the theme set above it, which is
 * the opposite of what an unconfigured install should do — and would be a
 * particularly bad answer under RTL, where the text is meant to run from the
 * right. Left is therefore the unset state, not a declaration; see
 * SRDP_Frontend::listing_css().
 */
.srdp-body {
	box-sizing: border-box;
	padding: var(--srdp-body-padding, 0);
	text-align: var(--srdp-text-align, inherit);
}

/*
 * Both custom properties are undeclared unless a site sets them, so the
 * fallbacks are what listings and an unconfigured single profile get: the
 * shared radius token, and no border at all. Only the single view declares
 * them, which is why a bordered profile photo does not turn up in a grid.
 *
 * box-sizing matters here: the photo column is a grid track, and a border on a
 * content-box wrapper would push the track wider than the size setting asked
 * for. Themes usually set this globally, but not all of them do.
 */
.srdp-photo {
	box-sizing: border-box;
	overflow: hidden;
	border: var(--srdp-photo-border, none );
	border-radius: var(--srdp-photo-radius, var(--srdp-radius) );
}

.srdp-photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--srdp-photo-ratio);
	object-fit: cover;
}

/*
 * The no-photo placeholder: SRDP_Render::photo_placeholder(), the person's
 * initials on a plain panel. Sized exactly as the photo it stands in for, so a
 * card with no upload keeps its row's rhythm and the single page keeps its
 * photo column. The wrapper still owns the radius and the border, so the
 * placeholder picks both up for free.
 *
 * Both greys are currentColor at an opacity rather than a color-mix, which is
 * the one place on the front end that departs from the file's usual habit. Two
 * reasons, and the second is why it is worth the extra element:
 *
 * * `color-mix()` reached for through a `var()` fallback is the single most
 *   fragile construct in this stylesheet. A CSS minifier that does not parse
 *   modern colour functions drops the whole declaration, and the panel then
 *   falls back to no background at all while the letters fall back to the
 *   theme's full-strength text colour — a black initial on nothing, which is
 *   exactly what it looks like. currentColor and opacity have been safe since
 *   CSS2 and cannot be mangled into something invalid.
 * * currentColor in any property other than `color` resolves against the
 *   element's *own* colour, so tinting the panel and fading the letters in one
 *   rule made the panel a mix of an already-faded colour. Splitting them across
 *   two elements is what keeps the panel measured against the theme.
 *
 * Still no absolute colour anywhere: the panel and the letters are both the
 * theme's text colour held back, so a light theme gets light grey on white and
 * a dark theme gets the inverse, with no value in this file to keep in step.
 */
.srdp-photo-placeholder {
	position: relative;
	container-type: inline-size;
	display: grid;
	place-items: center;
	aspect-ratio: var(--srdp-photo-ratio);
	background: var( --srdp-placeholder-bg, transparent );
}

/*
 * The panel tint: a currentColor wash behind the letters, which is what makes an
 * unconfigured placeholder read correctly on a theme this plugin has never seen.
 *
 * Appearance → Listing's Profile Photo Placeholder → Background sets
 * `--srdp-placeholder-bg` and takes this to 0 in the same breath, because a 10%
 * layer of body text over a chosen colour is not that colour.
 * See SRDP_Frontend::placeholder_properties().
 */
.srdp-photo-placeholder::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: var( --srdp-placeholder-tint, 0.1 );
}

/*
 * Sized against the container, not the root font size: the same placeholder has
 * to hold a 90px avatar in a list row and a 400px column on the single page,
 * and an rem-sized letter would be lost in one and clipped by the other.
 *
 * Positioned only to lift it over the tint layer above.
 *
 * The negative margin cancels the trailing letter-spacing on the last letter,
 * which would otherwise push the whole group off-centre by half a space.
 *
 * The colour and the opacity are a pair. `inherit` and 0.45 is a mix against the
 * theme, which is right until a site names a letter colour; Initials Colour then
 * sets `--srdp-placeholder-color` and takes the opacity to 1, because 45% of a
 * chosen swatch is not the swatch.
 */
.srdp-photo-placeholder-initials {
	position: relative;
	color: var( --srdp-placeholder-color, inherit );
	opacity: var( --srdp-placeholder-ink, 0.45 );
	font-size: 34cqi;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.04em;
	margin-right: -0.04em;
	text-transform: uppercase;
}

/* One letter has the width to grow into; three have to give some back. */
.srdp-photo-placeholder-1 .srdp-photo-placeholder-initials {
	font-size: 44cqi;
}

.srdp-photo-placeholder-3 .srdp-photo-placeholder-initials {
	font-size: 26cqi;
}

/* ------------------------------------------------------------------ *
 * Listing's Profile Photo → Hover Effect
 *
 * Appearance names one of these and SRDP_Render::wrapper_class() writes
 * `srdp-fx-{key}` onto the wrapper; every effect is drawn here, keyed off that
 * class. A class rather than a custom property because a keyframe list is not a
 * value — see SRDP_Settings::photo_hover_effects().
 *
 * The effect is on the picture inside `.srdp-photo` — the upload or the drawn
 * placeholder — and never on the frame, since 2.3.23. The frame clips to its
 * own border radius, so the effect stays inside the photo's box: the border,
 * the corners and the card around it do not move. It was on the frame until
 * then, which grew it over the card's padding and out of a Cards panel.
 *
 * Moving a picture inside a clipped frame opens a gap at the edge it leaves,
 * so every effect that travels or tilts also zooms by `scale: 1.1` while
 * hovered — the individual property, which composes with each effect's own
 * `transform` and keyframes rather than being replaced by them.
 *
 * Every rule is a `:hover` on the photo frame, so the effect fires from the
 * same place the name's hover does and works whether or not the listing links
 * its profiles.
 *
 *  - Nothing here is scoped to `.srdp-archive`. `.srdp-profiles` is every set
 *    the plugin renders, so a Profiles Grid block on any page takes the effect
 *    too — the same reach the Listing's Profile typography group has, and for
 *    the same reason.
 * ------------------------------------------------------------------ */

/*
 * The shared transition. The attribute selector matches any of the effect
 * classes without naming eleven of them, and the ones built on `animation`
 * simply never use it.
 */
.srdp-profiles[class*="srdp-fx-"] .srdp-photo :is(img, .srdp-photo-placeholder) {
	transition: transform 0.3s ease-out, scale 0.3s ease-out;
}

/* The cover zoom for the effects that move the picture off its edges. */
.srdp-profiles:is(.srdp-fx-rotate, .srdp-fx-float, .srdp-fx-bob, .srdp-fx-wobble-horizontal, .srdp-fx-wobble-vertical, .srdp-fx-buzz, .srdp-fx-buzz-out) .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	scale: 1.1;
}

.srdp-profiles.srdp-fx-grow .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	transform: scale(1.1);
}

/* Overshoot and settle, which a transition cannot express on its own. */
@keyframes srdp-fx-pop {
	50% {
		transform: scale(1.2);
	}
}

.srdp-profiles.srdp-fx-pop .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	animation: srdp-fx-pop 0.3s linear 1;
}

/*
 * The overshoot is in the timing function rather than in keyframes: the curve
 * passes above 1 and comes back, so the photo springs past its target and
 * settles on it.
 */
.srdp-profiles.srdp-fx-bounce-in .srdp-photo :is(img, .srdp-photo-placeholder) {
	transition-duration: 0.5s;
	transition-timing-function: cubic-bezier(0.47, 2.02, 0.31, -0.36);
}

.srdp-profiles.srdp-fx-bounce-in .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	transform: scale(1.2);
}

.srdp-profiles.srdp-fx-rotate .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	transform: rotate(4deg);
}

.srdp-profiles.srdp-fx-grow-rotate .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	transform: scale(1.1) rotate(4deg);
}

.srdp-profiles.srdp-fx-float .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	transform: translateY(-8px);
}

/*
 * Bob is Float that keeps going: one run up to the raised position, then a slow
 * loop around it. Two animations rather than one because the entry and the
 * hover-held oscillation have different durations, and the second is delayed by
 * exactly the length of the first so they meet without a jump.
 */
@keyframes srdp-fx-bob-lift {
	100% {
		transform: translateY(-8px);
	}
}

@keyframes srdp-fx-bob {
	0%,
	100% {
		transform: translateY(-8px);
	}

	50% {
		transform: translateY(-4px);
	}
}

.srdp-profiles.srdp-fx-bob .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	animation: srdp-fx-bob-lift 0.3s ease-out, srdp-fx-bob 1.5s 0.3s ease-in-out infinite;
}

/* A damped shake — each swing smaller than the last, ending where it started. */
@keyframes srdp-fx-wobble-horizontal {
	16.65% {
		transform: translateX(8px);
	}

	33.3% {
		transform: translateX(-6px);
	}

	49.95% {
		transform: translateX(4px);
	}

	66.6% {
		transform: translateX(-2px);
	}

	83.25% {
		transform: translateX(1px);
	}

	100% {
		transform: translateX(0);
	}
}

.srdp-profiles.srdp-fx-wobble-horizontal .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	animation: srdp-fx-wobble-horizontal 1s ease-in-out 1;
}

@keyframes srdp-fx-wobble-vertical {
	16.65% {
		transform: translateY(8px);
	}

	33.3% {
		transform: translateY(-6px);
	}

	49.95% {
		transform: translateY(4px);
	}

	66.6% {
		transform: translateY(-2px);
	}

	83.25% {
		transform: translateY(1px);
	}

	100% {
		transform: translateY(0);
	}
}

.srdp-profiles.srdp-fx-wobble-vertical .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	animation: srdp-fx-wobble-vertical 1s ease-in-out 1;
}

/*
 * Buzz runs for as long as the pointer is there; Buzz Out runs once and damps
 * out. Same idea at two lengths, which is why they are two effects rather than
 * one with a switch.
 */
@keyframes srdp-fx-buzz {
	50% {
		transform: translateX(3px) rotate(2deg);
	}

	100% {
		transform: translateX(-3px) rotate(-2deg);
	}
}

.srdp-profiles.srdp-fx-buzz .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	animation: srdp-fx-buzz 0.15s linear infinite;
}

@keyframes srdp-fx-buzz-out {
	10% {
		transform: translateX(3px) rotate(2deg);
	}

	20% {
		transform: translateX(-3px) rotate(-2deg);
	}

	30% {
		transform: translateX(3px) rotate(2deg);
	}

	40% {
		transform: translateX(-3px) rotate(-2deg);
	}

	50% {
		transform: translateX(2px) rotate(1deg);
	}

	60% {
		transform: translateX(-2px) rotate(-1deg);
	}

	70% {
		transform: translateX(2px) rotate(1deg);
	}

	80% {
		transform: translateX(-2px) rotate(-1deg);
	}

	90% {
		transform: translateX(1px) rotate(0);
	}

	100% {
		transform: translateX(-1px) rotate(0);
	}
}

.srdp-profiles.srdp-fx-buzz-out .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
	animation: srdp-fx-buzz-out 0.75s linear 1;
}

/*
 * A reader who has asked the operating system for less motion gets none of it.
 * Not negotiable and not a setting: Bob and Buzz loop for as long as a pointer
 * rests on a card, which is exactly the kind of movement that setting exists to
 * stop. The hover still does everything else it did — the name's colour and
 * underline are not motion.
 */
@media (prefers-reduced-motion: reduce) {
	.srdp-profiles[class*="srdp-fx-"] .srdp-photo :is(img, .srdp-photo-placeholder),
	.srdp-profiles[class*="srdp-fx-"] .srdp-photo:hover :is(img, .srdp-photo-placeholder) {
		transform: none;
		scale: none;
		transition: none;
		animation: none;
	}
}

.srdp-name {
	margin: 0;
	font-size: var(--srdp-text-lg);
	line-height: 1.3;
}

.srdp-name a {
	text-decoration: none;
	color: inherit;
}

/*
 * The photo is a second link to the same profile, so pointing at it lights the
 * name as though the name had been pointed at. The trigger widens; the target
 * does not — the effect is still drawn on the name, which is the only element
 * here with anything to draw.
 *
 * The sibling combinator scopes this to a card on its own: `.srdp-body` exists
 * nowhere but `templates/parts/profile-card.php`, and the photo is always the
 * element immediately before it there. A card with no photo simply never
 * matches.
 *
 * No `:focus-visible` counterpart, deliberately. That anchor carries
 * `tabindex="-1"` and `aria-hidden` — a duplicate link the keyboard is meant to
 * skip past — so it has no focus state to answer, and the name's own
 * `:focus-visible` already covers the keyboard.
 *
 * SRDP_Settings::typography_fields() names this same selector as `name_card`'s
 * `link_hover`, so Hover Colour and Underline reach it too. Keep the two in
 * step: the settings copy is prefixed with `.srdp-profiles` and therefore
 * out-specifies this rule, which is what lets Underline → Never win here.
 */
.srdp-name a:hover,
.srdp-name a:focus-visible,
.srdp-photo:hover + .srdp-body .srdp-name a {
	text-decoration: underline;
}

.srdp-position {
	margin: 0 0 8px;
	padding: 0;
	font-weight: var(--srdp-label-weight);
	font-size: var(--srdp-text-md);
}

.srdp-subtitle {
	margin: 0 0 8px;
	padding: 0;
	font-size: var(--srdp-text-sm);
	color: var(--srdp-muted);
}

/*
 * The categories a profile is in, one line on its card. Sized and dimmed like
 * the subtitle above it — it is the same kind of line, a small label under the
 * name — and given no colour of its own so it keeps mixing against the theme
 * until Appearance → Listing's Profile Category says otherwise.
 *
 * Nothing here uppercases it. That is exactly what Letter case on that card is
 * for, and a stylesheet that had already decided would leave the control able
 * to change everything but the thing it was set to.
 */
.srdp-categories {
	margin: 0 0 8px;
	padding: 0;
	font-size: var(--srdp-text-sm);
	color: var(--srdp-muted);
}

/*
 * The Highlight line. Sized between the position and the subtitle and given the
 * label weight, because what lands here is usually a number — "16 Years
 * Experience" — and a number reads as a credential only if it carries a little
 * more weight than the line above it.
 */
.srdp-highlight {
	margin: 0 0 8px;
	padding: 0;
	font-size: var(--srdp-text-md);
	font-weight: var(--srdp-label-weight);
}

.srdp-bio {
	margin: 12px 0 0;
	font-size: var(--srdp-text-base);
	line-height: 1.65;
}

.srdp-bio p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* Social links                                                        */
/* ------------------------------------------------------------------ */

.srdp-social {
	display: flex;
	flex-wrap: wrap;
	/* Undeclared until a site picks something other than Left, so an
	   unconfigured row sits exactly where it always has. */
	justify-content: var(--srdp-social-justify, flex-start );
	gap: 8px;
	list-style: none !important;
	margin: 16px 0 0 !important;
	padding: 0 !important;
}

/*
 * Three undeclared properties, all three optional. Set none of them and every
 * value here is still a color-mix against currentColor, so the icons inherit
 * from the theme; the colours only become absolute when a site names one in
 * Settings → Appearance. See SRDP_Frontend::social_properties().
 *
 * box-sizing keeps the 44px touch target at 44px once a border is added,
 * rather than growing the circle by twice the border width (design.md §10).
 */
.srdp-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	/* 44px minimum touch target (design.md §10). */
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var( --srdp-social-color, inherit );
	text-decoration: none;
	background: var( --srdp-social-bg, color-mix( in srgb, currentColor 8%, transparent ) );
	border: var( --srdp-social-border, 0 solid transparent );
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.srdp-social-link:hover,
.srdp-social-link:focus-visible {
	background: var( --srdp-social-bg-hover, color-mix( in srgb, currentColor 18%, transparent ) );
	transform: translateY( -1px );
}

.srdp-social-icon {
	display: block;
}

/* ------------------------------------------------------------------ */
/* Timeline                                                            */
/* ------------------------------------------------------------------ */

.srdp-timeline {
	margin: 8px 0 0;
	padding: 0 !important;
	list-style: none !important;
}

.srdp-timeline-title {
	margin: 0 0 4px;
	font-size: var(--srdp-text-xl);
	line-height: 1.35;
}

.srdp-timeline-date {
	margin: 0 0 2px;
	font-size: var(--srdp-text-base);
	font-weight: var(--srdp-label-weight);
	letter-spacing: 0.02em;
	color: var(--srdp-muted);
}

.srdp-timeline-description {
	font-size: var(--srdp-text-base);
	line-height: 1.6;
}

.srdp-timeline-description p:last-child {
	margin-bottom: 0;
}

.srdp-timeline-image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--srdp-radius);
	margin: 8px 0;
}

/* Vertical */
.srdp-timeline-vertical {
	position: relative;
	padding-left: 28px !important;
}

.srdp-timeline-vertical::before {
	content: "";
	position: absolute;
	top: 6.4px;
	bottom: 6.4px;
	left: 5px;
	width: 2px;
	background: var(--srdp-timeline-line, var(--srdp-faint) );
}

.srdp-timeline-vertical .srdp-timeline-item {
	position: relative;
	padding-bottom: 24px;
}

.srdp-timeline-vertical .srdp-timeline-item:last-child {
	padding-bottom: 0;
}

/*
 * Undeclared properties again, so an unconfigured timeline keeps the dot on
 * --srdp-accent and the 0.65 dimming that makes a currentColor mix read as a
 * marker. Naming a colour in Settings → Appearance sets the opacity to 1 as
 * well — see SRDP_Frontend::timeline_properties() — because a colour chosen
 * deliberately should arrive as chosen rather than washed out.
 *
 * box-sizing for the same reason as the social link: the dot is a fixed
 * 0.75rem circle, and a border on a content box would grow it and pull it off
 * the line it is meant to sit on.
 */
.srdp-timeline-marker {
	position: absolute;
	box-sizing: border-box;
	top: 6.4px;
	left: -28px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--srdp-timeline-dot-bg, var(--srdp-accent) );
	border: var(--srdp-timeline-dot-border, 0 solid transparent );
	opacity: var(--srdp-timeline-dot-opacity, 0.65 );
}

/* Cards */
.srdp-timeline-cards {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
}

.srdp-timeline-card {
	padding: 20px;
	border-radius: var(--srdp-radius);
	background: color-mix( in srgb, currentColor 5%, transparent );
}

.srdp-timeline-card .srdp-timeline-image {
	margin: -20px -20px 16px;
}

.srdp-timeline-card .srdp-timeline-image img {
	border-radius: var(--srdp-radius) var(--srdp-radius) 0 0;
	margin: 0;
	width: 100%;
}

/* Simple list */
.srdp-timeline-list {
	display: grid;
	gap: 12px;
}

.srdp-timeline-list .srdp-timeline-item {
	display: grid;
	grid-template-columns: minmax( 72px, max-content ) 1fr;
	gap: 16px;
	align-items: baseline;
	padding-bottom: 12px;
	/* Ghost border rather than a solid rule (design.md §6). */
	border-bottom: 1px solid var(--srdp-faint);
}

.srdp-timeline-list .srdp-timeline-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.srdp-timeline-list dt,
.srdp-timeline-list dd {
	margin: 0;
}

.srdp-timeline-list .srdp-timeline-title {
	display: block;
	font-weight: var(--srdp-label-weight);
}

.srdp-timeline-list .srdp-timeline-description {
	display: block;
	color: var(--srdp-muted);
}

/* ------------------------------------------------------------------ */
/* Custom fields                                                       */
/* ------------------------------------------------------------------ */

.srdp-fields {
	display: grid;
	gap: 12px;
	margin: 20px 0 0;
}

/*
 * Both divider properties are undeclared unless the single page asks for one,
 * so listings and an unconfigured profile get no line and no extra space —
 * `0 solid transparent` and a zero pad are the same as not writing the rule.
 * See SRDP_Frontend::single_properties().
 */
.srdp-fields .srdp-field {
	display: grid;
	grid-template-columns: minmax( 96px, max-content ) 1fr;
	gap: 4px 16px;
	align-items: baseline;
	padding-bottom: var(--srdp-fields-divider-space, 0 );
	border-bottom: var(--srdp-fields-divider, 0 solid transparent );
}

/* A divider under the last field is a line under the section, not between two
   fields — and the section already ends there. */
.srdp-fields .srdp-field:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.srdp-field-label {
	font-size: var(--srdp-text-base);
	font-weight: var(--srdp-label-weight);
	color: var(--srdp-muted);
}

.srdp-field-value {
	margin: 0;
	font-size: var(--srdp-text-md);
}

.srdp-field-value p:last-child {
	margin-bottom: 0;
}

/*
 * Types a half-width column cannot hold: label above the value instead of
 * beside it.
 *
 * Scoped to `.srdp-fields` deliberately. Left as bare type classes these never
 * applied at all — `.srdp-fields .srdp-field` above is two classes and beat
 * them, so a textarea or a gallery rendered beside its label however long it
 * was. Matching that specificity and coming later is what makes them win.
 */
.srdp-fields .srdp-field-textarea,
.srdp-fields .srdp-field-timeline,
.srdp-fields .srdp-field-repeater,
.srdp-fields .srdp-field-gallery,
.srdp-fields .srdp-field-list {
	grid-template-columns: 1fr;
}

/*
 * Per-field overrides from the field builder's Label Position control. Same
 * specificity as the type rules above and placed after them, so a field that
 * states a position outranks whatever its type would have done.
 *
 * The mobile rule further down still wins over both, because it is later again
 * — every field stacks on a phone whatever a field says (design.md §8).
 */
.srdp-fields .srdp-field-align-side {
	grid-template-columns: minmax( 96px, max-content ) 1fr;
}

.srdp-fields .srdp-field-align-stack {
	grid-template-columns: 1fr;
}

/*
 * The `list` custom field. Named itemlist rather than list because `.srdp-list`
 * is already the list *layout* for a set of profiles, and the two would collide.
 *
 * Everything a row carries is a span inside its <li> — no heading tag, no
 * paragraph — so the field cannot join the page's outline or inherit a theme's
 * heading rules. The heading reads as one through weight alone, and the
 * description becomes a second line only because of the `display: block` here.
 * Delete that one declaration and the pair sits inline.
 */
.srdp-itemlist {
	margin: 0;
	padding-left: 20px;
}

.srdp-itemlist-item {
	margin-bottom: 8px;
}

.srdp-itemlist-item:last-child {
	margin-bottom: 0;
}

.srdp-itemlist-heading {
	font-weight: var(--srdp-label-weight);
}

.srdp-itemlist-description {
	display: block;
	font-size: var(--srdp-text-sm);
	color: var(--srdp-muted);
}

.srdp-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.srdp-gallery img,
.srdp-field-image {
	display: block;
	border-radius: var(--srdp-radius);
	height: auto;
	max-width: 100%;
}

.srdp-repeater {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.srdp-repeater-row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
}

.srdp-repeater-label {
	font-size: var(--srdp-text-xs);
	font-weight: var(--srdp-label-weight);
	color: var(--srdp-muted);
	display: block;
}

/* ------------------------------------------------------------------ */
/* Single profile                                                      */
/* ------------------------------------------------------------------ */

.srdp-single {
	--srdp-single-photo-col: 260px;
	--srdp-cover-height: 380px;

	/*
	 * The details column of a split layout, and the one place a token is
	 * defined in terms of another. Until 1.19.0 the split column *was* the
	 * photo width, so defaulting to it means a site that never sets a column
	 * width lays out exactly as it did. Settings override this declaration
	 * from the head; the photo width below then only sizes the photo itself.
	 */
	--srdp-single-header-col: var(--srdp-single-photo-col);
}

/*
 * Standard: photo beside the position/subtitle/social block, everything else
 * full width beneath. `.srdp-single-body` is a plain block here and only
 * becomes a grid under the split layouts, so this is the arrangement a theme
 * still carrying a version 1 copy of single-profile.php falls back to.
 *
 * The floor is wrapped in min() rather than written as a bare 140px: the photo
 * width is a free measurement from 1.18.0, and a site that asks for 120px must
 * get 120px instead of being quietly floored. minmax() with a max below its min
 * drops the max entirely, so the naive form would have ignored the setting
 * exactly where it was set most deliberately. Above the floor this is identical
 * to what it replaced.
 */
.srdp-single-header {
	display: grid;
	grid-template-columns:
		minmax( min( 140px, var(--srdp-single-photo-col) ), var(--srdp-single-photo-col) )
		1fr;
	gap: 32px;
	align-items: start;
	margin-bottom: 32px;
}

/*
 * Every heading part moved into the main column, so the header holds only the
 * photo. Without this the 1fr track above stays in the grid and the photo sits
 * beside a column of nothing.
 *
 * Scoped to Standard on purpose. It is the only arrangement with two tracks to
 * collapse — both split layouts already run their header at a single 1fr below,
 * and an unscoped rule sitting after them would cap their photo column at the
 * photo width instead.
 */
.srdp-single-standard.srdp-header-photo-only .srdp-single-header {
	grid-template-columns:
		minmax( min( 140px, var(--srdp-single-photo-col) ), var(--srdp-single-photo-col) );
}

/*
 * The heading in its other slot. `.srdp-single-header` carries the margin that
 * separates it from the biography, and it is no longer between the two.
 */
.srdp-single-main .srdp-single-heading {
	margin-bottom: 32px;
}

/* ------------------------------------------------------------------ */
/* Split layouts                                                       */
/* ------------------------------------------------------------------ */

.srdp-single-split .srdp-single-body,
.srdp-single-split-reverse .srdp-single-body {
	display: grid;
	gap: var(--srdp-gap);
	align-items: start;
}

/*
 * Details column sized, biography column always 1fr — so the two together fill
 * the row whatever the first one is set to.
 *
 * Same min() guard as .srdp-single-header above, at this layout's own floor.
 */
.srdp-single-split .srdp-single-body {
	grid-template-columns:
		minmax( min( 200px, var(--srdp-single-header-col) ), var(--srdp-single-header-col) )
		1fr;
}

/*
 * Reversed: placed by column rather than with `order`, so the DOM keeps the
 * details first. A screen reader therefore still meets the photo, position and
 * social links before the biography, which is the reading order the page wants
 * whichever side they are drawn on.
 */
.srdp-single-split-reverse .srdp-single-body {
	grid-template-columns:
		1fr
		minmax( min( 200px, var(--srdp-single-header-col) ), var(--srdp-single-header-col) );
}

.srdp-single-split-reverse .srdp-single-header {
	grid-column: 2;
	grid-row: 1;
}

.srdp-single-split-reverse .srdp-single-main {
	grid-column: 1;
	grid-row: 1;
}

/* In a column the photo sits above the details rather than beside them. */
.srdp-single-split .srdp-single-header,
.srdp-single-split-reverse .srdp-single-header {
	grid-template-columns: 1fr;
	gap: 20px;
	margin-bottom: 0;
}

/*
 * Here the photo width is a cap on the photo rather than a grid track: the
 * column is sized by --srdp-single-header-col above, and the name, position and
 * social links below want that whole column even when the photo is narrower
 * than it. Capping the track instead would wrap the name at the photo's edge.
 *
 * Undeclared with a 100% fallback, the way --srdp-photo-border and
 * --srdp-photo-radius are. Clearing the Photo Width setting therefore leaves
 * the photo filling its column and scaling with it, rather than dropping back
 * to the 260px the track happens to default to — which is the answer for a
 * setting whose empty state has to mean "no opinion", not "260px".
 */
.srdp-single-split .srdp-photo-single,
.srdp-single-split-reverse .srdp-photo-single {
	max-width: var(--srdp-photo-max-width, 100% );
}

/*
 * The details column follows the reader down the biography.
 *
 * Written as a plain rule and *undone* at the mobile breakpoint rather than
 * wrapped in a `min-width: 600px` query of its own. Two media queries would mean
 * two breakpoint literals, and CSS has no way to keep them in step: a custom
 * property cannot appear in a media query prelude, `@custom-media` is an
 * unshipped draft, and there is no build step here to hold a variable. Undoing
 * it below leaves one number governing both behaviours, so moving the
 * breakpoint moves this with it.
 *
 * Split layouts only, and not because Standard was forgotten: there the header
 * is a full-width band above the biography, so sticking it would pin that band
 * to the top of the viewport and let the biography scroll underneath it.
 * Sticky is only meaningful where the header is a column.
 *
 * It works because the containing block of a grid item is its grid area, and
 * `align-items: start` on .srdp-single-body leaves the item shorter than the row
 * the biography sizes. That gap is the distance it can travel; a stretched item
 * would have none and sticky would appear to do nothing.
 *
 * The offset is undeclared with a theme-neutral fallback, the way
 * --srdp-photo-border is: a site with a fixed header needs its own number, and
 * that should not be a stylesheet edit.
 */
/*
 * Compound, not descendant: `srdp-sticky-header` and `srdp-single-split` are
 * both emitted onto the same wrapper by SRDP_Render::single_class(), so a space
 * between them would ask for a split wrapper nested inside a sticky one and
 * match nothing.
 */
.srdp-sticky-header.srdp-single-split .srdp-single-header,
.srdp-sticky-header.srdp-single-split-reverse .srdp-single-header {
	position: sticky;
	top: var(--srdp-sticky-top, 32px );
}

/*
 * The admin bar is fixed over the top of the page for a logged-in visitor, so
 * without this the details column slides underneath it and loses its first line.
 *
 * Two mechanisms, each covering the other's failure:
 *
 * * `body.admin-bar` is added by core only when the bar actually renders, so a
 *   logged-out visitor never picks up the offset and the rule above stands.
 * * `--wp-admin--admin-bar--height` is core's own property, declared on :root by
 *   admin-bar.css. Using it rather than a bare 32px means the bar's height stays
 *   core's business — it already switches to 46px under core's own 782px
 *   breakpoint, which is not a number this stylesheet should be repeating. The
 *   32px fallback is what that property was worth before it existed.
 *
 * Still one declaration, so --srdp-sticky-top overrides this exactly as it
 * overrides the rule above.
 */
body.admin-bar .srdp-sticky-header.srdp-single-split .srdp-single-header,
body.admin-bar .srdp-sticky-header.srdp-single-split-reverse .srdp-single-header {
	top: var(--srdp-sticky-top, calc( var(--wp-admin--admin-bar--height, 32px ) + 32px ) );
}

/* ------------------------------------------------------------------ */
/* Back link                                                           */
/* ------------------------------------------------------------------ */

/*
 * Deliberately close to bare text. This sits above or below the cover, where
 * the theme's own link colour and underline are what a visitor already knows
 * to click, so nothing here paints a colour — only the arrow, the spacing and
 * the nudge on hover belong to the plugin.
 *
 * Above the cover it needs the space beneath it; below the cover the cover has
 * already left its own margin, so the margin is set on one side at a time
 * rather than collapsing two of them together.
 */
.srdp-back {
	margin: 0 0 16px;
}

.srdp-cover + .srdp-back {
	margin: -8px 0 24px;
}

/*
 * The size sits on the link, not on the paragraph, because the Appearance tab
 * targets the link — a colour set on the wrapper would lose to the theme's own
 * `a` rule. Splitting the two would let an em size compound against this one.
 */
.srdp-back-link {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4em;
	font-size: 0.9375em;
}

/*
 * Only the arrow moves. Shifting the whole link would reflow the text beside
 * it, and this reads as the link leaning back towards where it goes.
 */
.srdp-back-arrow {
	transition: transform 0.15s ease;
}

.srdp-back-link:hover .srdp-back-arrow,
.srdp-back-link:focus-visible .srdp-back-arrow {
	transform: translateX( -0.2em );
}

@media ( prefers-reduced-motion: reduce ) {
	.srdp-back-arrow {
		transition: none;
	}

	.srdp-back-link:hover .srdp-back-arrow,
	.srdp-back-link:focus-visible .srdp-back-arrow {
		transform: none;
	}
}

/* ------------------------------------------------------------------ */
/* Cover                                                               */
/* ------------------------------------------------------------------ */

.srdp-cover {
	position: relative;
	margin-bottom: 24px;
	border-radius: var(--srdp-radius);
	overflow: hidden;
}

.srdp-cover img {
	display: block;
	width: 100%;
	height: auto;
	max-height: var(--srdp-cover-height);
	object-fit: cover;
}

/*
 * A cover with no image behind it. The picture normally gives the band its
 * height, so without one the height has to be stated. The colour itself is an
 * inline style, since it is per-site data rather than a rule.
 */
.srdp-cover-plain {
	height: var(--srdp-cover-height);
}

/*
 * The overlay and the name over it are the only absolute colours in this
 * stylesheet, and they have to be: text drawn over an arbitrary uploaded
 * photograph cannot inherit a theme colour and stay legible. Everywhere else
 * still mixes against currentColor.
 *
 * Nothing is painted until a site sets an opacity — the property is undefined
 * by default, so this rule collapses to nothing.
 */
.srdp-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: var(--srdp-cover-overlay, transparent );
	opacity: var(--srdp-cover-overlay-opacity, 0 );
}

/*
 * The caption fills the cover rather than hugging its bottom edge, so the name
 * can be placed on either axis. It is a flex container purely for that: one
 * child, positioned by justify-content and align-items.
 */
.srdp-cover-caption {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	padding: 24px;
	color: var(--srdp-name-color, #fff );
	text-shadow: var(--srdp-name-shadow, none );
}

.srdp-cover-name {
	margin: 0;
	color: inherit;
	line-height: 1.15;
}

/* Down the cover. */
.srdp-valign-top .srdp-cover-caption    { justify-content: flex-start; }
.srdp-valign-middle .srdp-cover-caption { justify-content: center; }
.srdp-valign-bottom .srdp-cover-caption { justify-content: flex-end; }

/* Across it. align-items places the block, text-align sets its wrapped lines. */
.srdp-halign-left .srdp-cover-caption {
	align-items: flex-start;
	text-align: left;
}

.srdp-halign-center .srdp-cover-caption {
	align-items: center;
	text-align: center;
}

/*
 * The details column's own heading. Larger than a card's name because it is
 * the top of a block rather than one cell in a grid, and it sets the size the
 * position below it steps down from.
 */
.srdp-name-single {
	font-size: var(--srdp-text-2xl);
}

.srdp-single .srdp-position {
	font-size: var(--srdp-text-lg);
}

/*
 * A block within a profile — the timeline, at present.
 *
 * Scoped to `.srdp-single`, because the listing page uses the same class for
 * its bands and must not inherit this. That page's spacing is padding and its
 * margins are 0 by design (see the Page Spacing rules below); a 2rem top margin
 * arriving through a shared class is exactly the stacking the padding-only
 * rhythm exists to avoid. Same class, two surfaces, and the scope is what keeps
 * them apart — the arrangement `.srdp-photo` already has.
 */
.srdp-single .srdp-section {
	margin-top: 32px;
}

/*
 * The plugin's own page template.
 *
 * Full width, no margin, no padding. It used to be a centred 72rem column with
 * 2.5rem of padding, which is a page shell — and the theme has already drawn
 * one. Two of them nested is what put a profile in a narrow strip inside a
 * container that was already the right width, with a gutter counted twice.
 *
 * The spacing is a setting instead, in Single Profile Page → Page Spacing. Both
 * custom properties are undeclared here so an unconfigured site gets the
 * fallbacks below and ships no inline CSS at all; SRDP_Frontend::page_css()
 * declares them on `.srdp-page-single` once a site sets one.
 *
 * The listing page reaches its spacing a different way and never declares these
 * two — see `--srdp-archive-padding` below. Padding on this element indents
 * everything inside it, and on a listing that includes the cover band, which is
 * the one thing on the page that must not be indented: a full-bleed banner is
 * the whole reason `.srdp-page` gives up its own measure. So the listing spaces
 * its contents and leaves the shell at 0.
 *
 * `border-box` is what keeps that padding inside the 100% rather than pushing
 * the page wider than its container. Still no colours — get_header() has
 * already painted the page.
 */
.srdp-page {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: var(--srdp-page-margin, 0);
	padding: var(--srdp-page-padding, 0);
}

.srdp-page-title {
	margin: 0 0 24px;
}

/*
 * The listing page's cover band.
 *
 * Deliberately not `.srdp-cover`. That one lives inside `.srdp-single`, which
 * declares --srdp-cover-height and the overlay properties the single page's
 * settings write to; this band sits in `.srdp-page`, outside both wrappers, so
 * every one of those var() references would be invalid at computed-value time
 * here. Its own class with its own fallback is the honest version of that, and
 * it also keeps the single page's cover height from silently resizing a
 * listing banner that has nothing to do with it.
 *
 * 380px matches what Medium resolves to on a profile, so the two bands are the
 * same height on a site that has left the single page alone, and it is what
 * Listing Page → Cover Photo → Height overrides — per device band, inside the
 * same four media queries the listing's column counts use. Every band empty
 * emits nothing and leaves this fallback standing, the contract every
 * measurement here keeps.
 *
 * No margin. The gap under the band is the heading block's own top padding, so
 * the space between them is stated once — see the spacing rules below. A margin
 * here would stack on top of that padding and put the two controls that decide
 * one gap in two different places.
 *
 * No radius either, since 1.39.0. This band is a full-bleed banner running edge
 * to edge across the page — the one element the full-width change exists to let
 * bleed — and rounded corners on a box with no margin beside them only cut four
 * notches out of the page's own background. A profile's cover is a block inside
 * a measured column and keeps its rounding; this is not that. `overflow` stays:
 * it is what holds the image and the caption inside the band once a height is
 * set on it.
 */
.srdp-archive-cover {
	position: relative;
	overflow: hidden;
}

/*
 * A height that is set is exact; no height at all is the picture's own.
 *
 * The two declarations are the same token with different fallbacks, and that is
 * the whole trick. Unset, this is `height: auto` under `max-height: 380px` — the
 * picture's natural height, capped on a wide page, exactly what 1.38.0 drew. Set,
 * both resolve to the same length and the band is that tall at every width, with
 * `object-fit` cropping the picture into it.
 *
 * A cap alone could not do the job the per-device setting exists for. A 1600x500
 * crop at 100% width is about 122px tall on a phone, so `max-height` was already
 * satisfied by every value a site would type there and Mobile did nothing at all
 * — the setting looked broken while behaving exactly as written. It is also the
 * only way the two halves of the band agree: `.srdp-archive-cover-plain` has
 * always taken its height exactly, having no picture to take one from.
 */
.srdp-archive-cover img {
	display: block;
	width: 100%;
	height: var(--srdp-archive-cover-height, auto);
	max-height: var(--srdp-archive-cover-height, 380px);
	object-fit: cover;
}

/*
 * A band with no image behind it. The picture normally gives it its height, so
 * without one the height has to be stated — the same shape `.srdp-cover-plain`
 * has, and for the same reason. The colour itself is an inline style, since it
 * is per-site data rather than a rule.
 */
.srdp-archive-cover-plain {
	height: var(--srdp-archive-cover-height, 380px);
}

/*
 * The heading, once it is placed inside the band.
 *
 * `.srdp-page-title` carries a 1.5rem bottom margin for the case it was written
 * for — a heading above a listing — and it is declared later in this file than
 * `.srdp-cover-name`, so it wins on source order and would push a centred
 * caption off centre by three-quarters of a line. Two classes rather than one
 * is deliberate (see SRDP_Render::archive_cover), so the margin is answered
 * here instead of by dropping either of them.
 */
.srdp-archive-cover .srdp-page-title {
	margin: 0;
}

/*
 * The listing page's content measure — Listing Page → Page Spacing → Page Width.
 *
 * The page itself stays full width, which is what lets the cover band run edge
 * to edge; this caps what sits *on* it and centres each piece in the band. That
 * split is the whole point of the control, and it is why the max-width is here
 * rather than back on `.srdp-page`, where it would take the band in with it.
 *
 * Undeclared by default, so `none` means full width and a site that has set
 * nothing gets exactly what 1.28.1 rendered. Scoped to `.srdp-archive` because
 * `.srdp-profiles` is also how every block and shortcode renders a set, and a
 * listing measure has no business reaching one placed on an About page.
 *
 * **Structural, not by name**, and the same pair of selectors the page padding
 * below uses: a block a band holds is capped, padded and centred, whatever it
 * turns out to be. It was a list of class names until 1.39.0, which meant every
 * new block had to be added to it by hand — the listing heading was capped only
 * because it was remembered, and the next one would have shipped uncapped. That
 * is not a rule anybody can hold in their head; a band holding a block is.
 *
 * Three consequences, all of them the point:
 *
 * - `.srdp-slider-wrap` is the block a band holds, and the track inside it is
 *   not. The measure moves up to the wrapper, so a capped slider's arrows sit
 *   inside the measure rather than out at the page's edge.
 * - A `[srd_profiles]` in a term description is not a child of a section, so it
 *   no longer takes the page measure — it fills the capped block it sits in,
 *   which is what the padding rule already decided for the same case.
 * - `.srdp-empty` is a `<p>` and stays out of both. One line of "none found" is
 *   not a block of the page.
 *
 * The caption keeps its name: it lives on the cover band rather than in a
 * section, so no structural selector here reaches it.
 *
 * `margin-inline` rather than `margin`, so the header's own bottom margin and
 * any margin a theme put on the grid survive. On the caption — which is
 * absolutely positioned with `inset: 0` — auto margins centre it between those
 * two edges, which is the same mechanism working on a different box.
 */
.srdp-archive .srdp-cover-caption,
.srdp-archive .srdp-section > div,
.srdp-archive .srdp-section > .srdp-pagination {
	box-sizing: border-box;
	max-width: var(--srdp-page-width, none);
	margin-inline: auto;
}

/*
 * The listing page's spacing — Listing Page → Page Spacing → Padding and Margin.
 *
 * Not on the page, and for the reason the measure above is not either: the page
 * stays full width so the cover band can run edge to edge, so anything that
 * indents the page indents the band with it. These space what sits *on* the
 * page — the block a band holds for the padding, the measured blocks themselves
 * for the margin. SRDP_Frontend::page_css() declares the two properties on
 * `.srdp-page.srdp-archive` and they inherit down to here.
 *
 * Deliberately not `--srdp-page-padding` / `--srdp-page-margin`: those are read
 * by `.srdp-page` itself, which these elements are inside, so sharing the names
 * would apply every value twice — once as the shell's inset and again as the
 * contents'. Their own names, exactly as `.srdp-archive-cover` keeps its own
 * height token for being outside the wrapper that declares the other one.
 *
 * The page's vertical rhythm is padding, and the margins are 0 — the cover band
 * included, above. One box draws the space, so a gap between two blocks belongs
 * to one of them and is one number, not a margin and a padding stacking into a
 * total neither value states. It is also the half that Page Spacing → Padding
 * reaches, which is what makes the whole rhythm settable rather than only the
 * part of it a stylesheet did not already claim.
 *
 * 50px top and bottom is the fallback, so an unconfigured listing is spaced
 * rather than flush. 0 across all four sides is what the settings hold until a
 * site says otherwise, and it means *this* — the page's own spacing — the same
 * way 0 means "not capped" for the measure above rather than zero width. Type
 * a value into any side and the four you typed replace it outright.
 *
 * `margin-inline: auto` follows the shorthand and so wins the horizontal axis.
 * That is the intended order: centring the capped contents in the page is what
 * Page Width means, and it cannot be both centred and pushed off by a left
 * margin. Margin Top and Bottom are the two that move a listing.
 */
/*
 * The bands themselves — Listing Page → Section Spacing.
 *
 * A section is full width and holds one measured block, so this is the spacing
 * that can carry a background from edge to edge while the heading or the listing
 * inside it stays capped and centred. Both fall back to 0: the page's rhythm is
 * the blocks' own padding below, and a section that spaced itself as well would
 * add a second gap nobody asked for.
 *
 * No `margin-inline: auto` here, and no measure. A section is the full width of
 * the page by definition — capping one would move the edge-to-edge boundary in
 * and leave a background stopping short of the page it is meant to band. That
 * is also why Margin Left and Right do something here and nothing a level down:
 * there is no centring for them to lose to.
 */
.srdp-archive .srdp-section {
	box-sizing: border-box;
	margin: var(--srdp-section-margin, 0);
	padding: var(--srdp-section-padding, 0);
}

/*
 * The padding and the margin land on the blocks a band holds, not on the heading
 * and the listing by name. The structural selector picks out the same elements
 * the named pair did, and it keeps doing so for a layout that wraps its listing
 * (the slider's track sits inside `.srdp-slider-wrap`) or a template override
 * that puts its own block in a band.
 *
 * It also stops the page's own spacing reaching a set that is not the listing. A
 * shortcode in a term description renders `.srdp-profiles` inside the heading
 * block, where `.srdp-archive .srdp-profiles` matched it and gave it the page's
 * own gutter; a child of a section it is not.
 *
 * `.srdp-pagination` is named beside `div` because it is a `nav` — the listing's
 * band holds it as a second block, and page links that did not take the gutter
 * or the measure would sit out of line with the grid they page through. Named
 * rather than reaching for `> *`, which would also catch `.srdp-empty`: a single
 * line of "none found" is not a block of the page and has never been spaced as
 * one.
 *
 * The cover band is deliberately out of reach: it is not a `.srdp-section`, so
 * `.srdp-archive-cover > div` — the caption — keeps the 1.5rem inset that holds
 * the heading off the band's edges rather than taking a page gutter whose top
 * starts at 0. See the caption's own rule below.
 */
.srdp-archive .srdp-section > div,
.srdp-archive .srdp-section > .srdp-pagination {
	padding: var(--srdp-archive-padding, 50px 0);
	margin: var(--srdp-archive-margin, 0);
	margin-inline: auto;
}

/*
 * The listing's heading and the listing are two blocks in one band, which is the
 * arrangement the structural padding above was not written for: each would take
 * the page's full vertical gutter and stack two of them into the gap between a
 * heading and the grid it names.
 *
 * So the pair splits one gutter. The heading keeps the top, the listing keeps the
 * bottom, and the space between them is the heading's own margin below — an
 * intra-block rhythm like `.srdp-pagination ul`, not page spacing, so it is a
 * length here rather than a setting.
 *
 * Both selectors are three classes, deliberately: the rule they override is
 * `.srdp-archive .srdp-section > div`, whose element selector out-specifies a
 * plain two-class pair. The adjacent sibling is what keeps this to the case it
 * describes — a listing with no heading before it is untouched and takes the
 * whole gutter, exactly as it does now.
 */
.srdp-archive .srdp-section > .srdp-listing-heading {
	padding-bottom: 0;
}

/*
 * And whatever follows one of those blocks does not draw the gutter again —
 * the block above it already did. Three pairs, because a grouped listing is the
 * heading-and-set pair repeated:
 *
 * - a heading and its own set, the ungrouped page;
 * - a set and the next group's heading;
 * - two headings, where the page's own heading is followed by the first group's.
 *
 * Each gap is then one number: the set's bottom padding between groups, and the
 * heading's own 1.5rem margin between a heading and what it names.
 */
.srdp-archive .srdp-listing-heading + .srdp-profiles,
.srdp-archive .srdp-profiles + .srdp-listing-heading,
.srdp-archive .srdp-listing-heading + .srdp-listing-heading {
	padding-top: 0;
}

/*
 * The page's own listing heading and a category section's, which are two
 * settings and one gap: the space under a heading is the space under a heading
 * whichever of them drew it.
 */
.srdp-listing-title,
.srdp-group-title {
	margin: 0 0 24px;
}

/*
 * The caption takes the margin but not the padding. Its 1.5rem is the inset
 * that holds the heading off the band's edges, not a gutter — replacing it with
 * a page padding whose top and bottom start at 0 would drop the name flat
 * against the top of the cover the moment a site set a side gutter. The measure
 * above already lines the caption up with the header and listing below it.
 */
.srdp-archive .srdp-cover-caption {
	margin: var(--srdp-archive-margin, 0);
	margin-inline: auto;
}

/*
 * The archive heading and its introduction. No colours and no type scale —
 * both follow the theme, and the Appearance tab is where a site changes them.
 *
 * The block's own 2rem below now lives as the margin fallback above rather than
 * in a rule here, where a `margin-bottom` would be dead weight — outranked by
 * the two-class selector whatever the order.
 */
.srdp-archive-header .srdp-page-title {
	margin-bottom: 12px;
}

/*
 * The introduction takes the full width of the block it sits in, and carries no
 * measure of its own. It had `max-width: 65ch` until 1.39.0, on the reasoning
 * that prose set the width of a six-column grid is hard to read back to — true
 * of prose, but this is the one block on the page that a site writes itself. A
 * cap here fought Page Width, which is where a listing's measure is set, and it
 * left a centred introduction sitting off to the left of the heading above it.
 *
 * Nothing declares the 100%: a div is already the width of its parent. The width
 * to change is Listing Page → Page Spacing → Page Width, which caps the whole
 * heading block.
 */
.srdp-archive-intro > :first-child {
	margin-top: 0;
}

.srdp-archive-intro > :last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* Slider                                                              */
/* ------------------------------------------------------------------ */

.srdp-slider-wrap {
	position: relative;
}

.srdp-slider {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc( ( 100% - ( var(--srdp-columns, 3) - 1 ) * var(--srdp-gap) ) / var(--srdp-columns, 3) );
	gap: var(--srdp-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 0;
	padding-bottom: 8px;
	scrollbar-width: thin;
}

.srdp-slider > .srdp-profile {
	scroll-snap-align: start;
}

.srdp-slider-nav {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	z-index: 2;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	color: inherit;
	background: color-mix( in srgb, Canvas 85%, currentColor 15% );
	box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.12 );
}

.srdp-slider-nav[disabled] {
	opacity: 0.35;
	cursor: default;
}

.srdp-slider-prev { left: -12px; }
.srdp-slider-next { right: -12px; }

/* ------------------------------------------------------------------ */
/* Modal button                                                        */
/* ------------------------------------------------------------------ */

/*
 * The card's button. Outlined in a mix of the card's own text colour, so it
 * reads on any theme without a colour of its own — the same premise as every
 * other surface here.
 *
 * Every property reads a `--srdp-modal-button-*` token from Appearance →
 * Modal → Button, undeclared until set, with today's look as the fallback.
 * Hover falls back to the resting value before the faint mix, so a site that
 * paints the button and leaves hover empty keeps its paint on hover.
 */
.srdp-modal-trigger {
	margin-top: 12px;
}

/*
 * The button itself keeps the card's text colour and never takes the Colour
 * setting: an empty border colour falls back through `currentColor`, and
 * painting the button would hand that fallback the text's colour — the Border
 * then moved with Colour, though it has a colour of its own. Colour lands on
 * `.srdp-modal-button-label` inside instead, which is also why the flex and
 * the gap are on the label.
 */
.srdp-modal-button {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0.5em 1em;
	font: inherit;
	font-size: var(--srdp-text-sm);
	line-height: 1.2;
	color: inherit;
	background: var(--srdp-modal-button-bg, transparent);
	border: var(--srdp-modal-button-border, 1px solid color-mix( in srgb, currentColor 35%, transparent ));
	border-radius: var(--srdp-modal-button-radius, var(--srdp-radius));
	cursor: pointer;
}

.srdp-modal-button-label {
	display: inline-flex;
	align-items: center;
	gap: 0.375em;
	color: var(--srdp-modal-button-color, inherit);
}

.srdp-modal-button:hover,
.srdp-modal-button:focus-visible {
	background: var(--srdp-modal-button-hover-bg, var(--srdp-modal-button-bg, var(--srdp-faint)));
}

.srdp-modal-button:hover .srdp-modal-button-label,
.srdp-modal-button:focus-visible .srdp-modal-button-label {
	color: var(--srdp-modal-button-hover-color, var(--srdp-modal-button-color, inherit));
}

/*
 * The ↗ turns a quarter of the way round to → on hover (2.3.22). Inline-block
 * because a transform does nothing on an inline box.
 */
.srdp-modal-button-icon {
	display: inline-block;
	transition: transform 0.25s ease;
}

.srdp-modal-button:hover .srdp-modal-button-icon,
.srdp-modal-button:focus-visible .srdp-modal-button-icon {
	transform: rotate( 45deg );
}

@media ( prefers-reduced-motion: reduce ) {
	.srdp-modal-button-icon {
		transition: none;
	}
}

/* ------------------------------------------------------------------ */
/* Pagination & empty state                                            */
/* ------------------------------------------------------------------ */

/*
 * `margin: 1.5rem 0 0` is the gap between a set and its own page links, and it
 * stays here rather than becoming part of the page's rhythm: every block and
 * shortcode that paginates relies on it, and on the listing page — where the nav
 * now takes Page Spacing → Padding — it is the only thing holding the links off
 * the last row of cards when that padding's top and bottom are 0.
 *
 * The alignment is undeclared until a site picks something other than Left, so an
 * unconfigured row sits exactly where it always has. Flex terms rather than
 * logical ones, which is what keeps "Left" meaning the starting edge under RTL.
 * See SRDP_Frontend::pagination_css().
 */
.srdp-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: var( --srdp-pagination-justify, flex-start );
	gap: 6px;
	list-style: none;
	margin: 24px 0 0;
	padding: 0;
}

/*
 * One number — Appearance → Listing's Pagination Number. Five undeclared
 * properties, all optional: set none and the background is still a color-mix
 * against currentColor and the text still inherits, so the numbers follow the
 * theme until a site names a colour.
 *
 * `min-height` rather than `height`, and `box-sizing: border-box` beside it.
 * A fixed height made the vertical padding either add to the 2.25rem or be
 * swallowed by it depending on whether the theme had set `box-sizing` globally —
 * a setting whose effect depended on the theme. A minimum renders identically at
 * zero padding and grows from there, and the border-box means a border thickens
 * the number's edge rather than growing the box it sits in.
 */
.srdp-pagination a,
.srdp-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 36px;
	min-height: 36px;
	margin: var( --srdp-pagination-margin, 0 );
	padding: var( --srdp-pagination-padding, 0 10px );
	border: var( --srdp-pagination-border, 0 solid transparent );
	/* Nested, so Corners left at "Slightly rounded" keeps following the shared
	   token rather than pinning a copy of its current value. */
	border-radius: var( --srdp-pagination-radius, var(--srdp-radius) );
	text-decoration: none;
	background: var( --srdp-pagination-bg, color-mix( in srgb, currentColor 6%, transparent ) );
	color: var( --srdp-pagination-color, inherit );
}

/*
 * The Previous and Next icon — Appearance → Previous & Next → Icon and Size.
 *
 * `1em` by default, so an unconfigured icon is the size of the number beside it
 * whatever type scale the site is on; Size replaces that with a fixed length.
 * `flex-shrink: 0` because the number is a flex box with a minimum width, and a
 * long word beside the icon would otherwise squash the icon rather than widen the
 * box.
 *
 * `display: block` kills the inline baseline gap under an inline SVG, which would
 * otherwise sit the shape a couple of pixels above centre inside a link whose
 * height the padding controls.
 */
.srdp-pagination-arrow {
	display: block;
	flex-shrink: 0;
	width: var( --srdp-pagination-arrow, 1em );
	height: var( --srdp-pagination-arrow, 1em );
}

/*
 * The word behind an icon. `screen-reader-text` is the class core and every theme
 * use, and the plugin already relies on it for the social links — but a theme is
 * not required to define it, and the failure mode here is the word printing next
 * to the icon it replaced. Scoped to the plugin's own wrapper so this is a floor
 * under the theme's rule rather than an argument with it.
 *
 * `min-width` and `min-height` are the load-bearing pair, and a theme's own copy
 * of this class does not carry them: the rule above styles every `span` inside the
 * nav, minimum 2.25rem, and a minimum beats a width — so without these the hidden
 * label computes to a 36px box and takes its place in the row. Two classes to that
 * rule's one, so it wins wherever both apply.
 */
.srdp-pagination .screen-reader-text {
	position: absolute;
	width: 1px;
	min-width: 0;
	height: 1px;
	min-height: 0;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
	background: none;
}

/*
 * The page being viewed. Its own two properties, each falling back through the
 * number's own: leave the current pair empty and the background stays the accent
 * mix that marks where you are, while the text follows whatever colour the other
 * numbers were given. Setting one of them is a site repainting the marker rather
 * than removing it, which is why the fallback is the mix and not `inherit`.
 *
 * Everything else — the padding, the margin, the border and the corners — comes
 * from the rule above, so the current number cannot drift into a different shape.
 */
.srdp-pagination .current {
	background: var( --srdp-pagination-current-bg, color-mix( in srgb, var(--srdp-accent) 18%, transparent ) );
	color: var( --srdp-pagination-current-color, var( --srdp-pagination-color, inherit ) );
	font-weight: var(--srdp-label-weight);
}

.srdp-empty {
	margin: 0;
	opacity: 0.7;
	font-style: italic;
}

/* ------------------------------------------------------------------ */
/* Responsive (design.md §3)                                           */
/* ------------------------------------------------------------------ */

@media ( max-width: 1239px ) {
	.srdp-cols-5,
	.srdp-cols-6 {
		--srdp-columns: 4;
	}
}

@media ( max-width: 899px ) {
	.srdp-grid,
	.srdp-cards,
	.srdp-slider {
		--srdp-columns: 2;
	}
}

@media ( max-width: 599px ) {
	.srdp-profiles,
	.srdp-single {
		--srdp-gap: 24px;
	}

	.srdp-grid,
	.srdp-cards,
	.srdp-slider {
		--srdp-columns: 1;
	}

	/* Complex rows become narrative cards on mobile (design.md §8). */
	.srdp-list .srdp-profile,
	.srdp-single-header,
	.srdp-fields .srdp-field,
	.srdp-timeline-list .srdp-timeline-item {
		grid-template-columns: 1fr;
	}

	.srdp-slider-prev { left: 0; }
	.srdp-slider-next { right: 0; }

	/*
	 * `.srdp-page` had a smaller padding here. It has none at any width now,
	 * so there is nothing to reduce — and a phone override would fight the
	 * Page Spacing setting rather than refine it.
	 */

	/*
	 * Both split layouts fall back to one column, and the explicit placement
	 * that reversed them has to be undone or it would pin two children to the
	 * same cell. Source order wins: details, then biography.
	 */
	.srdp-single-split .srdp-single-body,
	.srdp-single-split-reverse .srdp-single-body {
		display: block;
	}

	.srdp-single-split-reverse .srdp-single-header,
	.srdp-single-split-reverse .srdp-single-main {
		grid-column: auto;
		grid-row: auto;
	}

	.srdp-single-split .srdp-single-header,
	.srdp-single-split-reverse .srdp-single-header {
		margin-bottom: 32px;
	}

	/*
	 * Social row between the heading and the biography, not above the name.
	 *
	 * Stacked, the header renders whole — photo *and* the social row it still
	 * holds — before the body, so the icons land above the name.
	 *
	 * An earlier attempt ordered the header against `.srdp-single-main` and put
	 * the row at the foot of the page: main holds the biography, custom fields
	 * and timeline as well as the heading, so "after the Highlight" is a
	 * position *inside* it that no sibling can reach. Both slots therefore drop
	 * to `display: contents` here — their children join one flex flow, and the
	 * row can be placed between two of main's own children rather than after
	 * all of them.
	 *
	 * Order: photo, the heading parts that moved into main, social, then
	 * everything else main holds. `.srdp-single-main > *` gives that last group
	 * its 4 at one class, which the two-class rule above it overrides for the
	 * heading — so a new child of main needs no rule of its own.
	 *
	 * gap is 0 on purpose: the spacing is the margins these elements already
	 * carry, so the stack reads as it did before. Under `display: contents` the
	 * header's own margin goes with the box, so the photo takes it instead.
	 *
	 * Gated on srdp-header-social-only (SRDP_Render::single_class) because it
	 * is only correct when social is all the header slot holds.
	 *
	 * The cost, stated plainly: below 600px what is seen (photo, name, …,
	 * social) no longer matches what is announced (photo, social, name, …).
	 * Switching Social Links on under "Show in the Body" fixes both orders and
	 * needs none of this — at the price of moving the icons on desktop too.
	 */
	/*
	 * align-items has to be restored, not inherited. The split layouts set
	 * `align-items: start` on this same element for the two-column grid, where
	 * it means "do not stretch the shorter column down the taller one". Turning
	 * the box into a column flex container swaps the axis that property governs
	 * from vertical to horizontal, and `start` then means "shrink every child to
	 * the width of its own content and pin it left" — so the heading collapsed
	 * to the natural width of whatever it held and the social row inside it had
	 * no free space left to centre itself in. The alignment setting was applying
	 * correctly the whole time; there was simply nothing to align within.
	 */
	.srdp-header-social-only.srdp-single-split .srdp-single-body,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-body {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.srdp-header-social-only.srdp-single-split .srdp-single-header,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-header,
	.srdp-header-social-only.srdp-single-split .srdp-single-main,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-main {
		display: contents;
	}

	.srdp-header-social-only.srdp-single-split .srdp-single-main > *,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-main > * {
		order: 4;
	}

	.srdp-header-social-only.srdp-single-split .srdp-single-header > .srdp-photo,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-header > .srdp-photo {
		order: 1;
		margin-bottom: 32px;
	}

	.srdp-header-social-only.srdp-single-split .srdp-single-main > .srdp-single-heading,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-main > .srdp-single-heading {
		order: 2;
		margin-bottom: 0;
	}

	.srdp-header-social-only.srdp-single-split .srdp-single-header > .srdp-single-heading,
	.srdp-header-social-only.srdp-single-split-reverse .srdp-single-header > .srdp-single-heading {
		order: 3;
		margin-bottom: 32px;
	}

	/*
	 * Standard's photo-only collapse has to be undone here, and explicitly: a
	 * media query adds no specificity, so the two-class rule that collapses the
	 * header to the photo track would otherwise beat the single-class rule above
	 * that flattens it to 1fr — and only on the profiles that moved their whole
	 * heading across, which is the worst way to find a bug.
	 */
	.srdp-single-standard.srdp-header-photo-only .srdp-single-header {
		grid-template-columns: 1fr;
	}

	/*
	 * Sticky comes off with the columns. Both split bodies are `display: block`
	 * here, so the header is no longer a grid item with a tall area to travel
	 * inside — it is a full-width band above the biography, which is exactly the
	 * arrangement the rule declines to stick on desktop.
	 *
	 * This undo is the *only* thing tying sticky to a viewport width. There is
	 * deliberately no `min-width` query anywhere for it; see the rule itself.
	 */
	.srdp-sticky-header.srdp-single-split .srdp-single-header,
	.srdp-sticky-header.srdp-single-split-reverse .srdp-single-header {
		position: static;
	}

	/*
	 * The photo cap goes with the column it was capping. Standard already lets
	 * its photo fill the width here — its track collapses to 1fr with the other
	 * complex rows above — and a photo pinned to a desktop measurement while
	 * everything beside it went full width is the one result nobody wants.
	 */
	.srdp-single-split .srdp-photo-single,
	.srdp-single-split-reverse .srdp-photo-single {
		max-width: none;
	}

	/*
	 * A name over a cover is cramped at this width and the overlap eats most of
	 * a small cover, so both stand down. The name still renders — the detail
	 * block puts it in .srdp-cover-caption either way — it just stops being
	 * absolutely positioned and sits under the image instead.
	 */
	.srdp-cover-caption {
		position: static;
		display: block;
		padding: 16px 0 0;
		color: inherit;
		text-shadow: none;
	}

	/*
	 * A plain colour band with no picture to size it comes down to something a
	 * phone can spare. 380px of empty colour is most of the first screen spent
	 * saying nothing.
	 */
	.srdp-cover-plain {
		height: 128px;
	}

	/*
	 * The listing band comes down with it, but as a *fallback* rather than a
	 * value, and that is the whole point of this rule being separate.
	 *
	 * A flat 8rem here is inside a media query and later in the file, so it beat
	 * the base rule's `var()` on the tie-break: Listing Page → Cover Photo →
	 * Height did nothing at all on Mobile for a colour band, however it was
	 * filled in. Handing the token its phone value as the fallback keeps the
	 * short banner for a listing that has set nothing and stands aside for one
	 * that has.
	 *
	 * `.srdp-cover-plain` above keeps a flat value: the single profile's cover
	 * has one height for every screen, so there is no per-device value for it to
	 * stand aside for.
	 */
	.srdp-archive-cover-plain {
		height: var(--srdp-archive-cover-height, 128px);
	}

	/*
	 * Except over a plain colour band, where the name stays put. The reason
	 * captions step outside on mobile is that text over a photograph gets
	 * unreadable at this width — against a flat colour the contrast is known
	 * and fixed, and an empty coloured rectangle with the heading underneath
	 * would just look like a mistake.
	 */
	.srdp-cover-plain .srdp-cover-caption,
	.srdp-archive-cover-plain .srdp-cover-caption {
		position: absolute;
		display: flex;
		padding: 20px;
		color: var(--srdp-name-color, #fff );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.srdp-social-link {
		transition: none;
	}
}

/* ------------------------------------------------------------------ */
/* Popup dialog                                                        */
/* ------------------------------------------------------------------ */

/*
 * The card popup — SRDP_Render::modal(), opened by srdp-modal.js. Last in the
 * file on purpose: it re-lays out the single profile's own rules, including
 * the responsive ones above, and equal specificity then resolves its way.
 *
 * A full-screen panel on wide screens and a bottom sheet on phones, with the
 * photo alone in a column beside the name, position and biography. That
 * arrangement is fixed — modal() renders every popup as Standard with every
 * heading part in the main column — so nothing here has to allow for the page's
 * layout settings.
 *
 * The dialog is appended to <body>, so it inherits the theme's text colour
 * there, and the script copies the body's own background into
 * `--srdp-modal-surface`. Canvas is the fallback for a page that paints none.
 * No colour, font or weight below is the plugin's own.
 *
 * It slides up as it fades in: 32px over a quarter second, entered through
 * @starting-style and left through `.is-closing`, which the script holds on
 * for the length of the transition before it closes the dialog.
 */
.srdp-modal {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--srdp-modal-max-width, none);
	height: 100%;
	max-height: none;
	margin: 0 auto;
	padding: var(--srdp-modal-padding, 30px 56px 20px);
	color: var(--srdp-modal-color, inherit);
	background: var(--srdp-modal-bg, var(--srdp-modal-surface, Canvas));
	border: 0;
	border-radius: var(--srdp-modal-radius, 0);
	box-shadow: 0 0 10px rgb( 0 0 0 / 0.5 );
	overflow: hidden;
	opacity: 1;
	transform: translateY( 0 );
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.srdp-modal[open] {
	display: flex;
	flex-direction: column;
}

@starting-style {
	.srdp-modal[open] {
		opacity: 0;
		transform: translateY( 32px );
	}
}

.srdp-modal.is-closing {
	opacity: 0;
	transform: translateY( 32px );
}

/*
 * Read from the dialog's own custom properties, which a backdrop inherits in
 * current browsers. An older one ignores the setting and keeps 50% black.
 */
.srdp-modal::backdrop {
	background: var(--srdp-modal-backdrop, #000);
	opacity: var(--srdp-modal-backdrop-opacity, 0.5);
	transition: opacity 0.25s ease;
}

@starting-style {
	.srdp-modal[open]::backdrop {
		opacity: 0;
	}
}

.srdp-modal.is-closing::backdrop {
	opacity: 0;
}

/* The page behind an open popup stays where it was. */
html.srdp-modal-open {
	overflow: hidden;
}

.srdp-modal-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/*
 * Close: a bare circle at the top of the panel, level with the content's edge.
 * In the flow rather than positioned, so Appearance → Modal → Padding moves it
 * with everything else instead of leaving it over the profile.
 *
 * Appearance → Modal → Close Button sets the `--srdp-modal-close-*` tokens.
 * Colour lands on the icon, not the button, for the reason the other two
 * buttons split it onto a label: an empty Border colour follows the button's
 * `currentColor`, and that should stay the modal's text colour.
 */
.srdp-modal-close {
	display: grid;
	flex: none;
	align-self: flex-end;
	place-items: center;
	box-sizing: border-box;
	width: 48px;
	height: 48px;
	margin: 0 0 30px;
	padding: 0;
	font: inherit;
	line-height: 1;
	color: inherit;
	background: var(--srdp-modal-close-bg, transparent);
	border: var(--srdp-modal-close-border, 0);
	border-radius: var(--srdp-modal-close-radius, 50%);
	cursor: pointer;
}

/* A drawn cross rather than the × glyph, whose weight depends on the theme's font. */
.srdp-modal-close svg {
	display: block;
	width: 25px;
	height: 25px;
	color: var(--srdp-modal-close-color, inherit);
}

.srdp-modal-close:hover,
.srdp-modal-close:focus-visible {
	background: var(--srdp-modal-close-hover-bg, var(--srdp-modal-close-bg, var(--srdp-modal-faint)));
}

.srdp-modal-close:hover svg,
.srdp-modal-close:focus-visible svg {
	color: var(--srdp-modal-close-hover-color, var(--srdp-modal-close-color, inherit));
}

/* The bottom sheet's grab bar. A close button too; phones only. */
.srdp-modal-handle {
	display: none;
	flex: none;
	align-self: center;
	width: 100%;
	margin: 0;
	padding: 12px 0;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.srdp-modal-handle::before {
	content: "";
	display: block;
	width: 15%;
	min-width: 48px;
	height: 4px;
	margin: 0 auto;
	background: var(--srdp-modal-line);
	border-radius: 4px;
}

/* Previous and Next, pinned under the scrolling profile. */
.srdp-modal-nav {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 20px;
}

.srdp-modal-nav[hidden] {
	display: none;
}

/*
 * Same split as the card's button, for the same reason: the button keeps the
 * modal's text colour so an empty Border colour falls back to that and not to
 * the Colour setting, which lands on `.srdp-modal-nav-label` inside it.
 */
.srdp-modal-nav button {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 10px 20px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	color: inherit;
	background: var(--srdp-modal-nav-bg, transparent);
	border: var(--srdp-modal-nav-border, 2px solid currentColor);
	border-radius: var(--srdp-modal-nav-radius, 16px);
	cursor: pointer;
}

.srdp-modal-nav-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: var(--srdp-modal-nav-color, inherit);
}

/*
 * Appearance → Modal → Previous & Next declares these tokens on the row; the
 * same fallback chain as the card's button, so a painted button keeps its
 * paint on hover until a hover colour is named.
 */
.srdp-modal-nav button:hover,
.srdp-modal-nav button:focus-visible {
	background: var(--srdp-modal-nav-hover-bg, var(--srdp-modal-nav-bg, var(--srdp-modal-faint)));
}

.srdp-modal-nav button:hover .srdp-modal-nav-label,
.srdp-modal-nav button:focus-visible .srdp-modal-nav-label {
	color: var(--srdp-modal-nav-hover-color, var(--srdp-modal-nav-color, inherit));
}

/*
 * Two mixes against the inherited text colour, declared where both the
 * dialog's own controls and the profile inside it can read them.
 */
.srdp-modal {
	--srdp-modal-faint: color-mix( in srgb, currentColor 8%, transparent );
	--srdp-modal-line: color-mix( in srgb, currentColor 20%, transparent );
}

/*
 * The profile inside. Every selector is two classes, so each one beats the
 * stylesheet's single-class defaults and the equal `.srdp-single .srdp-…`
 * rules above it on source order — and still loses to Appearance, whose
 * typography is the same two classes printed later, in the page head. A site
 * that sized the profile name gets that size in the popup too.
 */
/*
 * Only the biography scrolls. The profile fills the modal body to its exact
 * height, so the body itself never overflows — its own `overflow-y: auto`
 * stays only as the fallback for a theme override without these wrappers —
 * and `.srdp-single-main` is the scroller instead. The photo column beside it
 * therefore never moves, and the heading at the top of the main column is
 * pinned with `sticky` rather than taken out of it: the bio, custom fields and
 * timeline are its siblings, and CSS cannot wrap them in a box of their own.
 */
.srdp-single.srdp-single-modal {
	--srdp-radius: 16px;

	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
}

.srdp-single-modal .srdp-single-body {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: var(--srdp-modal-photo-col, 400px) minmax( 0, 1fr );
	grid-template-rows: minmax( 0, 1fr );
	gap: 56px 50px;
	align-items: start;
	min-height: 0;
}

/*
 * A column, so a photo taller than the panel shrinks into it and is cropped by
 * `object-fit` rather than cut off at the bottom.
 */
.srdp-single-modal .srdp-single-header {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	min-height: 0;
	margin: 0;
}

.srdp-single-modal .srdp-photo-single {
	flex: 0 1 auto;
	min-height: 0;
	max-width: none;
	background: var(--srdp-modal-faint);
}

.srdp-single-modal .srdp-photo-single img {
	height: 100%;
}

.srdp-single-modal .srdp-single-main {
	align-self: stretch;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Painted with the panel's own surface, so the bio passes under it unseen. */
.srdp-single-modal .srdp-single-heading {
	position: sticky;
	top: 0;
	z-index: 1;
	margin-bottom: 0;
	padding-bottom: 20px;
	background: var(--srdp-modal-bg, var(--srdp-modal-surface, Canvas));
}

.srdp-single-modal .srdp-name-single {
	margin: 0;
	font-size: 45px;
	line-height: 1.2;
}

.srdp-single-modal .srdp-position {
	margin: 0;
	padding: 0 0 30px;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.25;
	color: var(--srdp-muted);
}

.srdp-single-modal .srdp-bio-full {
	margin-top: 0;
	font-size: 18px;
	line-height: 1.45;
}

@media ( max-width: 1280px ) {
	.srdp-single-modal .srdp-single-body {
		/* Appearance → Modal → Photo Column, capped at the reference's 328px. */
		grid-template-columns: min( var(--srdp-modal-photo-col, 400px), 328px ) minmax( 0, 1fr );
		gap: 20px 25px;
	}

	.srdp-single-modal .srdp-name-single {
		font-size: 30px;
		line-height: 1.3;
	}

	.srdp-single-modal .srdp-position {
		padding: 0 0 10px;
		font-size: 18px;
		line-height: 1.55;
	}

	.srdp-single-modal .srdp-bio-full {
		font-size: 15px;
		line-height: 1.65;
	}
}

/*
 * Tablets and phones (2.3.25): the photo is a 220px picture centred in its
 * column, rather than filling it. `max-width` keeps it inside a column that is
 * narrower still.
 */
@media ( max-width: 991px ) {
	.srdp-single-modal .srdp-photo-single {
		width: 220px;
		max-width: 100%;
		margin-inline: auto;
	}
}

/*
 * Phones: a sheet risen from the bottom, stopping 80px short of the top so the
 * page shows above it. The grab bar stands in for the corner close button, and
 * the photo sits above the details, 220px wide and 250px tall.
 *
 * The padding here is flat on purpose and outranks Appearance → Modal →
 * Padding, which the help text says: a panel's 56px gutters are the wrong
 * inset for a phone, and one value cannot serve both. The radius still
 * follows the setting, on the sheet's two top corners only.
 */
@media ( max-width: 767px ) {
	.srdp-modal {
		top: 80px;
		height: calc( 100% - 80px );
		padding: 4px 24px 24px;
		border-radius: var(--srdp-modal-radius, 24px) var(--srdp-modal-radius, 24px) 0 0;
	}

	.srdp-modal-close {
		display: none;
	}

	.srdp-modal-handle {
		display: block;
	}

	.srdp-single-modal .srdp-single-body {
		grid-template-columns: minmax( 0, 1fr );
		grid-template-rows: auto minmax( 0, 1fr );
	}

	.srdp-single-modal .srdp-photo img {
		height: 250px;
		aspect-ratio: auto;
		object-position: 50% 20%;
	}

	.srdp-single-modal .srdp-single-main {
		margin-top: 10px;
	}

	.srdp-single-modal .srdp-name-single {
		line-height: 1.33;
	}

	.srdp-single-modal .srdp-bio-full {
		font-size: 14px;
		line-height: 1.7;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.srdp-modal,
	.srdp-modal::backdrop {
		transition: none;
	}

	.srdp-modal.is-closing {
		transform: none;
	}
}
