/* Espace pro Naudon Mathe : pages autonomes, sans la feuille de style du site. */

@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/GeneralSans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Overused Grotesk"; src: url("../fonts/OverusedGrotesk-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
	--rouge: #C80000;
	--rouge-fonce: #A10000;
	--rouge-pale: #FBEBEA;
	--encre: #1C1C1C;
	--nuit: #141414;
	--texte: #2A2A2A;
	--texte-doux: #5B5B5B;
	--pierre: #F4F1EC;
	--pierre-2: #EAE4DA;
	--ligne: #E3DDD3;
	--filet: #F0EBE3;
	--titres: "Overused Grotesk", "General Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100dvh;
	background: var(--pierre);
	color: var(--texte);
	font-family: "General Sans", system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--encre); }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; font-family: var(--titres); font-weight: 700; color: var(--encre); }
:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
[hidden] { display: none !important; }
.ep-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Boutons */
.ep-bouton {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 54px; padding: 0 22px;
	border: 0; border-radius: 999px;
	font-size: 16px; font-weight: 600; text-decoration: none; text-align: center;
	transition: background-color .15s ease, transform .1s ease;
}
.ep-bouton:active { transform: scale(.98); }
.ep-bouton--rouge { background: var(--rouge); color: #fff; }
.ep-bouton--rouge:hover { background: var(--rouge-fonce); color: #fff; }

/* Logo */
.ep-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; line-height: 1; }
.ep-logo img { width: 58px; height: 32px; }
.ep-logo small { display: block; font-size: 9px; letter-spacing: 1.8px; color: var(--texte-doux); }
.ep-logo strong { display: block; margin-top: 3px; font-family: var(--titres); font-size: 16px; font-weight: 700; color: var(--rouge); }
.ep-logo--clair img { width: 72px; height: 40px; }
.ep-logo--clair small { font-size: 10px; letter-spacing: 2px; color: rgba(255, 255, 255, .62); }
.ep-logo--clair strong { font-size: 18px; color: #fff; }

/* Page du code */
body[data-ep="code"] { background: var(--nuit); color: #fff; }
.ep-code {
	width: 100%; max-width: 420px; min-height: 100dvh; margin: 0 auto;
	padding: 40px 24px calc(24px + env(safe-area-inset-bottom));
	display: flex; flex-direction: column;
}
.ep-code h1 { margin: 44px 0 8px; font-size: 38px; line-height: 1.02; letter-spacing: -.02em; color: #fff; }
.ep-code-intro { margin: 0; color: rgba(255, 255, 255, .72); }
.ep-code-form { flex: 1; display: flex; flex-direction: column; }
.ep-points { display: flex; justify-content: center; gap: 14px; margin: 34px 0 30px; }
.ep-points i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); transition: background-color .1s ease; }
.ep-points i.plein { background: #fff; box-shadow: none; }
.ep-code-erreur { margin: -14px 0 16px; text-align: center; font-size: 15px; font-weight: 500; color: #FF9A9A; }
.ep-code-champ input {
	width: 100%; height: 56px; margin-bottom: 18px; padding: 0 16px;
	border: 0; border-radius: 14px; background: #262626; color: #fff;
	font-size: 24px; letter-spacing: 8px; text-align: center;
}
.ep-code-form.avec-pave .ep-code-champ { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ep-pave { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ep-pave button {
	height: 66px; border: 0; border-radius: 16px; background: #262626; color: #fff;
	font-family: var(--titres); font-size: 26px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	transition: background-color .1s ease;
}
.ep-pave button:active { background: #3A3A3A; }
.ep-pave .ep-pave-texte { background: transparent; color: rgba(255, 255, 255, .72); font-family: inherit; font-size: 14px; font-weight: 500; }
.ep-code-bas { margin-top: auto; padding-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.ep-code-form.avec-pave [data-entrer] { display: none; }
.ep-code-form.avec-pave.complet [data-entrer] { display: flex; }
.ep-rester { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; line-height: 1.3; color: rgba(255, 255, 255, .78); }
.ep-rester input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--rouge); }

/* Entêtes */
.ep-haut {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--ligne);
}
.ep-badge { padding: 7px 12px; border-radius: 999px; background: var(--encre); color: #fff; font-size: 12px; font-weight: 600; }
.ep-barre {
	position: sticky; top: 0; z-index: 10;
	display: flex; align-items: center; gap: 8px;
	padding: 12px 12px 12px 8px; background: #fff; border-bottom: 1px solid var(--ligne);
}
.ep-barre h1 { font-size: 22px; line-height: 1.1; }
.ep-retour { flex: none; display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--encre); }

/* Contenu */
.ep-contenu { width: 100%; max-width: 900px; margin: 0 auto; padding: 20px 20px 32px; display: flex; flex-direction: column; gap: 24px; }
.ep-contenu--docs { gap: 18px; padding-top: 18px; }
.ep-contenu h2 { margin-bottom: 12px; font-size: 20px; }
.ep-contenu h3 { margin: 18px 0 8px; font-size: 16px; }
.ep-vide { margin: 0; padding: 22px; border-radius: 14px; background: #fff; color: var(--texte-doux); }

/* Recherche */
.ep-recherche { position: relative; }
.ep-recherche label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--encre); }
.ep-recherche-champ { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--ligne); color: var(--texte-doux); }
.ep-recherche-champ:focus-within { box-shadow: inset 0 0 0 2px var(--encre); }
.ep-recherche-champ input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--encre); outline: none; }
.ep-resultats { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ep-resultats a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #fff; text-decoration: none; }
.ep-resultats strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ep-resultats small { font-size: 12px; color: var(--texte-doux); }
.ep-resultats .ep-aucun { padding: 12px 14px; color: var(--texte-doux); font-size: 14px; }

/* Rubriques */
.ep-tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ep-tuile { display: flex; flex-direction: column; gap: 10px; min-height: 104px; padding: 16px; border-radius: 16px; background: #fff; color: var(--encre); text-decoration: none; transition: box-shadow .15s ease; }
.ep-tuile:hover { box-shadow: 0 0 0 2px var(--encre); }
.ep-tuile i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.ep-tuile strong { display: block; font-size: 16px; font-weight: 600; }
.ep-tuile small { font-size: 13px; color: var(--texte-doux); }
.ep-rangees { display: flex; flex-direction: column; border-radius: 16px; background: #fff; overflow: hidden; }
.ep-rangees a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px; border-bottom: 1px solid var(--filet); color: var(--encre); font-weight: 500; text-decoration: none; }
.ep-rangees a:last-child { border-bottom: 0; }
.ep-rangees a:hover { background: var(--pierre); }
.ep-rangees svg { flex: none; color: var(--rouge); }

/* Documents */
.ep-pilules { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-pilules a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: #fff; color: var(--encre); font-size: 14px; font-weight: 600; text-decoration: none; }
.ep-pilules a[aria-current] { background: var(--encre); color: #fff; }
.ep-docs { display: flex; flex-direction: column; gap: 8px; }
.ep-doc { display: flex; align-items: stretch; border-radius: 14px; background: #fff; overflow: hidden; }
.ep-doc-lire { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 14px; color: var(--encre); text-decoration: none; }
.ep-doc-lire:hover { background: #FBFAF8; }
.ep-pdf { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--rouge-pale); color: var(--rouge-fonce); font-size: 11px; font-weight: 600; }
.ep-doc-texte { flex: 1; min-width: 0; }
.ep-doc-texte strong { display: block; font-size: 14px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.ep-doc-texte small { display: block; margin-top: 4px; font-size: 12px; color: var(--texte-doux); }
.ep-doc-actions { flex: none; display: flex; }
.ep-doc-charger { flex: none; display: flex; width: 54px; align-items: center; justify-content: center; border-left: 1px solid var(--filet); color: var(--rouge); }
.ep-doc-charger:hover { background: var(--rouge-pale); }

/* Lecteur de PDF */
body:has(.ep-lecteur) { background: #262626; }
.ep-lecteur { position: fixed; inset: 0; display: flex; flex-direction: column; background: #262626; color: #fff; }
.ep-lecteur-haut { display: flex; align-items: center; gap: 6px; padding: 10px 8px; background: var(--nuit); }
.ep-lecteur-haut .ep-retour { color: #fff; }
.ep-lecteur-haut h1 { flex: 1; min-width: 0; font-family: inherit; font-size: 14px; line-height: 1.25; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.ep-rond { flex: none; display: flex; width: 46px; height: 46px; align-items: center; justify-content: center; border-radius: 50%; background: var(--rouge); color: #fff; }
.ep-lecteur-pages { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ep-page { flex: none; position: relative; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.ep-page canvas { display: block; width: 100%; height: 100%; }
.ep-page:empty::before { content: "Page en cours de chargement"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 14px; color: var(--texte-doux); }
.ep-lecteur-etat { margin: auto; max-width: 320px; text-align: center; color: rgba(255, 255, 255, .8); }
.ep-lecteur-etat a { color: #fff; font-weight: 600; }
.ep-lecteur-bas { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--nuit); }
.ep-lecteur-bas > div { display: flex; align-items: center; gap: 4px; }
.ep-lecteur-bas button { display: flex; width: 46px; height: 46px; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: #2E2E2E; color: #fff; }
.ep-lecteur-bas button:disabled { opacity: .4; cursor: default; }
.ep-lecteur-bas span { min-width: 62px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Colonnes réservées à l'ordinateur */
.ep-cote, .ep-bureau, .ep-docs-tete, .ep-doc-date, .ep-doc-voir, .ep-doc-charger span { display: none; }

@media (min-width: 760px) {
	.ep-tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.ep-code { padding-top: 72px; }
	.ep-lecteur-haut { padding: 10px 16px; }
	.ep-lecteur-haut h1 { font-size: 16px; }
}

/* Ordinateur : colonne de rubriques à gauche, tableau de documents à droite. */
@media (min-width: 1000px) {
	.ep-cadre { display: flex; min-height: 100dvh; align-items: stretch; }
	.ep-cote {
		flex: none; width: 300px; padding: 26px 20px;
		display: flex; flex-direction: column; gap: 26px;
		background: var(--nuit); color: #fff;
		position: sticky; top: 0; height: 100dvh; overflow-y: auto;
	}
	.ep-cote .ep-logo img { width: 66px; height: 37px; }
	.ep-cote .ep-logo small { color: rgba(255, 255, 255, .62); }
	.ep-cote .ep-logo strong { font-size: 18px; color: #fff; }
	.ep-cote-groupe { display: flex; flex-direction: column; gap: 2px; }
	.ep-cote-groupe p { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 1.4px; color: rgba(255, 255, 255, .62); }
	.ep-cote-groupe a { padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .82); font-size: 15px; text-decoration: none; }
	.ep-cote-groupe a:hover { background: #222; color: #fff; }
	.ep-cote-groupe a[aria-current] { background: #2A2A2A; color: #fff; font-weight: 600; }

	.ep-principal { flex: 1; min-width: 0; padding: 32px clamp(20px, 4vw, 48px); }
	.ep-principal > * { max-width: 900px; }
	.ep-haut { display: none; }
	.ep-bureau { display: block; margin-bottom: 30px; }
	.ep-barre { position: static; padding: 0; background: none; border: 0; }
	.ep-barre .ep-retour { display: none; }
	.ep-barre h1 { font-size: 34px; line-height: 1.05; letter-spacing: -.015em; }
	.ep-contenu { margin: 0; padding: 14px 0 0; max-width: 900px; }
	
	/* Les documents passent en tableau. */
	.ep-docs { gap: 0; border-radius: 16px; background: #fff; overflow: hidden; }
	.ep-docs-tete, .ep-doc { display: grid; grid-template-columns: minmax(0, 1fr) 170px 150px; align-items: center; }
	.ep-docs-tete { padding: 14px 18px; color: var(--texte-doux); font-size: 12px; font-weight: 600; letter-spacing: .4px; }
	.ep-doc { border-radius: 0; border-top: 1px solid var(--filet); padding: 0 18px; overflow: visible; font-size: 14px; }
	.ep-doc-lire { padding: 13px 16px 13px 0; align-items: center; background: none !important; }
	.ep-doc-lire:hover strong { color: var(--rouge-fonce); }
	.ep-pdf { width: 34px; height: 34px; border-radius: 8px; font-size: 10px; }
	.ep-doc-texte small { display: none; }
	.ep-doc-date { display: block; color: var(--texte-doux); }
	.ep-doc-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
	.ep-doc-voir { display: inline; font-weight: 600; }
	.ep-doc-charger { width: auto; border: 0; font-weight: 600; color: var(--rouge-fonce); text-decoration: underline; background: none !important; }
	.ep-doc-charger svg { display: none; }
	.ep-doc-charger span { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
