/*
 * Page d'accueil : calques « Carrousel », « Search box » et « Agenda » de la maquette.
 * Mêmes unités que le header (--u = 1 unité de maquette, 508 = 1920 px).
 * Origine : coin haut-gauche de la colonne de contenu, sous le header (x 105.83, y 44.98 dans la maquette).
 * Sous 900 px, --u est recalculé localement pour que chaque bloc tienne dans la largeur de l'écran.
 */
.acc {
	--carrousel-fondu: 1.4s;   /* durée du fondu entre deux slides */
	position: relative;
	width: var(--hd-col);
	margin: calc(5.29 * var(--u)) 0 0 calc(50% - var(--hd-col) / 2);
	font-family: 'Barlow Semi Condensed', sans-serif;
}
.acc__haut { position: relative; height: calc(121.29 * var(--u)); }
.acc :where(h1, h2, h3, p, ul, li) { margin: 0; padding: 0; }
.acc :where(ul) { list-style: none; }

/* ---------- Carrousel ---------- */
.acc-carrousel {
	position: absolute; top: 0; left: 0;
	width: calc(171.98 * var(--u)); height: calc(114.68 * var(--u));
}
.acc-carrousel__liste { position: relative; width: 100%; height: 100%; }
.acc-slide {
	position: absolute; inset: 0;
	background: linear-gradient(90deg, #8e4a8f, #b73d41);
	opacity: 0; pointer-events: none;
	transition: opacity var(--carrousel-fondu) ease, transform var(--carrousel-fondu) ease;
}
.acc-slide.est-actif { opacity: 1; pointer-events: auto; z-index: 2; }
.acc-slide.est-suivant { opacity: 1; z-index: 1; transform: translate(calc(6.615 * var(--u)), calc(6.615 * var(--u))); }
.acc-slide__image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.acc .acc-slide__titre {
	position: absolute; z-index: 3;
	top: calc(9.17 * var(--u)); left: calc(39.69 * var(--u));
	width: calc(132.29 * var(--u)); height: calc(10.583 * var(--u));
	background: #fff; color: #000;
	font-weight: 900; font-size: calc(8.46667 * var(--u)); line-height: calc(10.583 * var(--u));
	letter-spacing: calc(.34925 * var(--u)); text-transform: uppercase;
	transition: opacity .3s;
}
.acc .acc-slide__titre { box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 calc(3 * var(--u)) 0 calc(9.08 * var(--u)); }
.acc .acc-slide__titre span { position: relative; top: calc(-.43 * var(--u)); }
.acc .acc-slide__lien { position: absolute; inset: 0; display: block; color: inherit; }
.acc .acc-slide__lien:focus-visible { outline: calc(.8 * var(--u)) solid #fff; outline-offset: calc(-1.6 * var(--u)); box-shadow: inset 0 0 0 calc(1.2 * var(--u)) var(--cgt-rouge); }
.acc .acc-slide__bouton {
	position: absolute; z-index: 3; box-sizing: border-box;
	top: calc(19.76 * var(--u)); left: calc(39.69 * var(--u));
	width: calc(59.53 * var(--u)); height: calc(7.94 * var(--u));
	padding-left: calc(2.13 * var(--u));
	background: var(--cgt-rouge); color: #fff;
	font-weight: 500; font-size: calc(6.35 * var(--u)); line-height: calc(7.94 * var(--u));
	letter-spacing: calc(.34925 * var(--u)); text-transform: uppercase;
	transition: opacity .3s;
}
.acc .acc-slide__bouton > span { position: relative; top: calc(-.32 * var(--u)); }
.acc-slide__bouton svg { position: absolute; left: calc(50.6 * var(--u)); top: calc(1.32 * var(--u)); width: calc(6.35 * var(--u)); height: calc(5.29 * var(--u)); }
.acc-slide.est-suivant .acc-slide__titre, .acc-slide.est-suivant .acc-slide__bouton { opacity: 0; }
.acc-slide.est-suivant .acc-slide__lien { pointer-events: none; }
.acc-slide__lien { cursor: pointer; }

/* ---------- Colonne latérale : panneaux gris à pied rouge ---------- */
.acc__lateral { position: absolute; top: 0; left: calc(203.73 * var(--u)); width: calc(92.6 * var(--u)); }
.acc-panneau {
	position: relative; box-sizing: border-box; overflow: hidden;
	width: calc(92.6 * var(--u)); max-width: 100%;
	background: #e6e6e6; border-radius: calc(3.44 * var(--u));
}
.acc-panneau::after {
	content: ''; position: absolute; left: 0; right: 0; bottom: 0;
	height: calc(3.44 * var(--u)); background: var(--cgt-rouge);
}
.acc .acc-panneau__titre {
	display: flex; align-items: center; justify-content: center; gap: calc(2.05 * var(--u));
	padding: calc(2.41 * var(--u)) calc(9.45 * var(--u)) 0;
	font-weight: 400; font-size: calc(5.64444 * var(--u)); line-height: calc(6.61 * var(--u));
	letter-spacing: calc(.34925 * var(--u)); text-transform: uppercase; color: #545454;
}
.acc-panneau__titre::before, .acc-panneau__titre::after { content: ''; flex: 1; height: calc(.8 * var(--u)); background: #545454; }
.acc-panneau__titre--agenda { gap: calc(4.5 * var(--u)); }

/* Recherche */
.acc-recherche-panneau { height: calc(37.04 * var(--u)); }
.acc-recherche { margin: 0; }
.acc-recherche form { margin: 0; }
.acc-recherche__barre {
	position: relative; box-sizing: border-box;
	width: calc(73.9 * var(--u)); height: calc(11.64 * var(--u));
	margin: calc(6.99 * var(--u)) 0 0 calc(9.45 * var(--u));
	background: #fff; border: calc(.264 * var(--u)) solid #999; border-radius: calc(1.32 * var(--u));
}
.acc-recherche__loupe { position: absolute; left: calc(2.75 * var(--u)); top: calc(3.17 * var(--u)); width: calc(5.25 * var(--u)); height: calc(5.29 * var(--u)); }
.acc .acc-recherche__champ {
	position: absolute; left: calc(8.5 * var(--u)); top: 0; box-sizing: border-box;
	width: calc(50 * var(--u)); height: 100%; margin: 0; padding: 0;
	border: 0; border-radius: 0; background: transparent; box-shadow: none;
	font-family: inherit; font-size: calc(4.8 * var(--u)); color: #333;
}
.acc .acc-recherche__champ:focus { outline: none; }
.acc-recherche__barre:focus-within { border-color: #545454; }
.acc .acc-recherche__bouton {
	position: absolute; left: calc(60.2 * var(--u)); top: calc(1.46 * var(--u));
	width: calc(11.91 * var(--u)); height: calc(8.73 * var(--u));
	margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
}
.acc-recherche__bouton svg { display: block; width: 100%; height: 100%; }
.acc-recherche__bouton:focus-visible { outline: calc(.4 * var(--u)) solid var(--cgt-rouge); outline-offset: calc(.3 * var(--u)); }

/* Agenda */
.acc-agenda { min-height: calc(80.28 * var(--u)); margin-top: calc(3.97 * var(--u)); display: flex; flex-direction: column; }
.acc-agenda__liste { margin: calc(2.89 * var(--u)) 0 0; padding: 0 calc(9.45 * var(--u)); }
.acc-agenda__evt { box-sizing: border-box; min-height: calc(14 * var(--u)); padding-bottom: calc(3 * var(--u)); } /* hauteur mini de la maquette ; un titre long passe à la ligne et pousse l'entrée suivante */
.acc .acc-agenda__date {
	display: inline-block; height: calc(5.16 * var(--u)); padding: 0 calc(1 * var(--u)) 0 calc(1.21 * var(--u));
	background: #545454; color: #fff;
	font-size: calc(3.52778 * var(--u)); line-height: calc(5.16 * var(--u));
	letter-spacing: calc(.34925 * var(--u)); text-transform: uppercase;
}
.acc .acc-agenda__titre { margin: calc(.4 * var(--u)) 0 0 calc(4.69 * var(--u)); font-size: calc(4.23333 * var(--u)); line-height: 1.2; letter-spacing: calc(.34925 * var(--u)); color: #545454; }
.acc .acc-agenda__titre a { color: inherit; overflow-wrap: anywhere; }
.acc .acc-agenda__vide { padding: calc(2.89 * var(--u)) calc(9.45 * var(--u)); font-size: calc(4.23333 * var(--u)); color: #545454; }
.acc .acc-agenda__toutes {
	box-sizing: border-box;
	align-self: flex-end; margin: calc(4 * var(--u)) calc(9.25 * var(--u)) calc(7 * var(--u)) auto; position: relative;
	width: calc(34.4 * var(--u)); height: calc(6.61 * var(--u));
	padding: calc(.3 * var(--u)) 0 0 calc(1.31 * var(--u));
	background: #545454; color: #fff; border-radius: calc(.463 * var(--u));
	font-size: calc(3.52778 * var(--u)); line-height: calc(4.23 * var(--u));
	letter-spacing: calc(.34925 * var(--u)); text-transform: uppercase;
}
.acc-agenda__toutes::after { content: ''; position: absolute; left: calc(1.43 * var(--u)); top: calc(5 * var(--u)); width: calc(31.53 * var(--u)); height: calc(.53 * var(--u)); background: #e6e6e6; }
.acc :where(a:focus-visible) { outline: calc(.4 * var(--u)) solid var(--cgt-rouge); outline-offset: calc(.3 * var(--u)); }

/* ---------- Titre de section « ACTUS » + grille (la grille n'est pas dessinée dans la maquette) ---------- */
.acc-actus { margin-top: calc(10.56 * var(--u)); padding-bottom: calc(14 * var(--u)); }
.acc .acc-titre-section {
	display: flex; align-items: flex-start; gap: calc(11.43 * var(--u));
	font-weight: 900; font-size: calc(10.5833 * var(--u)); line-height: calc(12.7 * var(--u));
	letter-spacing: calc(.34925 * var(--u)); text-transform: uppercase; color: #000;
}
.acc-titre-section::before, .acc-titre-section::after { content: ''; flex: 1; align-self: flex-start; height: calc(2.1167 * var(--u)); margin-top: calc(5.82 * var(--u)); background: var(--cgt-rouge); }
.acc-titre-section::after { margin-left: calc(-5.43 * var(--u)); }   /* écart de 6 à droite du texte au lieu de 11.43 */
.acc-actus__liste { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(8 * var(--u)) calc(6 * var(--u)); margin-top: calc(8 * var(--u)); }
.acc .acc-actu__date { font-size: calc(3.7 * var(--u)); letter-spacing: calc(.349 * var(--u)); text-transform: uppercase; color: #545454; }
.acc .acc-actu__titre { margin: calc(1 * var(--u)) 0; font-weight: 800; font-size: calc(6 * var(--u)); line-height: 1.15; text-transform: uppercase; }
.acc .acc-actu__titre a { color: #000; }
.acc .acc-actu__titre a:hover { color: var(--cgt-rouge); }
.acc .acc-actu__intro { font-size: calc(4.4 * var(--u)); line-height: 1.35; color: #333; }
.acc .acc-actus__toutes { margin-top: calc(8 * var(--u)); text-align: right; font-size: calc(4.4 * var(--u)); text-transform: uppercase; letter-spacing: calc(.349 * var(--u)); }
.acc .acc-actus__toutes a { color: var(--cgt-rouge); }

/* ---------- Compact (sous 900 px) : une colonne, chaque bloc tient dans la largeur ---------- */
@media (max-width: 899.98px) {
	.acc { --larg: calc(100vw - var(--sbw, 0px) - 32px); width: auto; margin: 20px 16px 0; }
	.acc__haut { height: auto; }
	.acc-carrousel { --u: calc(var(--larg) / 178.6); position: relative; margin-bottom: calc(6.615 * var(--u)); }
	.acc__lateral { --u: calc(var(--larg) / 92.6); position: static; width: var(--larg); margin-top: 16px; }
	.acc-panneau { width: var(--larg); }
	.acc-actus { --u: calc(var(--larg) / 296.34); margin-top: 24px; }
	.acc-actus__liste { grid-template-columns: 1fr; gap: 20px; }
	.acc .acc-titre-section { --u: calc(var(--larg) / 130); gap: 10px; font-size: 30px; line-height: 36px; }
	.acc-titre-section::before, .acc-titre-section::after { height: 6px; margin-top: 15px; margin-left: 0; }
	.acc .acc-actu__date { font-size: 14px; }
	.acc .acc-actu__titre { font-size: 22px; margin: 4px 0 6px; }
	.acc .acc-actu__intro, .acc .acc-actus__toutes { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
	.acc-slide, .acc-slide__titre, .acc-slide__bouton { transition: none; }
}

/* Neutralise le thème par défaut (soulignement des liens, styles de formulaire SPIP) */
.acc :where(a), .acc :where(a:hover), .acc :where(a:focus) { text-decoration: none; background: transparent; }
.acc .acc-agenda__toutes, .acc .acc-agenda__toutes:hover { color: #fff; }
.acc .formulaire_recherche { margin: 0; padding: 0; border: 0; background: none; }
.acc .formulaire_recherche form, .acc .formulaire_recherche .editer-groupe { margin: 0; padding: 0; border: 0; }

/* Le thème par défaut met « display: inline » sur tout le formulaire de recherche et du padding sur .main */
.acc.main { padding: 0; }
.acc .acc-recherche .acc-recherche__barre { display: block; }
.acc .acc-recherche .acc-recherche__loupe, .acc .acc-recherche .acc-recherche__bouton, .acc .acc-recherche .acc-recherche__bouton svg { display: block; }
.acc .acc-recherche input.acc-recherche__champ.text {
	display: block; box-sizing: border-box; width: calc(50 * var(--u)); height: 100%; margin: 0; padding: 0;
	border: 0; border-radius: 0; background: transparent; box-shadow: none; float: none;
	font-family: inherit; font-size: calc(4.8 * var(--u)); color: #333;
}

/* Agenda : au survol, le titre passe en rouge (pas de fond coloré, illisible sur le gris) */
.acc .acc-agenda .acc-agenda__titre a,
.acc .acc-agenda .acc-agenda__titre a:visited { color: inherit; background: transparent; }
.acc .acc-agenda .acc-agenda__titre a:hover,
.acc .acc-agenda .acc-agenda__titre a:focus-visible { color: #C30C07; background: transparent; text-decoration: none; }
/* Bouton « Toutes les dates » : il garde son fond gris foncé, c'est le trait dessous qui passe en rouge */
.acc .acc-agenda .acc-agenda__toutes:hover,
.acc .acc-agenda .acc-agenda__toutes:focus-visible { background: #545454; color: #fff; }
.acc .acc-agenda .acc-agenda__toutes:hover::after,
.acc .acc-agenda .acc-agenda__toutes:focus-visible::after { background: #C30C07; }

/* ---------- Liens des articles : au survol, seule la couleur du texte change (pas de fond) ---------- */
.acc .acc-actu__titre a, .acc .acc-actu__titre a:visited,
.page .menu_articles a, .page .menu_articles a:visited { background: transparent; text-decoration: none; }
.acc .acc-actu__titre a:hover, .acc .acc-actu__titre a:focus-visible,
.page .menu_articles a:hover, .page .menu_articles a:focus-visible,
.page .menu_articles a:active { color: #C30C07; background: transparent; text-decoration: none; }

/* « Toutes les actus » : noir ; au survol rouge avec un filet au-dessus et un filet en dessous */
.acc .acc-actus__toutes a, .acc .acc-actus__toutes a:visited {
	display: inline-block; padding: calc(1.2 * var(--u)) calc(1.5 * var(--u));
	color: #000; background: transparent; text-decoration: none;
	border-top: 2px solid transparent; border-bottom: 2px solid transparent;
	transition: color .15s, border-color .15s;
}
.acc .acc-actus__toutes a:hover, .acc .acc-actus__toutes a:focus-visible {
	color: #C30C07; background: transparent; border-top-color: #C30C07; border-bottom-color: #C30C07;
}
@media (max-width: 899.98px) {
	.acc .acc-actus__toutes a { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.acc .acc-actus__toutes a { transition: none; }
}

/* ---------- Liens : le thème met un fond au survol (a:hover #c41558) et un fond sombre au focus (!important) ----------
 * Ici, quel que soit l'état (survol, clic, focus), jamais de fond : seule la couleur du texte change, en #C30C07 au survol. */
.acc .acc-actu__titre a, .acc .acc-actu__titre a:visited, .acc .acc-actu__titre a:focus, .acc .acc-actu__titre a:active,
.page .menu_articles a, .page .menu_articles a:visited, .page .menu_articles a:focus, .page .menu_articles a:active {
	background: transparent !important; color: #000 !important; text-decoration: none !important; text-shadow: none !important;
}
.acc .acc-actu__titre a:hover, .acc .acc-actu__titre a:focus-visible,
.page .menu_articles a:hover, .page .menu_articles a:focus-visible {
	background: transparent !important; color: #C30C07 !important;
}
.acc .acc-actus__toutes a, .acc .acc-actus__toutes a:visited, .acc .acc-actus__toutes a:focus, .acc .acc-actus__toutes a:active {
	background: transparent !important; color: #000 !important; text-decoration: none !important; text-shadow: none !important;
}
.acc .acc-actus__toutes a:hover, .acc .acc-actus__toutes a:focus-visible { background: transparent !important; color: #C30C07 !important; }
.acc .acc-agenda .acc-agenda__titre a, .acc .acc-agenda .acc-agenda__titre a:visited,
.acc .acc-agenda .acc-agenda__titre a:focus, .acc .acc-agenda .acc-agenda__titre a:active {
	background: transparent !important; color: #545454 !important; text-decoration: none !important; text-shadow: none !important;
}
.acc .acc-agenda .acc-agenda__titre a:hover, .acc .acc-agenda .acc-agenda__titre a:focus-visible { background: transparent !important; color: #C30C07 !important; }
.acc .acc-agenda .acc-agenda__toutes, .acc .acc-agenda .acc-agenda__toutes:hover, .acc .acc-agenda .acc-agenda__toutes:focus, .acc .acc-agenda .acc-agenda__toutes:active {
	background: #545454 !important; color: #fff !important; text-shadow: none !important;
}
.acc .acc-slide__lien, .acc .acc-slide__lien:hover, .acc .acc-slide__lien:focus, .acc .acc-slide__lien:active { background: transparent !important; color: inherit !important; }

/* ---------- Actus : image à gauche, texte à droite (2 colonnes de cartes) ----------
 * L'image est le logo de l'article, recadré en 4/3 par SPIP (400 x 300 px, soit le double de la taille affichée). */
.acc-actus__liste { grid-template-columns: repeat(2, 1fr); gap: calc(10 * var(--u)) calc(8 * var(--u)); }
.acc-actu--image { display: grid; grid-template-columns: calc(52.9 * var(--u)) 1fr; gap: calc(5.3 * var(--u)); align-items: start; }
.acc-actu__texte { min-width: 0; }
.acc .acc-actu__vignette, .acc .acc-actu__vignette:hover, .acc .acc-actu__vignette:focus, .acc .acc-actu__vignette:active {
	display: block; width: calc(52.9 * var(--u)); aspect-ratio: 4 / 3; overflow: hidden;
	background: #e6e6e6 !important; text-decoration: none;
}
.acc-actu__vignette img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: opacity .2s; }
.acc-actu__vignette:hover img, .acc-actu__vignette:focus-visible img { opacity: .85; }
@media (max-width: 899.98px) {
	.acc-actus__liste { grid-template-columns: 1fr; }
	.acc-actu--image { grid-template-columns: 1fr; gap: 12px; }
	.acc .acc-actu__vignette, .acc .acc-actu__vignette:hover, .acc .acc-actu__vignette:focus, .acc .acc-actu__vignette:active { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .acc-actu__vignette img { transition: none; } }
.acc-actu--image .acc-actu__texte { margin-top: calc(-2.4 * var(--u)); }   /* le haut de la date s'aligne sur le haut de l'image */
@media (max-width: 899.98px) { .acc-actu--image .acc-actu__texte { margin-top: 0; } }

/* ---------- Accueil sur mobile : bloc centré, marges égales à gauche et à droite ----------
 * Le conteneur .page du thème par défaut mesure 95 % de l'écran, centré : mes marges de 16 px s'y ajoutaient
 * et décalaient tout vers la droite. Sur l'accueil on le rend pleine largeur ; les marges viennent de .acc. */
@media (max-width: 899.98px) {
	body.page_sommaire .page { width: auto; max-width: none; margin-left: 0; margin-right: 0; }
	/* espace entre le carrousel (dont la slide suivante dépasse en bas) et la boîte Recherche : 24 px après le dépassement */
	.acc__lateral { margin-top: calc(6.615 * var(--larg) / 178.6 + 24px); }
}
@media (max-width: 899.98px) {
	/* le thème met aussi 20 px de marge de chaque côté du body : on les retire sur l'accueil (les marges de 16 px viennent de .acc) */
	body.page_sommaire { padding-left: 0; padding-right: 0; }
	body.page_sommaire .page .footer { padding-left: 16px; padding-right: 16px; }
}

/* Actus (bureau) : date + titre + extrait ne dépassent jamais la hauteur de l'image.
 * Le titre est limité à 3 lignes ; l'extrait est raccourci par js/script.js pour tenir en entier. */
@media (min-width: 900px) {
	.acc-actu--image .acc-actu__titre { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
	.acc-actu--image .acc-actu__texte { overflow: hidden; }
}
