/* S-Accessibilité : panneau. Tailles en px pour ne pas subir les réglages appliqués à la page. */
#sacc {
	--sacc-bg: #0f2a4a;
	--sacc-fg: #fff;
	position: fixed;
	top: var(--sacc-offset, 33%);
	right: 0;
	z-index: 2147483000;
	transform: translateY(-50%);
}
#sacc.sacc--light { --sacc-bg: #fff; --sacc-fg: #0f2a4a; }
#sacc.sacc--left { right: auto; left: 0; }
/* Panneau ouvert : centré verticalement pour qu'il tienne toujours à l'écran. */
#sacc.sacc--open { top: 50%; }

/* Neutralise les styles du thème et les réglages de la page à l'intérieur du panneau. */
#sacc,
#sacc * {
	box-sizing: border-box;
	color: inherit !important;
	background-color: transparent !important;
	border-color: currentColor !important;
	text-shadow: none !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	line-height: 1.3 !important;
	text-transform: none;
}
#sacc { color: var(--sacc-fg) !important; font-size: 16px; line-height: 1.3; }

#sacc button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font-size: 16px;
	line-height: 1.3 !important;
	cursor: pointer;
	min-height: 0;
	width: auto;
	box-shadow: none;
	text-decoration: none !important;
}

#sacc .sacc-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid var(--sacc-fg) !important;
	border-right: 0 !important;
	border-radius: 8px 0 0 8px;
	background-color: var(--sacc-bg) !important;
	color: var(--sacc-fg) !important;
}
#sacc.sacc--left .sacc-toggle {
	border-right: 2px solid var(--sacc-fg) !important;
	border-left: 0 !important;
	border-radius: 0 8px 8px 0;
}
#sacc .sacc-toggle .sacc-icon { width: 30px; height: 30px; }
#sacc .sacc-toggle[aria-expanded="true"] { display: none; }

#sacc .sacc-panel {
	width: 340px;
	max-width: calc(100vw - 12px);
	max-height: calc(100vh - 24px);
	overflow-y: auto;
	padding: 12px;
	border: 2px solid var(--sacc-fg) !important;
	border-right: 0 !important;
	border-radius: 12px 0 0 12px;
	background-color: var(--sacc-bg) !important;
	color: var(--sacc-fg) !important;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
}
#sacc.sacc--left .sacc-panel {
	border-right: 2px solid var(--sacc-fg) !important;
	border-left: 0 !important;
	border-radius: 0 12px 12px 0;
}
#sacc .sacc-panel[hidden] { display: none !important; }

#sacc .sacc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 10px;
}
#sacc .sacc-title {
	margin: 0;
	padding: 0 4px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3 !important;
	text-align: left !important;
}
#sacc .sacc-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0 !important;
	border-radius: 6px;
}

/* Grille de tuiles sur deux colonnes. */
#sacc .sacc-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
		gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
#sacc .sacc-list li { display: flex; margin: 0; padding: 0; list-style: none; }
/* La taille du texte, fonction principale, occupe toute la largeur. */
#sacc .sacc-list li:first-child { grid-column: 1 / -1; }
#sacc .sacc-list li:first-child .sacc-btn { flex-direction: row; gap: 12px; min-height: 64px; font-size: 15px; }
#sacc .sacc-list li:first-child .sacc-state { position: static; font-size: 14px; }
#sacc .sacc-list li::before,
#sacc .sacc-list li::marker { content: none; }

#sacc .sacc-btn {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 92px;
	padding: 12px 8px;
	border: 2px solid var(--sacc-fg) !important;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	text-align: center !important;
}
#sacc .sacc-btn .sacc-icon { width: 30px; height: 30px; }
#sacc .sacc-state {
	position: absolute;
	top: 6px;
	right: 8px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

/* Fonction active : couleurs inversées + coche. */
#sacc .sacc-btn[aria-pressed="true"],
#sacc .sacc-btn.sacc-on {
	background-color: var(--sacc-fg) !important;
	color: var(--sacc-bg) !important;
}
#sacc .sacc-btn[aria-pressed="true"]::after {
	content: "✓";
	position: absolute;
	top: 5px;
	right: 9px;
	font-size: 15px;
	font-weight: 700;
}

#sacc .sacc-reset {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	margin-top: 8px;
	padding: 8px 12px;
	border: 2px dashed var(--sacc-fg) !important;
	border-radius: 10px;
	font-size: 15px;
	text-align: center !important;
}
#sacc .sacc-reset .sacc-icon { width: 22px; height: 22px; }

#sacc .sacc-foot {
	margin: 10px 0 0;
	padding: 0;
	font-size: 14px;
	text-align: center !important;
}
#sacc .sacc-foot a {
	color: var(--sacc-fg) !important;
	text-decoration: underline !important;
	outline-offset: 2px;
}

#sacc .sacc-btn:hover,
#sacc .sacc-reset:hover { box-shadow: inset 0 0 0 2px var(--sacc-fg); }
#sacc .sacc-close:hover,
#sacc .sacc-toggle:hover { text-decoration: underline !important; }

/* Focus clavier très visible, double anneau lisible sur tout fond. */
#sacc button:focus,
#sacc a:focus { outline: none; }
#sacc button:focus-visible,
#sacc a:focus-visible {
	outline: 3px solid var(--sacc-fg) !important;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--sacc-bg) !important;
}

#sacc .sacc-icon { display: block; flex: 0 0 auto; fill: currentColor; }

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

@media print {
	#sacc,
	.sacc-gray-layer { display: none !important; }
}

/* ------------------------------------------------------------------ *
 * Effets sur la page
 * ------------------------------------------------------------------ */

/* Souligner les liens */
html.sacc-underline a,
html.sacc-underline a * {
	text-decoration: underline !important;
	text-underline-offset: 2px;
}

/* Contraste élevé : texte blanc sur fond noir, liens jaunes. Images conservées. */
html.sacc-contrast,
html.sacc-contrast body,
html.sacc-contrast body * {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.sacc-contrast a,
html.sacc-contrast a * {
	color: #ff0 !important;
}
html.sacc-contrast a:hover,
html.sacc-contrast a:focus { outline: 2px solid #ff0 !important; }
html.sacc-contrast input,
html.sacc-contrast select,
html.sacc-contrast textarea,
html.sacc-contrast button {
	border: 2px solid #fff !important;
}
html.sacc-contrast ::placeholder { color: #ccc !important; opacity: 1; }
html.sacc-contrast img,
html.sacc-contrast video,
html.sacc-contrast picture,
html.sacc-contrast iframe { background-color: transparent !important; }

/* Espacer le texte : valeurs du critère WCAG 1.4.12 (espacement du texte). */
html.sacc-spacing body * {
	letter-spacing: .12em !important;
	word-spacing: .16em !important;
	line-height: 1.6 !important;
}
html.sacc-spacing body p {
	margin-bottom: 2em !important;
}

/* Police simple (Atkinson Hyperlegible, conçue pour les malvoyants ; chargée uniquement si la fonction est activée).
 * Les polices d'icônes sont épargnées. */
@font-face {
	font-family: "SACC Atkinson";
	src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "SACC Atkinson";
	src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
html.sacc-font body *:not(i):not([class*="icon"]):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons):not(.material-icons):not([aria-hidden="true"]) {
	font-family: "SACC Atkinson", Verdana, Arial, sans-serif !important;
}

/* Arrêter les animations : tout se termine instantanément dans son état final. */
html.sacc-noanim *,
html.sacc-noanim *::before,
html.sacc-noanim *::after {
	animation-duration: .001ms !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: .001ms !important;
	transition-delay: 0s !important;
	scroll-behavior: auto !important;
}

/* Aligner à gauche : uniquement les textes justifiés (repérés par le script). */
html.sacc-align [data-sacc-justify] {
	text-align: left !important;
}

/* Grand curseur */
html.sacc-cursor,
html.sacc-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 8.5-6.5 1.8-2.9 6.2z' fill='%23000' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 7 4, auto !important;
}

/* Niveaux de gris : calque transparent sous le panneau. */
.sacc-gray-layer {
	position: fixed;
	inset: 0;
	z-index: 2147482999;
	pointer-events: none;
	-webkit-backdrop-filter: grayscale(1);
	backdrop-filter: grayscale(1);
}
