@charset "UTF-8";

/**
 * theme-grids.css
 *
 * Grid layout system — CSS Grid based, responsive, with AJAX support.
 * Types spécifiques (table, search, products, events, posts...) — projet, voir theme-components.css.
 *
 * STRUCTURE
 * .grid > .items > .item > .item-content
 *                        > .images / .thumbnails
 *                        > .infos
 *
 * MODIFIERS
 * .grid.list        — single column, horizontal layout
 * .grid.swiperable  — switchable to swiper
 * .grid.fluid       — masonry-style fluid layout
 *
 * ITEM SIZES
 * .item.large  — 2:1 thumbnail ratio
 * .item.small  — 1:1 thumbnail ratio
 * .item.sticky — full-width row (grid-column: 1 / -1)
 *
 * GRID SIZES (items per row)
 * .grid.items-N            — numeric target (core/group)
 * .grid.items-min/-short   — named presets (core/gallery)
 * See CSS-GUIDELINES.md § Nomenclature — classes de taille et de quantité
 *
 * Tokens
 * --grid-gap / --grid-gap-short   gap between items (responsive)
 * --items-per-row                 columns count (responsive)
 * --item-width                    computed from --items-per-row / --grid-gap
 * --item-border-radius            item corner radius
 * --item-background-color         item background (hover / list state)
 * --item-border-top               .grid.list separator — override per type in theme
 * --grid-font-size                font-size context for .grid
 * --grid-fluid-height             row height for .grid.fluid
 * --results-title-size            .results-title font-size
 *
 * Dependencies
 * --font-size          defined in fonts.css
 * --main-font-size     defined in fonts.css
 * --bright-color       defined in colors.css
 * --stroke-width       defined in structure.css
 * --ease, --duration-fast, --duration-normal  defined in animations.css
 * --content-spacing, --content-max-width      defined in structure.css
 */


.grid .item {
	margin: 0;
}

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

/**
 * Section to paste in styles.css (loaded after ALL core files: several rules rely on source order).
 * Scale: 480 / 760 / 1000 / 1200 / 1400.
 *
 * Only what depends on the width of a component lives here: grids and swipers follow
 * their own width (@container). Page structure (layout, sidebar), columns (own @container)
 * and device capabilities (hover, pointer) stay in the core.
 *
 * Items count (has-items-N, alignment.css)
 * - below 760px (container): --items-per-row = 2 (3 for has-items-6 / -min)
 * - from 760px (container):  --items-per-row = --items-target
 * Per grid, override --items-per-row, --item-width (width mode) or --grid-item-min-width (count + width)
 * on the grid concerned (eg. .grid.posts), see grids.css.
 *
 * Within a block, a rule with the same specificity as a previous one overrides it by
 * source order: keep types (.events...) after the generic rule, thresholds ascending.
 * Container thresholds are grid widths, not screen widths (gutters, sidebar): adjust per project.
 */


/* ============================== DEFAULT ============================== */
/*
.grid:not(.events) {
	--item-img-filter: grayscale(0);
	--item-img-hover-filter: grayscale(1);
}
*/
/*
.grid.events {
	--item-img-filter: grayscale(1);
	--item-img-hover-filter: grayscale(0);
}
*/
.grid.actions,
.grid.residences {
	--item-img-filter: grayscale(0);
	--item-img-hover-filter: grayscale(1);
}


/* ============================== GRIDS ============================== */

@media (min-width: 760px) {
	:root, .grid {
		--grid-gap-x: 1em;
		--grid-gap-y: 1em;
	}
}


/* ============================== FLUIDS ============================== */

@media (min-width: 760px) {
	:root { --grid-fluid-height: 15rem; }
}
@media (min-width: 1000px) {
	:root { --grid-fluid-height: 20rem; }
}


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

.grid .items { --items-per-row: 1; }

@container grid (min-width: 480px) {
	.grid .items { --items-per-row: 2; }
	.grid.events .items { --items-per-row: 1; }
}
@container grid (min-width: 1000px) {
	.grid .items { --items-per-row: 3; }
	.grid.events .items { --items-per-row: 2; }
}
@container grid (min-width: 1400px) {
	.grid .items { --items-per-row: 4; }
	.grid.events .items { --items-per-row: 3; }
}


/* ============================== HAS ITEMS SIZES ============================== */

/* Below 760px the ramp above applies. From 760px the target declared by alignment.css (.has-items-N, -medium, -short, -min)
   wins over the ramp: more specific, and after it. Keep this block after the ramp. */

@container grid (min-width: 760px) {
	.grid[class*='has-items-'] .items { --items-per-row: var(--items-target); }
	.grid.gallery[class*='has-items-'] .items { --items-per-row: calc(var(--items-target) * 2); }
}


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

.grid img {
	transition:
	filter var(--duration-fast) var(--ease),
	opacity var(--duration-fast) var(--ease);
}


/* ================================================================================================= */
/* ============================================= GRIDS ============================================= */
/* ================================================================================================= */

/* here for project-specific media overrides */

/* ============================== LIST ============================== */

.grid.list .item::before { border-color: var(--light-color); }


/* ============================== VIEWER ============================== */

.grid.gallery.has-viewer .items:hover a.item-content { filter: grayscale(1) blur(.25em); }
.grid.gallery.has-viewer .items:hover a.item-content:hover,
.grid.gallery.has-viewer a.item-content:hover { filter: grayscale(0) blur(0); }


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

/* =============== TITLES =============== */

.grid:not(.list) .post-title {
	font-size: var(--h5-font-size);
}

.grid .post-title {
	font-size: var(--h5-font-size);
}


/* =============== IMAGES =============== */

.grid .images {
	position: relative;
	width: 100%;
}

.grid a.item-content img { filter: var(--item-img-filter); }
.grid a.item-content:hover img { filter: var(--item-img-hover-filter); }


/* =============== THUMBNAILS =============== */

.grid.list .thumbnails {
	height: 100%;
}
.grid a.item-content:hover .thumbnails {
	opacity: 1;
}
.grid .item.large .thumbnail {
	aspect-ratio: 2/1;
}
.grid .item.small .thumbnail {
	aspect-ratio: 1/1;
}
.grid.list.small .thumbnail {
	display: none;
}


/* =============== INFOS =============== */

.grid .infos {
	position: relative;
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	flex-direction: column;
	/*align-items: flex-start;*/
	/*gap: 1em;*/
	gap: calc(var(--grid-gap-y) / 2);
	margin: 0;
	width: 100%;
}
/*
.grid .infos > * {
	margin: 0;
}
*/
.grid .infos > * + * {
	/*margin-top: calc(var(--grid-gap-y) / 2);*/
	margin-top: 0;
}

.grid .infos > .inline {
	justify-content: center;
}

/* LIST */

.grid.list .infos {
	text-align: left;
	padding: 0;
}
.grid.list .infos > * {
	margin: 0;
}



/* =============== DESCRIPTION =============== */

.grid .post-description {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	text-overflow: ellipsis;
	overflow: hidden;
	margin-top: 1em;
	height: 3em;
	width: 100%;
	font-size: .875em;
	line-height: 1;
	text-align: left !important;
}
.grid .post-time {
	display: flex;
	gap: 0 1em;
}
.grid .infos .post-time > * {
	flex-basis: 0;
}



/* =================================================================================================== */
/* ============================================= RESULTS ============================================= */
/* =================================================================================================== */


/*.results-title.sticky {
	line-height: 1;
	padding: max(calc(var(--content-spacing) / 2), calc((var(--contextual-height) - var(--results-title-size)) / 2)) 0;
	background: none;
	pointer-events: none;
}*/

.results-title.sticky {
	padding: calc(var(--content-spacing) / 2) 0;
	background: none;
	pointer-events: none;
}

.results-title::after {
	content: '';
	position: absolute;
	inset: 0;
	border-bottom: solid var(--stroke-width) var(--light-color);
	margin-bottom: calc(var(--stroke-width) * -1);
	pointer-events: none;
}
.grid.list .results-title.sticky + .items { margin-top: 0; }



/* ================================================================================================== */
/* ============================================= EVENTS ============================================= */
/* ================================================================================================== */


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

.grid.events {
	/* core */
	--item-gap: 1.5em;
	--large-font-size: 3em;
	--focus-outline-offset: .5em;
	/* custom */
	--item-padding-bottom: 2em;
	--event-gap: calc(var(--font-size) * 3); /* for item content */

	--event-title-margin: auto;
	--event-title-align: center;

	--event-meta-order: -1;
	--event-img-order: 2;
}

.grid.list.events {
	/* custom */
	--event-title-margin: 0;
	--event-title-align: flex-start;

	--event-img-size: 6em;
	--event-img-order: 4;
}
@media (width < 1000px) {
	.grid.events.list {
		--event-img-size: 4em;
		--event-img-order: -1;
	}
}

.grid.events:not(.is-archive) .item.unavailable {
	--item-unavailable-label: 'terminé';
	--item-opacity: .33;
	--button-font-size: calc(var(--font-size) * .625);
	--button-text-color: var(--accent-color);
	--button-background-color: transparent;
	--button-hover-text-color: var(--dark-color);
	--button-hover-background-color: var(--theme-color);
	--button-border: var(--stroke-width);
	--button-radius: 3em;
}
.grid.events:not(.is-archive) .item.unavailable:hover { --item-opacity: 1; }

/* label by reason — past keeps the default one */
.grid.events:not(.is-archive) .item.unavailable.cancelled { --item-unavailable-label: 'annulé'; }
.grid.events:not(.is-archive) .item.unavailable.complete { --item-unavailable-label: 'complet'; }


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

/* grid as default */

.grid.events:not(.list):not(.swiperable) .items { gap: calc(var(--grid-gap-y) * 2) var(--grid-gap-x); }

.grid.events:not(.swiperable) .item { padding-bottom: var(--content-spacing); }
.grid.events:not(.swiperable) .item::after {
	content: '';
	position: absolute;
	inset: 0;
	width: inherit;
	border-bottom: solid var(--stroke-width) var(--light-color);
}

.grid.events .item-content { justify-content: space-between; }
.grid.events:not(.list) .item-content { padding-bottom: var(--item-padding-bottom); }


/* ============================== UNAVAILABLE (past, cancelled, complete) ============================== */

/* .grid.events .item.unavailable .post-date { text-decoration: line-through; } */

.grid.events:not(.is-archive) .item.unavailable::before {
	content: var(--item-unavailable-label);
	position: absolute;
	z-index: 20;
	top: 50%;
	/*left: 50%;*/
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/*font-size: .75em;*/
	color: var(--bright-color);
	background: var(--dark-color);
	/*padding: .5em 1em;
	transform: translate3d(-50%, -50%, 0);*/
	/*
	display: inline-block;*/
	font-size: var(--button-font-size);
	padding-block: calc(var(--nav-anchor-padding-y) / 4);
	padding-inline: calc(var(--nav-anchor-padding-x) / 2);
	width: auto;
	max-width: 100%;
	white-space: nowrap;
	font-family: var(--font-family-sans);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	/*color: var(--button-text-color);
	background: var(--button-background-color);*/
	border: solid var(--button-border) currentColor;
}


/* ============================== INFOS ============================== */
/*
.grid.events .infos {
	order: 1;
	gap: var(--item-gap);
}
.grid.events.list .infos {
	flex-direction: row;
	align-items: flex-start;
	flex: 1 1 0;
	gap: calc(var(--item-gap) / 2) var(--item-gap);
}
*/


/* ============================== META ============================== */

.grid.events .post-meta {
	order: var(--event-meta-order);
	gap: 0 var(--content-spacing);
	justify-content: flex-start;
}

.grid.events .post-date.important { width: var(--event-gap); }


/* ============================== TAGS ============================== */

.grid.events:not(.list) .post-tags {
	position: absolute;
	inset: auto 0 0 0;
}

/* ============================== TIME ============================== */

.grid.events time {
	display: flex;
	flex-direction: column;
	gap: 0;
}
.grid.events time > * + * { margin-top: 0; }


/* ============================== TITLE ============================== */

.grid.events .post-title {
	margin-inline: var(--event-title-margin);
	align-items: var(--event-title-align);
}

@media (width < 1000px) {
	.grid.events.list .post-title {
		width: 100%;
		text-align: left;
	}
}
@media (min-width: 1000px) {
	.grid.events:not(.list) .post-title { padding-inline: var(--event-gap); }
}


/* ============================== IMAGES ============================== */

.grid.events .item-content > :where(.thumbnails, .thumbnail) {
	order: var(--event-img-order);
	margin-top: auto;
	margin-inline: auto;
	width: calc(100% - (var(--event-gap) + 1em) * 2);
}


/* ============================== AS LIST ============================== */

.grid.events.list .item { padding-bottom: var(--grid-gap-y); }
.grid.events.list .item-content {
	align-items: center;
	justify-content: flex-start;
}
.grid.events.list .item-content > :where(.thumbnails, .thumbnail) {
	flex: 0 0 var(--event-img-size);
	margin-block: auto;
	margin-inline: auto 0;
}

.grid.events.list .item-content > .thumbnails .thumbnail { width: 100%; }
.grid.events.list .item-content > .thumbnails { margin-left: auto; height: auto; }

.grid.events.list .infos { align-items: center; }
.grid.events.list .post-tags { width: auto; }


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


/* ============================== HOVER ============================== */

 @media (hover: hover) {
	/*.grid.events.list:hover .item-content { opacity: .5; }
	.grid.events.list:hover .item:hover .item-content { opacity: 1; }*/
	.grid.events.is-archive .item.unavailable:hover { --item-opacity: 1; }
}
@media (hover: none) {
	/*.grid.events.list.hover .item-content { opacity: .5; }
	.grid.events.list.hover .item:hover .item-content { opacity: 1; }*/
	.grid.events.is-archive .item.unavailable.hover { --item-opacity: 1; }
}



/* ================================================================================================= */
/* ============================================= POSTS ============================================= */
/* ================================================================================================= */

.grid.posts .thumbnail { order: -1; }
.grid.posts .infos { padding-bottom: calc(var(--item-gap) / 2); }


/* ============================== HOVER ============================== */
/*
 @media (hover: hover) {
	.grid.posts:hover .item-content { opacity: .5; }
	.grid.posts:hover .item:hover .item-content { opacity: 1; }
}
@media (hover: none) {
	.grid.posts.hover .item-content { opacity: .5; }
	.grid.posts.hover .item:hover .item-content { opacity: 1; }
}
*/


/* =================================================================================================== */
/* ============================================= ACTIONS ============================================= */
/* =================================================================================================== */


.grid.actions .thumbnail { order: -1; }
.grid.actions .infos { padding-bottom: calc(var(--item-gap) / 2); }



/* ====================================================================================================== */
/* ============================================= RESIDENCES ============================================= */
/* ====================================================================================================== */


.grid.residences .item { padding-bottom: var(--content-spacing); }
.grid.productions .item { padding-bottom: var(--content-spacing); }

.grid.residences .infos,
.grid.productions .infos { align-items: flex-start; }

.grid.residences .infos { order: 3; }
.grid.productions .thumbnail { order: -1; }



/* =================================================================================================== */
/* ============================================= SEASONS ============================================= */
/* =================================================================================================== */


.grid.list.seasons .items { isolation: isolate; }

/* reveal moved from .item to .infos: .item must not create a stacking context */
.grid.list.seasons .item.scrolltime-revealed { animation: none; }
.grid.list.seasons .item.scrolltime-revealed .infos {
	animation: reveal ease-in-out both;
	animation-range: cover -25% cover 25%;
	animation-timeline: view(block);
}

.grid.list.seasons .item { position: relative; }
.grid.list.seasons .item::before {
	content: '';
	position: absolute;
	z-index: -1;
	inset: 0;
	width: inherit;
	border-top: solid var(--stroke-width) var(--light-color);
}

.grid.list.seasons .thumbnail {
	position: absolute;
	z-index: 20;
	inset: 0;
	height: 33svh;
	align-items: center;
	pointer-events: none;
	opacity: 0;
	overflow: clip;
	transform: translateX(-1em);

	--img-height: 33svh;
	--img-fit: contain;
}
.grid.list.seasons .item-content:hover .thumbnail {
	opacity: 1;
	transform: translateX(0);
}




/* ================================================================================================== */
/* ============================================= SEARCH ============================================= */
/* ================================================================================================== */


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

.grid.list.search .item::before {
	content: '';
	position: absolute;
	inset: 0;
	width: inherit;
	border-top: solid var(--stroke-width) var(--light-color);
}
.grid.search.list .item-content { flex-direction: row; }
.grid.search.list .cover {
	flex-grow: 1;
	flex-basis: 0;
	aspect-ratio: auto !important;
}
.grid.search .cover img {
	height: 100%;
	object-fit: contain;
}
.grid.search.list .title {
	text-transform: uppercase;
	font-weight: var(--font-weight-bold);
}


.grid.search .post-title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .25em;
}
.grid.search .post-title .post-tag {
	order: initial;
	margin: 0;
}
.grid.search .post-meta {
	justify-content: flex-start;
}

.grid.search.list:hover .item { opacity: .5 }
.grid.search.list:hover .item:hover { opacity: 1; }



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

/* Driven by swipers.js (.has-progress): --swiper-slide-out is 0 while the slide is in view, negative before the start, positive after the end.
   The images follow the slide position (drag and transitions), easing comes from the swiper itself, no CSS transition. */


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

.grid.swiperable {
	--grid-parallax-shift: calc(var(--grid-swiperable-gutter) * 4);
}


/* ============================== IMAGES ============================== */

.grid.swiperable.has-progress .swiper-slide .item-content > figure {
	/*opacity: calc(1 - min(abs(var(--swiper-slide-out, 0)), 1) * (1 - var(--grid-parallax-opacity)));*/
	transform: translateX(calc(var(--swiper-slide-out, 0) * var(--grid-parallax-shift)));
}