/* ==========================================================================
   Base : typographie, accessibilité, mouvement
   Règles UI/UX Pro Max appliquées : color-contrast, focus-states, focus-not-obscured,
   reduced-motion, readable-font-size, line-length, heading-line-balance,
   long-token-wrapping, cursor-pointer, tap-delay, touch-target-size.
   ========================================================================== */

html {
	scroll-behavior: smooth;
	/* focus-not-obscured : l'en-tête collant ne doit pas masquer l'élément focalisé */
	scroll-padding-top: calc(var(--uk-header-h) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--uk-font-body);
	font-size: var(--uk-text-base);
	line-height: var(--uk-leading-body);
	color: var(--uk-text);
	background: var(--uk-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ---------- Titres ---------- */
h1, h2, h3, h4,
.entry-title, .widget-title, .ast-archive-title {
	font-family: var(--uk-font-display);
	font-weight: 800;
	color: var(--uk-navy);
	line-height: 1.15;
	letter-spacing: -.01em;
	text-wrap: balance;               /* heading-line-balance (amélioration progressive) */
	overflow-wrap: anywhere;
}
h5, h6 { font-family: var(--uk-font-body); font-weight: 800; color: var(--uk-navy); }

/* Longueur de ligne confortable pour le texte courant (pages et articles) */
body:not(.uk-own-layout) :where(.entry-content) > :where(p, ul, ol, blockquote, h2, h3, h4) { max-width: var(--uk-measure); }
body:not(.uk-own-layout) :where(.entry-content) > :where(.alignwide, .alignfull, figure, .wp-block-group, .wp-block-columns, .wp-block-image, table, form) { max-width: none; }

/* ---------- Liens ---------- */
:where(a) { color: var(--uk-link); text-underline-offset: 3px; }
:where(a:hover) { color: var(--uk-link-hover); }
body:not(.uk-own-layout) :where(.entry-content, .comment-content) a:where(:not(.wp-block-button__link, .button)) {
	text-decoration: underline;               /* jamais la couleur seule (color-not-only) */
	text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
	transition: text-decoration-color var(--uk-dur-fast) var(--uk-ease);
}
body:not(.uk-own-layout) :where(.entry-content) a:hover { text-decoration-color: var(--uk-yellow); text-decoration-thickness: 3px; }

/* ---------- Focus visible (clavier) : anneau jaune + halo bleu, contraste ≥ 3:1 sur tous fonds ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--uk-focus);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--uk-blue);
	border-radius: 2px;
}
:where(a, button, input, select, textarea, summary):focus:not(:focus-visible) { outline: none; }

/* Lien d'évitement (skip-links) fourni par Astra : rendu net et lisible */
.skip-link:focus, .screen-reader-text:focus {
	background: var(--uk-yellow);
	color: var(--uk-ink);
	font-weight: 800;
	padding: 12px 20px;
	z-index: 100000;
	clip: auto !important;
	height: auto; width: auto;
	box-shadow: var(--uk-shadow-1);
}

/* ---------- Interactions ---------- */
:where(a, button, [role="button"], summary, input[type="submit"], input[type="button"], select) {
	cursor: pointer;
	touch-action: manipulation;       /* supprime le délai de tap de 300 ms */
}
:where(button, input[type="submit"], input[type="button"], .button, .wp-block-button__link) {
	min-height: var(--uk-target);
}

/* ---------- Médias : pas de décalage de mise en page (CLS) ---------- */
img, video { max-width: 100%; height: auto; }
img[width][height] { height: auto; }

/* Chiffres alignés (dates, effectifs, tarifs) */
table, .uk-num, .posted-on { font-variant-numeric: tabular-nums; }

/* ---------- Sélection de texte ---------- */
::selection { background: var(--uk-yellow); color: var(--uk-ink); }

/* ---------- Préférences utilisateur ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
@media (forced-colors: active) {
	:where(a, button, input, select, textarea):focus-visible { outline-color: Highlight; box-shadow: none; }
}
@media print {
	#masthead, .uk-shortcuts, .uk-navwrap, .uk-catbar, .site-footer, .ast-breadcrumbs-wrapper, .post-navigation { display: none !important; }
	body { background: #fff; color: #000; }
	a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
