/* Everything but the home page loads this file (functions.php), so the home page's CSS stays within budget (K-04). */

/*
 * The slim bar above the header on phones and small tablets, which have no room for the main
 * button beside the logo: the congress dates and the button's link on paper. Not on the home
 * page, whose slider offers the button (inc/section-nav.php), nor while there is no button (it is
 * left out on the page it leads to), nor from 782px, where the header's button shows.
 */
.savtek-topbar {
	background: var(--wp--preset--color--paper);
	border-bottom: 1px solid var(--wp--custom--border-color);
	font-size: 0.8125rem;
}

.savtek-topbar .savtek-topbar__row {
	gap: 1rem;
}

.savtek-topbar__row > * {
	margin: 0;
}

.savtek-topbar__dates {
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
}

.savtek-topbar .savtek-topbar__cta {
	margin-inline-start: auto;
}

.savtek-topbar__cta .wp-element-button {
	color: var(--wp--preset--color--accent);
	font-size: inherit;
	min-height: 2.75rem;
	text-decoration: none;
}

.savtek-topbar__cta .wp-element-button:hover {
	color: var(--wp--preset--color--contrast);
}

.savtek-topbar:not(:has(.wp-block-button)) {
	display: none;
}

@media (min-width: 782px) {

	.savtek-topbar {
		display: none;
	}
}

/*
 * The title band (A3): paper under the dotted grid. A featured image (a Cover block using it) is a
 * panel with a slanted left edge from 782px and a strip across the top below; the text never runs
 * over it. Without one the section's silhouette (inc/decor.php) stands faintly at the right.
 */
.savtek-page-hero {
	background: var(--savtek-dots), var(--wp--preset--color--paper);
	border-bottom: 1px solid var(--wp--custom--border-color);
	color: var(--wp--preset--color--contrast);
	isolation: isolate;
	overflow: hidden;
	padding-block: clamp(2.25rem, 4.5vw, 4rem) clamp(2.5rem, 5vw, 4rem);
	position: relative;
}

.wp-block-cover.savtek-page-hero {
	align-items: flex-end;
	min-height: 0;
	padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
}

/* Core's paper overlay would hide the dots: it stays only as the ground the photo panel is cut from. */
.wp-block-cover.savtek-page-hero > .wp-block-cover__background {
	opacity: 0 !important;
}

/* The photo panel: above the overlay (core gives the image z-index 0), below the text. */
.wp-block-cover.savtek-page-hero > .wp-block-cover__image-background {
	z-index: 2;
}

.wp-block-cover.savtek-page-hero > .wp-block-cover__inner-container {
	color: inherit;
	z-index: 3;
}

/* The section's silhouette (inc/decor.php): hidden on phones, where the band is all text. */
.savtek-page-hero > .savtek-decor {
	display: none;
}

.wp-block-group.savtek-page-hero > :not(.savtek-decor) {
	position: relative;
	z-index: 3;
}

@media (min-width: 782px) {

	.wp-block-cover.savtek-page-hero > .wp-block-cover__image-background {
		clip-path: var(--savtek-slant);
		inset: 0 0 0 auto;
		width: 46%;
	}

	.wp-block-cover.savtek-page-hero:has(> .wp-block-cover__image-background) {
		min-height: clamp(15rem, 10rem + 14vw, 24rem);
	}

	.savtek-page-hero > .savtek-decor {
		bottom: -6%;
		display: block;
		height: auto;
		inset-inline-end: 2%;
		opacity: 0.6;
		pointer-events: none;
		position: absolute;
		width: min(42%, 34rem);
		z-index: 1;
	}

	/* Each about as heavy as the helicopter. */
	.savtek-page-hero > .savtek-decor--ship {
		bottom: 8%;
		width: min(40%, 32rem);
	}

	.savtek-page-hero > .savtek-decor--tank-small {
		bottom: 0;
		width: min(30%, 24rem);
	}

	/* The text keeps to the left of the panel (padding, since core centers the wide group with !important margins). */
	.wp-block-cover.savtek-page-hero:has(> .wp-block-cover__image-background) > .wp-block-cover__inner-container > .alignwide {
		box-sizing: border-box;
		padding-inline-end: calc(46% + 2rem);
	}
}

@media (max-width: 781px) {

	.wp-block-cover.savtek-page-hero > .wp-block-cover__image-background {
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0 86%);
		height: 11rem;
		inset: 0 0 auto;
	}

	.wp-block-cover.savtek-page-hero:has(> .wp-block-cover__image-background) {
		padding-block-start: calc(11rem + 1.25rem);
	}
}

.savtek-page-hero .wp-block-breadcrumbs {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
}

.savtek-page-hero .wp-block-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.savtek-page-hero .wp-block-breadcrumbs a:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}

.savtek-page-hero .savtek-page-hero__label {
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.3;
	margin-block: clamp(1.75rem, 3vw, 2.5rem) 0;
	text-transform: uppercase;
}

/* The title is the H1 preset; after the breadcrumbs it keeps the label's distance. */
.savtek-page-hero :is(.wp-block-post-title, .wp-block-query-title, h1) {
	color: inherit;
	margin-block-start: clamp(1.75rem, 3vw, 2.5rem);
	max-width: 24ch;
}

/* An announcement's title is a sentence, often long: a smaller size on a wider measure. */
.single .savtek-page-hero .wp-block-post-title {
	font-size: min(clamp(2rem, 1.4rem + 2.2vw, 3.25rem), var(--savtek-fit-cap, 100vw));
	line-height: 1.1;
	max-width: 30ch;
}

.savtek-page-hero :is(.savtek-page-hero__label, .savtek-eyebrow) + :is(.wp-block-post-title, .wp-block-query-title, h1),
.savtek-page-hero :is(.wp-block-post-title, .wp-block-query-title, h1):first-child {
	margin-block-start: 0.5rem;
}

.savtek-page-hero .savtek-page-hero__lead {
	color: var(--wp--preset--color--muted);
	font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
	line-height: 1.55;
	margin-block-start: 1.1rem;
	max-width: 42rem;
}

.savtek-page-hero .savtek-lead {
	color: var(--wp--preset--color--muted);
	max-width: 40rem;
}

.savtek-page-hero .wp-block-post-date {
	color: var(--wp--preset--color--accent);
	font-weight: 600;
	margin-block-start: var(--wp--preset--spacing--30);
}

.savtek-update-line {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin-block: 0.5rem 0;
}

/* A search on the title band (search results, 404): its button in the edition color. */
.savtek-page-hero .wp-block-search__button {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.savtek-page-hero .wp-block-search__button:hover {
	background: var(--wp--custom--accent-hover);
}

/*
 * On phones the current page leaves the row and stays for screen readers: the title right below
 * says it in full, where the row would have to cut it short.
 */
@media (max-width: 599px) {

	.savtek-page-hero .wp-block-breadcrumbs li:nth-last-child(2)::after {
		content: none;
	}

	/* What is left is the way back. */
	.savtek-page-hero .wp-block-breadcrumbs li:nth-last-child(2) a::before {
		content: "← ";
		content: "← " / "";
	}

	.savtek-page-hero .wp-block-breadcrumbs li:last-child:not(:first-child) {
		clip-path: inset(50%);
		height: 1px;
		overflow: hidden;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}
}

.wp-site-blocks > main > .savtek-page-hero:first-child,
.wp-site-blocks > main > .wp-block-cover.savtek-page-hero:first-child {
	margin-block-start: 0;
}

/*
 * A page's text and its rail: side by side from 1100px, the rail sticking below the header (and
 * scrolling itself when it is taller than the window); below that the rail follows the text, its
 * two boxes side by side where they fit.
 */
.savtek-page-layout {
	display: grid;
	gap: clamp(2rem, 3.5vw, 3.5rem);
	grid-template-columns: minmax(0, 1fr);
}

.savtek-page-layout > * {
	margin-block: 0;
}

.savtek-page-layout .wp-block-post-content > .alignfull {
	margin-inline: 0;
	max-width: none;
}

.savtek-rail {
	align-content: start;
	align-items: start;
	container: savtek-rail / inline-size;
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.savtek-rail > * {
	margin: 0;
}

@media (min-width: 1100px) {

	.savtek-page-layout {
		grid-template-columns: minmax(0, 1fr) 17rem;
	}

	.savtek-rail {
		align-self: start;
		grid-template-columns: minmax(0, 1fr);
		max-height: calc(100vh - var(--savtek-header-height) - 2.5rem - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
		overscroll-behavior: contain;
		position: sticky;
		scrollbar-width: thin;
		top: calc(var(--savtek-header-height) + 1.5rem + var(--wp-admin--admin-bar--height, 0px));
	}
}

/* The rail's cards, one family. */
:is(.savtek-rail__nav, .savtek-rail__news, .savtek-side__card, .savtek-rail__facts) {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--custom--border-color);
	border-radius: var(--wp--custom--radius);
	border-top: 3px solid var(--wp--custom--border-strong);
	padding: 1.1rem 0.85rem;
}

.savtek-rail__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* A card's title is a small label, like the band's. */
:is(.savtek-rail, .savtek-side) :is(.savtek-rail__title, .savtek-404__title) {
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.3;
	margin: 0 0.5rem 0.6rem;
	text-transform: uppercase;
}

.savtek-rail__nav a {
	border-radius: var(--wp--custom--radius-sm);
	color: var(--wp--preset--color--contrast);
	display: block;
	font-size: 0.9375rem;
	line-height: 1.35;
	padding: 0.5rem;
	text-decoration: none;
}

.savtek-rail__nav a:hover {
	background: var(--wp--preset--color--paper);
}

.savtek-rail__nav a[aria-current="page"] {
	background: var(--wp--custom--accent-tint);
	box-shadow: inset 3px 0 0 var(--wp--preset--color--accent);
	font-weight: 600;
}

/* Beside an announcement, the newest others; no card while there is none. */
.savtek-rail__news:not(:has(.wp-block-post)) {
	display: none;
}

.savtek-rail__news .wp-block-post {
	border-top: 1px solid var(--wp--custom--border-color);
	margin: 0;
	padding: 0.7rem 0.5rem;
}

.savtek-rail__news .wp-block-post:first-child {
	border-top: 0;
	padding-top: 0.15rem;
}

.savtek-rail__news .wp-block-post-title {
	font-size: 0.9375rem;
	line-height: 1.4;
	margin: 0;
}

.savtek-rail__news .wp-block-post-date {
	font-size: 0.8125rem;
	margin-top: 0.2rem;
}

.savtek-rail__nav .savtek-rail__toc {
	border-left: 1px solid var(--wp--custom--border-color);
	margin: 0.25rem 0 0.5rem 0.75rem;
	padding-left: 0.5rem;
}

.savtek-rail__toc a {
	color: var(--wp--preset--color--muted);
	padding-block: 0.35rem;
}

/* The facts card: the countdown, the dates and the venue, and the main button, under an edition-color rule. */
.savtek-rail__facts {
	border-top-color: var(--wp--custom--accent-raw);
	overflow: hidden;
	padding: 1.4rem 1.25rem 1.25rem;
}

.savtek-rail__facts:not(:has(p, a)) {
	display: none;
}

.savtek-rail__facts > * {
	margin-block: 0;
}

.savtek-rail__count {
	color: var(--wp--preset--color--muted);
	font-weight: 600;
	line-height: 1.2;
}

.savtek-rail__count .savtek-count__number {
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--display);
	font-size: 2.75rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 0.95;
	margin-right: 0.15em;
}

.savtek-rail__facts .savtek-rail__status {
	color: var(--wp--preset--color--muted);
	font-size: 0.9375rem;
	margin-block-start: 0.5rem;
}

.savtek-rail__status strong {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

/* After the congress there is no countdown: its state leads the card. */
.savtek-rail__facts .savtek-rail__status:first-child {
	color: var(--wp--preset--color--contrast);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
}

.savtek-rail__facts .savtek-details {
	border-top: 1px solid var(--wp--custom--border-color);
	font-size: 0.9375rem;
	gap: 0.6rem;
	margin-block: 1rem 0;
	padding-top: 1rem;
}

.savtek-rail__facts .savtek-details > * {
	margin: 0;
}

.savtek-rail__facts .savtek-details:first-child {
	border-top: 0;
	margin: 0;
	padding: 0;
}

.savtek-rail__facts .savtek-details__label {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.savtek-rail__facts .savtek-details__item > .savtek-details__value {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	margin-top: 0.15rem;
}

.savtek-rail__facts .savtek-details__item > .savtek-details__note {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	margin-top: 0;
}

.savtek-rail__facts .savtek-rail__buttons {
	margin-block-start: 1.25rem;
}

.savtek-rail__buttons:not(:has(a)) {
	display: none;
}

.savtek-rail__button,
.savtek-rail__button .wp-element-button {
	width: 100%;
}

.savtek-rail__button .wp-element-button {
	padding-inline: 1rem;
}

/* After the congress: a thanks under its state and, in place of the button, the past congresses. */
.savtek-rail__facts .savtek-rail__thanks {
	color: var(--wp--preset--color--muted);
	font-size: 0.9375rem;
	margin-block-start: 0.4rem;
}

.savtek-rail__facts .savtek-rail__more {
	font-size: 0.9375rem;
	margin-block-start: 1.25rem;
}

/*
 * Where the rail follows the text (below 1100px, and under the full programme) it is wider than
 * the side column: the section's pages become one row of links, and the facts card, whose dates
 * and venue the footer repeats, and this page's headings are left out.
 */
@container savtek-rail (min-width: 17.5rem) {

	.savtek-rail__facts,
	.savtek-rail__toc {
		display: none;
	}

	.savtek-rail__nav > ul {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.savtek-rail__nav > ul a {
		align-items: center;
		border: 1px solid var(--wp--custom--border-color);
		box-sizing: border-box;
		display: flex;
		min-height: 2.75rem;
		padding: 0.5rem 0.9rem;
	}

	.savtek-rail__nav > ul a[aria-current="page"] {
		border-color: var(--wp--preset--color--accent);
		box-shadow: inset 0 0 0 1px var(--wp--preset--color--accent);
	}
}

/*
 * In the text of inner pages (their templates mark it savtek-prose) the headings step down from the
 * title band's title, also inside columns and groups; the home page's section titles keep the large
 * size. Editors' size choices (preset classes) still win.
 */
.savtek-prose h2 {
	font-size: min(clamp(1.5rem, 1.25rem + 0.7vw, 1.875rem), var(--savtek-fit-cap, 100vw));
}

.savtek-prose h3 {
	font-size: 1.3125rem;
}

/* Running text at about 70 characters a line. */
.savtek-prose > :is(p, .wp-block-list:not([class*="is-style-"])) {
	max-width: 40rem;
}

.savtek-prose > .wp-block-savtek-key-dates.is-layout-list {
	max-width: 42rem;
}

/* Plain lists in page text: a modest indent and markers in the edition color. */
.savtek-prose .wp-block-list:not([class*="is-style-"]):not(.savtek-links) {
	padding-left: 1.25rem;
}

.savtek-prose .wp-block-list:not([class*="is-style-"]):not(.savtek-links) > li::marker {
	color: var(--savtek-accent-text);
}

/*
 * Beside the rail, running text keeps the reading width and every other block (key dates,
 * documents, tables, logos, speakers) fills the column, so sibling pages line up.
 */
.savtek-page-layout .savtek-prose > :not(p, h2, h3, h4, h5, h6, ul, ol, blockquote) {
	max-width: none;
}

/*
 * Lists of names or themes run across the wide width under the reading column, so a long committee
 * fills the page instead of a narrow column (team lead, 2026-10-19). Beside the rail a notice runs
 * across the column too, in line with wide blocks such as the programme.
 */
.savtek-prose > .is-style-columns,
.savtek-page-layout .savtek-prose > .is-style-notice {
	max-width: var(--wp--style--global--wide-size);
}

.savtek-404__title {
	font-size: var(--wp--preset--font-size--large);
}

/* Lists of posts that the home page never shows: the search results and the page numbers. */
.savtek-results .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* A pinned result's badge follows the line that says what it is. */
.savtek-results .wp-block-post {
	align-items: center;
	border-bottom: 1px solid var(--wp--custom--border-color);
	column-gap: 0.6rem;
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding-block: var(--wp--preset--spacing--40);
}

.savtek-results .wp-block-post > * {
	margin: 0;
}

/* The badge follows the title in the markup (so screen readers hear the title first); the title and the rest come after the type line. */
.savtek-results .wp-block-post > :not(.savtek-results__meta, .savtek-badge) {
	flex-basis: 100%;
	order: 1;
}

/* A result says what it is, and an announcement also when it was published. */
.savtek-results .savtek-results__meta {
	align-items: center;
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	font-weight: 500;
	gap: 0 0.5rem;
	margin-bottom: 0.5rem;
}

/* The site's neutral chip. */
.savtek-results .savtek-results__type {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--custom--border-color);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	padding: 0.15rem 0.6rem;
}

.savtek-results__meta > * {
	margin: 0;
}

.savtek-results .savtek-badge {
	margin-bottom: 0.4rem;
}

.savtek-results :is(.type-page, .type-savtek_edition) .savtek-results__date {
	display: none;
}

/* Below about 22px the wide face reads heavy. */
.savtek-results .savtek-results__title {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.35;
	margin-bottom: 0.4rem;
}

/* With no result, the results list these links themselves. */
.savtek-page-layout:has(.wp-block-query-no-results) > .savtek-side {
	display: none;
}

@media (min-width: 1100px) {

	.savtek-side .savtek-links {
		grid-template-columns: minmax(0, 1fr);
		margin: 0;
	}

	.savtek-side .savtek-links > li:last-child {
		border-bottom: 0;
	}
}

/* Page numbers under a list: square buttons on the 6 px radius, the current one filled. */
.wp-block-query-pagination {
	gap: 0.5rem;
}

.wp-block-query-pagination-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	align-items: center;
	border: 1px solid var(--wp--custom--border-color);
	border-radius: var(--wp--custom--radius);
	color: var(--wp--preset--color--contrast);
	display: inline-flex;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	justify-content: center;
	min-height: 2.75rem;
	min-width: 2.75rem;
	padding: 0 0.85rem;
	text-decoration: none;
}

.wp-block-query-pagination a:hover {
	border-color: var(--wp--preset--color--contrast);
}

.wp-block-query-pagination .page-numbers.current {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

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

@media print {

	.savtek-rail {
		display: none;
	}

	.savtek-page-hero {
		background: none;
		color: #000;
	}

	.savtek-page-hero > .savtek-decor {
		display: none;
	}
}

/* Links that stand alone: a 24px target, the text in place (WCAG 2.5.8). */
:is(.savtek-back, .savtek-results__title) > a {
	padding-block: 0.3125rem;
}

/*
 * The video link card is solid navy until a poster is chosen; with one, the poster shows under the
 * navy veil, which at 70 % keeps the white text and the glass button readable even over a white photo.
 */
.wp-block-cover.savtek-video-card:not(:has(.wp-block-cover__image-background, .wp-block-cover__video-background)) {
	background-color: var(--wp--preset--color--navy);
}

/* A notice in text (the "Notice" paragraph style): a quiet box with a rule and an info icon. */
.is-style-notice {
	background: var(--wp--preset--color--paper);
	border-left: 3px solid var(--wp--preset--color--contrast);
	box-sizing: border-box;
	color: var(--wp--preset--color--contrast);
	font-size: 0.9375rem;
	line-height: 1.5;
	padding: 0.9rem 1.1rem 0.9rem 2.95rem;
	position: relative;
}

.is-style-notice::before {
	background: currentcolor;
	content: "";
	height: 1.125rem;
	left: 1.1rem;
	mask: 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.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
	position: absolute;
	top: 1.05rem;
	width: 1.125rem;
}

.is-style-notice a {
	color: var(--wp--preset--color--accent);
}
