@charset "UTF-8";

/**
 * theme-layout.css 2.0.0
 * Author: hybrid.
 *
 * Core layout — wrapper, header, footer, sections, aside, sidebar.
 * Project overrides live in theme-layout.css.
 *
 * Section modifiers
 * [default]  — normal content max-width
 * .focus     — heading section
 * .full      — no content max-width, no padding
 * .large     — no content max-width
 * .min       — short padding
 * .cover     — fullscreen (100svh) min-height
 * .banner    — introduction section, fixed height
 *
 * WP / CSS mapping
 * section           ↔ .section / .wp-block-group
 * section-content   ↔ .wp-block-group__inner-container
 * null              ↔ short
 * alignwide         ↔ normal
 * alignfull         ↔ large
 *
 * Breakpoints
 * 50rem   = 800px
 * 62.5rem = 1000px
 * 75rem   = 1200px
 * 87.5rem = 1400px
 *
 * Tokens
 * --gutter-gap         structural spacing: header padding, first/last child in main,
 *                      gap between section-content and aside, sticky sidebar offset.
 *                      Varies widely: 1.25rem → 3rem.
 * --section-gap        horizontal only: margin-left / margin-right of .section-content.
 *                      Varies moderately: 1.25rem → 2rem.
 * --content-max-width  max-width of content areas (default: 75rem → 87.5rem at 1400px)
 * --stroke-width       border width used throughout the theme (default: .125rem)
 *
 * Dependencies
 * --content-spacing  defined in spacing.css
 * --font-size        defined in fonts.css
 * --bright-color     defined in colors.css
 * --dark-color       defined in colors.css
 * --background-color defined in colors.css
 */



/* ================================================================================================== */
/* ============================================= CONFIG ============================================= */
/* ================================================================================================== */


/* ============================== HEADER ============================== */

:root {
	--header-padding-x: var(--gutter-gap);
	--header-padding-y: calc(var(--gutter-gap) / 6); /* = .5em;*/
}

@media (width < 1000px) {
	:root {
		--header-padding-y: 0px; /*calc(var(--gutter-gap) / 2);*/
	}
}


/* ============================== HEIGHTS ============================== */

:root {
	--header-height: calc((var(--font-size) * 3) + (var(--header-padding-y) * 2));
	--banner-height: 60svh;
	--sticky-footer-height: 0px; /*calc(var(--button-font-size) * 3);*/
	--viewport-height: calc(100svh - var(--header-height) - var(--sticky-footer-height));
}

@media (width < 1000px) {
	:root {
		--contextual-height: calc(var(--font-size) * .75 + var(--font-size) * .75 * .5 * 2 + var(--content-spacing) * 2);
	}
}

/* ============================== INDEX ============================== */

:root {
	--index-font-size: 1.5em;
	--index-height: 100%;
	--index-width: 100%;
	--index-padding: 0;
	--index-ratio: 16/3;
}
@media (min-width: 1000px) {
	:root { --index-font-size: 3em; }
}



/* ====================================================================================================== */
/* ============================================= ANIMATIONS ============================================= */
/* ====================================================================================================== */




/* ================================================================================================== */
/* ============================================= LAYOUT ============================================= */
/* ================================================================================================== */

/* ============================== HEADER ============================== */

/*:root {
	--header-padding-y: 0px;
}*/



/* ============================================================================================== */
/* ============================================= FX ============================================= */
/* ============================================================================================== */


/* ============================== CONFIG ============================== */

:root {
	--fx-spacing: calc(var(--content-spacing) * 4);
	--wrapper-fx-top-height: calc(var(--header-height) + var(--fx-spacing));
}

@media (width < 1000px) {
	:root { --fx-spacing: calc(var(--content-spacing) * 2); }
}

/* ============================== STACKING ============================== */

header + main { padding-top: var(--fx-spacing); }
header + .nav.contextual.pages + main { padding-top: var(--gutter-gap); margin-top: 0; }
footer { margin-top: var(--fx-spacing); }


/* ============================== WRAPPER ============================== */

#wrapper::before {
	content: "";
	position: absolute;
	z-index: 5;
	top: 0;
	left: 0;
	width: 100%;
	transform: translate3d(0, 0, 0);
	height: var(--wrapper-fx-top-height);
	background: linear-gradient(
		to bottom,
		var(--theme-color) 0%,
		transparent
	);
	pointer-events: none;
}


/* ============================== FOOTER ============================== */

footer::after {
	content: "";
	position: absolute;
	z-index: -1;
	bottom: 0;
	left: 0;
	width: 100%;
	transform: translate3d(0, 0, 0);
	height: calc(100% + var(--fx-spacing));
	background: linear-gradient(
		to top,
		var(--theme-color) 0%,
		transparent
	);
	pointer-events: none;
}


/* ============================== HEADER ============================== */

header::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	transform: translate3d(0, 0, 0);
	background: var(--background-color);
	opacity: var(--header-after-opacity, 1);
	background: linear-gradient(
		to bottom,
		var(--bright-color) var(--header-after-gradient, 100%),
		transparent
	);
	pointer-events: none;
}


/* ============================== FOOTER ============================== */

footer { --content-max-width: none; }
footer nav.secondary { flex-grow: 1; flex-basis: 0; }
footer nav.socialbar { width: auto; }



/* =============================================================================================== */
/* ============================================= 404 ============================================= */
/* =============================================================================================== */

body.error main {

}



/* =================================================================================================== */
/* ============================================= HEADING ============================================= */
/* =================================================================================================== */

/*
content-header.php – OK
--h1-font-size for page-title
*/

/* ============================== CONFIG ============================== */

#heading { --h1-font-size: 1em; }
#heading > * { --nav-width: auto; }


/* ============================== DEFAULT ============================== */

#heading {
	position: relative;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0;
	order: -1;
	width: 100%;
}
#heading > * { margin: 0; }


/* ============================== HOME ============================== */

#heading .home-link { padding: var(--nav-anchor-padding-x); }
#heading .home-link + * { margin-inline: 0 auto; }
#heading .home-link.active { --icon-fill-color: currentColor; }


/* ============================== SPACING ============================== */

#heading > .home-link,
#heading > nav.primary { margin-left: calc(var(--nav-anchor-padding-x) * -1); }
#heading > *:last-child { margin-right: calc(var(--nav-anchor-padding-x) * -1); }



/* ================================================================================================== */
/* ============================================= NAVBAR ============================================= */
/* ================================================================================================== */


/* ============================== CONFIG ============================== */

#navbar {
	--nav-font-size: 1em;
	--nav-anchor-padding-y: 1em;
	--nav-anchor-padding-x: 1em;
	--nav-anchor-opacity: 1;
}


/* ============================== DEFAULT ============================== */

#navbar {
	position: relative;
	z-index: 1200;
	display: flex;
	justify-content: flex-end;
	gap: 0;
	pointer-events: none;
	flex: 0 0 auto;
}



/* ====================================================================================================== */
/* ============================================= CONTEXTUAL ============================================= */
/* ====================================================================================================== */


/* ============================== DEFAULT ============================== */

#contextual {
	position: sticky;
	z-index: 1100;
	top: var(--header-height);
	margin: 0;
	width: 100%;
	max-width: none !important;
	font-size: var(--font-size);
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	padding-top: var(--content-spacing);
	padding-bottom: var(--content-spacing);
	gap: 0;
	background: var(--bright-color);
}

main #contextual + section[class*="-background-color"] .section-content {
	margin-top: calc(var(--content-spacing) / 2);
}







/* ============================== FOCUS ============================== */

main section.focus {
	background: var(--background-color);
}
/*
section.focus .section-content {
	display: flex;
	flex-direction: column;
}
*/
section.focus .main-title:after {
	content: "";
	position: relative;
	z-index: 100;
	pointer-events: none;
	height: 100%;
	width: 100%;
	margin-top: var(--gutter-gap);
	aspect-ratio: var(--line-break-ratio);
	background: var(--line-break);
	background-size: 100% auto;
	background-position: center;
	background-repeat: no-repeat;
}
section.focus + #contextual { margin-top: calc(var(--gutter-gap) * -1); }


/* ============================== STICKY-FOOTER ============================== */

.sticky-footer {
	position: sticky;
	bottom: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}
.sticky-footer > * { margin: 0; }



/* =================================================================================================== */
/* ============================================= SIDEBAR ============================================= */
/* =================================================================================================== */


/* ============================== EVENT ============================== */

/*.sidebar.event .inline {
	width: 100%;
	gap: 0 1em;
}*/
.sidebar.event .inline nav.swiper-controls {
	width: auto;
}

@media (max-width: 1000px) {
	.sidebar.event.sticky {
		--aside-sticky-top: auto;
		order: 2;
		width: 100%;
		margin-inline: 0;
		padding-inline: var(--aside-gap-x);
		padding-bottom: var(--aside-gap-y);
		bottom: var(--sticky-footer-height);
		max-width: none;
		margin: 0;
	}
	.sidebar.event.sticky::after {
		content: '';
		position: absolute;
		z-index: -1;
		inset: 0;
		background: var(--bright-color);
	}
}


/* ============================== CONTENT ============================== */

/* =============== FORMS =============== */

.sidebar form {
	pointer-events: auto;
}


/* =============== FILTERS =============== */

.sidebar nav.filters {
	width: 100%;
}
.sticky.sidebar nav.filters.only-mobile {
	margin: 0;
}


/* =============== INLINE =============== */

/* In books — .sidebar.inline */

.sidebar.inline .buttons-container {
	flex-direction: row;
	align-items: baseline;
	gap: var(--gutter-gap);
}
.sidebar.inline .buttons-container > * {
	flex-grow: 1;
	flex-basis: 0;
	white-space: nowrap;
	margin: 0;
}
.sidebar.inline .buttons-container fieldset {
	flex-grow: 2;
}
.sidebar.inline .buttons-container nav.buttons {
	flex-wrap: unset;
}
.sidebar.inline.is-stuck {
	background: var(--bright-color);
}


/* =============== CONTEXTUAL OFFSETS =============== */

@media (min-width: 1000px) {
	section.focus + .sidebar.sticky,
	section.focus + section[class*="-background-color"] + .sidebar.sticky {
		margin-top: 0;
	}
	#contextual + .sidebar.sticky,
	#contextual + .columns .sidebar.sticky {
		top: calc(var(--header-height) + var(--contextual-height));
		margin-top: 0;
	}
}


/* ============================== AS STICKY-FOOTER ============================== */

.sidebar.sticky-footer {
	margin-top: auto;
	padding: var(--content-spacing) 0;
	background: var(--bright-color);
}




.sidebar.sticky.is-stuck {
		background: var(--bright-color);
}


/* ================================================================================================== */
/* ============================================= BANNER ============================================= */
/* ================================================================================================== */


/* ============================== CONFIG ============================== */

:root { --banner-height: calc(100svh - var(--header-height)); }


/* ============================== DEFAULT ============================== */

section.banner {
	z-index: 10;
	min-height: var(--banner-height);
}
section.banner .section-content {
	align-items: center;
	justify-content: center;
	gap: 1em;
	margin-block: auto;
	max-width: none;
	height: 100%;
	width: 100%;
}


/* ============================== BANNER SWIPER ============================== */

section.banner .swiper-container,
section.banner .swiper-wrapper { height: 100%; }

section.banner .swiper-slide-content {
	display: flex;
	flex-wrap: nowrap;
	flex-direction:column;
	align-items: center;
	justify-content: center;
	padding-block: var(--content-spacing);
	padding-inline: 0px;
}


/* ======================================================================================================== */
/* ============================================= INTRODUCTION ============================================= */
/* ======================================================================================================== */


/* ============================== CONFIG ============================== */

/* the section is the size container: cqw = its width, without the scrollbar (svw includes it, the gaps then shrink) */
#introduction {
	container-type: inline-size;

	--introduction-gap: var(--gutter-gap); /* minimum space between two images */
	--introduction-peek: var(--gutter-gap); /* visible part of each neighbour image */

	/* parallax: texts and buttons move slower than the image (per slide of distance) and fade within a distance in slides */
	--introduction-parallax-shift: 50cqw; /*calc(var(--img-width) * 2 / 2);*/
	--introduction-parallax-fade-distance: .5;
	/*--swiper-speed: 750ms;*/

	/* bound by the height, and by the width so that the gaps and the visible parts fit */
	--img-width: min(
		calc(var(--banner-height) / 2 * var(--media-ratio)),
		calc(100cqw - 2 * (var(--introduction-gap) + var(--introduction-peek)))
	);

	/* space between two images: at least --introduction-gap, grows on wide screens so that the neighbours stay flush with the window edges */
	--introduction-slide-gap: calc(50cqw - var(--img-width) / 2 - var(--introduction-peek));

	/* click zones: from the window edge to the active image */
	--swiper-cursor-zone-size: calc((100cqw - var(--img-width)) / 2);
}


/* ============================== SWIPERS ============================== */

/* slide = image + gap, centered: the padding (peek + half gap) is what shows of the neighbours, flush with the window edges (Swiper subtracts it from its size) */
#introduction .swiper-container {
	padding-inline: calc(var(--introduction-peek) + var(--introduction-slide-gap) / 2);
}

#introduction .swiper-slide-content {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
	justify-items: center;
	height: calc(var(--banner-height) - var(--header-height));
	padding-bottom: calc(var(--content-spacing) + var(--header-height));
}

#introduction .swiper-cursor {
	--cursor-color: var(--button-colored-background-color);
	--cursor-background: var(--button-colored-text-color);
}

/* click zones stop right above the buttons: slide padding + buttons height + spacing */
#introduction .swiper-cursor-zone {
	min-width: 8em;
	inset-block: var(--header-height) calc(
		var(--content-spacing) + var(--header-height)
		+ 1lh + 2 * var(--button-padding-y)
		+ var(--content-spacing)
	);
}


/* ============================== PARALLAX ============================== */

/* Driven by swipers.js (.has-progress): --swiper-slide-progress is 0 on the slide in place, negative on the following slides, positive on the previous ones.
   Texts and buttons follow the slide position (drag and transitions), no CSS transition: the easing comes from the swiper. */

/* the fade is on the texts only: the image stays visible (neighbour slides) and follows the slide */
#introduction .swiper-slide-content { opacity: 1; }

/* texts and buttons: shifted toward the image in place (slower than the slide), faded with the distance */
#introduction .swiper-slide-content > :not(figure) {
	opacity: calc(1 - min(abs(var(--swiper-slide-progress, 0)) / var(--introduction-parallax-fade-distance), 1));
	transform: translateX(calc(var(--swiper-slide-progress, 0) * var(--introduction-parallax-shift)));
	will-change: transform, opacity;

	/* same duration and easing as the wrapper (0 while dragging): runs on the compositor, in sync with the image */
	/*
	transition-property: transform, opacity;
	transition-duration: var(--swiper-progress-duration, 0ms);
	transition-timing-function: var(--swiper-wrapper-transition-timing-function);
	*/
}


/* ============================== INTRODUCTION ============================== */

#introduction {
	margin-top: 0;
	background: linear-gradient(
		to bottom,
		var(--theme-color) 50%,
		var(--background-color)
	);
}

#wrapper:has(#introduction)::before {
	height: calc(var(--banner-height) + var(--header-height));
}
#wrapper:has(#introduction) main { padding-top: 0; }


/* ============================== POST-INFOS ============================== */

#introduction .post-infos {
	display: flex;
	flex-direction: column;
	align-items: center;
	align-self: end;
	color: var(--text-color);
	margin-bottom: var(--content-spacing);
}

#introduction .h2 { order: -2; }
#introduction .h2 + .post-tags,
#introduction .h2 + .post-meta { order: -3; }

#introduction .post-meta,
#introduction .h2 + .post-tags,
#introduction .h2 + .post-meta { margin-bottom: calc(var(--content-spacing) / 2); }

#introduction .post-meta {
	gap: 0 2em;
	width: auto;
	margin-inline: auto;
}
#introduction time .post-time { margin-left: 1em; }


/* ============================== THUMBNAIL ============================== */

/* box reserved before loading (ratio), no empty space around the image */
#introduction .thumbnail {
	--img-fit: contain;
	width: var(--img-width);
	aspect-ratio: var(--media-ratio);
}


/* ============================== BUTTONS ============================== */

#introduction .buttons {
	align-self: start;
	margin-top: var(--content-spacing);
}


/* ============================== @MEDIA ============================== */

@media (width < 1000px) {
	:root { --banner-height: calc(90svh - var(--header-height)); }

	/* image justified on the content edges (buttons, controls, swiperable): not centered, the next one peeks out on the right */
	#introduction {
		--introduction-gap: calc(var(--gutter-gap) / 2);
		--img-width: calc(100cqw - 2 * var(--gutter-gap));
		--introduction-peek: calc(var(--gutter-gap) - var(--introduction-gap));
		--introduction-slide-gap: var(--introduction-gap);
		--introduction-parallax-shift: 25cqw; /*calc(var(--img-width) * 2 / 2);*/
		 /*--swiper-speed: 500ms;*/
	}
	#introduction .swiper-slide-content { padding-inline: calc(var(--introduction-slide-gap) / 2); }
	#introduction .swiper-container.min {
		--swiper-inactive-text-opacity: 0;
		--swiper-controls-next-from: var(--swiper-full-controls-previous-from);
		--swiper-controls-next-to: var(--swiper-full-controls-previous-to);
	}
	#introduction .swiper-slide-content {
		min-height: var(--banner-height);
		padding-bottom: var(--content-spacing);
	}
	#introduction .buttons {
		justify-self: end;
		align-self: end;
	}
	#introduction .swiper-controls .next { right: calc(100% - ( ((var(--swiper-controls-icon-padding) * 2 + var(--swiper-controls-button-size)) * 2) + var(--swiper-gap) )); }
}