/* FB En-tête — en-tête du site et réglages d'accessibilité. */

/* ------------------------------------------------------------------ */
/* Base (indépendante du thème)                                        */
/* ------------------------------------------------------------------ */

.fbet,
.fbet *,
.fbet-dialog,
.fbet-dialog * {
	box-sizing: border-box;
}

.fbet {
	position: relative;
	z-index: 900;
	width: 100%;
	background: var(--fbet-bg);
	color: var(--fbet-text);
	font-size: 15px;
	line-height: 1.4;
}

.fbet--sticky {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
}

@media (max-width: 600px) {
	/* La barre d'administration n'est plus fixe sur petit écran. */
	.fbet--sticky {
		top: 0;
	}
}

/* Remises à zéro en :where() : elles l'emportent sur le thème (button, a…) mais pas sur les classes ci-dessous. */
.fbet :where(ul) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fbet :where(a) {
	color: inherit;
	text-decoration: none;
}

.fbet :where(button),
.fbet-dialog :where(button) {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	line-height: inherit;
	min-height: 0;
	cursor: pointer;
}

.fbet-icon {
	display: block;
	flex: none;
	width: 20px;
	height: 20px;
}

.fbet-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fbet :focus-visible,
.fbet-dialog :focus-visible {
	outline: 3px solid var(--fbet-primary);
	outline-offset: 3px;
}

.fbet-anchor {
	display: block;
	scroll-margin-top: var(--fbet-h, 0px);
}

.fbet-anchor:focus {
	outline: none;
}

/* Liens d'évitement (visibles au clavier) */
.fbet-skip a {
	position: absolute;
	top: -200px;
	left: 12px;
	z-index: 1000;
	padding: 10px 16px;
	background: #242424;
	color: #fff;
	font-size: 14px;
}

.fbet-skip a:focus {
	top: 8px;
}

/* ------------------------------------------------------------------ */
/* Ligne du haut : réseaux + accessibilité | logo | le mag             */
/* ------------------------------------------------------------------ */

.fbet-top {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 20px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 18px 24px;
	transition: padding .25s;
}

.fbet-left {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.fbet-brand {
	justify-self: center;
	text-align: center;
}

.fbet-right {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 24px;
}

.fbet-logo {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.fbet-logo-img {
	display: block;
	width: auto;
	height: var(--fbet-logo-h);
	max-width: min(460px, 60vw);
	object-fit: contain;
	transition: height .25s;
}

.fbet-logo-text {
	color: var(--fbet-primary);
	font-size: calc(var(--fbet-logo-h) * .55);
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1;
	text-transform: uppercase;
	transition: font-size .25s;
}

/* Nom écrit à côté du blason */
.fbet-logo-img + .fbet-logo-text {
	font-size: calc(var(--fbet-logo-h) * .5);
}

.fbet-social {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin-left: -9px;
}

.fbet-social a {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	transition: background-color .2s, color .2s;
}

.fbet-social a:hover {
	background: var(--fbet-primary);
	color: #fff;
}

.fbet-tool {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 14px;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.fbet-tool:hover .fbet-label {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.fbet-burger,
.fbet-drawer-extras {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Menu principal                                                      */
/* ------------------------------------------------------------------ */

.fbet-drawer {
	position: relative;
	border-top: 1px solid rgba(0, 0, 0, .12);
}

.fbet-nav {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
}

.fbet-nav:focus {
	outline: none;
}

.fbet-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 36px;
}

.fbet-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 16px 0;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
	transition: padding .25s;
}

.fbet-link::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 8px;
	left: 0;
	height: 3px;
	background: var(--fbet-primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .2s, bottom .25s;
}

.fbet-link:hover::after,
.fbet-item.is-open > .fbet-link::after,
.fbet-item.is-current > .fbet-link::after {
	transform: scaleX(1);
}

.fbet-toggle .fbet-icon {
	width: 16px;
	height: 16px;
	transition: transform .2s;
}

.fbet-item.is-open > .fbet-toggle .fbet-icon {
	transform: rotate(180deg);
}

/* Panneaux des sous-menus */
.fbet-sub {
	display: none;
}

.fbet-item.is-open > .fbet-sub,
.fbet-nojs .fbet-has-sub:hover > .fbet-sub,
.fbet-nojs .fbet-has-sub:focus-within > .fbet-sub {
	display: block;
}

.fbet-sub-title {
	margin: 0 0 14px;
	color: var(--fbet-primary);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
}

.fbet-sub-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--fbet-primary);
	font-weight: 600;
}

.fbet-sub-all .fbet-icon {
	width: 18px;
	height: 18px;
	transition: transform .2s;
}

.fbet-sub-all:hover .fbet-icon {
	transform: translateX(3px);
}

.fbet-sub-list a {
	display: inline-block;
	padding: 6px 0;
	font-size: 16px;
}

.fbet-sub-list a:hover,
.fbet-sub-list a[aria-current] {
	color: var(--fbet-primary);
	text-decoration: underline;
	text-underline-offset: 4px;
}

.fbet .fbet-sub-sub {
	margin: 0 0 6px;
	padding-left: 14px;
	border-left: 2px solid rgba(0, 0, 0, .1);
}

.fbet-sub-sub a {
	padding: 3px 0;
	font-size: 14px;
}

/* ------------------------------------------------------------------ */
/* Ordinateur                                                          */
/* ------------------------------------------------------------------ */

@media (min-width: 1024px) {
	.fbet-sub {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		background: var(--fbet-bg);
		border-top: 1px solid rgba(0, 0, 0, .12);
		box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .25);
		animation: fbet-in .18s ease-out;
	}

	.fbet-sub-inner {
		display: grid;
		grid-template-columns: 280px 1fr;
		gap: 40px;
		max-width: 1240px;
		margin: 0 auto;
		padding: 36px 24px 40px;
	}

	/* Sous-éléments en colonnes, lus de haut en bas */
	.fbet-sub-list {
		columns: 220px auto;
		column-gap: 32px;
	}

	.fbet-sub-list > li {
		break-inside: avoid;
	}

	/* En-tête resserré quand on fait défiler la page */
	.fbet.is-scrolled {
		box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35);
	}

	.fbet.is-scrolled .fbet-top {
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.fbet.is-scrolled .fbet-logo-img {
		height: calc(var(--fbet-logo-h) * .6);
	}

	.fbet.is-scrolled .fbet-logo-text {
		font-size: calc(var(--fbet-logo-h) * .38);
	}

	.fbet.is-scrolled .fbet-social {
		display: none;
	}

	.fbet.is-scrolled .fbet-link {
		padding: 10px 0;
	}

	.fbet.is-scrolled .fbet-link::after {
		bottom: 4px;
	}
}

@keyframes fbet-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

/* ------------------------------------------------------------------ */
/* Mobile et tablette                                                  */
/* ------------------------------------------------------------------ */

@media (max-width: 1023.98px) {
	.fbet-top {
		grid-template-columns: 1fr auto;
		padding: 10px 16px;
	}

	.fbet-left,
	.fbet-right {
		display: none;
	}

	.fbet-brand {
		justify-self: start;
		text-align: left;
	}

	.fbet-logo-img {
		height: min(var(--fbet-logo-h), 48px);
	}

	.fbet-logo-text {
		font-size: 24px;
	}

	.fbet-burger {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		padding: 4px 6px;
		font-size: 12px;
		letter-spacing: .04em;
		text-transform: uppercase;
	}

	.fbet-burger .fbet-icon {
		width: 28px;
		height: 28px;
	}

	.fbet-burger-close,
	.fbet.is-menu-open .fbet-burger-open {
		display: none;
	}

	.fbet.is-menu-open .fbet-burger-close {
		display: block;
	}

	.fbet-drawer {
		display: none;
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		max-height: calc(100vh - var(--fbet-h, 70px));
		max-height: calc(100dvh - var(--fbet-h, 70px));
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--fbet-bg);
		box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .3);
	}

	.fbet.is-menu-open .fbet-drawer {
		display: block;
	}

	.fbet-nojs .fbet-drawer {
		display: block;
		position: static;
		max-height: none;
		box-shadow: none;
	}

	.fbet-nav {
		padding: 0;
	}

	.fbet-menu {
		display: block;
	}

	.fbet-item {
		border-bottom: 1px solid rgba(0, 0, 0, .1);
	}

	.fbet-link {
		display: flex;
		justify-content: space-between;
		width: 100%;
		padding: 15px 16px;
		text-align: left;
	}

	.fbet-link::after {
		display: none;
	}

	.fbet-item.is-current > .fbet-link {
		color: var(--fbet-primary);
	}

	.fbet-sub-inner {
		padding: 0 16px 14px 28px;
	}

	.fbet-sub-title {
		display: none;
	}

	.fbet-sub-head {
		margin-bottom: 4px;
	}

	.fbet-drawer-extras {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 18px 16px 24px;
	}

	.fbet-drawer-extras .fbet-tool {
		font-size: 15px;
	}
}

/* ------------------------------------------------------------------ */
/* Fenêtre « Paramètres d'accessibilité »                              */
/* ------------------------------------------------------------------ */

.fbet-dialog {
	width: min(560px, calc(100% - 32px));
	max-height: calc(100% - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: var(--fbet-bg, #fff);
	color: var(--fbet-text, #242424);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
	font-size: 16px;
	line-height: 1.45;
}

.fbet-dialog::backdrop {
	background: rgba(10, 8, 30, .55);
}

.fbet-dialog-box {
	position: relative;
	padding: 28px 28px 24px;
}

.fbet-dialog-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.fbet-dialog-close:hover {
	background: rgba(0, 0, 0, .07);
}

.fbet-dialog h2 {
	margin: 0 44px 6px 0;
	color: var(--fbet-primary);
	font-size: 24px;
	line-height: 1.2;
}

.fbet-dialog-intro {
	margin: 0 0 20px;
	font-size: 14px;
	opacity: .8;
}

.fbet-dialog fieldset {
	min-width: 0;
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}

.fbet-dialog legend {
	margin-bottom: 8px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
}

.fbet-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fbet-choice {
	position: relative;
	margin: 0;
}

.fbet-choice input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.fbet-choice span {
	display: inline-block;
	padding: 8px 16px;
	border: 2px solid var(--fbet-primary);
	border-radius: 999px;
	font-size: 15px;
	cursor: pointer;
}

.fbet-choice input:checked + span {
	background: var(--fbet-primary);
	color: #fff;
}

.fbet-choice input:checked + span::before {
	content: "✓ ";
}

.fbet-choice input:focus-visible + span {
	outline: 3px solid var(--fbet-primary);
	outline-offset: 2px;
}

.fbet-choice--dys span {
	font-family: "OpenDyslexic", Verdana, Tahoma, sans-serif;
}

.fbet-choice--large span {
	letter-spacing: .02em;
}

.fbet-dialog-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 6px;
}

.fbet-dialog .fbet-btn {
	padding: 11px 22px;
	border: 2px solid var(--fbet-primary);
	border-radius: 4px;
	background: var(--fbet-primary);
	color: #fff;
	font-weight: 600;
}

.fbet-dialog .fbet-btn--ghost {
	background: transparent;
	color: var(--fbet-primary);
}

/* ------------------------------------------------------------------ */
/* Réglages d'accessibilité, appliqués à tout le site (classes sur <html>) */
/* ------------------------------------------------------------------ */

/* Contrastes renforcés : texte noir sur fond blanc, liens bleu foncé soulignés. */
html.fbet-c-high body,
html.fbet-c-high body *:not(svg):not(svg *) {
	color: #000 !important;
	background-color: #fff !important;
	background-image: none !important;
	border-color: #000 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

html.fbet-c-high body a,
html.fbet-c-high body a *:not(svg):not(svg *) {
	color: #00009c !important;
}

html.fbet-c-high body a {
	text-decoration: underline !important;
}

html.fbet-c-high body :focus-visible {
	outline: 3px solid #000 !important;
	outline-offset: 2px !important;
}

html.fbet-c-high body .fbet-dialog .fbet-choice input:checked + span,
html.fbet-c-high body .fbet-dialog .fbet-btn:not(.fbet-btn--ghost) {
	background-color: #000 !important;
	color: #fff !important;
}

html.fbet-c-high .fbet-link::after {
	background: #000;
}

/* Contrastes inversés : couleurs inversées, photos et vidéos gardées telles quelles. */
html.fbet-c-invert {
	background-color: #fff;
	filter: invert(1) hue-rotate(180deg);
}

html.fbet-c-invert img,
html.fbet-c-invert video,
html.fbet-c-invert iframe,
html.fbet-c-invert canvas,
html.fbet-c-invert embed,
html.fbet-c-invert object,
html.fbet-c-invert [style*="background-image"],
html.fbet-c-invert [style*="url("] {
	filter: invert(1) hue-rotate(180deg);
}

/* Police adaptée à la dyslexie (OpenDyslexic si ses fichiers sont fournis, sinon Verdana) et espacement. */
html.fbet-dys body,
html.fbet-dys body *:not(svg):not(svg *):not(i):not(.dashicons):not([class*="icon"]):not([class*="fa-"]) {
	font-family: "OpenDyslexic", Verdana, Tahoma, sans-serif !important;
}

html.fbet-dys body {
	letter-spacing: .05em;
	word-spacing: .16em;
}

/* Interlignage augmenté */
html.fbet-lh body,
html.fbet-lh body :is(p, li, dd, dt, blockquote, td, th, label, figcaption, address, input, textarea) {
	line-height: 1.9 !important;
}

html.fbet-lh body :is(h1, h2, h3, h4, h5, h6) {
	line-height: 1.5 !important;
}

/* ------------------------------------------------------------------ */
/* Animations réduites et impression                                   */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.fbet *,
	.fbet-dialog * {
		transition: none !important;
		animation: none !important;
	}
}

@media print {
	.fbet--sticky {
		position: static;
	}

	.fbet-skip,
	.fbet-left,
	.fbet-right,
	.fbet-drawer,
	.fbet-burger,
	.fbet-dialog {
		display: none !important;
	}
}
