/*
 * Blog OFAP — vitrine des articles (page des articles, catégories, étiquettes,
 * auteurs, dates, recherche, état vide).
 *
 * Dans la lignée du catalogue : recherche en vue, pastilles de catégories avec
 * compteurs, cartes uniformes sur trois colonnes ; l'article le plus récent est
 * présenté « à la une », image en feuille.
 *
 * Chargée après fonts.css, styles.css, kit-ofap.css et blog.css, dont elle
 * reprend les jetons (--blog-*, posés par la classe de body .ofap-article) et
 * les composants : .ofap-bouton, .ofap-etiquette, .ofap-ariane, .ofap-formations.
 * Le balisage vient de inc/blog-vitrine.php ; la page est un gabarit Elementor
 * Pro de type « Archive » (outils/wp/construire-modele-blog.php).
 *
 * Sommaire
 *   1. Jetons et conteneurs
 *   2. Bandeau : sur-titre, titre, introduction, recherche
 *   3. Navigation par catégorie
 *   4. Article à la une
 *   5. Liste : en-tête, grille, carte d'article
 *   6. Pagination
 *   7. État vide
 *   8. Bas de page : bloc de formations
 *   9. Écrans étroits
 */

/* 1. Jetons et conteneurs ------------------------------------------------- */
.ofap-vitrine {
	--vitrine-filet: #E3E2E9;        /* bord des cartes et des pastilles */
	--vitrine-filet-fort: #C9C7D6;   /* bord au survol */
	--vitrine-rose: #FBD3D0;         /* quart de cercle du bandeau */
	--vitrine-anneau: #F3989D;       /* anneau du bandeau */
	--vitrine-marge: 48px;           /* marge de page, suit --blog-conteneur */
	--vitrine-feuille: 72px 14px 72px 14px;
}
/* La vitrine n'a pas de sommaire collant : une ancre s'arrête sous l'en-tête. */
html:has(body.ofap-vitrine) { scroll-padding-top: 112px; }
/* Avec la barre d'administration : les valeurs de compat-wp.css, redites ici
 * parce que celles de blog.css (articles) l'emporteraient sur elle. */
html:has(body.admin-bar.ofap-vitrine) { scroll-padding-top: 144px; }
@media (max-width: 782px) { html:has(body.admin-bar.ofap-vitrine) { scroll-padding-top: 158px; } }
@media (max-width: 600px) { html:has(body.admin-bar.ofap-vitrine) { scroll-padding-top: 112px; } }

.ofap-vitrine #contenu { color: var(--ink); }
.ofap-vitrine__int {
	width: var(--blog-conteneur);
	margin-inline: auto;
}
/* Vitrine rendue sans gabarit Elementor (repli d'index.php) : pas de bloc de
 * formations pour finir la page, la liste garde sa marge basse. */
.ofap-vitrine #contenu > .ofap-vitrine__int:last-child { padding-bottom: clamp(72px, 9vw, 110px); }

/* 2. Bandeau -------------------------------------------------------------- */
.ofap-vitrine-bandeau {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--blog-peche);
}
/* Décors du catalogue : quart de cercle en haut à droite, anneau en bas. */
.ofap-vitrine-bandeau::before,
.ofap-vitrine-bandeau::after {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
}
.ofap-vitrine-bandeau::before {
	top: -110px;
	right: -110px;
	width: 430px;
	height: 430px;
	border-radius: 0 0 0 100%;
	background: var(--vitrine-rose);
}
.ofap-vitrine-bandeau::after {
	left: 36%;
	bottom: -158px;
	width: 200px;
	height: 200px;
	border: 12px solid var(--vitrine-anneau);
	border-radius: 50%;
}
.ofap-vitrine-bandeau__int {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
	column-gap: clamp(32px, 5vw, 80px);
	align-items: center;
	padding-block: 52px 60px;
}
/* Fil d'Ariane (catégorie, recherche, archives) : au-dessus des deux colonnes. */
.ofap-vitrine-bandeau__ariane {
	grid-column: 1 / -1;
	margin: -22px 0 26px;
}
.ofap-vitrine .ofap-vitrine-bandeau__ariane a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	margin-left: -6px;
	padding-inline: 6px;
	border-radius: 4px;
}
.ofap-vitrine .ofap-vitrine-bandeau__ariane li { display: flex; align-items: center; min-height: 40px; }
.ofap-vitrine .ofap-vitrine-bandeau__ariane a:hover { color: var(--red-dark); }

/* Sur-titre : Poppins 700, 13 px, capitales, interlettrage 12 % (kit).
 * Rouge sombre : sur le fond pêche, #D91921 reste sous 4,5:1. */
.ofap-vitrine-surtitre {
	display: flex;
	align-items: center;
	gap: 16px;
	font: 700 .8125rem/1.5 var(--heading);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--red-dark);
}
.ofap-vitrine-surtitre::before {
	content: "";
	flex: none;
	width: 40px;
	height: 3px;
	border-radius: 3px;
	background: var(--blog-rouge);
}
.ofap-vitrine-titre {
	margin-top: 16px;
	font: 700 clamp(2.25rem, 1.42rem + 3vw, 3.5rem)/1.1 var(--heading);
	letter-spacing: -.035em;
	color: var(--blog-nuit);
	overflow-wrap: break-word;
	text-wrap: balance;
}
/* Trait rouge « à la main » sous un seul mot du titre (kit, catalogue). */
.ofap-vitrine-souligne {
	position: relative;
	display: inline-block;
	white-space: nowrap;
}
.ofap-vitrine-souligne::after {
	content: "";
	position: absolute;
	left: -1%;
	bottom: -.11em;
	width: 102%;
	height: .16em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 20' preserveAspectRatio='none'%3E%3Cpath fill='%23ed1c24' d='M2 16C101 1 303-5 492 8c6 .4 9 3 8 7-.3 1.8-1.7 2.7-5 2.4C312 10 144 10 3 19c-3 .2-4-1.7-1-3Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	pointer-events: none;
}
.ofap-vitrine-intro {
	max-width: 33em;
	margin-top: 20px;
	font-size: clamp(1.0625rem, 1rem + .32vw, 1.1875rem);
	line-height: 1.6;
	color: var(--text);
}
/* Introduction d'une catégorie : sa description, saisie dans WordPress. */
.ofap-vitrine-intro p + p { margin-top: .7em; }
.ofap-vitrine .ofap-vitrine-intro a { color: var(--red-dark); text-decoration: underline; text-underline-offset: .15em; }

/* Recherche : carte blanche en « feuille », champ en pilule du catalogue. */
.ofap-vitrine-recherche {
	padding: 30px 32px 26px;
	border-radius: 56px 0 56px 0;
	background: #fff;
	box-shadow: 0 18px 48px rgba(45, 42, 78, .09);
}
.ofap-vitrine-recherche__libelle {
	display: block;
	font: 500 1.0625rem/1.4 var(--heading);
	letter-spacing: -.01em;
	color: var(--blog-nuit);
}
.ofap-vitrine-recherche__champ {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 14px;
	padding: 5px 5px 5px 20px;
	border: 1px solid var(--blog-noir);
	border-radius: 999px;
	background: #fff;
}
.ofap-vitrine-recherche__champ:focus-within {
	outline: 3px solid var(--teal);
	outline-offset: 3px;
}
.ofap-vitrine-recherche__loupe { flex: none; color: var(--blog-vert); }
.ofap-vitrine .ofap-vitrine-recherche__saisie {
	flex: 1;
	width: auto;
	min-width: 0;
	height: 50px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: 400 1rem/1.4 var(--body);
	color: var(--ink);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.ofap-vitrine-recherche__saisie::placeholder { color: #6F6E80; opacity: 1; }
.ofap-vitrine-recherche__saisie::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.ofap-vitrine .ofap-vitrine-recherche__envoi {
	position: relative;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 10px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--blog-rouge-texte);
	font: 700 .9375rem/1.2 var(--heading);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s;
}
.ofap-vitrine .ofap-vitrine-recherche__envoi:hover { background: var(--red-dark); }
.ofap-vitrine .ofap-vitrine-recherche__envoi:focus-visible { outline-offset: 3px; }
.ofap-vitrine-recherche__envoi svg { display: none; }
.ofap-vitrine-recherche__aide {
	margin-top: 12px;
	padding-left: 20px;
	font-size: .8125rem;
	line-height: 1.5;
	color: var(--muted);
}

/* 3. Navigation par catégorie --------------------------------------------- */
.ofap-vitrine-categories {
	position: relative;
	padding-top: 30px;
}
.ofap-vitrine-categories__liste {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	width: var(--blog-conteneur);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}
.ofap-vitrine .ofap-vitrine-pastille {
	position: relative; /* contient le texte masqué « articles » : hors de la pastille, il élargirait la page */
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 44px;
	padding: 6px 7px 6px 16px;
	border: 1px solid var(--vitrine-filet);
	border-radius: 999px;
	background: #fff;
	font: 500 .875rem/1.25 var(--heading);
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s, border-color .2s, color .2s;
}
/* Point de couleur : la teinte de la catégorie, reprise par l'étiquette des cartes. */
.ofap-vitrine-pastille__point {
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--blog-rouge);
}
.ofap-vitrine-pastille--menthe .ofap-vitrine-pastille__point { background: var(--blog-vert); }
.ofap-vitrine-pastille--peche .ofap-vitrine-pastille__point { background: var(--blog-nuit); }
.ofap-vitrine-pastille__nombre {
	display: grid;
	place-items: center;
	min-width: 30px;
	height: 30px;
	padding-inline: 8px;
	border-radius: 999px;
	background: var(--soft);
	font: 500 .75rem/1 var(--heading);
	color: var(--text);
	transition: background-color .2s, color .2s;
}
.ofap-vitrine .ofap-vitrine-pastille:hover {
	border-color: var(--blog-nuit);
	background: var(--blog-peche);
}
.ofap-vitrine .ofap-vitrine-pastille:hover .ofap-vitrine-pastille__nombre { background: #fff; }
.ofap-vitrine .ofap-vitrine-pastille:focus-visible { outline-offset: 3px; }
/* Catégorie affichée : pastille pleine, bleu nuit. */
.ofap-vitrine .ofap-vitrine-pastille[aria-current] {
	border-color: var(--blog-nuit);
	background: var(--blog-nuit);
	color: #fff;
}
.ofap-vitrine .ofap-vitrine-pastille[aria-current] .ofap-vitrine-pastille__nombre {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}
.ofap-vitrine .ofap-vitrine-pastille[aria-current] .ofap-vitrine-pastille__point { background: #fff; }

/* 4. Article à la une ------------------------------------------------------ */
/* Sans cadre : l'image 2:1 entière (les visuels du blog portent leur titre au
 * centre : aucun recadrage), en feuille sur une trame de points, texte à côté. */
.ofap-vitrine-une {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	column-gap: clamp(32px, 4.5vw, 64px);
	align-items: center;
	margin-top: 44px;
}
.ofap-vitrine-une__image {
	position: relative;
	isolation: isolate;
	display: block;
	aspect-ratio: 2 / 1;
}
.ofap-vitrine-une__image::before {
	content: "";
	position: absolute;
	z-index: -1;
	left: -22px;
	bottom: -22px;
	width: 148px;
	height: 148px;
	background-image: radial-gradient(var(--blog-rouge) 1.8px, transparent 1.9px);
	background-size: 16px 16px;
	opacity: .55;
}
.ofap-vitrine .ofap-vitrine-une__image img,
.ofap-vitrine .ofap-vitrine-carte__image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 0;
	object-fit: cover;
}
.ofap-vitrine .ofap-vitrine-une__image img { border-radius: var(--vitrine-feuille); background: var(--blog-peche); }
.ofap-vitrine .ofap-vitrine-carte__image img { transition: transform .35s; }
.ofap-vitrine-carte:hover .ofap-vitrine-carte__image img { transform: scale(1.035); }
/* Sans image mise en avant : le motif du kit, à la place d'un aplat nu. */
.ofap-vitrine-une__image:empty,
.ofap-vitrine-carte__image:empty {
	background: radial-gradient(circle at 100% 0, rgba(244, 99, 106, .3) 0 46%, transparent 46.5%), var(--blog-peche);
}
/* À la une : le motif est porté par un calque, au-dessus de la trame de points
 * (un fond serait peint dessous). */
.ofap-vitrine-une__image:empty { background: none; }
.ofap-vitrine-une__image:empty::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--vitrine-feuille);
	background: radial-gradient(circle at 100% 0, rgba(244, 99, 106, .3) 0 46%, transparent 46.5%), var(--blog-peche);
}
.ofap-vitrine-une__corps {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}
.ofap-vitrine-une__etiquettes { display: flex; flex-wrap: wrap; gap: 8px; }
.ofap-vitrine-une__titre {
	font: 700 clamp(1.625rem, 1.05rem + 1.8vw, 2.375rem)/1.12 var(--heading);
	letter-spacing: -.025em;
	color: var(--blog-nuit);
	overflow-wrap: break-word;
	text-wrap: balance;
}
.ofap-vitrine-une__extrait {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	font-size: clamp(1rem, .94rem + .3vw, 1.125rem);
	line-height: 1.7;
	color: var(--text);
	overflow: hidden;
}
/* Le bouton est un décor (aria-hidden) : le lien du titre couvre le bloc. */
.ofap-vitrine-une .ofap-bouton { margin-top: 6px; }
.ofap-vitrine-une:hover .ofap-bouton--rouge { background: var(--red-dark); transform: translateY(-2px); }

/* Lien du titre étiré sur tout le bloc : une seule cible, toute la surface. */
.ofap-vitrine .ofap-vitrine-une__titre a::after,
.ofap-vitrine .ofap-vitrine-carte__titre a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}
.ofap-vitrine .ofap-vitrine-une__titre a,
.ofap-vitrine .ofap-vitrine-carte__titre a { border-radius: 4px; color: inherit; text-decoration: none; transition: color .2s; }
.ofap-vitrine .ofap-vitrine-une:hover .ofap-vitrine-une__titre a,
.ofap-vitrine .ofap-vitrine-carte:hover .ofap-vitrine-carte__titre a { color: var(--blog-rouge-texte); }
/* Focus au clavier : l'anneau entoure le bloc entier. */
@supports selector(:has(a)) {
	.ofap-vitrine .ofap-vitrine-une__titre a:focus-visible,
	.ofap-vitrine .ofap-vitrine-carte__titre a:focus-visible { outline: none; }
	.ofap-vitrine-une:has(.ofap-vitrine-une__titre a:focus-visible),
	.ofap-vitrine-carte:has(.ofap-vitrine-carte__titre a:focus-visible) {
		outline: 3px solid var(--teal);
		outline-offset: 4px;
	}
	.ofap-vitrine-une:has(.ofap-vitrine-une__titre a:focus-visible) { outline-offset: 10px; border-radius: 6px; }
}

/* Date · temps de lecture (à la une et cartes). */
.ofap-vitrine-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 8px;
	font-size: .8125rem;
	line-height: 1.5;
	color: var(--muted);
}

/* 5. Liste ----------------------------------------------------------------- */
.ofap-vitrine-liste { padding-top: 64px; }
.ofap-vitrine-liste--seule { padding-top: 36px; }
.ofap-vitrine-liste__tete {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 24px;
	margin-bottom: 24px;
}
.ofap-vitrine-liste__titre {
	font: 700 clamp(1.375rem, 1.2rem + .6vw, 1.625rem)/1.2 var(--heading);
	letter-spacing: -.02em;
	color: var(--blog-noir);
}
.ofap-vitrine-liste__compte { font-size: .9375rem; line-height: 1.5; color: var(--muted); }

.ofap-vitrine-grille {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ofap-vitrine-grille > li { display: flex; min-width: 0; }

/* Carte d'article : image 2:1, catégorie, titre, extrait, date · lecture. */
.ofap-vitrine-carte {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--vitrine-filet);
	border-radius: 22px 0 22px 0;
	background: #fff;
	overflow: hidden;
	transition: border-color .2s, box-shadow .2s, transform .2s;
}
.ofap-vitrine-carte:hover {
	border-color: var(--vitrine-filet-fort);
	box-shadow: var(--shadow);
	transform: translateY(-3px);
}
.ofap-vitrine-carte__image {
	display: block;
	flex: none;
	aspect-ratio: 2 / 1;
	background: var(--blog-peche);
	overflow: hidden;
}
.ofap-vitrine-carte__corps {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 18px 20px 14px;
}
/* Nom long (« Compétences professionnelles ») sur une carte étroite : deux lignes. */
.ofap-vitrine .ofap-vitrine-carte__categorie,
.ofap-vitrine .ofap-vitrine-une__etiquettes .ofap-etiquette { max-width: 100%; border-radius: 13px; }
/* Un titre est toujours lu en entier : pas de coupe. */
.ofap-vitrine-carte__titre {
	font: 500 1.0625rem/1.35 var(--heading);
	letter-spacing: -.012em;
	color: var(--blog-noir);
	overflow-wrap: break-word;
}
.ofap-vitrine-carte__extrait {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	font-size: .9375rem;
	line-height: 1.55;
	color: var(--text);
	overflow: hidden;
	overflow-wrap: break-word;
}
.ofap-vitrine-carte__pied {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}
/* Pastille flèche du kit, en bas à droite : un décor, la carte est le lien. */
.ofap-vitrine-carte__fleche {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--blog-peche);
	color: var(--blog-rouge-texte);
	transition: background-color .2s, color .2s;
}
.ofap-vitrine-carte:hover .ofap-vitrine-carte__fleche { background: var(--blog-rouge-texte); color: #fff; }

/* 6. Pagination ------------------------------------------------------------ */
/* Balisage brut de paginate_links( type => list ), habillé comme les pastilles. */
.ofap-vitrine-pagination { margin-top: 48px; }
.ofap-vitrine-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ofap-vitrine-pagination li { display: flex; }
.ofap-vitrine .ofap-vitrine-pagination :is(a, span).page-numbers {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--vitrine-filet);
	border-radius: 999px;
	background: #fff;
	font: 500 .9375rem/1 var(--heading);
	color: var(--ink);
	text-decoration: none;
	transition: background-color .2s, border-color .2s, color .2s;
}
.ofap-vitrine .ofap-vitrine-pagination a.page-numbers:hover { border-color: var(--blog-nuit); background: var(--blog-peche); }
.ofap-vitrine .ofap-vitrine-pagination a.page-numbers:focus-visible { outline-offset: 3px; border-radius: 999px; }
.ofap-vitrine .ofap-vitrine-pagination .page-numbers.current { border-color: var(--blog-nuit); background: var(--blog-nuit); color: #fff; }
.ofap-vitrine .ofap-vitrine-pagination .page-numbers.dots { min-width: 28px; padding-inline: 0; border-color: transparent; background: none; color: var(--muted); }
.ofap-vitrine .ofap-vitrine-pagination :is(.prev, .next).page-numbers { padding-inline: 20px; }
.ofap-vitrine-pagination li:has(.prev) { margin-right: 8px; }
.ofap-vitrine-pagination li:has(.next) { margin-left: 8px; }

/* 7. État vide ------------------------------------------------------------- */
.ofap-vitrine-vide {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: clamp(20px, 3vw, 36px);
	align-items: center;
	margin-top: 36px;
	padding: clamp(28px, 4.4vw, 52px) clamp(24px, 5vw, 64px);
	border-radius: 64px 0 64px 0;
	background: var(--blog-menthe);
}
.ofap-vitrine-vide__icone {
	display: grid;
	place-items: center;
	width: clamp(72px, 9vw, 104px);
	aspect-ratio: 1;
	border-radius: 50%;
	background: #fff;
	color: var(--teal);
}
.ofap-vitrine-vide__titre {
	font: 700 clamp(1.375rem, 1.2rem + .6vw, 1.625rem)/1.2 var(--heading);
	letter-spacing: -.02em;
	color: var(--blog-noir);
}
.ofap-vitrine-vide__texte {
	max-width: 40em;
	margin-top: 10px;
	font-size: 1rem;
	line-height: 1.6;
	color: #17594E;
}
.ofap-vitrine-vide__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* 8. Bas de page : bloc de formations ------------------------------------- */
.ofap-vitrine .e-con.ofap-vitrine-suite {
	width: var(--blog-conteneur);
	margin-inline: auto;
	padding-block: clamp(64px, 8vw, 104px) clamp(72px, 9vw, 110px);
}
/* Le bloc s'aligne sur la grille des articles (990 px dans un article). */
.ofap-vitrine-suite .ofap-formations { max-width: none; }

/* 9. Écrans étroits -------------------------------------------------------- */
@media (max-width: 1190px) {
	.ofap-vitrine { --vitrine-marge: 32px; }
	.ofap-vitrine-bandeau__int { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
	.ofap-vitrine-recherche { padding: 26px 26px 22px; border-radius: 48px 0 48px 0; }
	.ofap-vitrine .ofap-vitrine-recherche__envoi { padding-inline: 20px; }
	.ofap-vitrine-grille { gap: 24px 20px; }
}

/* Bandeau sur une colonne, grille sur deux. */
@media (max-width: 1020px) {
	.ofap-vitrine { --vitrine-feuille: 56px 12px 56px 12px; }
	.ofap-vitrine-bandeau__int {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 30px;
		padding-block: 44px 48px;
	}
	.ofap-vitrine-bandeau__ariane { margin: -18px 0 -6px; }
	.ofap-vitrine-bandeau::before { top: -150px; right: -150px; }
	.ofap-vitrine-bandeau::after { left: auto; right: 12%; }
	.ofap-vitrine-recherche { max-width: 640px; }
	.ofap-vitrine-une { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 32px; }
	.ofap-vitrine-une__extrait { -webkit-line-clamp: 2; line-clamp: 2; }
	.ofap-vitrine-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Deux colonnes et un nombre impair de cartes : la première occupe la rangée
 * entière, image à gauche. Plus de carte seule sur la dernière ligne. */
@media (min-width: 601px) and (max-width: 1020px) {
	.ofap-vitrine-grille > li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
	.ofap-vitrine-grille > li:first-child:nth-last-child(odd) > .ofap-vitrine-carte {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: stretch;
	}
	.ofap-vitrine-grille > li:first-child:nth-last-child(odd) .ofap-vitrine-carte__image { aspect-ratio: auto; min-height: 100%; }
	.ofap-vitrine-grille > li:first-child:nth-last-child(odd) .ofap-vitrine-carte__corps { justify-content: center; padding: 24px 24px 18px; }
	.ofap-vitrine-grille > li:first-child:nth-last-child(odd) .ofap-vitrine-carte__titre { font-size: 1.25rem; }
}

/* Catégories sur deux rangées qui défilent ensemble, à la une empilée. */
@media (max-width: 760px) {
	.ofap-vitrine { --vitrine-marge: 20px; --vitrine-feuille: 44px 12px 44px 12px; }
	.ofap-vitrine-bandeau__int { padding-block: 34px 38px; row-gap: 26px; }
	.ofap-vitrine-bandeau__ariane { margin-top: -14px; }
	.ofap-vitrine-bandeau::before { top: -210px; right: -210px; }
	.ofap-vitrine-bandeau::after { display: none; }
	.ofap-vitrine-recherche { padding: 22px 20px 18px; border-radius: 36px 0 36px 0; box-shadow: 0 12px 32px rgba(45, 42, 78, .08); }
	.ofap-vitrine-recherche__champ { padding-left: 16px; gap: 10px; }
	.ofap-vitrine-recherche__aide { padding-left: 4px; }

	.ofap-vitrine-categories { padding-top: 14px; }
	.ofap-vitrine-categories__liste {
		display: grid;
		grid-auto-flow: column;
		grid-template-rows: repeat(2, auto);
		justify-content: start;
		gap: 8px;
		width: auto;
		margin: 0;
		/* Marge droite de la largeur du fondu : la dernière pastille en sort entière. */
		padding: 8px 56px 8px var(--vitrine-marge);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-padding-inline: var(--vitrine-marge) 56px;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.ofap-vitrine-categories__liste::-webkit-scrollbar { display: none; }
	.ofap-vitrine-categories__liste > li { scroll-snap-align: start; }
	/* La catégorie affichée passe en tête : elle reste visible sans défiler. */
	.ofap-vitrine-categories__liste > li:has([aria-current]) { order: -1; }
	/* Fondu à droite : la ligne continue. */
	.ofap-vitrine-categories::after {
		content: "";
		position: absolute;
		top: 14px;
		right: 0;
		bottom: 0;
		width: 56px;
		background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 78%);
		pointer-events: none;
	}

	.ofap-vitrine-une { grid-template-columns: minmax(0, 1fr); row-gap: 20px; margin-top: 22px; }
	.ofap-vitrine-une__image::before { display: none; }
	.ofap-vitrine-une__corps { gap: 12px; }
	.ofap-vitrine-une__extrait { -webkit-line-clamp: 3; line-clamp: 3; }
	.ofap-vitrine-liste { padding-top: 44px; }
	.ofap-vitrine-liste--seule { padding-top: 22px; }
	.ofap-vitrine-liste__tete { margin-bottom: 18px; }
	.ofap-vitrine-grille { gap: 18px 16px; }
	.ofap-vitrine-carte__corps { padding: 16px 16px 12px; }
	.ofap-vitrine-pagination { margin-top: 36px; }
	.ofap-vitrine-vide { margin-top: 22px; border-radius: 40px 0 40px 0; }
}

/* Une colonne : la carte devient une ligne compacte — vignette, catégorie et
 * date en tête, puis le titre et deux lignes d'extrait sur toute la largeur. */
@media (max-width: 600px) {
	.ofap-vitrine-grille { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.ofap-vitrine-carte {
		display: grid;
		grid-template-columns: clamp(108px, 33%, 168px) minmax(0, 1fr);
		grid-template-rows: auto auto;
		column-gap: 14px;
		align-content: start;
		padding: 14px 14px 16px;
		border-radius: 18px 0 18px 0;
	}
	.ofap-vitrine-carte:hover { transform: none; }
	.ofap-vitrine-carte__corps { display: contents; }
	.ofap-vitrine-carte__image {
		grid-column: 1;
		grid-row: 1 / span 2;
		align-self: start;
		border-radius: 10px 0 10px 0;
	}
	/* L'étiquette devient un simple libellé : un nom long passe à la ligne. */
	.ofap-vitrine .ofap-vitrine-carte__categorie {
		grid-column: 2;
		grid-row: 1;
		align-self: start;
		min-height: 0;
		padding: 0;
		border-radius: 0;
		background: none;
		line-height: 1.35;
	}
	.ofap-vitrine-carte__pied {
		grid-column: 2;
		grid-row: 2;
		align-self: start;
		margin-top: 4px;
		padding-top: 0;
		border-top: 0;
	}
	.ofap-vitrine-carte__fleche { display: none; }
	/* « 30 septembre 2026 · 27 min » tient sur une ligne à côté de la vignette. */
	.ofap-vitrine-carte .ofap-vitrine-meta__suite { display: none; }
	.ofap-vitrine-carte__titre { grid-column: 1 / -1; grid-row: 3; margin-top: 12px; font-size: 1rem; }
	.ofap-vitrine-carte__extrait {
		grid-column: 1 / -1;
		grid-row: 4;
		margin-top: 6px;
		font-size: .875rem;
	}

	/* Recherche allégée : le libellé et le champ, sans les exemples. */
	.ofap-vitrine-recherche { padding: 16px; border-radius: 28px 0 28px 0; box-shadow: 0 8px 24px rgba(45, 42, 78, .07); }
	.ofap-vitrine-recherche__libelle { font-size: .9375rem; }
	.ofap-vitrine-recherche__champ { margin-top: 10px; }
	.ofap-vitrine-recherche__aide { display: none; }

	/* Numéros sur une ligne, « Précédent » et « Suivant » en dessous. */
	.ofap-vitrine-pagination ul.page-numbers { gap: 5px; }
	.ofap-vitrine-pagination li { order: 1; }
	.ofap-vitrine .ofap-vitrine-pagination :is(a, span).page-numbers { min-width: 40px; min-height: 40px; }
	@supports selector(:has(a)) {
		/* Saut de ligne après les numéros : sans lui, un bouton qui tient à côté d'eux y reste. */
		.ofap-vitrine-pagination ul.page-numbers::after { content: ""; order: 1; flex: 0 0 100%; height: 0; }
		.ofap-vitrine-pagination li:has(.prev, .next) { order: 2; flex: 1 1 40%; margin: 3px 0 0; }
		.ofap-vitrine .ofap-vitrine-pagination li:has(.prev, .next) > .page-numbers { flex: 1; min-height: 48px; }
	}
	.ofap-vitrine .ofap-vitrine-pagination .page-numbers.dots { min-width: 20px; }
	.ofap-vitrine-vide { grid-template-columns: minmax(0, 1fr); row-gap: 18px; }
}

@media (max-width: 480px) {
	/* Le bouton de recherche se réduit à sa loupe : le champ garde une ligne. */
	.ofap-vitrine-recherche__loupe { display: none; }
	.ofap-vitrine-recherche__champ { padding: 4px 4px 4px 18px; }
	.ofap-vitrine .ofap-vitrine-recherche__saisie { height: 46px; }
	.ofap-vitrine .ofap-vitrine-recherche__envoi { width: 46px; min-height: 46px; padding: 0; }
	.ofap-vitrine-recherche__envoi svg { display: block; }
	.ofap-vitrine-recherche__envoi-texte {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
	.ofap-vitrine .ofap-vitrine-pastille { font-size: .8125rem; padding-left: 14px; }
	.ofap-vitrine-vide__actions .ofap-bouton { flex: 1 1 100%; }
}

@media (max-width: 390px) {
	.ofap-vitrine { --vitrine-marge: 16px; }
	.ofap-vitrine-recherche { padding-inline: 14px; }
	.ofap-vitrine-pagination ul.page-numbers { gap: 4px; }
}

/* Contrastes forcés (Windows) : les fonds disparaissent, un cadre marque la
 * catégorie affichée et la page courante. */
@media (forced-colors: active) {
	.ofap-vitrine .ofap-vitrine-pastille[aria-current],
	.ofap-vitrine .ofap-vitrine-pagination .page-numbers.current { border: 3px solid Highlight; }
}

@media (prefers-reduced-motion: reduce) {
	.ofap-vitrine-carte,
	.ofap-vitrine .ofap-vitrine-carte__image img,
	.ofap-vitrine .ofap-vitrine-pastille,
	.ofap-vitrine .ofap-vitrine-pagination .page-numbers,
	.ofap-vitrine-carte__fleche { transition: none; }
	.ofap-vitrine-carte:hover,
	.ofap-vitrine-une:hover .ofap-bouton--rouge,
	.ofap-vitrine-carte:hover .ofap-vitrine-carte__image img { transform: none; }
}
