/* ============================================================
   Bosson blocks — additive frontend layout helpers.
   Only classes the hardcoded templates did not need.
   The blocks otherwise reuse the existing main.css classes.
   ============================================================ */

/* Button groups inside blocks reuse .hero__actions (flex/gap) */

/* Text + image : image on the left */
.about-grid--image-left .about-grid__text { order: 2; }
.tech-section--image-left > div:first-child { order: 2; }

/* Key figures : 2 or 4 columns (3 stays the main.css default) */
.stats-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
	.stats-grid--cols-2,
	.stats-grid--cols-4 { grid-template-columns: 1fr; }
}

/* ── Bouton autonome ─────────────────────────────────────── */
.bosson-button-block {
	display: flex;
	padding-block: 8px;
}
.bosson-button-block--left   { justify-content: flex-start; }
.bosson-button-block--center { justify-content: center; }
.bosson-button-block--right  { justify-content: flex-end; }

/* ── Image seule (légende + lien) ────────────────────────── */
.bosson-image {
	margin: 0;
}
.bosson-image--normal { max-width: 720px; margin-inline: auto; }
.bosson-image--wide   { max-width: 960px; margin-inline: auto; }
.bosson-image--full   { max-width: none; }
.bosson-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius);
}
.bosson-image figcaption {
	margin-top: 12px;
	font-size: 14px;
	color: var(--c-on-surface-variant);
	text-align: center;
}
.bosson-image figcaption a { color: var(--c-primary); text-decoration: underline; }

/* Feature list : compact (trust) presentation reuses .trust-grid */

/* Timeline : desktop zig-zag + readable mobile (block markup is uniform) */
@media (min-width: 769px) {
	.timeline .timeline-event:nth-child(even) .timeline-event__text--left {
		grid-column: 3;
		text-align: left;
	}
	.timeline .timeline-event:nth-child(even) .timeline-event__text--right {
		grid-column: 1;
	}
}
@media (max-width: 768px) {
	.timeline .timeline-event__text--left {
		display: block;
		grid-column: 2;
		grid-row: 2;
		text-align: left;
		padding: 0 0 0 24px;
	}
	.timeline .timeline-event__text--right { grid-row: 3; }
}

/* Team : optional fixed column counts */
.team-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .team-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .team-grid--3 { grid-template-columns: 1fr; } }

/* ── Pages composées ──────────────────────────────────────────
   the_content() de toutes les pages à blocs passe par .page-composed.
   Les sections Bosson (Hero, Texte+image…) restent pleine largeur ;
   le texte libre (paragraphes, titres, listes, images) est cadré
   comme le reste du site (aligné avec le logo).
   ──────────────────────────────────────────────────────────── */
.page-composed > * {
	max-width: var(--max-w);
	margin-inline: auto;
	padding-inline: var(--px-desktop);
	box-sizing: border-box;
}
.page-composed > * + * { margin-top: 24px; }

/* Les blocs Bosson gèrent leur propre conteneur → pleine largeur */
.page-composed > [class*="wp-block-bosson-"] {
	max-width: none;
	padding-inline: 0;
	margin-top: 0;
}

/* Respiration quand la page commence / finit par du texte */
.page-composed > *:first-child:not([class*="wp-block-bosson-"]) { margin-top: 56px; }
.page-composed > *:last-child:not([class*="wp-block-bosson-"])  { margin-bottom: 56px; }

/* Typo du texte libre — UNIQUEMENT les blocs core posés directement dans la
   page (enfants directs). Ne touche jamais l'intérieur des sections Bosson. */
.page-composed > h1,
.page-composed > h2,
.page-composed > h3 {
	color: var(--c-primary);
	font-weight: 600;
	margin-top: 40px;
}
.page-composed > p { line-height: 1.8; color: var(--c-on-surface-variant); }

/* Listes de contenu : réactive les puces (annulées globalement) */
.page-composed > ul,
.page-composed > ol,
.page-default .entry-content ul,
.page-default .entry-content ol { list-style: revert; }
.page-composed > ul,
.page-default .entry-content ul { list-style-type: disc; }
.page-composed > ol,
.page-default .entry-content ol { list-style-type: decimal; }
.page-composed > ul ul { list-style-type: circle; }

.page-composed > ul li,
.page-composed > ol li,
.page-default .entry-content li { margin-bottom: 6px; line-height: 1.7; color: var(--c-on-surface-variant); }

/* Une liste posée directement dans une page composée garde la gouttière du
   site EN PLUS de l'espace pour les puces */
.page-composed > ul,
.page-composed > ol {
	padding-left: calc(var(--px-desktop) + 1.5em);
	list-style-position: outside;
}
.page-default .entry-content ul,
.page-default .entry-content ol { padding-left: 1.5em; }

@media (max-width: 768px) {
	.page-composed > *:not([class*="wp-block-bosson-"]) { padding-inline: var(--px-mobile); }
	.page-composed > ul,
	.page-composed > ol { padding-left: calc(var(--px-mobile) + 1.5em); }
}

/* ── Tableaux (core/table) ───────────────────────────────── */
.wp-block-table { overflow-x: auto; }
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--c-outline-variant);
	font-size: 15px;
}
.wp-block-table th,
.wp-block-table td {
	padding: 12px 16px;
	border: 1px solid var(--c-outline-variant);
	text-align: left;
	vertical-align: top;
}
.wp-block-table thead th,
.wp-block-table tr:first-child th {
	background: var(--c-secondary-container);
	color: var(--c-primary);
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.wp-block-table tbody tr:nth-child(even) { background: var(--c-surface-low); }
.wp-block-table figcaption {
	font-size: 13px;
	color: var(--c-on-surface-variant);
	margin-top: 8px;
}

/* En-têtes triables */
.bosson-th-sort {
	cursor: pointer;
	user-select: none;
	padding-right: 30px;
	position: relative;
}
.bosson-th-sort:hover { background: var(--c-surface-high); }
.bosson-th-sort::after {
	content: '↕';
	position: absolute;
	right: 10px;
	opacity: 0.35;
	font-weight: 400;
}
.bosson-th-sort[data-sort="asc"]::after  { content: '↑'; opacity: 1; }
.bosson-th-sort[data-sort="desc"]::after { content: '↓'; opacity: 1; }

/* Barre de recherche */
.bosson-table-search { margin-bottom: 12px; }
.bosson-table-search input {
	width: 100%;
	max-width: 340px;
	padding: 10px 14px;
	border: 2px solid var(--c-outline-variant);
	border-radius: var(--radius);
	background: var(--c-surface-white);
	font-family: var(--font);
	font-size: 15px;
	color: var(--c-on-surface);
}
.bosson-table-search input:focus {
	outline: none;
	border-color: var(--c-primary);
}

/* Largeur des colonnes.
   WordPress coche « Cellules de tableau à largeur fixe » par défaut
   (.has-fixed-layout → table-layout: fixed; width: 100%) : toutes les
   colonnes sont alors écrasées à parts égales dans la largeur de l'écran,
   et le texte déborde d'une cellule à l'autre. On repasse en disposition
   automatique et on donne une largeur minimale à chaque cellule : quand
   les colonnes ne tiennent plus, le tableau s'élargit et c'est le wrapper
   `overflow-x: auto` qui fait défiler, le texte restant renvoyé à la ligne. */
.wp-block-table table,
.wp-block-table table.has-fixed-layout {
	table-layout: auto;
	width: 100%;
}
.wp-block-table th,
.wp-block-table td {
	min-width: 9rem;
	overflow-wrap: normal;
	word-break: normal;
}
.wp-block-table { -webkit-overflow-scrolling: touch; }

/* Footer : menu WordPress dans la colonne « Informations » */
.site-footer__nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.site-footer__nav-list li { margin: 0; }

/* ── Galerie d'images ─────────────────────────────────────── */
.bosson-gallery {
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(3, 1fr);
}
.bosson-gallery--cols-2 { grid-template-columns: repeat(2, 1fr); }
.bosson-gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
	.bosson-gallery,
	.bosson-gallery--cols-2,
	.bosson-gallery--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.bosson-gallery,
	.bosson-gallery--cols-2,
	.bosson-gallery--cols-4 { grid-template-columns: 1fr; }
}

.bosson-gallery__item {
	margin: 0;
}
.bosson-gallery__frame {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border: 1px solid var(--c-outline-variant);
	background: var(--c-surface-mid);
	cursor: zoom-in;
}
.bosson-gallery__frame--static { cursor: default; }
.bosson-gallery__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s;
}
.bosson-gallery__frame:not(.bosson-gallery__frame--static):hover img { transform: scale(1.05); }

.bosson-gallery__zoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 32, 69, 0);
	transition: background 0.3s;
	pointer-events: none;
}
.bosson-gallery__zoom .material-symbols-outlined {
	font-size: 40px;
	color: #fff;
	opacity: 0;
	transform: scale(0.7);
	transition: opacity 0.3s, transform 0.3s;
}
.bosson-gallery__frame:hover .bosson-gallery__zoom { background: rgba(0, 32, 69, 0.45); }
.bosson-gallery__frame:hover .bosson-gallery__zoom .material-symbols-outlined { opacity: 1; transform: scale(1); }

.bosson-gallery__caption {
	margin-top: 10px;
	font-size: 13px;
	color: var(--c-on-surface-variant);
}
.bosson-gallery__caption a { color: var(--c-primary); text-decoration: underline; }

/* Lightbox partagée */
.bosson-lightbox {
	border: none;
	padding: 0;
	background: transparent;
	max-width: 100%;
	max-height: 100%;
}
.bosson-lightbox::backdrop { background: rgba(0, 0, 0, 0.92); }
.bosson-lightbox[open] {
	position: fixed;
	inset: 0;
	z-index: 9999;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.bosson-lightbox figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	max-width: 95vw;
	max-height: 95vh;
	margin: 0;
}
.bosson-lightbox img {
	max-width: 95vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: var(--radius-lg);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.bosson-lightbox figcaption {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-align: center;
}
.bosson-lightbox__close {
	position: fixed;
	top: 20px;
	right: 24px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s;
}
.bosson-lightbox__close:hover { background: rgba(255, 255, 255, 0.3); }
