/*
Theme Name: SRY
Theme URI: https://suomenravitsemustieteenyhdistys.fi
Description: Suomen ravitsemustieteen yhdistys ry. Child theme of Twenty Twenty-Five. Editorial minimalism: hairline borders, muted accents, no gradients.
Author: WebAula
Template: twentytwentyfive
Version: 0.6.7
Text Domain: sry
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/*
 * Design tokens live in theme.json. This file carries only the rules that
 * theme.json cannot express: sticky positioning, backdrop filter, hover
 * transitions, and the navigation submenu panel.
 */

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */

/*
 * Sticky goes on the template-part WRAPPER, not on .sry-header.
 *
 * WordPress wraps every template part in its own element, here
 * <header class="wp-block-template-part">, and .sry-header is that wrapper's
 * only child. A sticky element can only travel inside its parent's box, and the
 * wrapper is exactly as tall as the header -- so the header had no room to move
 * and scrolled away with the page. It was never sticky, on any page.
 *
 * The wrapper's parent is .wp-site-blocks, which spans the whole document, so
 * sticky on the wrapper works. The admin bar variable keeps it clear of the
 * toolbar for logged-in editors; it resolves to 0 for everyone else.
 */
.wp-block-template-part:has(> .sry-header) {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 40;
}

/* isolation gives the ::before background its own stacking context to sit in
   at z-index -1. Unlike transform or filter it does not make this element a
   containing block for the drawer's position:fixed panel. */
.sry-header {
	position: relative;
	isolation: isolate;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

/*
 * The frosted background sits on a pseudo-element rather than on .sry-header
 * itself, and that is load-bearing, not tidiness.
 *
 * A backdrop-filter other than `none` makes an element a containing block for
 * every position:fixed descendant. The mobile menu overlay is exactly that: it
 * asks for position:fixed with inset:0, and with the filter on the header it
 * resolved against the 123px header box instead of the viewport. The menu
 * opened -- it was simply 375x122 and unusable. Same family of trap as
 * transform, filter, perspective, contain and will-change.
 *
 * Moving the filter one level down keeps the effect and returns the overlay to
 * the viewport. Nothing inside .sry-header may carry those properties either.
 */
.sry-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgb(248 247 245 / 92%);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.sry-header__bar {
	min-height: 64px;
	/* The three parts stay on one line: nav, logo, nav. Without nowrap the
	   navigation blocks claim their natural width and the row breaks, which
	   drops the logo out of the centre. The 1fr / auto / 1fr split is what
	   the design expressed as a grid before the logo was un-absolute-positioned. */
	flex-wrap: nowrap;
	gap: clamp(12px, 2vw, 28px);
}

.sry-header__bar > .wp-block-navigation {
	flex: 1 1 0;
	min-width: 0;
}

/* Logo sits in the centre column of the row. The design placed it with
   position:absolute and a 50.5% offset; that is flattened here, and the
   slight overhang is reproduced with a negative bottom margin instead.
   See buildability-report.md finding 2. */
/* Two class selectors, not one: the layout stylesheet WordPress prints for a
   flex group carries a `> *` margin reset at equal specificity and later in
   the cascade, which zeroes a single-class rule here. */
.sry-header__bar > .sry-logo {
	display: block;
	flex: 0 0 auto;
	align-self: flex-start;
	/* Scaled down from clamp(88px, 10.5vw, 132px): the medallion was dominating
	   the bar, most visibly on phones where it was half the header. The size is
	   a custom property so the overhang calc below cannot drift out of step
	   with it, which is exactly how the first version of this rule broke. */
	--sry-logo-size: clamp(66px, 8vw, 100px);
	width: var(--sry-logo-size);
	margin-top: 8px;
	/* The medallion hangs below the bar and crosses its bottom border, which is
	   what the design achieved with position:absolute and top:8px. 56px is the
	   bar height minus the 8px top offset, so the overhang stays proportional
	   as the logo scales. */
	margin-bottom: calc(56px - var(--sry-logo-size));
	position: relative;
	z-index: 2;
	line-height: 0;
}

/* img as well as svg: the logo pattern ships an <img> pointing at the theme's
   SVG file, so a selector on `svg` alone never matched. The mark kept its
   intrinsic 132px and overflowed the anchor, which is why the bar measured
   130px tall on a phone instead of 64 and the medallion looked oversized. */
.sry-logo img,
.sry-logo svg {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 2px 10px rgb(26 25 23 / 5%));
}

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

/* The top level navigation sets its own gap. Left to the theme.json blockGap
   it inherits 56px, which needs 631px for the four left hand items in a 546px
   column and wraps the row. The design used a fluid 12px to 28px gap. */
/* Not a child selector: overlayMenu wraps the list in
   .wp-block-navigation__responsive-container-content, so the list is a
   descendant. Submenus use __submenu-container and are unaffected. */
.sry-nav .wp-block-navigation__container {
	column-gap: clamp(12px, 1.6vw, 28px);
	row-gap: 4px;
}

.sry-nav .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: clamp(14px, 1.15vw, 16px);
	letter-spacing: -0.005em;
	color: var(--wp--preset--color--muted);
	padding-block: 6px;
	border-bottom: 1px solid transparent;
	transition: color 200ms, border-color 200ms;
}

.sry-nav .wp-block-navigation-item__content:hover,
.sry-nav .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--primary);
}

.sry-nav .current-menu-item > .wp-block-navigation-item__content,
.sry-nav .current_page_item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink);
	border-bottom-color: var(--wp--preset--color--primary);
}

/* Submenu panel. Core handles the open/close behaviour and keyboard access;
   only the visual shell is ours. The design opened these on hover only,
   which is unreachable by keyboard. See finding 6. */
.sry-nav .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 12%);
	border-radius: 6px;
	box-shadow: 0 10px 30px rgb(26 25 23 / 10%);
	padding-block: 8px;
	min-width: 268px;
}

.sry-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	font-size: 14px;
	color: #2e2b27;
	padding: 9px 18px;
	border-bottom: none;
	line-height: 1.4;
}

.sry-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.sry-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--surface);
}

/* --- the header below laptop width --- */

/*
 * Below 1100px the header is a centred logo with a drawer button on the right.
 * 1100 is measured rather than chosen: the four main items, the logo and the
 * three utility items only fit on one row from about that width, and at 1024
 * the fourth item "Ravitsemustiede Suomessa" still wrapped to a second line and
 * pushed the logo off centre.
 */

@media (max-width: 1099px) {
	.sry-header__bar > .sry-nav--main,
	.sry-header__bar > .sry-nav--utility {
		display: none;
	}

	/* Logo centred between two equal columns, drawer button in the third.
	   Two class selectors: the layout stylesheet WordPress prints for a flex
	   group sets display:flex at equal specificity. */
	.wp-block-group.sry-header__bar {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		align-items: center;
	}

	.sry-header__bar > .sry-logo {
		grid-column: 2;
	}

	.sry-header__bar > .sry-drawer {
		grid-column: 3;
		justify-self: end;
	}
}

@media (min-width: 1100px) {
	.sry-header__bar > .sry-drawer {
		display: none;
	}
}

/* ---------------------------------------------------------------
   Mobile drawer
   --------------------------------------------------------------- */

/*
 * This is written by hand instead of reusing a core Navigation block, and the
 * reason is specific: core's overlay always renders submenus expanded. With
 * overlayMenu set it pins aria-expanded to true and the toggle button is inert,
 * and openSubmenusOnClick does not change that inside the overlay -- measured,
 * not assumed. There is no state for CSS to hook onto, so a collapsible menu
 * cannot be built on top of it at all.
 *
 * So: a checkbox for the drawer, <details> for each group. Both are keyboard
 * operable natively, which is what makes the no-JavaScript version defensible,
 * and it matches the radio + :has() pattern the archive, Toiminta and
 * Ravitsemustiede filters already use.
 *
 * What is knowingly given up versus core's overlay: focus is not trapped inside
 * the panel, and Escape does not close it. Neither is reachable without
 * JavaScript. Clicking the scrim and the close button both work, the panel is
 * visibility:hidden when shut so it stays out of the tab order and the
 * accessibility tree, and <summary> handles Enter and Space on its own.
 */

/* Raw HTML block content does not pick up the border-box reset WordPress
   applies to its own blocks, so the panel's 24px padding was being added
   outside its width: 372x876 in a 375x812 viewport instead of 322x812. */
.sry-drawer,
.sry-drawer *,
.sry-drawer *::before,
.sry-drawer *::after {
	box-sizing: border-box;
}

.sry-drawer {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/*
 * The checkbox IS the button: it sits transparent over the icon so it keeps
 * native focus and Space handling. A <label> alone would not be focusable, and
 * a label with tabindex still would not toggle on a key press.
 */
.sry-drawer__switch {
	position: absolute;
	top: 50%;
	right: 0;
	margin: 0;
	padding: 0;
	width: 46px;
	height: 46px;
	transform: translateY(-50%);
	opacity: 0;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	z-index: 3;
}

.sry-drawer__burger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 6px;
	color: var(--wp--preset--color--ink);
}

.sry-drawer__switch:focus-visible + .sry-drawer__burger {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.sry-drawer__scrim {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: rgb(26 25 23 / 40%);
	opacity: 0;
	visibility: hidden;
	cursor: pointer;
	transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.sry-drawer__switch:checked ~ .sry-drawer__scrim {
	opacity: 1;
	visibility: visible;
	transition: opacity 300ms ease, visibility 0s;
}

/*
 * The panel stays in the DOM and slides, rather than being display-toggled.
 * That is what lets it animate in BOTH directions with a plain transition: a
 * display none/flex pair needs allow-discrete and @starting-style to animate at
 * all, and still snaps shut in browsers that lack them. visibility carries the
 * delay so the panel leaves the tab order only after it has finished leaving.
 */
.sry-drawer__panel {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	width: min(86vw, 360px);
	height: 100vh;
	height: 100dvh;
	padding: 16px 24px 48px;
	background: var(--wp--preset--color--surface);
	border-left: 1px solid rgb(26 25 23 / 10%);
	box-shadow: -18px 0 46px rgb(26 25 23 / 14%);
	overflow-y: auto;
	overscroll-behavior: contain;
	visibility: hidden;
	transform: translateX(100%);
	transition:
		transform 320ms cubic-bezier(0.32, 0.72, 0, 1),
		visibility 0s linear 320ms;
}

.sry-drawer__switch:checked ~ .sry-drawer__panel {
	visibility: visible;
	transform: translateX(0);
	transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
}

/* Hold the page still while the drawer is open. There is no CSS hook on body
   for a checkbox three levels down, but :has() on the root gives one. */
html:has(.sry-drawer__switch:checked) {
	overflow: hidden;
}

.sry-drawer__close {
	align-self: flex-end;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: 4px;
	border-radius: 6px;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

.sry-drawer__close:hover {
	color: var(--wp--preset--color--primary);
}

.sry-drawer__list,
.sry-drawer__list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* A hairline between top level entries, the same device the page sections use. */
.sry-drawer__list > li + li {
	border-top: 1px solid rgb(26 25 23 / 9%);
}

.sry-drawer__list > li > a,
.sry-drawer__group > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.005em;
	line-height: 1.25;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.sry-drawer__group > summary {
	cursor: pointer;
	list-style: none;
}

/* Both spellings: WebKit still uses the pseudo-element, everything else the
   ::marker. Without these the native triangle sits beside our own chevron. */
.sry-drawer__group > summary::-webkit-details-marker {
	display: none;
}

.sry-drawer__group > summary::marker {
	content: "";
}

.sry-drawer__group > summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
	border-radius: 4px;
}

.sry-drawer__group > ul {
	margin: 0 0 14px 2px;
	padding-left: 14px;
	border-left: 1px solid rgb(26 25 23 / 12%);
}

.sry-drawer__group > ul > li > a {
	display: block;
	padding: 9px 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.sry-drawer__panel a:hover,
.sry-drawer__panel a:focus-visible,
.sry-drawer__group > summary:hover {
	color: var(--wp--preset--color--primary);
}

.sry-drawer__chev {
	display: flex;
	flex: 0 0 auto;
	color: var(--wp--preset--color--muted);
	transition: transform 220ms ease;
}

.sry-drawer__group[open] > summary .sry-drawer__chev {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
	.sry-drawer__panel,
	.sry-drawer__scrim,
	.sry-drawer__chev {
		transition: none;
	}
}

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

/* The design's link columns are a plain stack, not a bulleted list. The list
   markup is kept because a list of links is what these are; only the marker
   and the default indent come off. */
.sry-footer-list {
	list-style: none;
	padding-left: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* The footer text sits on dark green, so the three tiers the design uses are
   expressed as opacity over the inherited surface colour rather than as three
   more palette slugs. */
.sry-footer-list a {
	opacity: 0.86;
	transition: opacity 200ms;
}

.sry-footer-list a:hover,
.sry-footer-list a:focus-visible {
	opacity: 1;
}

.sry-footer-lede {
	opacity: 0.72;
	max-width: 26em;
}

.sry-footer-label {
	opacity: 0.5;
	margin-bottom: 6px;
}

.sry-footer-cta a {
	border-bottom: 1px solid rgb(255 255 255 / 35%);
	padding-bottom: 3px;
	transition: color 200ms, border-color 200ms;
}

.sry-footer-cta a:hover,
.sry-footer-cta a:focus-visible {
	color: #e5a39f;
	border-bottom-color: #e5a39f;
}

.sry-footer-bar {
	border-top: 1px solid rgb(232 234 230 / 16%);
}

/* Partner logos sit on white tiles, because both marks are dark artwork that
   would disappear against the green. */
.sry-partners {
	align-items: stretch;
}

.sry-partner {
	flex: 1 1 0;
	margin: 0;
	background: var(--wp--preset--color--white);
	border-radius: 6px;
	padding: 12px 14px;
	min-width: 0;
}

.sry-partner a,
.sry-partner img {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	width: 100%;
}

.sry-partner img {
	object-fit: contain;
	max-height: 100%;
}

/* ---------------------------------------------------------------
   Eyebrow label, used above section headings and on dates
   --------------------------------------------------------------- */

.sry-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------
   Section heading with a hairline rule filling the remaining space
   --------------------------------------------------------------- */

.sry-rule {
	flex: 1 1 auto;
	height: 1px;
	background: rgb(26 25 23 / 14%);
}

/* ---------------------------------------------------------------
   Ajankohtaista: featured article beside two, then a row of four
   --------------------------------------------------------------- */

/* post-template renders a <ul>; the single featured item needs no list styling. */
.sry-featured,
.sry-side-list,
.sry-latest-rest .wp-block-post-template {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.sry-featured-media img {
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
	filter: saturate(0.9);
}

/* The vertical hairline separating the featured article from the two beside it. */
.sry-side {
	border-left: 1px solid rgb(26 25 23 / 12%);
	padding-left: var(--wp--preset--spacing--50);
}

.sry-side-list > li + li {
	border-top: 1px solid rgb(26 25 23 / 12%);
	margin-top: var(--wp--preset--spacing--50);
	padding-top: var(--wp--preset--spacing--50);
}

/* The row of four sits below a full width rule. */
.sry-latest-rest {
	border-top: 1px solid rgb(26 25 23 / 12%);
	padding-top: var(--wp--preset--spacing--50);
}

.sry-meta {
	column-gap: var(--wp--preset--spacing--30);
}

.sry-readmore {
	display: inline-block;
	border-bottom: 1px solid rgb(180 66 61 / 35%);
	padding-bottom: 3px;
}

/* ---------------------------------------------------------------
   Finnish compound words in headings
   --------------------------------------------------------------- */

/*
 * Something upstream sets word-break: break-word on post titles, which breaks a
 * word at whatever character happens to hit the edge: "Ravitsemusvi / ikko",
 * "syysseminaa / ri". Finnish compounds are long enough that narrow columns hit
 * this constantly, and it is the exact anti-pattern gutterberg-native-blocks
 * warns about.
 *
 * word-break: normal stops the arbitrary break. hyphens: auto then lets the
 * browser hyphenate at real syllable boundaries, which works here because the
 * document carries lang="fi". Titles come from the database, so manual &shy; is
 * not available the way it is in hand-written markup.
 */
:is(h1, h2, h3, h4, .wp-block-post-title) {
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: auto;
}

/* ---------------------------------------------------------------
   Event cards
   --------------------------------------------------------------- */

.sry-event-grid {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.sry-event-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Event artwork is posters and organisation logos rather than photography, so
   it is contained on a tinted panel instead of cropped to fill. Cropping a
   poster cuts the title off it. */
.sry-event-media {
	margin: 0;
	height: 190px;
	background: #faf9f7;
	border-bottom: 1px solid rgb(26 25 23 / 8%);
	padding: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sry-event-media img {
	max-height: 100%;
	max-width: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.sry-event-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.sry-event-dates, p.sry-event-dates {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

/* Pushed to the bottom so cards of differing title length still line their
   location up, which is what the design's flex:1 body achieved. */
.sry-event-location, p.sry-event-location {
	display: block;
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
	font-size: 14.5px;
	color: var(--wp--preset--color--muted);
}

.sry-badge {
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 4px 10px;
}

.sry-badge--host {
	color: #2f4a3f;
	background: #e7ede8;
}

.sry-badge--past {
	color: var(--wp--preset--color--muted);
	border: 1px solid rgb(26 25 23 / 16%);
}

/* ---------------------------------------------------------------
   Cards
   --------------------------------------------------------------- */

.sry-card {
	background: var(--wp--custom--card--background);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: var(--wp--custom--card--radius);
	overflow: hidden;
	transition: box-shadow 220ms, transform 220ms;
}

.sry-card:hover,
.sry-card:focus-within {
	box-shadow: 0 3px 14px rgb(26 25 23 / 6%);
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.sry-card,
	.sry-card:hover,
	.sry-card:focus-within {
		transform: none;
		transition: none;
	}
}

/* ---------------------------------------------------------------
   Hero. The design filled the right column with an absolutely
   positioned image; Media & Text with imageFill does this natively.
   See finding 3.
   --------------------------------------------------------------- */

.sry-hero {
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

/* display:grid makes the image a grid item that stretches to the figure's
   height. Without it, height:100% on the image resolves against an auto
   height and the image sits at its intrinsic size inside a taller figure. */
.sry-hero .wp-block-media-text__media {
	display: grid;
	min-height: 560px;
	border-left: 1px solid rgb(26 25 23 / 12%);
}

/* Fill the column rather than sitting at the image's own height. This is what
   imageFill would do, without imageFill's background-image markup. */
.sry-hero .wp-block-media-text__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(0.9);
}

@media (max-width: 781px) {
	.sry-hero .wp-block-media-text__media {
		min-height: 320px;
		border-left: 0;
	}
}

/* ---------------------------------------------------------------
   Focus visibility. The design defines no focus states at all.
   --------------------------------------------------------------- */

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ---------------------------------------------------------------
   Yhdistys: honorary members. A core table carries the year/name
   pairs so 22 rows stay one editable block instead of 22 column
   pairs. Core's table block draws a full box border; the design
   wants hairline rows only, so the reset below is deliberate.
   --------------------------------------------------------------- */

.sry-honorary table {
	border-collapse: collapse;
	width: 100%;
}

.sry-honorary td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--neutral);
	padding: 15px 0;
	vertical-align: baseline;
}

.sry-honorary td:first-child {
	width: 76px;
	padding-right: 28px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12.5px;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--primary);
	white-space: nowrap;
}

.sry-honorary td:last-child {
	font-size: 16px;
	line-height: 1.5;
}

/* Logo tiles: the inline height comes from the image block, but a wide
   logo would still overflow its card without this. */

.wp-block-image.is-resized img {
	max-width: 100%;
	object-fit: contain;
}

/* ---------------------------------------------------------------
   In-page anchor targets. The header is sticky at 78px, so an
   anchor jump would otherwise land the section heading underneath
   it. The nav links to /yhdistys#esittely and friends, so this is
   load-bearing rather than cosmetic.
   --------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
}

main [id] {
	scroll-margin-top: 100px;
}

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

/* ---------------------------------------------------------------
   Numbered step cards (Yhdistys: "SRY pähkinänkuoressa")
   --------------------------------------------------------------- */

/*
 * The card is a flex row of number + text. Without this the number is a
 * shrinkable flex item and "01" wraps to "0" over "1" -- two lines in a
 * 7px-wide box. flex-shrink: 0 keeps it at its own width; nowrap stops
 * the break even if something later squeezes the row.
 */
.sry-step-number {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* ---------------------------------------------------------------
   Hairline grids
   --------------------------------------------------------------- */

/*
 * The design builds its stat strips and card grids as a 1px-gap grid over a
 * neutral background: the background shows through the gaps as hairlines, and
 * a 1px border closes the outer edge. Two things block markup cannot express:
 *
 * 1. overflow: hidden. Without it the square corners of the child cells poke
 *    past the wrapper's 8px radius, squaring off all four corners.
 * 2. Core ships `.wp-block-columns.has-background { padding: 1.25em 2.375em }`,
 *    which fires on any columns block with a background and puts a thick band
 *    of the wrapper colour around the cells. The blocks defeat it with an
 *    explicit padding of 0; this is the note explaining why that 0 is there.
 *
 * Selecting on the neutral background is deliberate: in this design system a
 * neutral-backed grid or columns block IS the hairline device, nothing else.
 */

.wp-block-group.is-layout-grid.has-neutral-background-color,
.wp-block-columns.has-neutral-background-color {
	overflow: hidden;
}

/* ---------------------------------------------------------------
   Strategia
   --------------------------------------------------------------- */

/*
 * Value pills. Paragraph supports background and padding but not border
 * radius, so the pill shape lives here.
 */
.sry-pill {
	border-radius: 999px;
}

/*
 * Each kärkitavoite keeps its number and title beside the reader while the
 * aims scroll. Dropped on narrow screens, where the columns stack and a
 * sticky header would sit on top of its own content.
 */
.sry-goal-head {
	position: sticky;
	top: 110px;
}

/*
 * Aims and actions. The design draws an arrow before every aim and a bullet
 * before every action. Those glyphs are decoration, not content: as blocks
 * they would double the block count, be read aloud by screen readers, and
 * invite an editor to delete one and break the alignment. As ::before they
 * stay out of the accessibility tree and out of the editor's way, and the
 * aim stays a real heading with the actions a real list under it.
 */
.sry-aim {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--wp--preset--color--ink);
	max-width: 34em;
}

.sry-aim::before {
	content: "\2192";
	color: var(--wp--preset--color--primary);
	font-size: 15px;
	font-weight: 400;
}

.sry-actions {
	list-style: none;
	margin: 0;
	padding-left: 32px;
	display: grid;
	gap: 10px;
}

.sry-actions li {
	display: grid;
	grid-template-columns: 16px minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
	font-size: 16px;
	line-height: 1.65;
	color: var(--wp--preset--color--muted);
	max-width: 36em;
}

.sry-actions li::before {
	content: "\2022";
	color: var(--wp--preset--color--muted);
	font-size: 14px;
}

/* The two evaluation cards use the same arrow, without the indent. */
.sry-arrow-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 18px;
}

.sry-arrow-list li {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.68;
}

.sry-arrow-list li::before {
	content: "\2192";
	color: var(--wp--preset--color--primary);
	font-size: 15px;
}

@media (max-width: 781px) {
	.sry-goal-head {
		position: static;
	}

	.sry-actions {
		padding-left: 0;
	}
}

/* ---------------------------------------------------------------
   Saannot
   --------------------------------------------------------------- */

/* The pykälä index follows the reader down the document. */
.sry-pykala-nav {
	position: sticky;
	top: 102px;
}

/*
 * The index is a list of links, so it stays a list: screen readers announce
 * "11 items" and the arrow keys work. The pill look is all here.
 */
.sry-pykala-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sry-pykala-list li {
	margin: 0;
}

.sry-pykala-list a {
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12.5px;
	color: var(--wp--preset--color--muted);
	border: 1px solid rgb(26 25 23 / 16%);
	border-radius: 4px;
	padding: 7px 11px;
	transition: border-color 200ms, color 200ms;
}

.sry-pykala-list a:hover,
.sry-pykala-list a:focus-visible {
	border-color: rgb(180 66 61 / 50%);
	color: var(--wp--preset--color--primary);
}

/* Statute body copy. The measure is the design's, not a guess. */
.sry-pykala-text {
	max-width: 38em;
}

/*
 * Rhythm inside a numbered section (Säännöt, Tietosuoja).
 *
 * The content column asks for an 18px block gap. Until 2026-09-29 every
 * paragraph also carried an inline margin-top:0, and an inline style beats the
 * layout stylesheet, so consecutive paragraphs sat flush against each other on
 * both pages -- 0px apart, measured. The inline margins are gone and the gap
 * applies. Subheads get more room above than the 18px between paragraphs and
 * sit close to the text they introduce, so each reads as belonging to what
 * follows it rather than floating between two blocks.
 */
.sry-pykala-text + h3.sry-eyebrow,
.sry-rule-list + h3.sry-eyebrow,
.wp-block-heading + h3.sry-eyebrow {
	margin-block-start: 30px;
}

h3.sry-eyebrow + .sry-pykala-text,
h3.sry-eyebrow + .sry-rule-list {
	margin-block-start: 10px;
}

/*
 * The vuosikokous agenda in §9 is a real <ol>. The design prints "1." ...
 * "11." in a mono column, which the source data carried as literal text in
 * each item. A CSS counter renders the same thing while keeping the numbers
 * automatic, so inserting an item in the editor renumbers the rest instead
 * of silently producing two items labelled "7.".
 */
.sry-rule-list {
	list-style: none;
	counter-reset: sry-rule-item;
	/* Not margin:0 -- that also cancelled the column's block gap, so a list sat
	   flush under the paragraph introducing it. The top margin is the layout's. */
	margin-inline: 0;
	margin-block-end: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.sry-rule-list li {
	counter-increment: sry-rule-item;
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr);
	gap: 10px;
	align-items: baseline;
	font-size: 16px;
	line-height: 1.6;
}

.sry-rule-list li::before {
	content: counter(sry-rule-item) ".";
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12.5px;
	color: var(--wp--preset--color--muted);
}

/* Tietosuoja: the data lists are unordered, and the erasure conditions are
   lettered a) to e) as in the board-approved notice. Same column, same mono
   marker, different counter. Single hyphens on purpose: these classes live in
   page content, and WordPress rewrites "--" inside block comment JSON as
   -- on save. It decodes to the same class, but the stored page would
   then differ byte for byte from content/tietosuoja.html. */
.sry-rule-list-dash li::before {
	content: "\2013";
}

.sry-rule-list-alpha li::before {
	content: counter(sry-rule-item, lower-alpha) ")";
}

@media (max-width: 781px) {
	.sry-pykala-nav {
		position: static;
	}
}

/* ---------------------------------------------------------------
   Liity: inline document link
   --------------------------------------------------------------- */

/*
 * Body links elsewhere on the site are ink with a colour change on hover.
 * A link to a downloadable document needs to read as a link in running
 * prose, so the design gives this one the accent colour and an underline.
 */
.sry-doclink a {
	color: var(--wp--preset--color--primary);
	border-bottom: 1px solid rgb(180 66 61 / 35%);
}

.sry-doclink a:hover,
.sry-doclink a:focus-visible {
	border-bottom-color: var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------
   Yhteystiedot: board grid
   --------------------------------------------------------------- */

/*
 * The design animates each card in on load and reveals the organisation in a
 * gradient overlay on hover. Both are dropped: the entrance animation fights
 * prefers-reduced-motion for no informational gain, and the overlay only
 * repeated the organisation line that already sits under the name. What is
 * kept is the desaturation lift, which is the part that reads as intentional.
 */
.sry-board-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(0.72);
	transition: transform 700ms cubic-bezier(0.22, 0.75, 0.25, 1), filter 500ms ease;
}

.sry-board-grid li:hover .sry-board-photo img,
.sry-board-grid li:focus-within .sry-board-photo img {
	transform: scale(1.06);
	filter: saturate(1) contrast(1.02);
}

.sry-board-photo {
	background: var(--wp--preset--color--neutral);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
	overflow: hidden;
}

.sry-board-name {
	font-size: 21px;
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--wp--preset--color--ink);
}

.sry-board-role {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.sry-board-org {
	margin: 10px 0 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

/* post-template renders a <ul>; these cards need no list styling. */
.sry-board-grid {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The address is written out rather than linked, so it has to be free to break. */
.sry-email {
	overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
	.sry-board-photo img,
	.sry-board-grid li:hover .sry-board-photo img {
		transition: none;
		transform: none;
	}
}

/* ---------------------------------------------------------------
   Gravity Forms, brought onto the design system
   --------------------------------------------------------------- */

/*
 * Gravity Forms ships the Orbital theme, which arrives with its own palette --
 * most visibly a #204ce5 blue submit button.
 *
 * Colours, radii, sizes and the label colour are NOT set here. Gravity Forms
 * emits a per-form inline <style> at
 *
 *     #gform_wrapper_1[data-form-index="0"].gform-theme
 *
 * which is ID-level specificity and loads after the theme, so it beats any
 * reasonable selector in this file. That block is generated from the form
 * block's own appearance attributes (inputBorderColor, labelColor,
 * buttonPrimaryBackgroundColor and friends), which is the supported surface --
 * see the gravityforms/form block in content/yhteystiedot.html. Fighting it
 * from here with !important or an ID selector would work until the next
 * Gravity Forms release.
 *
 * What is left below is only what has no block attribute: the mono uppercase
 * label treatment, the checkbox accent and the consent link.
 */
/*
 * Size, colour and case come from the block's labelFontSize / labelColor
 * attributes. Family and tracking have no attribute, and Gravity Forms'
 * framework stylesheet sets font-family on the label at a specificity this
 * file has to match, hence the long selector rather than a short one.
 */
.gform_wrapper.gform-theme .gform_fields .gfield > .gfield_label,
.gform_wrapper.gform-theme .gform_fields .gfield > .gfield_label > * {
	font-family: var(--wp--preset--font-family--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.gform_wrapper .ginput_container_consent input[type="checkbox"] {
	accent-color: var(--wp--preset--color--primary);
	width: 17px;
	height: 17px;
}

/* The consent label carries the link to the tietosuojaseloste. */
.gform_wrapper .gfield_consent_label a {
	color: var(--wp--preset--color--primary);
	border-bottom: 1px solid rgb(180 66 61 / 35%);
}

/* ---------------------------------------------------------------
   Toiminta: seminar list and its upcoming/past switch
   --------------------------------------------------------------- */

/*
 * The switch is two radio inputs and two server-rendered Query Loops, shown and
 * hidden with :has(). No JavaScript, so both lists are in the HTML for search
 * engines and for anyone with JS off, and the control is a real radio group
 * that arrow keys already operate.
 *
 * This deliberately does not settle Phase 0.1 (events archive interactivity).
 * That decision is about the full archive, which needs filter chips and a date
 * picker over 88 events. Here there are two fixed views, which is the one shape
 * that does not need a filter layer at all.
 *
 * The two loops differ only by order: the sry_event_query_vars() filter in the
 * mu-plugin reads ASC as upcoming and DESC as past, and rewrites the meta query
 * accordingly. See the comment there.
 */

.sry-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.sry-seminar-toggle {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
	padding: 0 0 18px;
	border: 0;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

.sry-seminar-toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.sry-seminar-toggle label {
	font-size: 13.5px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid rgb(26 25 23 / 16%);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	transition: background 200ms, border-color 200ms, color 200ms;
}

.sry-seminar-toggle input:checked + label {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.sry-seminar-toggle input:focus-visible + label {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.sry-seminar-switch:has(#sry-sem-upcoming:checked) .sry-panel-past,
.sry-seminar-switch:has(#sry-sem-past:checked) .sry-panel-upcoming {
	display: none;
}

/* Result count, right aligned above the list as in the design. */
.sry-seminar-count {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	text-align: right;
	margin: 0 0 20px;
}

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

/* Horizontal card: fixed media rail, text takes the rest, wraps when narrow. */
.sry-seminar-card {
	flex-wrap: wrap;
	align-items: stretch;
}

.sry-seminar-media {
	flex: 0 0 200px;
	max-width: 100%;
	height: 130px;
	background: #faf9f7;
	border: 1px solid rgb(26 25 23 / 8%);
	border-radius: 6px;
	overflow: hidden;
	padding: 12px;
	margin: 0;
}

.sry-seminar-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sry-seminar-body {
	flex: 1 1 240px;
	min-width: 0;
}

.sry-seminar-title {
	font-size: 24px;
	line-height: 1.2;
	letter-spacing: -0.018em;
	margin: 0;
	overflow-wrap: break-word;
}

.sry-seminar-body .sry-readmore {
	margin-top: auto;
	padding-top: 12px;
	font-size: 14px;
	color: var(--wp--preset--color--primary);
}

@media (max-width: 600px) {
	.sry-seminar-media {
		flex-basis: 100%;
		height: 160px;
	}
}

/* ---------------------------------------------------------------
   Toiminta: nuoret ravitsemustieteilijat
   --------------------------------------------------------------- */

.sry-nuoret-media img {
	width: 100%;
	height: 320px;
	object-fit: cover;
	border-radius: 8px;
}

.sry-workgroup-name {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.35;
}

.sry-workgroup-org {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
}

/* ---------------------------------------------------------------
   Ravitsemustiede: research group directory
   --------------------------------------------------------------- */

/*
 * Organisation filter. Five radios over the taxonomy classes that
 * sry_group_post_class() puts on each loop item, shown and hidden with :has().
 * No JavaScript, so all 23 groups are in the HTML and the control is a real
 * radio group.
 *
 * The count is a CSS counter rather than a number in the markup. Items hidden
 * with display:none do not generate boxes and so do not increment a counter,
 * which means the count follows the active filter for free and, unlike a
 * hardcoded number, cannot go stale when an editor adds a group.
 *
 * That forces the DOM order list-then-count, because a counter can only be read
 * after the elements that increment it. The flex order below puts the count
 * back above the list visually.
 */

.sry-groups-wrap {
	display: flex;
	flex-direction: column;
}

.sry-groups-title { order: 1; }
.sry-group-filter { order: 2; }
.sry-group-count  { order: 3; }
.sry-groups-query { order: 4; }

.sry-group-filter {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
	padding: 0 0 22px;
	border: 0;
}

/*
 * Each radio is nested inside its label and stretched over the whole chip.
 * That makes the focusable box and the visible chip the same rectangle, which
 * is what lets a keyboard user arrow along the sideways-scrolling row on a
 * phone and have each chip scroll fully into view. As siblings the radio was a
 * 1px box somewhere else, and focus scrolled to that instead.
 */
.sry-group-filter label {
	position: relative;
	font-size: 13px;
	padding: 8px 15px;
	border-radius: 999px;
	border: 1px solid rgb(26 25 23 / 16%);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	transition: background 200ms, border-color 200ms, color 200ms;
}

.sry-group-filter input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.sry-group-filter label:has(input:checked) {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.sry-group-filter label:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.sry-groups-wrap:has(#sry-org-hy:checked)  .sry-groups > li:not(.tutkimusorganisaatio-hy),
.sry-groups-wrap:has(#sry-org-uef:checked) .sry-groups > li:not(.tutkimusorganisaatio-uef),
.sry-groups-wrap:has(#sry-org-utu:checked) .sry-groups > li:not(.tutkimusorganisaatio-utu),
.sry-groups-wrap:has(#sry-org-muu:checked) .sry-groups > li:not(.tutkimusorganisaatio-muu) {
	display: none;
}

.sry-groups-wrap { counter-reset: sry-group; }
.sry-groups > li { counter-increment: sry-group; }

.sry-group-count {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	text-align: right;
	margin: 0 0 8px;
	padding-bottom: 22px;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

.sry-group-count::after {
	content: counter(sry-group) " tutkimusryhmää";
}

/* One row per group: logo rail, then organisation over the name. */
.sry-groups {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sry-groups > li {
	border-bottom: 1px solid rgb(26 25 23 / 12%);
	padding: 26px 0;
}

.sry-group-logo {
	flex: 0 0 74px;
	height: 74px;
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 6px;
	padding: 9px;
	overflow: hidden;
	margin: 0;
}

.sry-group-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sry-group-headings {
	flex: 1 1 240px;
	min-width: 0;
}

.sry-group-org {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.sry-group-name {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--wp--preset--color--ink);
}

.sry-group-desc {
	margin: 16px 0 0 98px;
	max-width: 44em;
}

.sry-group-desc p {
	margin: 0;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.72;
}

.sry-group-lead {
	margin: 12px 0 0 98px;
	max-width: 44em;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

@media (max-width: 600px) {
	.sry-group-desc,
	.sry-group-lead {
		margin-left: 0;
	}
}

/* ---------------------------------------------------------------
   Single event
   --------------------------------------------------------------- */

/*
 * The design's meta table has six fixed rows. The data does not: of 88 events
 * only 9 carry a location, 26 a website, 4 a participation note, and none an
 * organiser, a format or a registration link. Rendering the table as written
 * would print an empty label beside a blank value on most events.
 *
 * So every row hides itself when its bound value comes back empty. A binding
 * that resolves to nothing leaves the paragraph genuinely empty, which :empty
 * matches, and :has() lifts that to the row. No PHP conditional, and the rows
 * start appearing on their own as the client fills the fields in.
 */

.sry-ev-meta .sry-ev-row:has(.sry-ev-val:empty) {
	display: none;
}

/*
 * The two link rows need a different test, because a bound button fails in two
 * different ways. An empty `url` binding still renders href="" -- an attribute
 * that is present and points at the current page -- so :not([href]) never
 * matches it. An empty `text` binding makes core drop the <a> altogether,
 * leaving an empty wrapper with nothing to test. Asking for "no anchor with a
 * non-empty href" covers both.
 */
.sry-ev-row--link:not(:has(a[href]:not([href=""]))),
.sry-ev-cta:not(:has(a[href]:not([href=""]))) {
	display: none;
}

/*
 * core/breadcrumbs inserts the taxonomy term between the archive and the event,
 * so the trail reads Etusivu / Tapahtumat / Muu järjestäjä / <event>. The term
 * archive has no template of its own, so that step links into the parent
 * theme's generic layout. Matched on the href rather than on position, which
 * would break on any event filed without a type.
 */
.sry-crumbs li:has(a[href*="/tapahtuman-tyyppi/"]) {
	display: none;
}

.sry-ev-row {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	padding: 18px 0;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

.sry-ev-key {
	flex: 0 0 150px;
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.sry-ev-val {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 16px;
	color: var(--wp--preset--color--ink);
	overflow-wrap: anywhere;
}

/* The website row is a bound button so it renders a real anchor, not text. */
.sry-ev-linkwrap {
	flex: 1 1 auto;
	min-width: 0;
	gap: 0;
}

.sry-ev-weblink .wp-block-button__link {
	background: none;
	border: 0;
	padding: 0;
	font-size: 16px;
	color: var(--wp--preset--color--primary);
	overflow-wrap: anywhere;
	text-align: left;
}

.sry-ev-weblink .wp-block-button__link:hover {
	color: var(--wp--preset--color--primary-dark);
}

/* Registration CTA disappears when the event carries no signup URL. */
.sry-ev-cta:has(.wp-block-button__link:not([href])) {
	display: none;
}

/* Poster panel: the artwork is a flyer, so it is contained, never cropped. */
.sry-ev-poster {
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
	padding: 24px;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 300px;
}

.sry-ev-poster img {
	max-width: 100%;
	width: auto;
	height: auto;
	max-height: 460px;
	object-fit: contain;
}

/* Event type comes from the taxonomy, which is the one field all 88 events have. */
.sry-ev-type {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #2f4a3f;
	background: #e7ede8;
	border-radius: 999px;
	padding: 5px 12px;
}

.sry-ev-type a {
	color: inherit;
	text-decoration: none;
}

.sry-ev-format {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.sry-ev-badges:has(.sry-ev-format:empty) .sry-ev-format {
	display: none;
}

.sry-ev-lede {
	max-width: 34em;
}

.sry-ev-body p {
	font-size: 18px;
	line-height: 1.75;
}

.sry-ev-body h2 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 400;
	font-size: 30px;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 44px 0 20px;
}

.sry-crumbs {
	margin: 0 0 28px;
}

@media (max-width: 600px) {
	.sry-ev-row {
		flex-direction: column;
		gap: 6px;
	}

	.sry-ev-key {
		flex-basis: auto;
	}
}

/* ---------------------------------------------------------------
   Articles archive (shared by home.html and archive.html)
   --------------------------------------------------------------- */

/*
 * The design offers a card view and a list view. Both render the SAME Query
 * Loop: the toggle only restyles it. Rendering two loops would double the DOM,
 * duplicate every title and excerpt for search engines, and double the database
 * work on every request.
 *
 * Category chips are real links to category archives, not a client-side filter.
 * With pagination a CSS filter would only ever filter the current page, quietly
 * hiding matches that sit on page two.
 */

/*
 * The toggle now sits inside the bar, in .sry-arch-tools beside search. It
 * used to be a sibling ABOVE the bar, where its margin-left:auto and order:3
 * had no flex row to act on, so it rendered as its own row with 0px between it
 * and the category chips. Grouping search and toggle means space-between puts
 * the pair on the right on a wide screen, and when the bar wraps they drop to
 * their own row starting from the left rather than floating right on a phone.
 */
.sry-arch-view {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
}

.sry-arch-view input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.sry-arch-view label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 8px 12px;
	border-radius: 4px;
	border: 1px solid rgb(26 25 23 / 16%);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

.sry-arch-view input:checked + label {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.sry-arch-view input:focus-visible + label {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.sry-arch-bar {
	padding-bottom: 20px;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

/* Category chips. wp:categories emits current-cat on the active term, which is
   why these are a core block and not hand-written links. */
.sry-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.sry-cat-list li {
	margin: 0;
}

.sry-cat-list a,
.sry-cat-all {
	display: inline-block;
	font-size: 13.5px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid rgb(26 25 23 / 16%);
	color: var(--wp--preset--color--muted);
	transition: background 200ms, border-color 200ms, color 200ms;
}

.sry-cat-list a:hover,
.sry-cat-all:hover {
	border-color: rgb(180 66 61 / 50%);
	color: var(--wp--preset--color--primary);
}

.sry-cat-list .current-cat > a,
body.blog .sry-cat-all {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.sry-arch-search .wp-block-search__input {
	font-size: 13.5px;
	border: 1px solid rgb(26 25 23 / 16%);
	border-radius: 4px;
	padding: 9px 13px;
	min-width: 200px;
	background: var(--wp--preset--color--white);
}

.sry-arch-count {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin: 18px 0 44px;
}

/*
 * The 18px above never applied. Every result count is the first child of its
 * Query Loop, and WordPress zeroes margin-block-start on the first child of any
 * flow layout with `:root :where(.is-layout-flow) > :first-child`, which is
 * (0,2,0). So the counts on the archive, search and both events loops sat
 * directly on the hairline above them. Three classes here to win outright.
 */
.wp-block-query > .wp-block-query-total.sry-arch-count,
.wp-block-query > .wp-block-query-total.sry-cal-count {
	margin-block-start: 18px;
}

/* Search keeps its input wide enough to type into on a phone once the tools
   drop to their own row. */
@media (max-width: 599px) {
	.sry-arch-tools {
		width: 100%;
	}

	.sry-arch-tools > .sry-arch-search {
		flex: 1 1 200px;
	}

	.sry-arch-tools .wp-block-search__input {
		width: 100%;
		min-width: 0;
	}
}

/* --- card view, the default --- */

.sry-arch-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sry-arch-items > li {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 220ms, transform 220ms;
}

.sry-arch-items > li:hover,
.sry-arch-items > li:focus-within {
	box-shadow: 0 3px 14px rgb(26 25 23 / 6%);
	transform: translateY(-2px);
}

.sry-arch-media {
	margin: 0;
	background: var(--wp--preset--color--neutral);
}

.sry-arch-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sry-arch-meta,
.sry-arch-title,
.sry-arch-excerpt,
.sry-arch-more {
	padding-inline: 24px;
}

.sry-arch-meta {
	margin: 24px 0 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.sry-arch-date {
	color: var(--wp--preset--color--primary);
}

.sry-arch-cat,
.sry-arch-cat a {
	color: var(--wp--preset--color--muted);
}

.sry-arch-title {
	margin: 10px 0 0;
	font-size: 23px;
	line-height: 1.22;
	letter-spacing: -0.018em;
}

.sry-arch-excerpt {
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

.sry-arch-more {
	margin: auto 0 24px;
	padding-top: 14px;
	font-size: 14px;
	color: var(--wp--preset--color--primary);
}

/* --- list view --- */

/*
 * display:contents on the meta group lifts the date and the category out of
 * their wrapper so they can be placed in the outer grid: date left, category
 * right, title and excerpt between. Without it they would stay glued together
 * in one cell.
 */
.sry-arch:has(#sry-view-list:checked) .sry-arch-items {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	border-top: 1px solid rgb(26 25 23 / 12%);
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-items > li {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr) 160px;
	gap: 8px 40px;
	align-items: baseline;
	background: none;
	border: 0;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
	border-radius: 0;
	padding: 30px 0;
	transform: none;
	box-shadow: none;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-meta {
	display: contents;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-media,
.sry-arch:has(#sry-view-list:checked) .sry-arch-more {
	display: none;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-date {
	grid-column: 1;
	grid-row: 1;
	color: var(--wp--preset--color--muted);
	padding-inline: 0;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-title {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	font-size: 24px;
	padding-inline: 0;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-excerpt {
	grid-column: 2;
	grid-row: 2;
	margin: 0;
	font-size: 15.5px;
	max-width: 42em;
	padding-inline: 0;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-cat {
	grid-column: 3;
	grid-row: 1;
	text-align: right;
	padding-inline: 0;
}

.sry-arch:has(#sry-view-list:checked) .sry-arch-cat,
.sry-arch:has(#sry-view-list:checked) .sry-arch-cat a {
	color: var(--wp--preset--color--primary);
}

/* "& arkisto" is a second voice in the same heading, not a second heading. */
.sry-arch-sub {
	color: var(--wp--preset--color--muted);
}

.sry-arch-pager {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding-top: 44px;
	border-top: 1px solid rgb(26 25 23 / 12%);
}

@media (max-width: 781px) {
	.sry-arch:has(#sry-view-list:checked) .sry-arch-items > li {
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.sry-arch:has(#sry-view-list:checked) .sry-arch-title,
	.sry-arch:has(#sry-view-list:checked) .sry-arch-excerpt,
	.sry-arch:has(#sry-view-list:checked) .sry-arch-cat {
		grid-column: 1;
		grid-row: auto;
		text-align: left;
	}
}

/* ---------------------------------------------------------------
   Single article
   --------------------------------------------------------------- */

/*
 * The design's byline block -- avatar, author name, affiliation -- is not built.
 * Every imported post carries post_author = 0, so there is no author to render,
 * and the real bylines ("Tiina Suikki ja Niina Kaartinen") live in the article
 * body rather than in any field. Printing an empty avatar and a blank name on
 * all seven posts would be worse than leaving it out until authorship is
 * modelled. See the note in tasks.md.
 */

.sry-art-meta {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.sry-art-cat,
.sry-art-cat a {
	color: var(--wp--preset--color--primary);
	margin: 0;
}

.sry-art-date,
.sry-art-read {
	color: var(--wp--preset--color--muted);
	margin: 0;
}

/* Em dashes between the three meta items, without putting them in the markup
   where a screen reader would read them out. */
.sry-art-meta > * + *::before {
	content: "—";
	color: rgb(26 25 23 / 28%);
	margin-right: 14px;
}

.sry-art-lede {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 22px;
	line-height: 1.5;
	color: #3a3630;
	margin: 0 0 32px;
}

.sry-art-hero {
	background: var(--wp--preset--color--neutral);
	overflow: hidden;
}

.sry-art-hero img {
	width: 100%;
	height: clamp(280px, 38vw, 480px);
	object-fit: cover;
	filter: saturate(0.9);
}

.sry-art-body p {
	font-size: 18px;
	line-height: 1.75;
	color: #2b2925;
}

.sry-art-body h2 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 400;
	font-size: 30px;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 44px 0 18px;
}

.sry-art-body figure {
	margin: 40px 0;
}

.sry-art-body figcaption {
	font-size: 14px;
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
	margin-top: 12px;
}

/* Imported charts are flat PNGs that vanish against the warm background. */
.sry-art-body figure img {
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
}

.sry-art-body blockquote {
	margin: 40px 0;
	padding: 0 0 0 28px;
	border-left: 2px solid var(--wp--preset--color--primary);
}

.sry-art-body blockquote p {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 24px;
	line-height: 1.45;
	letter-spacing: -0.015em;
	color: var(--wp--preset--color--ink);
}

.sry-art-nav a {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.sry-art-nav a:hover {
	color: var(--wp--preset--color--primary);
}

/* --- related strip --- */

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

.sry-related > li {
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
	padding: 28px;
	transition: box-shadow 220ms, transform 220ms;
}

.sry-related > li:hover,
.sry-related > li:focus-within {
	box-shadow: 0 3px 14px rgb(26 25 23 / 6%);
	transform: translateY(-2px);
}

.sry-rel-meta {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.sry-rel-date,
.sry-rel-cat,
.sry-rel-cat a {
	margin: 0;
	color: var(--wp--preset--color--primary);
}

.sry-rel-meta > * + *::before {
	content: "·";
	margin-right: 8px;
}

.sry-rel-title {
	margin: 0;
	font-size: 21px;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.sry-rel-excerpt {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

@media (prefers-reduced-motion: reduce) {
	.sry-related > li,
	.sry-related > li:hover {
		transition: none;
		transform: none;
	}
}

/*
 * Imported bodies carry bare reference URLs, e.g.
 * https://foodandnutritionresearch.net/index.php/... which is one unbreakable
 * 568px token. At 375px that alone pushed the whole document into horizontal
 * scroll. The articles come from the old site, so this recurs across the ~117
 * still to be imported; it belongs on the body wrapper, not on one post.
 */
.sry-art-body a,
.sry-ev-body a,
.sry-art-body p,
.sry-ev-body p {
	overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------
   Events archive
   --------------------------------------------------------------- */

/*
 * Two server-rendered Query Loops, upcoming and past, switched by radios.
 *
 * The "SRY:n tapahtumat" and "Kansainväliset" chips filter the UPCOMING list in
 * CSS. That is safe only because there are five upcoming events and that loop is
 * not paginated. The past loop is 83 events across pages, so it stays a separate
 * server query -- a CSS filter there would silently filter one page.
 *
 * This does not settle Phase 0.1. The date picker is the part that genuinely
 * cannot be server-rendered without a page load, and that is the decision still
 * outstanding. Everything else here needs no JavaScript.
 */

/*
 * .sry-cal is a constrained group, so WordPress gives its children
 * `margin-inline: auto` with a max-width. Making it `display: flex` collapsed
 * every panel to content width, because auto margins on a flex item size it to
 * its content instead of stretching. The column ordering that needs flex is
 * applied to .sry-cal-upcoming instead, which is a flow group and carries no
 * auto margins of its own.
 */

.sry-cal-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 20px;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

.sry-cal-filter,
.sry-cal-layout {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	border: 0;
}

.sry-cal-layout input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Radio nested in its label and stretched over the chip, for the same reason
   as the research group filter: focus then scrolls the whole chip into view in
   the sideways row on a phone. */
.sry-cal-filter input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.sry-cal-filter label {
	position: relative;
	font-size: 13.5px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid rgb(26 25 23 / 16%);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	transition: background 200ms, border-color 200ms, color 200ms;
}

.sry-cal-layout label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 7px 12px;
	border-radius: 4px;
	border: 1px solid rgb(26 25 23 / 16%);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

.sry-cal-filter label:has(input:checked),
.sry-cal-layout input:checked + label {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.sry-cal-filter label:has(input:focus-visible),
.sry-cal-layout input:focus-visible + label {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

/* Which panel, and which items inside it. */
.sry-cal:has(#cal-menneet:checked) .sry-cal-upcoming,
.sry-cal:not(:has(#cal-menneet:checked)) .sry-cal-past {
	display: none;
}

.sry-cal:has(#cal-sry:checked) .sry-cal-upcoming .sry-cal-items > li:not(.tapahtuman-tyyppi-sry),
.sry-cal:has(#cal-kv:checked) .sry-cal-upcoming .sry-cal-items > li:not(.tapahtuman-tyyppi-kansainvalinen) {
	display: none;
}

/*
 * Both counts are core/query-total, i.e. server-rendered from the query that
 * produced the list.
 *
 * A CSS counter over the visible items was tried first, so the count could
 * follow the SRY / Kansainvaliset chips, which filter in CSS. It resolved to 0
 * here although the identical pattern works on Ravitsemustiede; the difference
 * is that this post-template is a grid. Rather than ship a number that is
 * silently wrong, the count is the query total and it is hidden while a type
 * chip is active, because in that state the loop total no longer describes what
 * is on screen. Tulevat and Menneet, the two states backed by a real query,
 * both report correctly.
 */
.sry-cal:has(#cal-sry:checked) .sry-cal-count--upcoming,
.sry-cal:has(#cal-kv:checked) .sry-cal-count--upcoming {
	display: none;
}

.sry-cal-count {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin: 18px 0 44px;
}

/* --- card view --- */

.sry-cal-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sry-cal-items > li {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--white);
	border: 1px solid rgb(26 25 23 / 10%);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 220ms, transform 220ms;
}

.sry-cal-items > li:hover,
.sry-cal-items > li:focus-within {
	box-shadow: 0 3px 14px rgb(26 25 23 / 6%);
	transform: translateY(-2px);
}

/*
 * Event artwork is a mix of photographs and flyer/logo images, so it is
 * contained on a tile rather than cropped. A cropped logo loses its wordmark.
 */
.sry-cal-media {
	margin: 0;
	height: 188px;
	background: #faf9f7;
	padding: 18px;
	overflow: hidden;
}

.sry-cal-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sry-cal-badges,
.sry-cal-title,
.sry-cal-loc,
.sry-cal-more {
	padding-inline: 22px;
}

.sry-cal-badges {
	margin: 22px 0 0;
}

.sry-cal-date {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.sry-cal-type,
.sry-cal-past-badge {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 4px 10px;
}

.sry-cal-type,
.sry-cal-type a {
	color: #2f4a3f;
	background: #e7ede8;
	text-decoration: none;
}

.sry-cal-past-badge {
	color: var(--wp--preset--color--muted);
	border: 1px solid rgb(26 25 23 / 16%);
}

.sry-cal-title {
	margin: 10px 0 0;
	font-size: 23px;
	line-height: 1.22;
	letter-spacing: -0.018em;
}

.sry-cal-loc {
	margin: 10px 0 0;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
}

.sry-cal-loc:empty {
	display: none;
}

.sry-cal-more {
	margin: auto 0 22px;
	padding-top: 14px;
	font-size: 14px;
	color: var(--wp--preset--color--primary);
}

/* --- list view --- */

.sry-cal:has(#cal-list:checked) .sry-cal-items {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	border-top: 1px solid rgb(26 25 23 / 12%);
}

.sry-cal:has(#cal-list:checked) .sry-cal-items > li {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr) 170px;
	gap: 8px 32px;
	align-items: baseline;
	background: none;
	border: 0;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
	border-radius: 0;
	padding: 26px 0;
	transform: none;
	box-shadow: none;
}

.sry-cal:has(#cal-list:checked) .sry-cal-badges {
	display: contents;
}

.sry-cal:has(#cal-list:checked) .sry-cal-media {
	display: none;
}

.sry-cal:has(#cal-list:checked) .sry-cal-date {
	grid-column: 1;
	grid-row: 1;
	padding-inline: 0;
}

.sry-cal:has(#cal-list:checked) .sry-cal-title {
	grid-column: 2;
	grid-row: 1;
	margin: 0;
	font-size: 24px;
	padding-inline: 0;
}

.sry-cal:has(#cal-list:checked) .sry-cal-loc {
	grid-column: 2;
	grid-row: 2;
	margin: 0;
	padding-inline: 0;
}

.sry-cal:has(#cal-list:checked) .sry-cal-type,
.sry-cal:has(#cal-list:checked) .sry-cal-past-badge {
	grid-column: 3;
	justify-self: end;
}

.sry-cal:has(#cal-list:checked) .sry-cal-type { grid-row: 1; }
.sry-cal:has(#cal-list:checked) .sry-cal-past-badge { grid-row: 2; }

.sry-cal:has(#cal-list:checked) .sry-cal-more {
	grid-column: 3;
	grid-row: 3;
	justify-self: end;
	margin: 0;
	padding: 0;
}

.sry-cal-pager {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding-top: 44px;
	border-top: 1px solid rgb(26 25 23 / 12%);
}

@media (max-width: 781px) {
	.sry-cal:has(#cal-list:checked) .sry-cal-items > li {
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.sry-cal:has(#cal-list:checked) .sry-cal-title,
	.sry-cal:has(#cal-list:checked) .sry-cal-loc,
	.sry-cal:has(#cal-list:checked) .sry-cal-type,
	.sry-cal:has(#cal-list:checked) .sry-cal-past-badge,
	.sry-cal:has(#cal-list:checked) .sry-cal-more {
		grid-column: 1;
		grid-row: auto;
		justify-self: start;
	}
}

/* ---------------------------------------------------------------
   Fallback, search and 404
   --------------------------------------------------------------- */

/*
 * index.html is the fallback nothing should reach: home, archive, single,
 * page, search, 404 and the two tapahtuma templates cover every route. It
 * exists because a child theme without one inherits the PARENT's index.html,
 * so any fallthrough rendered Twenty Twenty-Five's layout with our header and
 * footer around it -- which looks close enough to finished to go unnoticed.
 *
 * wp:query-title renders nothing at all outside an archive context, so on a
 * fallthrough the hero would be an empty band holding its own padding. Collapse
 * it rather than reserve space for a title that is not coming.
 */
.sry-idx-head:not(:has(h1)) {
	display: none;
}

/*
 * The search term cannot be styled apart from the rest of the heading. Core
 * builds it with sprintf( __( 'Search results for: "%s"' ), ... ) and emits no
 * wrapper element around the term, so there is nothing to select. Leaving the
 * heading in one voice is the honest outcome; the alternative is JavaScript
 * that re-parses a translated string.
 */

/* Query Total still counts on an empty result set, and "0 tulosta löytyi"
   directly above a card that says the same thing reads as a glitch. */
.sry-srch .sry-arch-query:has(.sry-srch-empty) .sry-arch-count {
	display: none;
}

/*
 * Search reuses every .sry-arch-* card rule, so the results look identical to
 * the archive. What it does NOT reuse is the category chip row: those are real
 * links to category archives and would silently drop the search term.
 */
.sry-srch .sry-arch-view {
	justify-content: flex-end;
	margin: 0;
	padding-bottom: 20px;
	border-bottom: 1px solid rgb(26 25 23 / 12%);
}

.sry-srch-form .wp-block-search__inside-wrapper {
	gap: 8px;
}

.sry-srch-form .wp-block-search__input {
	font-size: 14.5px;
	border: 1px solid rgb(26 25 23 / 16%);
	border-radius: 4px;
	padding: 11px 14px;
	background: var(--wp--preset--color--white);
}

.sry-srch-form .wp-block-search__button {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 11px 20px;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	cursor: pointer;
	transition: background 200ms;
}

.sry-srch-form .wp-block-search__button:hover {
	background: var(--wp--preset--color--primary-dark);
}

/* 404 destination cards. The whole card is the hit area; the heading link is
   what carries it, so the arrow belongs to the heading. */
.sry-404-card h2 {
	line-height: 1.25;
}

.sry-404-card h2 a {
	color: inherit;
	text-decoration: none;
}

.sry-404-card h2 a::after {
	content: " \2192";
	color: var(--wp--preset--color--primary);
}

.sry-404-card:hover h2 a,
.sry-404-card:focus-within h2 a {
	color: var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------
   Filter bars on small screens
   --------------------------------------------------------------- */

/*
 * Every chip filter on the site -- article categories, event types and the
 * research group organisations -- wrapped to three or four rows on a phone.
 * Measured at 375px, a visitor scrolled past 360px of controls before the first
 * article, 246px before the first event and 203px before the first group.
 *
 * Below 782px each filter is a single row that scrolls sideways, the pattern
 * people already know from app stores and news sites, and below 600px the view
 * toggle becomes two icon buttons beside search.
 */

/* Registered so the edge fades can interpolate inside the scroll-driven
   animation below; an unregistered custom property only flips at 50%. */
@property --sry-fade-start {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px;
}

@property --sry-fade-end {
	syntax: "<length>";
	inherits: false;
	initial-value: 32px;
}

@keyframes sry-chip-edges {
	0% {
		--sry-fade-start: 0px;
		--sry-fade-end: 32px;
	}
	8% {
		--sry-fade-start: 24px;
	}
	92% {
		--sry-fade-end: 32px;
	}
	100% {
		--sry-fade-start: 24px;
		--sry-fade-end: 0px;
	}
}

@media (max-width: 781px) {
	/*
	 * The scrolling row. Three details are load-bearing:
	 *  - min-width:0, because a fieldset defaults to min-inline-size:min-content
	 *    and would refuse to shrink below its chips, so it would never scroll;
	 *  - position:relative, so the visually hidden radios are positioned inside
	 *    the row and scroll with their labels instead of pinning to the page;
	 *  - the 6px negative margin paid back as padding, so focus outlines are
	 *    not clipped by overflow while the chips still line up with the text.
	 * The 32px end padding lets the last chip scroll clear of the fade.
	 */
	.wp-block-group.sry-arch-cats,
	.sry-cal-bar > .sry-cal-filter,
	.sry-groups-wrap > fieldset.sry-group-filter {
		--sry-fade-start: 0px;
		--sry-fade-end: 32px;
		position: relative;
		flex-wrap: nowrap;
		min-width: 0;
		margin: -6px;
		padding: 6px 32px 6px 6px;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--sry-fade-start), #000 calc(100% - var(--sry-fade-end)), transparent 100%);
		mask-image: linear-gradient(to right, transparent 0, #000 var(--sry-fade-start), #000 calc(100% - var(--sry-fade-end)), transparent 100%);
	}

	.wp-block-group.sry-arch-cats::-webkit-scrollbar,
	.sry-cal-bar > .sry-cal-filter::-webkit-scrollbar,
	.sry-groups-wrap > fieldset.sry-group-filter::-webkit-scrollbar {
		display: none;
	}

	/* The categories block is a list inside the row: it must not wrap either,
	   and neither may a chip's own label. */
	.sry-arch-cats .sry-cat-list {
		flex-wrap: nowrap;
		flex: 0 0 auto;
	}

	.sry-arch-cats .sry-cat-all,
	.sry-cat-list a,
	.sry-cal-filter label,
	.sry-group-filter label {
		flex: 0 0 auto;
		white-space: nowrap;
	}

	/*
	 * Keyboard access relies on the radios being nested inside their labels
	 * and stretched over them (see the base filter rules). While they were
	 * siblings, a radio absolutely positioned inside a flex row took its static
	 * position at the START of the row, so arrowing to the last filter scrolled
	 * to x=0 and left the selected chip off screen.
	 */

	/* Archive: the chip row takes the whole bar, search and toggle wrap below. */
	.wp-block-group.sry-arch-cats {
		flex: 1 1 100%;
		scroll-padding-inline: 6px;
	}

	/* On a category page the active chip can sit off the right edge. Start the
	   row scrolled to it where supported; elsewhere it simply starts at 0. Kept
	   inside this query on purpose: above 781px the row is not a scroll
	   container, and the nearest one would be the page itself. */
	.sry-cat-list .current-cat {
		scroll-initial-target: nearest;
		scroll-snap-align: start;
	}

	/* Events: chips and the view toggle share one row. */
	.sry-cal-bar {
		flex-wrap: nowrap;
		gap: 12px;
	}

	.sry-cal-bar > .sry-cal-filter {
		flex: 1 1 auto;
	}

	.sry-cal-bar > .sry-cal-layout {
		flex: 0 0 auto;
		flex-wrap: nowrap;
	}

	/* Research groups: the fieldset's 22px bottom padding became part of the
	   scroll area, so the space below it moves to a margin. */
	.sry-groups-wrap > fieldset.sry-group-filter {
		margin-bottom: 14px;
	}

	/* Halve the dead band between the page intro and the filters: the theme's
	   56px block gap on top of the hero's own 56px of bottom padding. */
	main .wp-block-template-part:has(> .sry-arch),
	main > .wp-block-group.sry-cal,
	main > .wp-block-group.sry-srch {
		margin-block-start: 0;
	}
}

@supports (animation-timeline: scroll()) {
	@media (max-width: 781px) {
		/* The fades follow the scroll position: no left fade at the start, no
		   right fade at the end. Without support the right fade simply stays,
		   which is the correct cue on a row that has more to the right. */
		.wp-block-group.sry-arch-cats,
		.sry-cal-bar > .sry-cal-filter,
		.sry-groups-wrap > fieldset.sry-group-filter {
			animation: sry-chip-edges linear both;
			animation-timeline: scroll(self inline);
		}
	}
}

@media (max-width: 599px) {
	/* Search and the view toggle on one row. */
	.wp-block-group.sry-arch-tools {
		flex-wrap: nowrap;
		gap: 8px;
		width: 100%;
	}

	.sry-arch-tools > .sry-arch-search {
		flex: 1 1 auto;
		min-width: 0;
	}

	.sry-arch-tools .wp-block-search__input {
		min-height: 42px;
		padding-left: 38px;
		background: var(--wp--preset--color--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6862' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20 20'/%3E%3C/svg%3E") no-repeat 12px 50% / 17px 17px;
	}

	/*
	 * Kortit / Lista as icon buttons. font-size:0 hides the word visually but
	 * leaves it as the label's text, so it is still each radio's accessible
	 * name; the icon is a mask filled with currentColor, so it follows the
	 * checked and unchecked colours with no extra rules.
	 */
	.sry-arch-view label,
	.sry-cal-layout label {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 42px;
		height: 42px;
		padding: 0;
		font-size: 0;
		letter-spacing: 0;
	}

	.sry-arch-view label::before,
	.sry-cal-layout label::before {
		content: "";
		width: 18px;
		height: 18px;
		background-color: currentColor;
		-webkit-mask: var(--sry-view-icon) center / contain no-repeat;
		mask: var(--sry-view-icon) center / contain no-repeat;
	}

	label[for="sry-view-cards"],
	label[for="cal-cards"] {
		--sry-view-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7'%3E%3Crect x='4' y='4' width='6.5' height='6.5' rx='1.2'/%3E%3Crect x='13.5' y='4' width='6.5' height='6.5' rx='1.2'/%3E%3Crect x='4' y='13.5' width='6.5' height='6.5' rx='1.2'/%3E%3Crect x='13.5' y='13.5' width='6.5' height='6.5' rx='1.2'/%3E%3C/svg%3E");
	}

	label[for="sry-view-list"],
	label[for="cal-list"] {
		--sry-view-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M9.5 6.5h10.5M9.5 12h10.5M9.5 17.5h10.5'/%3E%3Ccircle cx='5' cy='6.5' r='1.2' fill='%23000' stroke='none'/%3E%3Ccircle cx='5' cy='12' r='1.2' fill='%23000' stroke='none'/%3E%3Ccircle cx='5' cy='17.5' r='1.2' fill='%23000' stroke='none'/%3E%3C/svg%3E");
	}

	/*
	 * Events: sharing a row with the toggle left the chips ~190px, so the third
	 * chip began inside the fade and nothing showed that two more filters
	 * existed. On a phone the chips take the full width and the toggle drops to
	 * its own line on the right, where the archive puts it too.
	 */
	.sry-cal-bar {
		flex-wrap: wrap;
		row-gap: 10px;
	}

	.sry-cal-bar > .sry-cal-filter {
		flex: 1 1 100%;
	}

	.sry-cal-bar > .sry-cal-layout {
		margin-left: auto;
	}

	/* Tighter rhythm between the controls, the count and the first result. */
	.sry-arch-bar,
	.sry-cal-bar {
		padding-bottom: 16px;
	}

	.wp-block-query > .wp-block-query-total.sry-arch-count,
	.wp-block-query > .wp-block-query-total.sry-cal-count {
		margin-block-start: 14px;
		margin-block-end: 24px;
	}
}

/* ---------------------------------------------------------------
   Client feedback, round 1 (2026-10-20)
   --------------------------------------------------------------- */

/* Research group card: the lead researchers line is now the last paragraph of
   the group's own content (so names can be linked), not a bound meta field.
   Same look as before; the old rule set margin-left 98px, which the parent
   .sry-group-desc already applies. Two classes beat .sry-group-desc p. */
.sry-group-desc .sry-group-lead {
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

/* The restored links sit in running prose, where the site-wide ink link style
   is indistinguishable from the text. Same treatment as .sry-doclink, which
   the study links at the top of the same page already use. */
.sry-group-desc a {
	color: var(--wp--preset--color--primary);
	border-bottom: 1px solid rgb(180 66 61 / 35%);
}

.sry-group-desc a:hover,
.sry-group-desc a:focus-visible {
	border-bottom-color: var(--wp--preset--color--primary);
}

/* Page banner (pattern sry/page-banner): a Cover block under the page header.
   21:9 comes from the block's aspect ratio setting; phones get 4:3 so people
   in the photo are not cropped to a strip. !important because the block
   writes its ratio as an inline style. */
.wp-block-cover.sry-page-banner {
	overflow: hidden;
}

@media (max-width: 600px) {
	.wp-block-cover.sry-page-banner {
		aspect-ratio: 4 / 3 !important;
	}
}

/* Password-protected page (Jäsenille): the form under the public header.
   Same side padding as the page sections so it lines up with the H1. */
.sry-password-form {
	box-sizing: border-box; /* like the groups: max-width includes the padding */
	padding: clamp(32px, 4vw, 48px) clamp(20px, 3vw, 48px) clamp(64px, 7vw, 96px);
}

.sry-password-form .post-password-form {
	max-width: 560px;
	padding: 28px;
	background: var(--wp--preset--color--white);
	border: 1px solid #efede8;
	border-radius: 8px;
}

.sry-password-form .post-password-form p {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

.sry-password-form .post-password-form p:last-child {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin: 0;
}

.sry-password-form .post-password-form label {
	display: flex;
	flex: 1 1 220px;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	color: var(--wp--preset--color--ink);
}

.sry-password-form .post-password-form input[type="password"] {
	font: inherit;
	font-size: 16px;
	padding: 11px 14px;
	border: 1px solid #d9d5cd;
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
}

/* Core's form markup runs through wpautop, which leaves an empty <p> after
   the hidden redirect field. The submit button already carries the theme's
   button classes (wp-element-button), so it needs no styling here. */
.sry-password-form .post-password-form p:empty {
	display: none;
}

.sry-password-form .post-password-form input:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Client feedback, round 2 (2026-10-26)
   --------------------------------------------------------------- */

/* Strategia: each arrow heading (.sry-aim) sat 0px under the previous aim's
   list, so it read as part of that list. Space on the list, not the heading:
   the headings carry an inline margin-top:0 from the editor, and this needs no
   !important and does not override anything set on a heading. */
.sry-actions:has(+ .sry-aim) {
	margin-bottom: 32px;
}

/* Research groups: "Lue lisää" (mu-plugins/sry-core/assets/group-readmore.js).
   Without the script nothing collapses. The visible height comes from the
   script (four lines of the text's own line height). */
.sry-group-desc.is-collapsed {
	max-height: var(--sry-readmore-height, 7em);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
	mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.sry-readmore {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0 98px;
	padding: 4px 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 15px;
	color: var(--wp--preset--color--primary);
	cursor: pointer;
}

.sry-readmore::after {
	content: "";
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 200ms ease;
}

.sry-readmore[aria-expanded="true"]::after {
	transform: translateY(2px) rotate(-135deg);
}

.sry-readmore:hover,
.sry-readmore:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sry-readmore:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.sry-readmore {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sry-readmore::after {
		transition: none;
	}
}

@media print {
	.sry-group-desc.is-collapsed {
		max-height: none;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.sry-readmore {
		display: none;
	}
}

/* ---------------------------------------------------------------
   Toiminta → Nuoret ravitsemustieteilijät: previous events
   --------------------------------------------------------------- */

/* A core/details block: closed by default, opens on click, works without
   JavaScript. The summary reads like the Lue lisää toggle above. */
.sry-past-events > summary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	color: var(--wp--preset--color--primary);
	cursor: pointer;
	list-style: none;
}

.sry-past-events > summary::-webkit-details-marker {
	display: none;
}

.sry-past-events > summary::after {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 200ms ease;
}

.sry-past-events[open] > summary::after {
	transform: translateY(2px) rotate(-135deg);
}

.sry-past-events > summary:hover,
.sry-past-events > summary:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sry-past-events > ul {
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.sry-past-events > ul > li {
	padding: 12px 0;
	border-top: 1px solid #EFEDE8;
	line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
	.sry-past-events > summary::after {
		transition: none;
	}
}
