/**
 * Styles des pages PIVOT.
 *
 * Volontairement discrets : le but est de s'insérer dans le thème hôte plutôt
 * que de lui imposer une identité. Tout est réglable via les variables
 * ci-dessous, redéfinissables dans le thème enfant.
 */

.pivot-listing,
.pivot-detail {
	--pivot-gap: 1.5rem;
	--pivot-radius: 6px;
	--pivot-border: 1px solid rgba( 0, 0, 0, 0.12 );
	--pivot-muted: rgba( 0, 0, 0, 0.6 );
	--pivot-accent: currentColor;
	--pivot-card-min: 260px;

	max-width: 1200px;
	margin: 0 auto;
	padding: var( --pivot-gap );
}

/* ------------------------------------------------------------------ commun */

.pivot-button {
	display: inline-block;
	padding: 0.5em 1.1em;
	border: var( --pivot-border );
	border-radius: var( --pivot-radius );
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.pivot-button:hover,
.pivot-button:focus-visible {
	border-color: currentColor;
}

.pivot-button-ghost {
	background: transparent;
}

.pivot-listing :focus-visible,
.pivot-detail :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ----------------------------------------------------------------- listing */

.pivot-listing-banner {
	margin: 0 0 var( --pivot-gap );
}

.pivot-listing-banner img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 400px;
	object-fit: cover;
}

.pivot-listing-header {
	margin-bottom: var( --pivot-gap );
}

.pivot-listing-intro {
	max-width: 68ch;
	color: var( --pivot-muted );
}

.pivot-criteria {
	margin-bottom: var( --pivot-gap );
	padding: var( --pivot-gap );
	border: var( --pivot-border );
	border-radius: var( --pivot-radius );
}

.pivot-filters-zone {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
	gap: 1rem;
}

.pivot-field label,
.pivot-field legend {
	display: block;
	margin-bottom: 0.35em;
	font-size: 0.9em;
	font-weight: 600;
}

.pivot-field input[type="text"],
.pivot-field input[type="search"],
.pivot-field select {
	width: 100%;
	padding: 0.5em;
	border: var( --pivot-border );
	border-radius: var( --pivot-radius );
	background: #fff;
	font: inherit;
}

.pivot-field fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

/* Groupe de critères : un intertitre au-dessus des critères qu'il réunit,
   comme « Équipements » au-dessus de ses cases. */
.pivot-filter-group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.pivot-filter-group-title {
	margin-bottom: 0.6em;
	padding: 0;
	font-weight: 700;
}

.pivot-filter-group > .pivot-field + .pivot-field {
	margin-top: 0.75em;
}

.pivot-filter-group > .pivot-field-toggle + .pivot-field-toggle {
	margin-top: 0;
}

.pivot-check {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin-bottom: 0.25em;
	font-weight: 400;
}

.pivot-check input {
	margin: 0;
}

.pivot-count {
	color: var( --pivot-muted );
	font-size: 0.85em;
	font-style: normal;
}

/* Critère numérique : « au moins [ 3 ] », « entre [ 10 ] € et [ 50 ] € ».
   Les variables ont une valeur de repli : un thème qui réécrit le gabarit de
   listing sans la classe pivot-listing peut réutiliser ce contrôle tel quel. */
.pivot-range {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em;
}

.pivot-field .pivot-range input[type="text"] {
	width: 6.5em;
	border: var( --pivot-border, 1px solid rgba( 0, 0, 0, 0.2 ) );
	border-radius: var( --pivot-radius, 6px );
}

.pivot-range-word,
.pivot-range-unit {
	color: var( --pivot-muted, rgba( 0, 0, 0, 0.6 ) );
	font-size: 0.9em;
}

.pivot-field input[type="range"] {
	display: block;
	width: 100%;
	margin: 0.35em 0;
	accent-color: var( --pivot-accent, currentColor );
}

.pivot-range-output {
	display: block;
	font-size: 0.9em;
}

.pivot-field .pivot-range input[aria-invalid="true"] {
	border-color: #b32d2e;
}

.pivot-field-error {
	margin: 0.35em 0 0;
	color: #b32d2e;
	font-size: 0.85em;
}

.pivot-field-error[hidden] {
	display: none;
}

/* Critère de date : « du [ 10/10/2026 ] au [ 31/10/2026 ] ». Le calendrier
   est celui du navigateur, dans la langue du visiteur. */
.pivot-dates {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em;
}

.pivot-field .pivot-dates input[type="date"] {
	flex: 1 1 9.5em;
	min-width: 0;
	max-width: 13em;
	padding: 0.45em 0.5em;
	border: var( --pivot-border, 1px solid rgba( 0, 0, 0, 0.2 ) );
	border-radius: var( --pivot-radius, 6px );
	background: #fff;
	font: inherit;
}

.pivot-dates-word {
	color: var( --pivot-muted, rgba( 0, 0, 0, 0.6 ) );
	font-size: 0.9em;
}

.pivot-criteria-actions {
	display: flex;
	gap: 0.5rem;
	margin: 1rem 0 0;
}

.pivot-map {
	height: 420px;
	margin-bottom: var( --pivot-gap );
	border-radius: var( --pivot-radius );
	background: rgba( 0, 0, 0, 0.04 );
}

/* Bulle d'une offre : bouton du tracé GPX (itinéraires). Le tracé lui-même
   porte les classes pivot-map-track-line et pivot-map-track-casing. */
.pivot-map-track {
	margin: 0.6em 0 0;
}

.pivot-map-track-button {
	padding: 0.35em 0.8em;
	font-size: 0.92em;
}

.pivot-map-track-button[aria-pressed="true"] {
	border-color: currentColor;
	font-weight: 700;
}

.pivot-map-track-button:disabled {
	cursor: default;
	opacity: 0.7;
}

.pivot-map-track-button.is-error {
	border-style: dashed;
}

.pivot-results-count {
	margin: 0 0 1rem;
	color: var( --pivot-muted );
	font-size: 0.95em;
}

/* ------------------------------------------------------------------ grille */

.pivot-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( var( --pivot-card-min ), 1fr ) );
	gap: var( --pivot-gap );
}

/* Colonnes d'une page de listing, aux paliers de la grille Bootstrap : le
   nombre réglé pour la page à partir de 1200 px, trois au plus dès 992 px,
   deux dès 576 px (tablette), une en dessous (mobile). Une grille sans classe
   pivot-cols-N, comme celle d'un gabarit de thème plus ancien, garde le
   remplissage automatique ci-dessus. */
.pivot-listing .pivot-grid[class*="pivot-cols-"] {
	grid-template-columns: minmax( 0, 1fr );
}

@media ( min-width: 576px ) {
	.pivot-listing .pivot-grid.pivot-cols-2,
	.pivot-listing .pivot-grid.pivot-cols-3,
	.pivot-listing .pivot-grid.pivot-cols-4,
	.pivot-listing .pivot-grid.pivot-cols-5,
	.pivot-listing .pivot-grid.pivot-cols-6 {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( min-width: 992px ) {
	.pivot-listing .pivot-grid.pivot-cols-3,
	.pivot-listing .pivot-grid.pivot-cols-4,
	.pivot-listing .pivot-grid.pivot-cols-5,
	.pivot-listing .pivot-grid.pivot-cols-6 {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}
}

@media ( min-width: 1200px ) {
	.pivot-listing .pivot-grid.pivot-cols-4 {
		grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	}

	.pivot-listing .pivot-grid.pivot-cols-5 {
		grid-template-columns: repeat( 5, minmax( 0, 1fr ) );
	}

	.pivot-listing .pivot-grid.pivot-cols-6 {
		grid-template-columns: repeat( 6, minmax( 0, 1fr ) );
	}
}

.pivot-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: var( --pivot-border );
	border-radius: var( --pivot-radius );
	background: #fff;
}

.pivot-card-media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: rgba( 0, 0, 0, 0.04 );
}

.pivot-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pivot-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1rem;
}

.pivot-card-type {
	margin: 0;
	color: var( --pivot-muted );
	font-size: 0.78em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pivot-card-title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.3;
}

.pivot-card-title a {
	color: inherit;
	text-decoration: none;
}

.pivot-card-title a:hover,
.pivot-card-title a:focus-visible {
	text-decoration: underline;
}

.pivot-card-place {
	margin: 0;
	color: var( --pivot-muted );
	font-size: 0.9em;
}

.pivot-card-excerpt {
	margin: 0;
	font-size: 0.92em;
}

.pivot-card-action {
	margin: auto 0 0;
	padding-top: 0.5rem;
}

.pivot-empty-results {
	grid-column: 1 / -1;
	padding: 2rem;
	border: 1px dashed rgba( 0, 0, 0, 0.2 );
	border-radius: var( --pivot-radius );
	color: var( --pivot-muted );
	text-align: center;
}

/* -------------------------------------------------------------- pagination */

.pivot-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: center;
	margin-top: var( --pivot-gap );
}

.pivot-pagination .pivot-page,
.pivot-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4em;
	height: 2.4em;
	padding: 0 0.6em;
	border: var( --pivot-border );
	border-radius: var( --pivot-radius );
	background: transparent;
	color: inherit;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.pivot-pagination .pivot-page.is-current,
.pivot-pagination .page-numbers.current {
	border-color: currentColor;
	font-weight: 700;
}

.pivot-page-dots {
	align-self: center;
	padding: 0 0.2em;
	color: var( --pivot-muted );
}

/* ------------------------------------------------------------------ détail */

.pivot-breadcrumb {
	margin-bottom: 1rem;
	color: var( --pivot-muted );
	font-size: 0.9em;
}

.pivot-breadcrumb a {
	color: inherit;
}

.pivot-detail-type {
	margin: 0 0 0.25rem;
	color: var( --pivot-muted );
	font-size: 0.8em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pivot-detail-title {
	margin: 0 0 0.5rem;
}

.pivot-detail-address {
	margin: 0;
	color: var( --pivot-muted );
}

.pivot-gallery {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 160px, 1fr ) );
	gap: 0.75rem;
	margin: var( --pivot-gap ) 0;
}

.pivot-gallery-item {
	position: relative;
	margin: 0;
	overflow: hidden;
	border-radius: var( --pivot-radius );
}

.pivot-gallery-item.is-primary {
	grid-column: span 2;
	grid-row: span 2;
}

.pivot-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pivot-credit {
	position: absolute;
	right: 0;
	bottom: 0;
	padding: 0.2em 0.5em;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	font-size: 0.72em;
}

.pivot-detail-layout {
	display: grid;
	grid-template-columns: minmax( 0, 2fr ) minmax( 0, 1fr );
	gap: calc( var( --pivot-gap ) * 1.5 );
	align-items: start;
}

.pivot-spec-group {
	margin-bottom: var( --pivot-gap );
}

.pivot-spec-group h2 {
	margin: 0 0 0.6rem;
	padding-bottom: 0.3rem;
	border-bottom: var( --pivot-border );
	font-size: 1.05rem;
}

.pivot-spec-list {
	margin: 0;
}

.pivot-spec {
	display: grid;
	grid-template-columns: minmax( 140px, 34% ) 1fr;
	gap: 0.5rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.06 );
}

.pivot-spec dt {
	margin: 0;
	color: var( --pivot-muted );
	font-size: 0.9em;
}

.pivot-spec dd {
	margin: 0;
}

.pivot-detail-side {
	position: sticky;
	top: 1rem;
	padding: 1rem;
	border: var( --pivot-border );
	border-radius: var( --pivot-radius );
}

.pivot-detail-side h2 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
}

.pivot-contact ul {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
}

.pivot-contact li {
	padding: 0.25rem 0;
}

.pivot-reference {
	color: var( --pivot-muted );
	font-size: 0.82em;
}

/* -------------------------------------------------------------- fermetures */

/* Zones de fermeture liées à une offre (Pivot_Closures). Couleurs réglables :
   --pivot-closed et --pivot-closed-text pour « fermé ce … »,
   --pivot-impact et --pivot-impact-text pour « Impact chasse + ». */

[data-pivot-closure][hidden],
[data-pivot-closure-end][hidden],
[data-pivot-closure-group][hidden] {
	display: none !important;
}

.pivot-closures {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
}

.pivot-card-media .pivot-closures {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	left: 0.6rem;
	z-index: 2;
}

.pivot-closure-today,
.pivot-closure-impact {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin: 0;
	padding: 0.3em 0.7em;
	border-radius: var( --pivot-radius, 6px );
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.25 );
}

.pivot-closure-today {
	background: var( --pivot-closed, #c62828 );
	color: var( --pivot-closed-text, #fff );
}

.pivot-closure-impact {
	background: var( --pivot-impact, #f39200 );
	color: var( --pivot-impact-text, #1d1d1b );
}

a.pivot-closure-impact:hover,
a.pivot-closure-impact:focus-visible {
	color: var( --pivot-impact-text, #1d1d1b );
	text-decoration: underline;
}

.pivot-closure-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.2em;
	height: 1.2em;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-size: 0.9em;
	line-height: 1;
}

/* Fiche : alerte du jour. */

.pivot-closure-alerts {
	margin: var( --pivot-gap, 1.5rem ) 0;
}

.pivot-closure-alert {
	padding: 0.9rem 1.1rem;
	border-left: 5px solid var( --pivot-closed, #c62828 );
	border-radius: var( --pivot-radius, 6px );
	background: rgba( 198, 40, 40, 0.08 );
}

.pivot-closure-alert.is-upcoming {
	border-left-color: var( --pivot-impact, #f39200 );
	background: rgba( 243, 146, 0, 0.1 );
}

.pivot-closure-alert p {
	margin: 0;
}

.pivot-closure-alert p + p {
	margin-top: 0.4rem;
}

.pivot-closure-alert-title {
	font-weight: 700;
}

.pivot-closure-alert .pivot-closure-kind {
	display: inline-block;
	margin-right: 0.4rem;
	font-size: 0.9em;
}

.pivot-closure-alert .pivot-closure-impact {
	margin-right: 0.4rem;
	box-shadow: none;
}

.pivot-closure-alert-more {
	margin: 0.5rem 0 0;
	font-size: 0.9em;
}

/* Fiche : dates à venir. */

.pivot-closures-schedule {
	margin-bottom: var( --pivot-gap, 1.5rem );
	scroll-margin-top: 2rem;
}

.pivot-closures-schedule h2 {
	margin: 0 0 0.6rem;
	padding-bottom: 0.3rem;
	border-bottom: var( --pivot-border );
	font-size: 1.05rem;
}

.pivot-closures-reason {
	margin: 0 0 0.6rem;
	color: var( --pivot-muted );
}

.pivot-closures-month h3 {
	margin: 0.9rem 0 0.3rem;
	font-size: 0.95rem;
}

.pivot-closures-month ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pivot-closures-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.75rem;
	padding: 0.35rem 0.5rem;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.06 );
}

.pivot-closures-row.is-today {
	border-radius: var( --pivot-radius, 6px );
	background: rgba( 198, 40, 40, 0.08 );
	box-shadow: inset 4px 0 0 var( --pivot-closed, #c62828 );
}

.pivot-closures-date {
	flex: 0 0 auto;
	font-weight: 600;
}

.pivot-closures-today-tag {
	align-self: center;
	padding: 0.05em 0.5em;
	border-radius: var( --pivot-radius, 6px );
	background: var( --pivot-closed, #c62828 );
	color: var( --pivot-closed-text, #fff );
	font-size: 0.75em;
	font-weight: 700;
}

.pivot-closures-row:not( .is-today ) .pivot-closures-today-tag {
	display: none;
}

.pivot-closures-kind,
.pivot-closures-zones {
	color: var( --pivot-muted );
	font-size: 0.88em;
}

.pivot-closures-zones {
	flex: 1 1 14rem;
}

/* ------------------------------------------------------------- adaptations */

@media ( max-width: 782px ) {
	.pivot-detail-layout {
		grid-template-columns: 1fr;
	}

	.pivot-detail-side {
		position: static;
	}

	.pivot-map {
		height: 300px;
	}

	.pivot-gallery-item.is-primary {
		grid-column: span 2;
		grid-row: auto;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.pivot-listing *,
	.pivot-detail * {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

@media ( prefers-color-scheme: dark ) {
	.pivot-listing,
	.pivot-detail {
		--pivot-border: 1px solid rgba( 255, 255, 255, 0.18 );
		--pivot-muted: rgba( 255, 255, 255, 0.65 );
	}

	.pivot-card,
	.pivot-field input[type="text"],
	.pivot-field input[type="search"],
	.pivot-field select {
		background: rgba( 255, 255, 255, 0.04 );
		color: inherit;
	}

	/* L'icône et le calendrier du navigateur suivent le thème sombre. */
	.pivot-field .pivot-dates input[type="date"] {
		background: rgba( 255, 255, 255, 0.04 );
		color: inherit;
		color-scheme: dark;
	}

	.pivot-field .pivot-range input[aria-invalid="true"] {
		border-color: #f86368;
	}

	.pivot-field-error {
		color: #f86368;
	}
}

/* ------------------------------------------------ insertion par shortcode */

.pivot-inline {
	--pivot-gap: 1.25rem;
	--pivot-radius: 6px;
	--pivot-border: 1px solid rgba( 0, 0, 0, 0.12 );
	--pivot-muted: rgba( 0, 0, 0, 0.6 );

	margin: 2rem 0;
}

.pivot-inline-title {
	margin: 0 0 1rem;
}

/* Le nombre de colonnes est fixé par le shortcode ; en dessous de 640 px la
   grille repasse en une seule colonne quoi qu'il arrive. */
.pivot-inline .pivot-grid {
	grid-template-columns: repeat( var( --pivot-inline-cols, 3 ), minmax( 0, 1fr ) );
}

.pivot-cols-1 { --pivot-inline-cols: 1; }
.pivot-cols-2 { --pivot-inline-cols: 2; }
.pivot-cols-3 { --pivot-inline-cols: 3; }
.pivot-cols-4 { --pivot-inline-cols: 4; }
.pivot-cols-5 { --pivot-inline-cols: 5; }
.pivot-cols-6 { --pivot-inline-cols: 6; }

.pivot-inline-more {
	margin-top: 1.25rem;
}

.pivot-inline-error {
	padding: 0.75rem 1rem;
	border-left: 4px solid #b32d2e;
	background: rgba( 179, 45, 46, 0.06 );
}

@media ( max-width: 900px ) {
	.pivot-inline .pivot-grid {
		grid-template-columns: repeat( min( var( --pivot-inline-cols, 3 ), 2 ), minmax( 0, 1fr ) );
	}
}

@media ( max-width: 600px ) {
	.pivot-inline .pivot-grid {
		grid-template-columns: 1fr;
	}
}

@media ( prefers-color-scheme: dark ) {
	.pivot-inline {
		--pivot-border: 1px solid rgba( 255, 255, 255, 0.18 );
		--pivot-muted: rgba( 255, 255, 255, 0.65 );
	}
}
