/* Panneau d'options d'accessibilité (site et page de connexion). */

.cse-a11y {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 9999;
	font-family: "Open Sans", Helvetica, Arial, sans-serif;
}

.cse-a11y__bouton {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #9B0000;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5);
	transition: transform 0.25s ease, background 0.2s ease;
}

.cse-a11y__bouton:hover {
	background: #CE0000;
	transform: scale(1.06);
}

.cse-a11y__bouton:focus-visible,
.cse-a11y__panneau button:focus-visible,
.cse-a11y__panneau a:focus-visible {
	outline: 3px solid #CE0000;
	outline-offset: 3px;
	box-shadow: 0 0 0 6px #fff;
}

.cse-a11y__bouton svg {
	width: 30px;
	height: 30px;
}

.cse-a11y__panneau {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.75rem);
	width: min(340px, calc(100vw - 2rem));
	max-height: calc(100vh - 7rem);
	overflow-y: auto;
	padding: 1.1rem 1.15rem 1rem;
	border: 1px solid #E5D8D8;
	border-radius: 18px;
	background: #fff;
	color: #120A0A;
	box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.45);
	font-size: 16px;
	line-height: 1.4;
}

.cse-a11y__panneau[hidden] {
	display: none;
}

.cse-a11y__entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.cse-a11y__entete h2 {
	margin: 0;
	font-family: "Didact Gothic", sans-serif;
	font-weight: 400;
	font-size: 1.35rem;
	color: #9B0000;
}

.cse-a11y__fermer {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 10px;
	background: #FBF3F3;
	color: #9B0000;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.cse-a11y__groupe {
	margin: 0 0 0.9rem;
	padding: 0;
	border: 0;
}

.cse-a11y__groupe legend {
	margin-bottom: 0.4rem;
	padding: 0;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #5F5F5F;
}

.cse-a11y__tailles {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.4rem;
}

.cse-a11y__tailles button {
	min-height: 44px;
	border: 2px solid #E5D8D8;
	border-radius: 12px;
	background: #fff;
	color: #120A0A;
	font-weight: 700;
	cursor: pointer;
}

.cse-a11y__tailles button:nth-child(1) { font-size: 0.85rem; }
.cse-a11y__tailles button:nth-child(2) { font-size: 1rem; }
.cse-a11y__tailles button:nth-child(3) { font-size: 1.2rem; }
.cse-a11y__tailles button:nth-child(4) { font-size: 1.4rem; }

.cse-a11y__tailles button[aria-pressed="true"] {
	border-color: #CE0000;
	background: #CE0000;
	color: #fff;
}

.cse-a11y__interrupteur {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	min-height: 48px;
	margin-bottom: 0.4rem;
	padding: 0.55rem 0.75rem;
	border: 2px solid #F0E6E6;
	border-radius: 12px;
	background: #fff;
	color: #120A0A;
	font: inherit;
	font-size: 0.95rem;
	text-align: left;
	cursor: pointer;
}

.cse-a11y__interrupteur span:first-child {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

/* Petit interrupteur visuel */
.cse-a11y__interrupteur::after {
	content: "";
	flex-shrink: 0;
	width: 40px;
	height: 22px;
	border-radius: 999px;
	background: #D9CFCF radial-gradient(circle at 11px 50%, #fff 7px, transparent 8px);
	transition: background 0.2s ease;
}

.cse-a11y__interrupteur[aria-checked="true"] {
	border-color: #CE0000;
}

.cse-a11y__interrupteur[aria-checked="true"]::after {
	background: #CE0000 radial-gradient(circle at 29px 50%, #fff 7px, transparent 8px);
}

.cse-a11y__pied {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.6rem;
	font-size: 0.85rem;
}

.cse-a11y__reinit {
	min-height: 40px;
	padding: 0 0.9rem;
	border: 2px solid #9B0000;
	border-radius: 999px;
	background: #fff;
	color: #9B0000;
	font-weight: 600;
	cursor: pointer;
}

.cse-a11y__pied a {
	color: #9B0000;
}

.cse-a11y__annonce {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 599px) {
	.cse-a11y {
		right: 0.75rem;
		bottom: 0.75rem;
	}

	.cse-a11y__bouton {
		width: 48px;
		height: 48px;
	}

	.cse-a11y__panneau {
		position: fixed;
		left: 0.75rem;
		right: 0.75rem;
		bottom: 4.5rem;
		width: auto;
	}
}

@media print {
	.cse-a11y {
		display: none;
	}
}

/* ---------------------------------------------------------------------
 * Options appliquées à la page (classes posées sur <html>).
 * Le mode « contraste renforcé » est dans style.css (il dépend du thème).
 * ------------------------------------------------------------------ */
@font-face {
	font-family: "Atkinson Hyperlegible";
	font-weight: 400;
	font-display: swap;
	src: url("fonts/atkinson-hyperlegible-400.woff2") format("woff2");
}

@font-face {
	font-family: "Atkinson Hyperlegible";
	font-weight: 700;
	font-display: swap;
	src: url("fonts/atkinson-hyperlegible-700.woff2") format("woff2");
}

/* Taille du texte */
html[data-cse-texte="1"] { font-size: 112.5%; }
html[data-cse-texte="2"] { font-size: 125%; }
html[data-cse-texte="3"] { font-size: 140%; }

/* Lecture facilitée : police conçue pour la lisibilité, espacements accrus */
html.cse-a11y-lecture body,
html.cse-a11y-lecture body :is(p, li, a, span, strong, em, td, th, label, input, textarea, button, h1, h2, h3, h4, .wp-block-navigation-item__content) {
	font-family: "Atkinson Hyperlegible", Verdana, sans-serif !important;
}

html.cse-a11y-lecture body :is(p, li, td, label) {
	line-height: 1.9 !important;
	letter-spacing: 0.03em !important;
	word-spacing: 0.12em !important;
	text-align: left !important;
}

/* Liens soulignés */
html.cse-a11y-liens a:not(.wp-element-button):not(.button) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
}

/* Animations réduites (option du panneau ou préférence du système) */
html.cse-a11y-animations *,
html.cse-a11y-animations *::before,
html.cse-a11y-animations *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

html.cse-a11y-animations :is(.cse-flottant, .cse-accueil__flottant, .cse-tuile__decors) {
	display: none !important;
}

html.cse-a11y-animations :is(.cse-tuile, .cse-acces-rapide a, .cse-partenaire, .cse-evenement):is(:hover, :focus-within) {
	transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
