/*
 * Boulegue : compléments au theme.json, pour ce que les réglages des blocs n'expriment pas.
 * Repris de htdocs/themes/boniandprod/css/boniandprod.css (sans Bootstrap).
 */

/*
 * Pied de page fixé en bas de l'écran, comme sur boniandprod (.footer, body padding-bottom).
 * La réserve sous le contenu suit la hauteur du pied : une ligne (40 px), deux sur mobile.
 */
:root {
	--boulegue-hauteur-pied: 40px;
}

@media (max-width: 599px) {
	:root {
		--boulegue-hauteur-pied: 56px;
	}
}

body {
	padding-bottom: var(--boulegue-hauteur-pied);
}

.wp-site-blocks > footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 10;
	margin: 0;
}

.boulegue-pied {
	box-sizing: border-box;
	min-height: var(--boulegue-hauteur-pied);
	border-top: 1px solid var(--wp--preset--color--filet-pied);
}

.boulegue-pied p {
	margin: 0;
}

/* Premier « o » rouge des menus et des titres (filtre lettre-rouge de boulegue-site). */
.lettre-rouge {
	color: var(--wp--preset--color--rouge);
}

/* En-tête : menu à droite, liens espacés comme .navbar-nav, élément courant grisé. */
nav.boulegue-menu {
	padding-top: 26px;
}

.boulegue-menu .wp-block-navigation-item__content {
	padding: 15px;
	line-height: 20px;
}

.boulegue-menu .current-menu-item > .wp-block-navigation-item__content {
	background-color: var(--wp--preset--color--fond-menu-actif);
}

.boulegue-menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	padding: 10px 15px;
}

/* Logo : jamais plus large que l'écran. */
.boulegue-entete .wp-block-site-logo img {
	max-width: 100%;
	height: auto;
}

@media (max-width: 599px) {
	.boulegue-entete .wp-block-site-logo {
		max-width: 60%;
	}

	nav.boulegue-menu {
		padding-top: 15px;
	}
}

/* Liens vers les Catégories, à la manière des filtres de boniandprod. */
.boulegue-categories {
	margin-bottom: 15px;
}

.boulegue-categories .wp-block-term-name {
	margin: 0;
}

.boulegue-categories ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.boulegue-categories .wp-block-term-name a {
	display: inline-block;
	padding: 6px 15px;
	border: 1px solid var(--wp--preset--color--rose-filtre);
	background-color: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--texte-filtre);
	font-size: var(--wp--preset--font-size--petit);
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
}

.boulegue-categories .wp-block-term-name a:hover,
.boulegue-categories .wp-block-term-name a:focus {
	background-color: var(--wp--preset--color--fond-filtre-survol);
	border-color: var(--wp--preset--color--bordure-filtre-survol);
	color: var(--wp--preset--color--anthracite);
}

/* Catégorie en cours (et « Tous » sur la liste du Type), comme le filtre actif de boniandprod. */
.boulegue-categories .wp-block-term-name a[aria-current="page"] {
	background-color: var(--wp--preset--color--fond-filtre-survol);
	border-color: var(--wp--preset--color--bordure-filtre-survol);
	color: var(--wp--preset--color--anthracite);
	box-shadow: var(--wp--preset--shadow--categorie-en-cours);
}

/* Grille de cartes : 3 colonnes, 2 sous 992 px, 1 sous 600 px ; hauteurs libres comme le masonry. */
.wp-block-post-template.boulegue-grille {
	align-items: start;
}

@media (max-width: 991px) {
	.wp-block-post-template.boulegue-grille {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.wp-block-post-template.boulegue-grille {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Carte production (.post-wrap, .meta-inf). */
.boulegue-carte__etiquettes > *,
.boulegue-fiche__etiquettes > * {
	margin: 0;
	padding: 10px 0;
	border-bottom: 1px solid var(--wp--preset--color--filet-etiquette);
}

.boulegue-etiquette:not(:has(.wp-block-post-terms)) {
	display: none;
}

.boulegue-etiquette .wp-block-post-terms {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
}

.boulegue-etiquette a,
.boulegue-etiquette .wp-block-post-terms__prefix {
	color: var(--wp--preset--color--etiquette);
}

/* Mise en avant : un seul bloc Termes, chaque terme coloré par son adresse ; Diaporama masqué. */
.boulegue-mise-en-avant {
	display: flex;
	flex-direction: column;
	padding: 0 !important;
	border: 0 !important;
}

.boulegue-mise-en-avant .wp-block-post-terms__separator,
.boulegue-mise-en-avant a[href*="term=diaporama"],
.boulegue-mise-en-avant a[href*="/diaporama"] {
	display: none;
}

.boulegue-mise-en-avant a {
	display: block;
	padding: 10px 0;
	border-bottom: 1px solid var(--wp--preset--color--filet-etiquette);
	pointer-events: none;
}

.boulegue-mise-en-avant a[href*="en-developpement"] {
	color: var(--wp--preset--color--developpement);
}

.boulegue-mise-en-avant a[href*="a-la-une"] {
	color: var(--wp--preset--color--accent);
}

.boulegue-carte__titre a {
	color: var(--wp--preset--color--titre);
}

.boulegue-carte .wp-block-post-featured-image {
	margin: 0;
}

.boulegue-carte .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
}

/* « Lire la suite » (a.read-more de boniandprod). */
.boulegue-carte .wp-block-read-more,
.boulegue-mini-fiche .wp-block-read-more {
	display: inline-block;
	padding: 0 4px;
	background-color: var(--wp--preset--color--rose-lire-la-suite);
	color: var(--wp--preset--color--blanc);
	font-weight: 300;
}

.boulegue-carte .wp-block-read-more:hover,
.boulegue-carte .wp-block-read-more:focus,
.boulegue-mini-fiche .wp-block-read-more:hover,
.boulegue-mini-fiche .wp-block-read-more:focus {
	background-color: var(--wp--preset--color--bouton-survol);
}

/* Liste des résultats de recherche. */
.boulegue-resultats .wp-block-post-title {
	margin-bottom: 0.5em;
}

/* ************************************************************
 * Fiches Production et Événement, agenda (story 11).
 * ************************************************************ */

/* Fil d'Ariane (.breadcrumb de Bootstrap). */
.boulegue-ariane {
	padding: 8px 15px;
	margin-bottom: 20px;
}

.boulegue-ariane ol {
	margin: 0;
}

.boulegue-ariane [aria-current] {
	color: var(--wp--preset--color--texte);
}

/* Étiquettes d'une fiche : Type › Catégorie, ou « Événements ». */
.boulegue-fiche__etiquettes {
	margin-bottom: 10px;
}

.boulegue-fiche__etiquettes .boulegue-etiquette-texte {
	text-transform: uppercase;
}

/* Titre des colonnes « Agenda : » et « À voir aussi : ». */
.boulegue-colonne__titre {
	margin-bottom: 15px;
}

/* Titre de la page Agenda (.page-header). */
.boulegue-titre-page {
	padding-bottom: 9px;
	border-bottom: 1px solid var(--wp--preset--color--fond-menu-actif);
}

/*
 * Ruban de date (.date-ribbons-wrapper .ribbon) : 40 px de large, queue en V découpée dans le fond
 * du ruban (la couleur suit celle choisie dans l'éditeur).
 */
.boulegue-ruban {
	position: relative;
	box-sizing: border-box;
	width: 40px;
	padding: 4px 0 2px;
	text-align: center;
	font-weight: 700;
	line-height: 1.2;
}

.boulegue-ruban::after {
	content: "";
	position: absolute;
	/* Chevauche le ruban d'1 px : pas de filet clair entre le ruban et sa queue. */
	top: calc(100% - 1px);
	left: 0;
	width: 100%;
	height: 11px;
	background: inherit;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 0, 0 100%);
}

.boulegue-ruban p {
	margin: 0;
}

.boulegue-ruban__mois,
.boulegue-ruban__annee {
	font-size: 10px;
}

.boulegue-ruban__jour {
	font-size: 25px;
	line-height: 1.1;
}

/* Fiche Événement : ruban en haut à droite de la carte (.production.full). */
.boulegue-fiche-evenement {
	position: relative;
}

/* Place du ruban (25 + 40 px depuis le bord, moins les 20 px de marge de la carte) : le titre et
   les étiquettes ne passent pas dessous. */
.boulegue-fiche-evenement > .wp-block-post-title,
.boulegue-fiche-evenement > .boulegue-fiche__etiquettes {
	padding-right: 55px;
}

.boulegue-fiche-evenement > .boulegue-ruban {
	position: absolute;
	top: 0;
	right: 25px;
	margin: 0 !important;
	z-index: 1;
}

/* Mini-fiche événement (mini_teaser) : visuel et ruban à gauche, texte à droite. */
.boulegue-mini-fiche {
	position: relative;
	height: 100%;
}

.boulegue-mini-fiche__visuel {
	position: relative;
	flex: 0 0 40%;
	min-height: 90px;
	padding-right: 15px;
	box-sizing: border-box;
}

.boulegue-mini-fiche__visuel .boulegue-ruban {
	position: absolute;
	top: 0;
	left: 5px;
	z-index: 1;
}

.boulegue-mini-fiche__visuel .wp-block-post-featured-image {
	margin: 0;
}

.boulegue-mini-fiche__visuel .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
}

.boulegue-mini-fiche__texte {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word;
}

.boulegue-mini-fiche__texte > * {
	margin: 0;
}

.boulegue-mini-fiche__date {
	padding: 5px 0;
	margin-bottom: 5px !important;
	border-bottom: 1px solid var(--wp--preset--color--filet-etiquette);
}

.boulegue-mini-fiche__titre {
	margin: 5px 0 !important;
}

.boulegue-mini-fiche__titre a {
	color: var(--wp--preset--color--titre);
}

.boulegue-mini-fiche .wp-block-read-more {
	margin-top: 5px;
}

/* Colonne d'une fiche : mini-fiches et carte empilées. */
.boulegue-a-voir-aussi .wp-block-post-template,
.boulegue-prochaines-dates .wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Lieu et Adresse d'une fiche Événement : lignes serrées, comme l'adresse de Drupal. */
.boulegue-fiche-evenement > .boulegue-fiche__adresse {
	margin-block-start: 0;
}

/* ************************************************************
 * Accueil (story 5) : diaporama, « À la une », colonne latérale, réseaux sociaux.
 * ************************************************************ */

/*
 * Diaporama (vue slideshow de boniandprod) : diapositives au format 1140 × 270, côte à côte, à
 * faire défiler horizontalement ; le script du thème les fait avancer et masque la barre.
 */
.boulegue-diaporama {
	position: relative;
	margin-bottom: 20px;
}

.boulegue-diaporama .boulegue-diaporama__diapos {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
}

.boulegue-diaporama.est-anime .boulegue-diaporama__diapos {
	scrollbar-width: none;
}

.boulegue-diaporama.est-anime .boulegue-diaporama__diapos::-webkit-scrollbar {
	display: none;
}

.boulegue-diaporama__diapos > li {
	position: relative;
	flex: 0 0 100%;
	margin: 0;
	aspect-ratio: 1140 / 270;
	overflow: hidden;
	scroll-snap-align: start;
	/* Fond neutre : un contenu sans image garde son titre lisible, sans image cassée. */
	background-color: var(--wp--preset--color--etiquette);
}

.boulegue-diaporama .wp-block-post-featured-image {
	position: absolute;
	inset: 0;
	margin: 0;
}

.boulegue-diaporama .wp-block-post-featured-image a,
.boulegue-diaporama .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.boulegue-diaporama .boulegue-diaporama__legende {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 30px 15px 28px;
	background: linear-gradient(transparent, color-mix(in srgb, var(--wp--preset--color--anthracite) 60%, transparent));
	line-height: 1.2;
}

.boulegue-diaporama .boulegue-diaporama__legende a {
	color: inherit;
}

/* Puces (.views_slideshow_pager_field_item) : point blanc de 8 px, le courant en anneau de 10 px,
   dans une zone cliquable de 24 × 24 px. */
.boulegue-diaporama__puces {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	text-align: center;
	line-height: 0;
	pointer-events: none;
}

.boulegue-diaporama__puces[hidden],
.boulegue-diaporama__pause[hidden] {
	display: none;
}

.boulegue-diaporama__puce,
.boulegue-diaporama__pause {
	position: relative;
	box-sizing: border-box;
	display: inline-block;
	width: 24px;
	height: 24px;
	margin: 0 2px;
	padding: 0;
	border: 0;
	background: none;
	vertical-align: top;
	cursor: pointer;
	pointer-events: auto;
}

.boulegue-diaporama__puce::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	box-sizing: border-box;
	width: 8px;
	height: 8px;
	border: 1px solid transparent;
	border-radius: 50%;
	background: var(--wp--preset--color--blanc);
	transform: translate(-50%, -50%);
}

.boulegue-diaporama__puce[aria-current="true"]::before {
	width: 10px;
	height: 10px;
	border-color: var(--wp--preset--color--blanc);
	background: transparent;
}

/* Bouton pause / lecture, en bas à droite : deux barres, ou un triangle une fois arrêté. */
.boulegue-diaporama__pause {
	position: absolute;
	right: 6px;
	bottom: 0;
	z-index: 2;
	margin: 0;
}

.boulegue-diaporama__pause::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 8px;
	width: 3px;
	height: 10px;
	border-left: 3px solid var(--wp--preset--color--blanc);
	border-right: 3px solid var(--wp--preset--color--blanc);
}

.boulegue-diaporama__pause.est-arrete::before {
	left: 9px;
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 8px solid var(--wp--preset--color--blanc);
	border-right: 0;
}

.boulegue-diaporama__puce:focus-visible,
.boulegue-diaporama__pause:focus-visible {
	outline: 2px solid var(--wp--preset--color--blanc);
	outline-offset: -2px;
}

@media (max-width: 599px) {
	/* Légende réduite et coupée à deux lignes : la diapositive ne fait que 90 px de haut. */
	.boulegue-diaporama .boulegue-diaporama__legende {
		display: -webkit-box;
		padding: 8px 40px 24px 10px;
		overflow: hidden;
		font-size: var(--wp--preset--font-size--petit) !important;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	.boulegue-diaporama__puce {
		margin: 0;
	}
}

/* « À la une » dans la colonne principale : 3 cartes, 2 sous 992 px, 1 sous 600 px (grille commune). */
.boulegue-a-la-une .boulegue-colonne__titre {
	margin-top: 0;
}

/* « À la une » vide (Boucle retirée par boulegue-site) : la colonne latérale prend toute la largeur. */
.boulegue-accueil__colonnes > .wp-block-column:first-child:not(:has(.boulegue-a-la-une)) {
	display: none;
}

.boulegue-accueil__colonnes:not(:has(.boulegue-a-la-une)) > .wp-block-column:last-child {
	flex-basis: 100% !important;
}

/* Colonne latérale : Coordonnées, newsletter, lien Facebook. */
.boulegue-colonne-accueil > :first-child {
	margin-top: 0;
}

.boulegue-colonne-accueil > .boulegue-colonne__titre {
	margin-top: 30px;
	margin-bottom: 0;
}

/* Pied de page : réseaux sociaux à droite du copyright, icônes en couleur Texte de la palette
   (plus fort que les couleurs de marque du style « logos seuls »). */
.boulegue-pied .boulegue-reseaux {
	flex-shrink: 0;
	margin: 0;
}

.boulegue-pied .wp-block-social-links.boulegue-reseaux .wp-social-link {
	color: var(--wp--preset--color--texte);
}

/* Affiche des fiches (field_image_body Drupal) : 250 px à gauche, le corps (titres compris) à
   côté ; les sections des paragraphes Drupal (boulegue-section), galeries, fichiers et vidéos
   passent dessous. */
.wp-block-image.boulegue-affiche.alignleft {
	margin: 0 15px 15px 0;
}
.wp-block-image.boulegue-affiche ~ :is(.boulegue-section, .wp-block-gallery, .wp-block-file, .wp-block-embed) {
	clear: both;
}
.wp-block-post-content:has(> .boulegue-affiche) {
	display: flow-root;
}
@media (max-width: 599px) {
	.wp-block-image.boulegue-affiche.alignleft {
		float: none;
		width: 100%;
		margin: 0 0 15px;
	}
	.wp-block-image.boulegue-affiche img {
		width: 100% !important;
	}
}
