/* ==========================================================================
   Pages intérieures — styles partagés (chargé sur toutes les pages sauf l'accueil)
   Colonne de lecture, navigation latérale, étiquettes, liens retour, boutons.
   Reprend le système de l'accueil (style.css) : tokens --b-*, --ink-*, .cta, .arch.
   ========================================================================== */

body:not(.home) {
	--sable: #f2e4cd;          /* Crème teinté de Sable (fond des actualités de l'accueil) */
	--paper: #fffaf0;          /* surface claire posée sur le Crème */
	--ink-line-strong: rgba(14, 34, 49, .16);
	--corail-ring: rgba(236, 114, 88, .32);
	--ink-soft: rgba(14, 34, 49, .72);  /* petits libellés : 4.5:1 minimum sur Crème et Sable */
	--measure: 62ch;                    /* ~75 caractères par ligne en Host Grotesk 18px */
	--ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Le bouton .cta est aussi utilisé en <button> (formulaires). */
button.cta {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	cursor: pointer;
}
/* Sur fond Crème, le contour de focus de la charte doit être Encre (style.css le met en Crème). */
body:not(.home) main .cta:focus-visible { outline-color: var(--b-encre); }

/* Lien retour « ← Toutes les actualités » */
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	font-family: var(--font-brand);
	font-weight: 500;
	font-size: 15px;
	color: var(--b-encre);
}
.back-link .icon {
	box-sizing: content-box;
	flex: 0 0 auto;
	padding: 10px;
	border-radius: 14px;
	background: var(--ink-fill);
	transition: transform .3s var(--ease-out), background-color .3s ease;
}
.back-link:hover,
.back-link:focus { color: var(--b-encre); }
.back-link:hover .icon,
.back-link:focus-visible .icon { transform: translateX(-4px); background: rgba(14, 34, 49, .1); }

/* Étiquettes de catégorie */
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--b-lumiere);
	font-family: var(--font-brand);
	font-size: 12px;
	line-height: 1;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--b-encre);
	transition: background-color .25s ease;
}
a.tag:hover,
a.tag:focus { color: var(--b-encre); background: #ffd08a; }

/* ---------- Colonne de lecture ---------- */
.prose {
	max-width: var(--measure);
	font-family: var(--font-brand-text);
	font-size: 18px;
	line-height: 1.7;
	color: var(--ink-text);
	text-wrap: pretty;
	overflow-wrap: break-word;
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose p:empty { display: none; }
.prose h2,
.prose h3,
.prose h4 {
	font-family: var(--font-brand);
	color: var(--b-encre);
	text-wrap: balance;
	scroll-margin-top: 32px;
}
.prose h2 {
	font-weight: 600;
	font-size: clamp(24px, 2.2vw, 30px);
	line-height: 1.15;
	letter-spacing: -.01em;
	margin: 2em 0 .6em;
}
.prose h3 {
	font-weight: 600;
	font-size: clamp(20px, 1.7vw, 23px);
	line-height: 1.25;
	margin: 1.8em 0 .5em;
}
.prose h4 { font-weight: 600; font-size: 18px; margin: 1.6em 0 .4em; }
.prose h2 strong,
.prose h3 strong { font-weight: inherit; }
.prose h2 + h3 { margin-top: .4em; }
.prose strong, .prose b { font-weight: 600; color: var(--b-encre); }
.prose a {
	color: var(--b-encre);
	text-decoration: underline;
	text-decoration-color: var(--b-corail);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: color .2s ease, text-decoration-color .2s ease;
}
.prose a:hover,
.prose a:focus { color: var(--btn-label-to); text-decoration-color: currentColor; }
.prose h2 a, .prose h3 a { text-decoration-thickness: 2px; }

.prose ul,
.prose ol { margin: 0 0 1.2em; padding: 0; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; padding-left: 1.5em; }
.prose ul > li::before {
	content: "";
	position: absolute;
	left: .3em;
	top: .68em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--b-corail);
}
.prose ol { padding-left: 1.5em; }
.prose ol > li::marker { font-family: var(--font-brand); font-weight: 600; color: var(--btn-label-to); }
.prose li + li { margin-top: .5em; }
.prose li > p { margin: 0; }
.prose li > ul, .prose li > ol { margin: .5em 0 0; }

.prose blockquote {
	margin: 1.6em 0;
	padding: 24px 28px;
	border-radius: 24px;
	background: var(--sable);
	font-family: var(--font-brand);
	font-size: 20px;
	line-height: 1.45;
	color: var(--b-encre);
}
.prose blockquote p:last-child { margin: 0; }
.prose img { border-radius: 20px; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.prose hr { border: 0; height: 1px; background: var(--ink-line-strong); margin: 2.4em 0; }

/* Tableaux : lisibles, défilement horizontal si besoin (enveloppe ajoutée par inc/pages.php) */
.table-scroll {
	margin: 1.2em 0 1.6em;
	overflow-x: auto;
	border: 1px solid var(--ink-line-strong);
	border-radius: 20px;
	background: rgba(255, 250, 240, .6);
	-webkit-overflow-scrolling: touch;
}
.table-scroll:focus-visible { outline: 2px solid var(--b-encre); outline-offset: 3px; }
.prose table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	font-size: 16px;
	line-height: 1.5;
}
.prose th,
.prose td {
	padding: 14px 18px;
	text-align: left;
	vertical-align: top;
	border: 0;
	border-bottom: 1px solid var(--ink-line-strong);
}
.prose th {
	background: var(--ink-fill);
	font-family: var(--font-brand);
	font-weight: 600;
	color: var(--b-encre);
}
.prose th strong { font-weight: inherit; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td p, .prose th p { margin: 0; }
/* Tableau d'une seule cellule utilisé comme encadré (confidentialité) */
.table-scroll:has(> table > tbody:only-child > tr:only-child > td:only-child) {
	border: 0;
	background: var(--sable);
	border-radius: 24px;
}
.table-scroll:has(> table > tbody:only-child > tr:only-child > td:only-child) table { min-width: 0; }
.table-scroll:has(> table > tbody:only-child > tr:only-child > td:only-child) td { padding: 24px 28px; }
.table-scroll:has(> table > tbody:only-child > tr:only-child > td:only-child) td p + p { margin-top: .4em; }

/* ---------- Pages simples : lecture + navigation latérale ---------- */
.reading {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); /* texte sur toute la largeur disponible */
	justify-content: space-between;
	align-items: start;
	gap: 56px clamp(48px, 8vw, 140px);
	padding-bottom: var(--section-y);
}
.reading__main { min-width: 0; }
.reading .prose { max-width: none; }
.reading__aside {
	position: sticky;
	top: 32px;
	display: flex;
	flex-direction: column;
	gap: 36px;
}
.side-nav__label {
	margin: 0 0 12px;
	font-family: var(--font-brand);
	font-size: 13px;
	color: var(--ink-soft);
}
.side-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--ink-line-strong);
}
.side-nav__list a {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 40px;
	padding: 6px 0 6px 18px;
	font-family: var(--font-brand);
	font-size: 15px;
	line-height: 1.3;
	color: var(--ink-text);
	transition: color .2s ease;
}
.side-nav__list a::before {
	content: "";
	position: absolute;
	left: -1px;
	top: 10px;
	bottom: 10px;
	width: 2px;
	border-radius: 2px;
	background: transparent;
	transition: background-color .2s ease;
}
.side-nav__list a:hover,
.side-nav__list a:focus { color: var(--b-encre); }
.side-nav__list a:hover::before { background: var(--ink-line-strong); }
.side-nav__list a[aria-current="page"] { font-weight: 600; color: var(--b-encre); }
.side-nav__list a[aria-current="page"]::before { background: var(--b-corail); }

/* Informations à compléter par la CAPA (pages légales) : bien visibles avant la mise en ligne */
.prose mark.todo {
	padding: .1em .35em;
	border-radius: 6px;
	background: var(--b-lumiere);
	color: var(--b-encre);
	font-weight: 500;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

@media (max-width: 991px) {
	.reading { grid-template-columns: minmax(0, 1fr); }
	.reading__aside { position: static; padding-top: 32px; border-top: 1px solid var(--ink-line-strong); }
	/* Le sommaire n'a d'intérêt qu'à côté du texte : masqué quand il passe dessous. */
	.reading__aside .side-nav:has(.side-nav__list--toc) { display: none; }
}
@media (max-width: 767px) {
	.prose { font-size: 17px; }
	.side-nav__list a { min-height: 44px; }
	.tag { min-height: 44px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.back-link .icon, .tag, .side-nav__list a, .side-nav__list a::before { transition: none; }
}

/* style.css arrondit tout élément focalisé à 4px : on garde la forme des pastilles. */
.tag:focus-visible,
.filter__link:focus-visible,
.search-bar__input:focus-visible { border-radius: 999px; }
.pager .page-numbers:focus-visible { border-radius: 16px; }
.cf__input:focus-visible { border-radius: 16px; }

/* Intertitres en capitales (texte d'origine conservé) */
.prose h2.prose__caps { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.35; letter-spacing: .03em; margin-top: 2.2em; }
.side-nav__list a.is-caps { font-size: 12px; letter-spacing: .03em; }

/* ---------- Recherche, page introuvable, liste vide (index.php : aussi en 404, sans page-actualites.css) ---------- */
/* Recherche */
.search-bar { display: flex; gap: 8px; max-width: 560px; margin: 0 0 40px; }
.search-bar__input {
	flex: 1;
	min-width: 0;
	height: 52px;
	padding: 0 22px;
	border: 1.5px solid var(--ink-line-strong);
	border-radius: 999px;
	background: var(--paper);
	font-family: var(--font-brand-text);
	font-size: 16px;
	color: var(--b-encre);
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.search-bar__input::placeholder { color: rgba(14, 34, 49, .7); }
.search-bar__input:hover { border-color: rgba(14, 34, 49, .32); }
.search-bar__input:focus { outline: none; border-color: var(--b-encre); box-shadow: 0 0 0 4px var(--corail-ring); }
/* Bouton = carré corail de la charte (.cta__icon) */
.search-bar__btn {
	flex: 0 0 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: var(--btn-icon);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, transform .3s var(--ease-out);
}
.search-bar__btn:hover,
.search-bar__btn:focus-visible { background: var(--btn-label-to); transform: rotate(-8deg); }
.search-bar__btn:focus-visible { outline: 2px solid var(--b-encre); outline-offset: 3px; border-radius: 18px; }

/* Aucun contenu */
.empty { max-width: 560px; padding: 40px 0; }
.empty__title { margin: 0; font-family: var(--font-brand); font-weight: 600; font-size: 28px; color: var(--b-encre); }
.empty .sec-text { margin: 12px 0 32px; }
.empty__title + .empty__actions { margin-top: 28px; }

.empty__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.news-page--search .empty { padding-top: 0; }
.news { padding: 0 0 var(--section-y); }
/* Variante « aller vers » du lien retour : flèche vers la droite */
.back-link--forward .icon { transform: rotate(180deg); }
.back-link--forward:hover .icon,
.back-link--forward:focus-visible .icon { transform: rotate(180deg) translateX(-4px); }

/* ==========================================================================
   Respiration (retour utilisateur : « page trop chargée »)
   Rythme vertical commun aux pages intérieures + lecture plus aérée.
   ========================================================================== */
body:not(.home) { --sec-pad: clamp(96px, 12vh, 160px); }

/* Lecture : paragraphes, intertitres, listes, citations */
.prose { line-height: 1.75; }
.prose p { margin-bottom: 1.4em; }
.prose h2 { margin: 2.6em 0 .8em; }
.prose h3 { margin: 2.2em 0 .7em; }
.prose h4 { margin: 2em 0 .6em; }
.prose h2 + h3 { margin-top: .6em; }
.prose h2.prose__caps { margin: 3em 0 .9em; }
.prose ul,
.prose ol { margin: .4em 0 1.8em; }
.prose li + li { margin-top: .75em; }
.prose blockquote { margin: 2.4em 0; padding: 32px 36px; }
.prose figure { margin: 2.4em 0; }
.prose hr { margin: 3.2em 0; }
.table-scroll { margin: 2em 0 2.4em; }

/* Pages simples (légales) : plus d'air autour de la colonne */
.reading { padding-top: clamp(16px, 3vh, 40px); padding-bottom: var(--sec-pad); row-gap: 72px; }
.reading__aside { gap: 48px; }

/* Listes et états vides */
.news { padding-bottom: var(--sec-pad); }
.search-bar { margin-bottom: 56px; }
.empty { padding: 56px 0; }

@media (max-width: 767px) {
	.prose blockquote { padding: 24px 22px; }
	.reading { row-gap: 56px; }
}

/* ==========================================================================
   Audit UX : sommaire repliable sur mobile et tablette (pages légales longues).
   Au-dessus de 991px, le sommaire latéral collant prend le relais.
   ========================================================================== */
.toc-mobile { display: none; }
@media (max-width: 991px) {
	.toc-mobile {
		display: block;
		margin: 0 0 48px;
		border-radius: 20px;
		background: var(--sable);
	}
	.toc-mobile__summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		min-height: 56px;
		padding: 0 22px;
		font-family: var(--font-brand);
		font-weight: 600;
		font-size: 16px;
		color: var(--b-encre);
		cursor: pointer;
		list-style: none;
	}
	.toc-mobile__summary::-webkit-details-marker { display: none; }
	.toc-mobile__summary::after {
		content: "";
		flex: 0 0 auto;
		width: 9px;
		height: 9px;
		margin-top: -5px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
		transition: transform .25s ease;
	}
	.toc-mobile[open] .toc-mobile__summary::after { transform: rotate(-135deg); margin-top: 5px; }
	.toc-mobile__summary:focus-visible { border-radius: 20px; }
	.toc-mobile__list {
		margin: 0;
		padding: 4px 22px 18px;
		list-style: none;
		border-top: 1px solid var(--ink-line-strong);
	}
	.toc-mobile__list a {
		display: flex;
		align-items: center;
		min-height: 44px;
		font-family: var(--font-brand);
		font-size: 15px;
		line-height: 1.3;
		color: var(--ink-text);
	}
	.toc-mobile__list a:hover,
	.toc-mobile__list a:focus { color: var(--b-encre); }
	/* Le sommaire latéral passe sous le texte : inutile en double. */
	.reading__aside .side-nav:has(.side-nav__list--toc) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.toc-mobile__summary::after { transition: none; }
}

/* ==========================================================================
   Audit mobile (2026-11-13)
   ========================================================================== */
/* Ancres du sommaire : l'intertitre ne passe pas sous l'en-tête fixe quand il réapparaît. */
.prose h2,
.prose h3,
.prose h4 { scroll-margin-top: 104px; scroll-margin-top: calc(var(--header-h, 88px) + 16px); }
.side-nav__label { font-size: 14px; }
/* Grand titre d'introduction (nom de thème, terme recherché) : un mot très long passe à la ligne au lieu de déborder. */
.page-hero__title { overflow-wrap: break-word; }
/* Tableau Gutenberg : la marge de la figure et celle de l'enveloppe ne s'additionnent plus sous l'intertitre. */
.prose .wp-block-table { margin: 1.2em 0 2.2em; }
.prose .wp-block-table > .table-scroll { margin: 0; }

/* Écrans tactiles (tablette, paysage) : cibles à 44px même au-dessus de 767px. */
@media (pointer: coarse) {
	.side-nav__list a { min-height: 44px; }
	.tag { min-height: 44px; padding: 0 16px; }
}

@media (max-width: 640px) {
	/* Tableau « intitulé / définition » (droits RGPD) : empilé au lieu de défiler de côté. */
	.table-scroll:has(> table th[scope="row"]) { overflow-x: visible; }
	.table-scroll:has(> table th[scope="row"]) table { min-width: 0; }
	.table-scroll:has(> table th[scope="row"]) :is(tbody, tr, th, td) { display: block; width: auto; }
	.table-scroll:has(> table th[scope="row"]) th { padding: 16px 18px 6px; background: none; }
	.table-scroll:has(> table th[scope="row"]) td { padding: 0 18px 16px; }
	.table-scroll:has(> table th[scope="row"]) tr { border-bottom: 1px solid var(--ink-line-strong); }
	.table-scroll:has(> table th[scope="row"]) tr:last-child { border-bottom: 0; }
	.table-scroll:has(> table th[scope="row"]) :is(th, td) { border-bottom: 0; }
	/* Encadré d'une cellule : marges réduites sur petit écran. */
	.table-scroll:has(> table > tbody:only-child > tr:only-child > td:only-child) td { padding: 20px; }

	.empty__title { font-size: 24px; line-height: 1.25; }
}

/* ==========================================================================
   iOS Safari (2026-11-13)
   ========================================================================== */
/* Champ de recherche : pas de loupe, croix ni ombre ajoutées par WebKit (16px = pas de zoom automatique). */
.search-bar__input::-webkit-search-decoration,
.search-bar__input::-webkit-search-cancel-button,
.search-bar__input::-webkit-search-results-button,
.search-bar__input::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-bar__input { background-clip: padding-box; } /* iOS : pas d'ombre intérieure sous la bordure */
.search-bar__btn { -webkit-appearance: none; appearance: none; }

/* Adresses, URL et e-mails longs (pages légales) : coupés au besoin plutôt que de déborder.
   Pas sur les cellules de tableau au bureau : « anywhere » réduit leur largeur minimale et écrase la colonne d'intitulés. */
.prose a { word-break: break-word; overflow-wrap: anywhere; }
.prose td a, .prose th a { word-break: normal; overflow-wrap: break-word; }
@media (max-width: 640px) {
	.table-scroll:has(> table th[scope="row"]) :is(th, td) { overflow-wrap: anywhere; }
}

/* Écrans tactiles : le :hover reste « collé » après un tapotement. */
@media (hover: none) {
	.back-link:hover:not(:focus-visible) .icon { transform: none; background: var(--ink-fill); }
	.back-link--forward:hover:not(:focus-visible) .icon { transform: rotate(180deg); }
	a.tag:hover:not(:focus-visible) { background: var(--b-lumiere); }
	.search-bar__input:hover:not(:focus) { border-color: var(--ink-line-strong); }
	.search-bar__btn:hover:not(:focus-visible) { background: var(--btn-icon); transform: none; }
	.side-nav__list a:not([aria-current="page"]):hover::before { background: transparent; }
}
