/* =========================================================================
   CRP-IMG Poitiers : design system (lot L2)
   Jetons dans style.css (--crp-*). Point de rupture mobile : 980 px (Divi).

   1. Polices          5. En-tête           9. Composants
   2. Base             6. Navigation       10. Infobulles des sigles
   3. Utilitaires      7. Recherche        11. Accessibilité, mouvement
   4. Bandeau haut     8. Pied de page
   ========================================================================= */

/* 1. Polices : hébergées dans le thème, licence OFL (assets/fonts/OFL-*.txt) */

@font-face {
	font-family: "Lora";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
	font-family: "Lora";
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/lora-latin-wght-italic.woff2") format("woff2-variations");
}
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
	font-family: "Source Sans 3";
	font-style: italic;
	font-weight: 200 900;
	font-display: swap;
	src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2-variations");
}

/* 2. Base : prend le pas sur les valeurs d'usine de Divi (14 px, #666) */

body.crp-site {
	background: var(--crp-white);
	color: var(--crp-ink);
	font-family: var(--crp-font-body);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

body.crp-site h1,
body.crp-site h2,
body.crp-site h3,
body.crp-site h4 {
	color: var(--crp-ink);
	font-family: var(--crp-font-heading);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	padding-bottom: 0;
	margin: 0 0 0.5em;
}
body.crp-site h1 { font-size: clamp(36px, 2.2rem + 1.6vw, 52px); font-weight: 700; line-height: 1.12; }
body.crp-site h2 { font-size: clamp(28px, 1.6rem + 0.9vw, 36px); }
body.crp-site h3 { font-size: 22px; }
body.crp-site h4 { font-size: 19px; }
body.crp-site h1 em,
body.crp-site h2 em { color: var(--crp-primary); font-style: italic; }

body.crp-site p { padding-bottom: 0; margin: 0 0 1em; }
body.crp-site a { color: var(--crp-primary); text-underline-offset: 0.18em; }
body.crp-site a:hover { color: var(--crp-secondary); }
body.crp-site strong { font-weight: 600; }

/*
 * Divi masque le débordement vertical de #page-container, ce qui empêche
 * position: sticky de fonctionner. « clip » coupe le débordement horizontal
 * sans créer de conteneur de défilement.
 */
body.crp-site #page-container {
	overflow: visible;
	overflow-x: clip;
	padding-top: 0 !important;
}

/* 3. Utilitaires */

/* L'attribut hidden l'emporte toujours, même sur un composant en display: flex. */
[hidden] { display: none !important; }

.crp-container {
	box-sizing: border-box;
	margin: 0 auto;
	max-width: calc(var(--crp-content-max) + 48px);
	padding: 0 24px;
	width: 100%;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.crp-skip-link {
	background: var(--crp-ink);
	color: var(--crp-white) !important;
	font-weight: 600;
	left: 16px;
	padding: 12px 16px;
	position: absolute;
	top: -100px;
	z-index: 100000;
}
.crp-skip-link:focus { top: 16px; }

.crp-eyebrow {
	color: var(--crp-secondary);
	font-family: var(--crp-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	margin: 0 0 12px;
	text-transform: uppercase;
}

.crp-lead { color: var(--crp-ink-soft); font-size: 19px; }
.crp-muted { color: var(--crp-ink-soft); }
.crp-section { padding: 72px 0; }
.crp-section--paper { background: var(--crp-paper); }

/* 4. Bandeau haut */

.crp-topbar {
	background: var(--crp-primary);
	color: var(--crp-white);
	font-size: 12px;
	line-height: 1;
}
.crp-topbar__inner {
	align-items: center;
	display: flex;
	justify-content: space-between;
	min-height: 36px;
}
.crp-topbar__label {
	font-weight: 600;
	letter-spacing: 0.1em;
	margin: 0 !important;
	text-transform: uppercase;
}
.crp-topbar__links {
	display: flex;
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0 !important;
}
body.crp-site .crp-topbar__links a {
	color: var(--crp-white);
	text-decoration: none;
}
body.crp-site .crp-topbar__links a:hover { text-decoration: underline; }

/* 5. En-tête */

.crp-header {
	background: var(--crp-white);
	border-bottom: 1px solid var(--crp-border);
	position: sticky;
	top: 0;
	transition: box-shadow 0.2s ease;
	z-index: 1000;
}
body.admin-bar .crp-header { top: 32px; }
.crp-header.is-stuck { box-shadow: 0 4px 16px rgba(34, 30, 29, 0.08); }

.crp-header__inner {
	align-items: center;
	display: flex;
	gap: 32px;
	min-height: 80px;
}

.crp-brand {
	align-items: baseline;
	display: inline-flex;
	flex-shrink: 0;
	gap: 6px;
	text-decoration: none !important;
}
.crp-brand__img { display: block; height: 56px; width: auto; }
.crp-brand__name {
	color: var(--crp-primary);
	font-family: var(--crp-font-heading);
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.crp-brand__place {
	color: var(--crp-ink-soft);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.crp-brand--inverse .crp-brand__name { color: var(--crp-white); }
.crp-brand--inverse .crp-brand__place { color: var(--crp-border); }

.crp-header__actions {
	align-items: center;
	display: flex;
	gap: 12px;
	margin-left: auto;
}

.crp-icon-btn {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: var(--crp-radius);
	color: var(--crp-ink);
	cursor: pointer;
	display: inline-flex;
	height: 44px;
	justify-content: center;
	padding: 0;
	width: 44px;
}
.crp-icon-btn:hover { background: var(--crp-paper); color: var(--crp-primary); }

.crp-menu-toggle { display: none; }
.crp-menu-toggle__bars,
.crp-menu-toggle__bars::before,
.crp-menu-toggle__bars::after {
	background: currentColor;
	border-radius: 2px;
	display: block;
	height: 2px;
	position: relative;
	transition: transform 0.2s ease, opacity 0.2s ease;
	width: 22px;
}
.crp-menu-toggle__bars::before,
.crp-menu-toggle__bars::after { content: ""; position: absolute; }
.crp-menu-toggle__bars::before { top: -7px; }
.crp-menu-toggle__bars::after { top: 7px; }
.crp-menu-toggle[aria-expanded="true"] .crp-menu-toggle__bars { background: transparent; }
.crp-menu-toggle[aria-expanded="true"] .crp-menu-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.crp-menu-toggle[aria-expanded="true"] .crp-menu-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

/* 6. Navigation (bureau : liens en capitales, soulignement de 2 px) */

.crp-nav { flex: 1; }
.crp-nav__list {
	display: flex;
	gap: 8px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0 !important;
}
.crp-nav__item { position: relative; display: flex; align-items: center; }

body.crp-site .crp-nav__link {
	align-items: center;
	background: none;
	border: 0;
	color: var(--crp-ink-soft);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--crp-font-body);
	font-size: 14px;
	font-weight: 600;
	gap: 6px;
	letter-spacing: 0.05em;
	line-height: 1;
	padding: 30px 12px;
	position: relative;
	text-decoration: none;
	text-transform: uppercase;
}
body.crp-site .crp-nav__link::after {
	background: var(--crp-primary);
	bottom: 22px;
	content: "";
	height: 2px;
	left: 12px;
	opacity: 0;
	position: absolute;
	right: 12px;
	transition: opacity 0.15s ease;
}
body.crp-site .crp-nav__link:hover,
body.crp-site .crp-nav__item.is-current > .crp-nav__link,
body.crp-site .crp-nav__item:focus-within > .crp-nav__link { color: var(--crp-ink); }
body.crp-site .crp-nav__item.is-current > .crp-nav__link::after,
body.crp-site .crp-nav__link:hover::after { opacity: 1; }

.crp-nav__toggle--icon {
	background: none;
	border: 0;
	color: var(--crp-ink-soft);
	cursor: pointer;
	margin-left: -10px;
	padding: 8px 6px;
}
.crp-nav__chevron {
	border-bottom: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	display: inline-block;
	height: 6px;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.15s ease;
	width: 6px;
}
.crp-nav__toggle[aria-expanded="true"] .crp-nav__chevron { transform: translateY(1px) rotate(-135deg); }

.crp-nav__sub {
	background: var(--crp-white);
	border: 1px solid var(--crp-border);
	border-radius: var(--crp-radius);
	border-top: 3px solid var(--crp-primary);
	box-shadow: 0 12px 32px rgba(34, 30, 29, 0.1);
	display: none;
	left: 0;
	list-style: none;
	margin: 0;
	min-width: 260px;
	padding: 8px 0 !important;
	position: absolute;
	top: calc(100% - 8px);
	z-index: 10;
}
.crp-nav__toggle[aria-expanded="true"] + .crp-nav__sub,
.crp-nav__toggle[aria-expanded="true"] ~ .crp-nav__sub { display: block; }

body.crp-site .crp-nav__sublink {
	color: var(--crp-ink);
	display: block;
	font-size: 16px;
	padding: 10px 20px;
	text-decoration: none;
}
body.crp-site .crp-nav__sublink:hover,
body.crp-site .crp-nav__subitem.is-current > .crp-nav__sublink {
	background: var(--crp-paper);
	color: var(--crp-primary);
}

.crp-nav__extra { display: none; }

@media (min-width: 1181px) {
	/* Survol à la souris en plus du clic et du clavier. */
	.crp-nav__item.has-children:hover > .crp-nav__sub { display: block; }
}

body.crp-site .crp-nav__link { white-space: nowrap; }

@media (max-width: 980px) {
	.crp-topbar { display: none; }
	.crp-header__inner { min-height: 64px; }
	.crp-brand__name { font-size: 22px; }
}

/*
 * Panneau plein écran sous 1180 px, et non 980 px comme Divi : en dessous,
 * logo + 4 entrées en capitales + loupe + bouton ne tiennent plus sur une
 * ligne (constaté à 1024 px). Seuil repris dans main.js.
 */
@media (max-width: 1180px) {
	.crp-header__inner { gap: 12px; }
	.crp-menu-toggle { display: inline-flex; }
	.crp-header__cta { padding: 10px 14px; }

	.crp-nav {
		background: var(--crp-white);
		bottom: 0;
		display: none;
		flex-direction: column;
		left: 0;
		overflow-y: auto;
		padding: 8px 24px 32px;
		position: fixed;
		right: 0;
		top: var(--crp-header-bottom, 64px);
		z-index: 999;
	}
	.crp-nav.is-open { display: flex; }

	.crp-nav__list { display: block; }
	.crp-nav__item {
		border-bottom: 1px solid var(--crp-border);
		display: flex;
		flex-wrap: wrap;
	}
	body.crp-site .crp-nav__link {
		border-left: 3px solid transparent;
		flex: 1;
		font-size: 16px;
		justify-content: space-between;
		padding: 18px 12px;
		text-align: left;
	}
	body.crp-site .crp-nav__link::after { display: none; }
	body.crp-site .crp-nav__item.is-current > .crp-nav__link {
		border-left-color: var(--crp-primary);
		color: var(--crp-primary);
	}
	.crp-nav__toggle--icon { margin-left: 0; padding: 0 16px; }
	.crp-nav__sub {
		border: 0;
		box-shadow: none;
		flex-basis: 100%;
		padding: 0 0 12px 12px !important;
		position: static;
	}
	.crp-nav__extra {
		display: flex;
		flex-direction: column;
		gap: 20px;
		margin-top: 24px;
	}
	.crp-nav__extra-links {
		display: flex;
		gap: 24px;
		list-style: none;
		margin: 0;
		padding: 0 !important;
	}
	body.crp-site .crp-nav__extra-links a { color: var(--crp-ink-soft); font-size: 15px; }

	body.crp-nav-open { overflow: hidden; }
}

@media (max-width: 420px) {
	.crp-brand__place { display: none; }
	.crp-header__actions { gap: 4px; }
}

/* 7. Recherche */

.crp-search {
	background: var(--crp-paper);
	border-top: 1px solid var(--crp-border);
	padding: 20px 0;
}
.crp-search__form { display: flex; gap: 12px; }
.crp-search__field {
	border: 1px solid var(--crp-border);
	border-radius: var(--crp-radius);
	color: var(--crp-ink);
	flex: 1;
	font: inherit;
	min-width: 0;
	padding: 12px 16px;
}

/* 8. Pied de page */

.crp-footer {
	background: var(--crp-ink);
	color: var(--crp-border);
	font-size: 15px;
	padding-top: 64px;
}
.crp-footer__grid {
	display: grid;
	gap: 40px;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	padding-bottom: 48px;
}
.crp-footer__about p { margin-top: 16px; max-width: 320px; }
body.crp-site .crp-footer__title {
	color: var(--crp-white);
	font-family: var(--crp-font-body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	margin-bottom: 16px;
	text-transform: uppercase;
}
.crp-footer__links { list-style: none; margin: 0; padding: 0 !important; }
.crp-footer__links li { padding: 5px 0; }
body.crp-site .crp-footer a { color: var(--crp-border); text-decoration: none; }
body.crp-site .crp-footer a:hover { color: var(--crp-white); text-decoration: underline; }

.crp-footer__bottom { border-top: 1px solid rgba(228, 221, 215, 0.18); font-size: 13px; }
.crp-footer__bottom-inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 32px;
	padding-bottom: 24px;
	padding-top: 24px;
}
.crp-footer__bottom p { margin: 0 !important; }
.crp-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	list-style: none;
	margin: 0;
	padding: 0 !important;
}
.crp-footer__credit { margin-left: auto !important; }

@media (max-width: 980px) {
	.crp-footer__grid { grid-template-columns: 1fr 1fr; }
	.crp-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
	.crp-footer__grid { grid-template-columns: 1fr; }
	.crp-footer__credit { margin-left: 0 !important; }
}

/* Bouton flottant : grand écran uniquement (le bouton de l'en-tête suffit sur mobile) */
.crp-float-cta {
	bottom: 24px;
	box-shadow: 0 8px 24px rgba(124, 40, 34, 0.28);
	opacity: 0;
	pointer-events: none;
	position: fixed;
	right: 24px;
	transform: translateY(12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 900;
}
.crp-float-cta.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.crp-float-cta:focus-visible { opacity: 1; pointer-events: auto; transform: none; }
/* body.crp-site : doit l'emporter sur « body.crp-site .crp-btn { display: inline-flex } ». */
@media (max-width: 980px) { body.crp-site .crp-float-cta { display: none; } }

/* 9. Composants */

body.crp-site .crp-btn {
	align-items: center;
	border: 1px solid transparent;
	border-radius: var(--crp-radius);
	box-sizing: border-box;
	cursor: pointer;
	display: inline-flex;
	font-family: var(--crp-font-body);
	font-size: 14px;
	font-weight: 600;
	gap: 8px;
	justify-content: center;
	letter-spacing: 0.05em;
	line-height: 1.2;
	padding: 14px 24px;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
body.crp-site .crp-btn--primary { background: var(--crp-primary); color: var(--crp-white); }
body.crp-site .crp-btn--primary:hover { background: var(--crp-secondary); color: var(--crp-white); }
body.crp-site .crp-btn--secondary { background: var(--crp-white); border-color: var(--crp-primary); color: var(--crp-primary); }
body.crp-site .crp-btn--secondary:hover { background: var(--crp-paper); color: var(--crp-primary); }
body.crp-site .crp-btn--inverse { background: var(--crp-white); color: var(--crp-primary); }
body.crp-site .crp-btn--inverse:hover { background: var(--crp-paper); color: var(--crp-primary); }
/* Sur fond sombre ou rouge (panneau de l'accueil, bandeau d'adhésion) : contour blanc. */
body.crp-site .crp-btn--ghost { background: transparent; border-color: rgba(255, 255, 255, 0.75); color: var(--crp-white); }
body.crp-site .crp-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--crp-white); color: var(--crp-white); }
.crp-btn--block { width: 100%; }

.crp-link-arrow { color: var(--crp-primary); font-weight: 600; text-decoration: none !important; }
.crp-link-arrow::after { content: " \2192"; }

.crp-pill {
	background: var(--crp-paper);
	border: 1px solid var(--crp-border);
	border-radius: 999px;
	color: var(--crp-secondary);
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	padding: 6px 14px;
	text-transform: uppercase;
}

.crp-cards {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.crp-card {
	background: var(--crp-white);
	border: 1px solid var(--crp-border);
	border-radius: var(--crp-radius);
	border-top: 3px solid var(--crp-primary);
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 32px;
	position: relative;
}
.crp-card__icon { color: var(--crp-secondary); height: 28px; width: 28px; }
body.crp-site .crp-card__title { font-size: 22px; margin: 0; }
.crp-card__text { color: var(--crp-ink-soft); flex: 1; margin: 0 !important; }
/* Toute la carte est cliquable, le lien du titre reste la cible accessible. */
.crp-card__link::before { content: ""; inset: 0; position: absolute; }
.crp-card:hover { border-color: var(--crp-secondary); }

.crp-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0 !important; }
.crp-chip {
	background: var(--crp-white);
	border: 1px solid var(--crp-border);
	border-radius: 999px;
	color: var(--crp-ink);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	padding: 8px 16px;
}
.crp-chip:hover { border-color: var(--crp-primary); }
.crp-chip[aria-pressed="true"] { background: var(--crp-primary); border-color: var(--crp-primary); color: var(--crp-white); }

.crp-breadcrumb { color: var(--crp-ink-soft); font-size: 13px; }
.crp-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0 !important; }
.crp-breadcrumb li + li::before { content: "\203A"; margin-right: 4px; }
body.crp-site .crp-breadcrumb a { color: var(--crp-ink-soft); }
.crp-breadcrumb [aria-current] { color: var(--crp-ink); }

.crp-help {
	background: var(--crp-paper);
	border: 1px solid var(--crp-border);
	border-radius: var(--crp-radius);
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
}
body.crp-site .crp-help__title { font-size: 22px; margin: 0; }

.crp-info-grid { display: grid; gap: 32px 48px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) { .crp-info-grid { grid-template-columns: 1fr; } }

.crp-placeholder {
	border: 1px dashed var(--crp-ink-soft);
	border-radius: var(--crp-radius);
	color: var(--crp-ink-soft);
	display: inline-block;
	font-size: 14px;
	padding: 2px 10px;
}

.crp-band { background: var(--crp-primary); color: var(--crp-white); padding: 64px 0; }
body.crp-site .crp-band h2 { color: var(--crp-white); }

/* 10. Infobulles des sigles (décision D07, shortcode [sigle] de crp-core) */

.crp-abbr {
	border-bottom: 1px dotted currentColor;
	cursor: help;
	position: relative;
	text-decoration: none;
}
.crp-abbr__def {
	background: var(--crp-ink);
	border-radius: var(--crp-radius);
	bottom: calc(100% + 8px);
	color: var(--crp-white);
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	left: 50%;
	line-height: 1.4;
	padding: 8px 12px;
	pointer-events: none;
	position: absolute;
	/* Décalage posé par main.js pour rester dans l'écran près d'un bord (390 px). */
	transform: translateX(calc(-50% + var(--crp-abbr-shift, 0px)));
	visibility: hidden;
	white-space: normal;
	width: max-content;
	max-width: min(280px, 80vw);
	z-index: 20;
}
.crp-abbr__def::after {
	border: 6px solid transparent;
	border-top-color: var(--crp-ink);
	content: "";
	left: calc(50% - var(--crp-abbr-shift, 0px));
	position: absolute;
	top: 100%;
	transform: translateX(-50%);
}
.crp-abbr:hover .crp-abbr__def,
.crp-abbr:focus .crp-abbr__def,
.crp-abbr.is-open .crp-abbr__def { visibility: visible; }
.crp-abbr.is-dismissed .crp-abbr__def { visibility: hidden; }

/* 11. Accessibilité, mouvement */

body.crp-site :focus-visible {
	outline: 2px solid var(--crp-primary);
	outline-offset: 2px;
}
body.crp-site .crp-topbar :focus-visible,
body.crp-site .crp-footer :focus-visible,
body.crp-site .crp-band :focus-visible,
body.crp-site .crp-btn--primary:focus-visible { outline-color: var(--crp-ink); box-shadow: 0 0 0 4px var(--crp-white); }
body.crp-site .crp-topbar :focus-visible,
body.crp-site .crp-footer :focus-visible,
body.crp-site .crp-band :focus-visible { outline-color: var(--crp-white); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
