/*
 * Home page slider (savtek-core) in the brochure showcase (A3, ADR-0024): a paper stage under the
 * dotted grid, the edition color's slanted band at its left edge, the copy (the congress logo or
 * the title, the lead and the buttons) on the left and the photo as a panel with a slanted edge on
 * the right from 782px (the brochure's arrow band went on 2026-10-24, team lead: it crossed the
 * drawings).
 * The tabs with their progress bars and the rotation button sit under the copy, the photo credit
 * under them. Slides share one grid cell and fade into each other. When the facts console follows
 * the slider, home.css sets --savtek-console-overlap from 782px, and the stage leaves room for the
 * console to lie over it. Phones put the photo across the top, clipped at its foot.
 */
.savtek-slider {
	--savtek-slider-frame: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-left, 1rem) + var(--wp--style--root--padding-right, 1rem));
	/* Where the copy ends and the photo panel begins, from 782px. */
	--savtek-split: 54%;
	/* The lead and the credit lie over the dots: a deeper muted tone keeps 4.5:1 there. */
	--savtek-slider-deep: color-mix(in srgb, var(--wp--preset--color--muted) 70%, var(--wp--preset--color--contrast));
	/* The console and the organizers fit the first screen (2026-10-24); a taller copy grows it. */
	--savtek-slider-height: clamp(30rem, calc(100svh - var(--savtek-header-height) - 10rem), 34rem);
	background: var(--savtek-dots), var(--wp--preset--color--paper);
	isolation: isolate;
	overflow: hidden;
	position: relative;
}

/* The slanted band at the left edge, with its hairline, as on the brochure's cover. */
.savtek-slider::before,
.savtek-slider::after {
	content: "";
	inset: 0 auto 0 0;
	pointer-events: none;
	position: absolute;
	width: 3.75rem;
	z-index: 0;
}

.savtek-slider::before {
	background: var(--wp--custom--accent-raw);
	clip-path: polygon(0 0, 100% 0, 40% 100%, 0 100%);
}

.savtek-slider::after {
	background: #fff;
	clip-path: polygon(2.2rem 0, 2.35rem 0, 0.85rem 100%, 0.7rem 100%);
	opacity: 0.9;
}

.savtek-slider__slides {
	display: grid;
	position: relative;
	z-index: 1;
}

/* A stacking context of its own, so the photo stays above the stage and below the copy. */
.savtek-slider__slide {
	align-items: center;
	display: flex;
	grid-area: 1 / 1;
	isolation: isolate;
	min-height: var(--savtek-slider-height);
	opacity: 0;
	position: relative;
	transition: opacity 0.9s var(--wp--custom--ease), visibility 0s linear 0.9s;
	visibility: hidden;
}

/* Its photo shows once its turn is near (savtek-core), so it loads lazily; the text keeps its place, so the stage never grows under a tap. */
.savtek-slider__slide:not(.is-active, .is-shown) .savtek-slider__image {
	display: none;
}

.savtek-slider__slide.is-active {
	opacity: 1;
	transition: opacity 0.9s var(--wp--custom--ease);
	visibility: visible;
}

.savtek-slider__image {
	height: 100%;
	inset: 0;
	object-fit: cover;
	object-position: 50% 30%;
	position: absolute;
	width: 100%;
	z-index: -1;
}

/* From 782px the photo is a panel at the right of the stage, its left edge slanted. */
@media (min-width: 782px) {

	.savtek-slider__image {
		clip-path: var(--savtek-slant);
		inset: 0 0 0 auto;
		width: calc(100% - var(--savtek-split));
	}
}

.savtek-slider__copy {
	box-sizing: border-box;
	/* The title's room. */
	container-type: inline-size;
	/* The copy starts on the wide content's edge, as the console and the section heads do, and past the side band where that edge is narrower than it. */
	padding: clamp(2rem, 3.5vw, 3rem) calc(100% - var(--savtek-split) + 2rem) 6.5rem max(var(--wp--style--root--padding-left, 1rem), calc((100% - var(--wp--style--global--wide-size)) / 2), 5rem);
	position: relative;
	width: 100%;
	z-index: 1;
}

.savtek-slider__copy > * {
	max-width: 36rem;
}

.savtek-slider__copy > .savtek-slider__title {
	max-width: none;
}

/* The kicker as an eyebrow in the edition color. */
.savtek-slider__kicker {
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin: 0 0 1.25rem;
	text-transform: uppercase;
}

/* With several slides, the tab names the slide. */
.savtek-slider.is-interactive .savtek-slider__kicker {
	display: none;
}

/* In the logo's colors: the name in the edition color (its readable tone), the year in grey. */
.savtek-slider__title {
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--display);
	/* Shrinks to its widest word (inc/fit.php). */
	font-size: min(var(--wp--preset--font-size--huge), calc(100cqi / var(--savtek-fit, 5.6)));
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 0.9;
	margin: 0;
}

.savtek-slider__title > span {
	display: block;
}

.savtek-slider__title-year {
	color: var(--wp--preset--color--muted);
	font-weight: 500;
	letter-spacing: -0.03em;
}

/*
 * An image in the title's place (the slide's choice, Slide_Title): as wide as its size allows and
 * no taller than its height; the plugin's BOXES give the same numbers to the image's sizes.
 */
.savtek-slider__title.is-logo {
	--savtek-title-w: 32rem;
	--savtek-title-h: 8rem;
	line-height: 0;
}

.savtek-slider__title.is-size-small {
	--savtek-title-w: 22rem;
	--savtek-title-h: 5.5rem;
}

.savtek-slider__title.is-size-large {
	--savtek-title-w: 40rem;
	--savtek-title-h: 12rem;
}

.savtek-slider__title.is-logo .savtek-slider__logo {
	display: block;
	height: auto;
	width: min(100%, var(--savtek-title-w), var(--savtek-title-h) * var(--savtek-title-ratio, 4));
}

/* A logo with its own background on a white plate, a white one on a night plate. */
.savtek-slider__title.has-opaque-logo .savtek-slider__logo,
.savtek-slider__title.has-light-logo .savtek-slider__logo {
	background: #fff;
	border-radius: var(--wp--custom--radius-sm);
	box-sizing: border-box;
	padding: 0.5rem;
}

.savtek-slider__title.has-light-logo .savtek-slider__logo {
	background: var(--wp--preset--color--night);
}

.savtek-slider__text {
	color: var(--savtek-slider-deep);
	font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
	line-height: 1.55;
	margin: 1.5rem 0 0;
}

.savtek-slider__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 2rem;
}

/* The first button in the edition color, the second outlined. */
.savtek-slider__button.wp-element-button {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.savtek-slider__button.wp-element-button:hover {
	background-color: var(--wp--custom--accent-hover);
	color: var(--wp--preset--color--base);
}

.savtek-slider__button.wp-element-button.is-secondary {
	background-color: var(--wp--preset--color--base);
	box-shadow: inset 0 0 0 1px var(--wp--custom--border-strong);
	color: var(--wp--preset--color--contrast);
}

.savtek-slider__button.wp-element-button.is-secondary:hover {
	background-color: var(--wp--preset--color--base);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast);
}

/* The photo credit under the tabs, inside the copy's gutter. */
.savtek-slider__credit {
	bottom: calc(var(--savtek-console-overlap, 0px) + 0.5rem);
	color: var(--savtek-slider-deep);
	font-size: 0.75rem;
	left: max(var(--wp--style--root--padding-left, 1rem), calc((100% - var(--wp--style--global--wide-size)) / 2), 5rem);
	line-height: 1.3;
	margin: 0;
	max-width: calc(var(--savtek-split) - 4rem);
	position: absolute;
}

/* The rotation button, then the tabs, under the copy: the order on screen is the order of the keyboard. */
.savtek-slider__controls {
	align-items: center;
	bottom: calc(var(--savtek-console-overlap, 0px) + 2.25rem);
	box-sizing: border-box;
	display: flex;
	gap: 1rem;
	left: 0;
	padding-inline: max(var(--wp--style--root--padding-left, 1rem), calc((100% - var(--wp--style--global--wide-size)) / 2), 5rem) calc(100% - var(--savtek-split) + 2rem);
	position: absolute;
	width: 100%;
	z-index: 3;
}

.savtek-slider__controls[hidden] {
	display: none;
}

.savtek-slider__tabs {
	display: flex;
	gap: 1rem;
}

.savtek-slider__tab {
	background: none;
	border: 0;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	display: grid;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	gap: 0.8rem;
	line-height: 1.3;
	min-width: 7.5rem;
	padding: 0 0 0.1rem;
	text-align: left;
}

.savtek-slider__tab[aria-selected="true"] {
	font-weight: 700;
}

/* The number stays in the tab's name ("02 Program") for screen readers. */
.savtek-slider__number {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.savtek-slider__progress {
	background: var(--wp--custom--accent-soft);
	display: block;
	height: 3px;
	overflow: hidden;
	position: relative;
}

.savtek-slider__progress > span {
	background: var(--wp--preset--color--accent);
	inset: 0;
	position: absolute;
	transform: scaleX(0);
	transform-origin: left;
}

.savtek-slider__tab[aria-selected="true"] .savtek-slider__progress > span {
	transform: scaleX(1);
}

.savtek-slider__tab.is-ticking .savtek-slider__progress > span {
	animation: savtek-progress var(--savtek-slide-delay, 6500ms) linear forwards;
}

@keyframes savtek-progress {

	from {
		transform: scaleX(0);
	}

	to {
		transform: scaleX(1);
	}
}

/* The previous and next buttons stay for scripts and keyboards' arrow keys, but the tabs do their work on screen. */
.savtek-slider__step {
	display: none;
}

.savtek-slider__rotation {
	align-items: center;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--custom--border-strong);
	border-radius: 50%;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	display: inline-grid;
	flex: none;
	height: 2.75rem;
	justify-content: center;
	padding: 0;
	transition: background-color var(--wp--custom--transition), border-color var(--wp--custom--transition);
	width: 2.75rem;
}

.savtek-slider__rotation:hover {
	background-color: var(--wp--preset--color--paper);
	border-color: var(--wp--preset--color--contrast);
}

/* Pause: two bars; play: a triangle. */
.savtek-slider__rotation::before {
	background: linear-gradient(90deg, currentcolor 0 35%, transparent 35% 65%, currentcolor 65%);
	content: "";
	height: 0.75rem;
	width: 0.65rem;
}

.savtek-slider__rotation.is-paused::before {
	background: currentcolor;
	clip-path: polygon(0 0, 100% 50%, 0 100%);
	margin-left: 0.15rem;
}

@media (max-width: 1099px) {

	/* A wider copy column, so the two buttons share a row from 782px. */
	.savtek-slider {
		--savtek-split: 60%;
	}

	/* Below 1100px five names never fit side by side: one row of 44px bars, the current name under them. */
	.savtek-slider__tabs {
		flex: 0 1 32rem;
		gap: 0.5rem;
		padding-bottom: 1.5rem;
		position: relative;
	}

	.savtek-slider__tab {
		align-content: center;
		flex: 1 1 0;
		min-height: 2.75rem;
		min-width: 0;
	}

	.savtek-slider__tab .savtek-slider__label {
		clip-path: inset(50%);
		height: 1px;
		overflow: hidden;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}

	.savtek-slider__tab[aria-selected="true"] .savtek-slider__label {
		bottom: 0;
		clip-path: none;
		height: auto;
		left: 0;
		overflow: visible;
		right: 0;
		white-space: normal;
		width: auto;
	}

	.savtek-slider__controls {
		align-items: flex-start;
	}

	/* Room for the bars, the name and the console, with air above them. */
	.savtek-slider__copy {
		padding-bottom: calc(var(--savtek-console-overlap, 0px) + 8.5rem);
	}
}

@media (min-width: 1100px) {

	.savtek-slider__copy {
		padding-bottom: calc(var(--savtek-console-overlap, 0px) + 6.5rem);
	}
}

@media (min-width: 782px) {

	.savtek-slider__title {
		font-size: min(clamp(3rem, 2rem + 4.5vw, 6rem), calc(100cqi / var(--savtek-fit, 5.6)));
	}
}

/*
 * Phones: the photo fills the top, min(80vw, 22rem) tall and clipped at its foot; the copy, the
 * controls and the credit follow on paper. The side band stays off the small screen.
 */
@media (max-width: 781px) {

	.savtek-slider {
		--savtek-slider-height: 0px;
	}

	.savtek-slider::before,
	.savtek-slider::after {
		display: none;
	}

	.savtek-slider__slide {
		align-items: flex-start;
	}

	.savtek-slider__image {
		bottom: auto;
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0 88%);
		height: min(80vw, 22rem);
		inset: 0 0 auto;
		object-position: 72% 40%;
		width: 100%;
	}

	.savtek-slider__copy {
		padding-bottom: 7.25rem;
		padding-left: var(--wp--style--root--padding-left, 1rem);
		padding-right: var(--wp--style--root--padding-right, 1rem);
		padding-top: calc(min(80vw, 22rem) + 1.25rem);
	}

	.savtek-slider__copy > * {
		max-width: none;
	}

	.savtek-slider__title.is-logo {
		--savtek-title-w: 20rem;
		--savtek-title-h: 6rem;
	}

	.savtek-slider__title.is-size-small {
		--savtek-title-w: 16rem;
		--savtek-title-h: 4.5rem;
	}

	.savtek-slider__title.is-size-large {
		--savtek-title-w: 100%;
		--savtek-title-h: 8rem;
	}

	.savtek-slider__text {
		margin-top: 1rem;
		max-width: 34rem;
	}

	.savtek-slider__buttons {
		margin-top: 1.5rem;
	}

	.savtek-slider__button.wp-element-button {
		flex: 1 1 auto;
	}

	.savtek-slider__controls {
		bottom: 2.25rem;
		gap: 0.75rem;
		padding-inline: var(--wp--style--root--padding-left, 1rem) var(--wp--style--root--padding-right, 1rem);
	}

	.savtek-slider__tabs {
		flex: 1;
	}

	.savtek-slider__credit {
		left: var(--wp--style--root--padding-left, 1rem);
		max-width: none;
		right: var(--wp--style--root--padding-right, 1rem);
	}
}

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

	.savtek-slider__tab.is-ticking .savtek-slider__progress > span {
		animation: none;
	}
}

@media print {

	.savtek-slider::before,
	.savtek-slider::after,
	.savtek-slider__controls,
	.savtek-slider__image {
		display: none;
	}
}
