/*
Theme Name: C'est qui c'est quoi ?
Theme URI: https://www.cestquicestquoi.com
Description: Thème mobile first de C'est qui c'est quoi ? (refonte 2026). Lit les contenus de l'ancien thème Junior.
Version: 0.9.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: cqcq
License: GPL-2.0-or-later
*/

/* Couleurs et typographie ------------------------------------------------ */

:root {
	--noir: #111111;
	--blanc: #ffffff;
	/* Fond général burlywood ; fond des vignettes d'œuvres bleu-vert clair. */
	--fond: #deb887;
	--gris: #cbe6ea;
	--gris-texte: #4a3a28;
	/* Couleurs du logo : rouge, bleu, jaune, vert. */
	--qui: #cd1719;
	--quoi: #009fe3;
	--jaune: #ffed00;
	--vert: #3fa535;
	--violet: #6c2bd9;
	--rose: #ff2e93;
	--orange: #ff8a00;
	--theme-0: var(--qui);
	--theme-1: var(--quoi);
	--theme-2: var(--vert);
	--titre: "Bricolage Grotesque", system-ui, sans-serif;
	--texte: "DM Sans", system-ui, sans-serif;
	--rayon: 8px;
	--bord: 1px solid var(--noir);
	--gouttiere: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--fond);
	color: var(--noir);
	font-family: var(--texte);
	font-size: 17px;
	line-height: 1.55;
}

/* Fond d'écran fixe : motif de triangles en pointillés (PNG transparent posé sur la couleur de fond).
   Calque fixe plutôt que background-attachment: fixed, ignoré ou saccadé sur iPhone/iPad. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: var(--fond-image, none) center bottom / cover no-repeat;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	clip: auto; width: auto; height: auto;
	z-index: 100; top: 8px; left: 8px;
	padding: 8px 12px; background: var(--jaune);
}

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gouttiere); }
.wrap--texte { max-width: 760px; }

.h1, .h2, .h3 { font-family: var(--titre); font-weight: 800; margin-block: 0; letter-spacing: -0.02em; }
.h1 { font-size: clamp(40px, 9vw, 72px); line-height: 0.95; }
.h2 { font-size: clamp(26px, 5.5vw, 40px); line-height: 1.05; }
.h3 { font-size: 22px; line-height: 1.1; }

.meta { margin: 0; font-size: 14px; color: var(--gris-texte); }

.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose a { text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Étiquettes et boutons ---------------------------------------------------- */

.tag {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 3px 8px;
	border-radius: 6px;
	border: 1px solid var(--noir);
	font-size: 12px; font-weight: 700; line-height: 1.3;
	background: var(--blanc); color: var(--noir);
}
.tag--qui { background: var(--qui); color: var(--blanc); }
.tag--quoi { background: var(--quoi); }
.tag--jaune { background: var(--jaune); letter-spacing: 0.06em; text-transform: uppercase; }
.tag--en svg { display: block; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 52px; padding: 0 20px;
	border: var(--bord); border-radius: var(--rayon);
	background: var(--blanc); color: var(--noir);
	font-weight: 700; font-size: 16px; text-decoration: none;
	cursor: pointer;
}
.btn--block { display: flex; width: 100%; }
.btn--dark { background: var(--noir); color: var(--blanc); }
.btn--red { background: var(--qui); color: var(--blanc); }
.btn--jaune { background: var(--jaune); }
.btn--petit { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn:hover { filter: brightness(0.95); }

.btn-icon {
	flex: 0 0 44px; width: 44px; height: 44px;
	display: inline-flex; align-items: center; justify-content: center;
	border: var(--bord); border-radius: var(--rayon);
	background: var(--blanc); color: var(--noir);
	cursor: pointer;
}
.btn-icon--dark { background: var(--noir); color: var(--blanc); }

/* En-tête et pied de page -------------------------------------------------- */

.site-header { position: sticky; top: 0; z-index: 20; background: var(--fond); border-bottom: var(--bord); }
/* Liseré aux quatre couleurs du logo sous l'en-tête. */
.site-header::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 4px; background: linear-gradient(90deg, var(--qui) 0 25%, var(--quoi) 25% 50%, var(--jaune) 50% 75%, var(--vert) 75%); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.site-header__actions { display: flex; gap: 8px; }

.logo { display: block; flex: 0 1 auto; }
.logo img { width: auto; height: 44px; }

.panel { border-top: var(--bord); padding-block: 16px; background: var(--fond); }
.search-form { display: flex; gap: 8px; }
.search-form input {
	flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 0 14px;
	border: var(--bord); border-radius: var(--rayon); font: inherit;
}
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu-list a { display: block; padding: 12px 0; font-family: var(--titre); font-weight: 800; font-size: 22px; text-decoration: none; }

.site-footer { margin-top: 48px; border-top: var(--bord); }
.site-footer__inner { display: grid; gap: 16px; padding-block: 28px 36px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer__credit { margin: 0; font-size: 14px; color: var(--gris-texte); }

/* Accueil ------------------------------------------------------------------ */

.home-une { padding-top: 28px; }
.home-une .eyebrow { display: inline-block; padding: 3px 10px; border: var(--bord); border-radius: 6px; background: var(--jaune); }
.une-card { display: block; border: var(--bord); border-radius: 16px; overflow: hidden; text-decoration: none; box-shadow: 6px 6px 0 var(--quoi); background: var(--blanc); transition: transform 0.15s, box-shadow 0.15s; }
.une-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--quoi); }
.une-card__visuel { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--gris); }
.une-card__visuel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.une-card__visuel .tag { position: absolute; top: 12px; left: 12px; font-size: 13px; }
.une-card__visuel .tag--en { left: auto; right: 12px; }
.une-card__texte { display: grid; gap: 4px; align-content: start; padding: 18px 16px 20px; border-top: var(--bord); }
.une-card__titre { font-family: var(--titre); font-weight: 800; font-size: clamp(32px, 8vw, 52px); line-height: 1; letter-spacing: -0.02em; }
.une-card__chapeau { margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--noir); }
.une-card__cta { justify-self: start; margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: var(--bord); border-radius: var(--rayon); background: var(--noir); color: var(--blanc); font-weight: 700; font-size: 15px; }

.home-liste { padding-top: 36px; }
.home-liste__tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.filtres { display: flex; gap: 8px; padding-block: 14px 16px; overflow-x: auto; }
.filtre {
	flex: 0 0 auto; min-height: 44px; padding: 0 16px;
	border: var(--bord); border-radius: var(--rayon);
	background: var(--blanc); font-weight: 700; font-size: 15px; cursor: pointer;
}
.filtre__nb { margin-left: 4px; font-weight: 400; opacity: 0.75; }
.filtre[aria-pressed="true"] { background: var(--noir); color: var(--blanc); }
.filtre--qui[aria-pressed="true"] { background: var(--qui); }
.filtre--quoi[aria-pressed="true"] { background: var(--quoi); color: var(--noir); }

.grille { list-style: none; margin-block: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
.grille [hidden] { display: none; }
.sel-card { display: grid; gap: 4px; align-content: start; height: 100%; text-decoration: none; }
.sel-card__visuel { position: relative; display: block; aspect-ratio: 16 / 9; border: var(--bord); border-radius: 12px; overflow: hidden; background: var(--gris); margin-bottom: 6px; transition: transform 0.15s, box-shadow 0.15s; }
.sel-card__visuel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sel-card__visuel .tag { position: absolute; top: 8px; left: 8px; }
.sel-card__visuel .tag--en { left: auto; right: 8px; }
.sel-card__titre { font-family: var(--titre); font-weight: 800; font-size: 19px; line-height: 1.1; }
.sel-card:hover .sel-card__titre { text-decoration: underline; }
.sel-card__chapeau { display: none; font-size: 15px; line-height: 1.45; color: var(--gris-texte); }

.encart-violet {
	margin-top: 40px; padding: 22px var(--gouttiere);
	border-radius: 16px; color: var(--blanc); display: grid; gap: 10px;
	max-width: calc(1180px - 2 * var(--gouttiere));
	width: calc(100% - 2 * var(--gouttiere));
}
.encart-violet { background: var(--vert); color: var(--noir); border: var(--bord); }
.encart-violet p { margin: 0; }
/* Fin de sélection : une simple ligne, sans encadré. */
.autre-selection { margin-top: 48px; padding-top: 20px; border-top: var(--bord); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.autre-selection p { margin: 0; font-family: var(--titre); font-weight: 800; font-size: 20px; }
.encart-violet a { color: var(--noir); font-weight: 700; }

/* Sélection ---------------------------------------------------------------- */

.selection__visuel { width: 100%; height: clamp(220px, 45vw, 460px); object-fit: cover; border-bottom: var(--bord); }
.selection__tete { display: grid; gap: 16px; padding-top: 20px; }
.selection__tags { display: flex; align-items: center; gap: 8px; }
.selection__tags .tag { font-size: 13px; }
.btn-partage { margin-left: auto; }
.prose--intro { font-size: 18px; color: #222; }

.video { border: var(--bord); border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--noir); }
.video iframe, .video video { display: block; width: 100%; height: 100%; border: 0; }

.lex {
	display: inline; margin: 0; padding: 0 1px; border: 0; background: transparent;
	font: inherit; color: inherit; cursor: pointer;
	text-decoration: underline dotted 2px; text-underline-offset: 4px;
}
.lex[aria-expanded="true"] { background: var(--jaune); }
.bulle {
	display: flex; gap: 10px; align-items: flex-start;
	margin: 12px 0; padding: 12px 14px;
	border: var(--bord); border-radius: 12px; background: var(--jaune);
	box-shadow: 4px 4px 0 var(--noir);
	font-size: 15px; line-height: 1.45;
}
.bulle p { margin: 0; flex: 1 1 auto; }
.bulle strong { font-weight: 700; }
.bulle .btn-icon { flex-basis: 32px; width: 32px; height: 32px; }

.voyage { margin-top: 36px; padding-block: 24px; background: var(--violet); color: var(--blanc); border-block: var(--bord); display: grid; gap: 16px; }
.voyage .wrap { display: grid; gap: 8px; justify-items: start; }
.voyage p { margin: 0; color: #f1e9ff; }
.voyage .btn { color: var(--noir); }
.frise { list-style: none; margin: 0; padding: 12px var(--gouttiere) 8px; display: flex; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gouttiere); }
.frise li { flex: 0 0 96px; scroll-snap-align: start; }
.frise__item {
	width: 100%; display: flex; flex-direction: column; align-items: center;
	padding: 0; border: 0; background: none; color: var(--blanc); cursor: pointer;
}
.frise__item img { width: 70px; height: 94px; object-fit: cover; border: 3px solid var(--blanc); border-radius: 8px; background: var(--blanc); }
.frise__tige { width: 3px; height: 14px; background: var(--blanc); }
.frise__point { position: relative; width: 100%; height: 16px; display: flex; align-items: center; justify-content: center; }
.frise__point::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: var(--blanc); }
.frise li:first-child .frise__point::before { left: 50%; }
.frise li:last-child .frise__point::before { right: 50%; }
.frise__point::after { content: ""; position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--jaune); border: 1px solid var(--noir); }
.frise__annee { margin-top: 8px; padding: 2px 8px; border-radius: 6px; background: var(--blanc); color: var(--noir); font-family: var(--titre); font-weight: 800; font-size: 15px; white-space: nowrap; }

.themes { padding-top: 40px; display: grid; gap: 36px; }
.theme { display: grid; gap: 14px; }
.theme__titre { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-family: var(--titre); font-weight: 800; font-size: 24px; line-height: 1.1; }
.theme__num { flex: 0 0 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: var(--bord); border-radius: 6px; background: var(--blanc); color: var(--noir); font-size: 18px; }
/* Chaque thème reprend sa couleur de la timeline. */
.theme__titre { padding: 10px 12px; border: var(--bord); border-radius: 12px; }
.theme--0 .theme__titre { background: var(--theme-0); color: var(--blanc); }
.theme--1 .theme__titre { background: var(--theme-1); color: var(--noir); }
.theme--2 .theme__titre { background: var(--theme-2); color: var(--noir); }
.theme--0 .oeuvre-card__couv { border-color: var(--theme-0); box-shadow: inset 0 -4px 0 var(--theme-0); }
.theme--1 .oeuvre-card__couv { border-color: var(--theme-1); box-shadow: inset 0 -4px 0 var(--theme-1); }
.theme--2 .oeuvre-card__couv { border-color: var(--theme-2); box-shadow: inset 0 -4px 0 var(--theme-2); }
.theme .prose { font-size: 16px; color: #333; }
.rangee { list-style: none; margin-block: 0; display: flex; gap: 12px; overflow-x: auto; padding-block: 10px 6px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gouttiere); }
.rangee li { flex: 0 0 118px; scroll-snap-align: start; }
.oeuvre-card { width: 100%; display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.oeuvre-card__couv { position: relative; display: block; height: 160px; border: var(--bord); border-radius: 12px; overflow: hidden; background: var(--blanc); }
.oeuvre-card__couv img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.oeuvre-card__couv .tag { position: absolute; left: 6px; bottom: 6px; font-size: 11px; }
.oeuvre-card__titre { font-weight: 700; font-size: 15px; line-height: 1.25; }
.oeuvre-card:hover .oeuvre-card__titre { text-decoration: underline; }

/* Timeline plein écran ----------------------------------------------------- */

.timeline__tete { border-bottom: var(--bord); padding-block: 14px; }
.timeline__tete-inner { display: flex; align-items: center; gap: 12px; }
.fil { list-style: none; margin: 0; padding-block: 24px 16px; position: relative; display: grid; gap: 14px; }
.fil::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gouttiere) + 88px); width: 4px; background: var(--violet); }
.fil__item { position: relative; display: grid; grid-template-columns: 64px 32px minmax(0, 1fr); align-items: center; column-gap: 10px; }
.fil__annee { text-align: right; font-family: var(--titre); font-weight: 800; font-size: 15px; line-height: 1.1; }
.fil__icone { position: relative; z-index: 1; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--noir); border-radius: 50%; background: var(--blanc); }
.fil__carte {
	display: flex; gap: 10px; align-items: center; min-height: 64px; padding: 8px;
	border: var(--bord); border-radius: 12px; text-align: left; cursor: pointer;
}
.fil__carte img { flex: 0 0 48px; width: 48px; height: 64px; object-fit: cover; border: 1px solid var(--noir); border-radius: 6px; background: var(--gris); }
.fil__textes { display: grid; gap: 3px; justify-items: start; }
.fil__titre { font-weight: 700; font-size: 15px; line-height: 1.25; }
.fil__auteur { font-size: 13px; font-weight: 500; }
.theme-fond--0 { background: var(--theme-0); color: var(--blanc); }
.theme-fond--1 { background: var(--theme-1); color: var(--noir); }
.theme-fond--2 { background: var(--theme-2); color: var(--noir); }
.notice-edition { margin-top: 16px; padding: 14px var(--gouttiere); border: 1px dashed var(--noir); border-radius: 12px; font-size: 15px; }

/* Timeline horizontale, ordinateur seulement (voir @media plus bas) ----------- */

.tl { display: none; overflow-x: clip; }
.tl__scene { position: relative; height: clamp(460px, calc(100vh - 390px), 760px); overflow: hidden; background: var(--noir); border-bottom: var(--bord); }
.tl__slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; visibility: hidden; transform: translateX(40px); transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.55s; }
.tl[data-sens="arriere"] .tl__slide:not(.is-active) { transform: translateX(-40px); }
.tl__slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.tl__fond { position: absolute; inset: 0; }
.tl__fond img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 6s ease; }
.tl__slide.is-active .tl__fond img { transform: scale(1); }
/* Sans image de fond dans la Sheet : la couverture floutée en fait office. */
.tl__fond--couv img { filter: blur(28px) saturate(1.2); transform: scale(1.2); }
.tl__slide.is-active .tl__fond--couv img { transform: scale(1.2); }
.tl__fond::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17, 17, 17, 0.88) 0%, rgba(17, 17, 17, 0.7) 45%, rgba(17, 17, 17, 0.15) 100%); }
.tl__contenu { position: relative; display: grid; grid-template-columns: auto minmax(0, 640px); gap: 36px; align-items: center; height: 100%; padding: 36px 96px; color: var(--blanc); }
.tl__gauche { display: grid; gap: 14px; justify-items: center; }
.tl__video { padding-inline: 22px; }
.tl__couv { width: auto; max-width: 300px; height: min(380px, calc(100vh - 560px)); min-height: 280px; object-fit: contain; border: 3px solid var(--blanc); border-radius: 12px; background: var(--gris); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.tl__textes { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-height: 100%; min-height: 0; }
.tl__annee { margin: 0; font-family: var(--titre); font-weight: 800; font-size: 56px; line-height: 0.9; letter-spacing: -0.03em; color: var(--jaune); }
.tl__titre { margin: 0; font-family: var(--titre); font-weight: 800; font-size: 30px; line-height: 1.1; }
.tl__auteur { margin: 0; font-size: 17px; font-weight: 500; }
.tl__auteur { flex: none; }
/* Texte complet ; s'il est long, il défile dans la diapo. */
.tl__texte { min-height: 0; overflow-y: auto; padding-right: 10px; font-size: 16px; line-height: 1.55; color: #f6f1ea; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.5) transparent; }
.tl__texte p { margin: 0 0 10px; }
.tl__texte .lex[aria-expanded="true"] { color: var(--noir); }
.tl__texte .bulle { color: var(--noir); }
.tl__liens { flex: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 0; font-size: 15px; font-weight: 700; }
.tl__liens a { color: var(--jaune); }
.tl__lecteur { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px 96px; background: rgba(17, 17, 17, 0.94); }
.tl__lecteur[hidden] { display: none; }
.tl__lecteur-cadre { width: min(960px, calc(100vw - 240px), calc((100vh - 510px) * 16 / 9)); aspect-ratio: 16 / 9; border: 1px solid var(--blanc); border-radius: 12px; overflow: hidden; background: var(--noir); }
.tl__lecteur-cadre iframe { display: block; width: 100%; height: 100%; border: 0; }
.tl__lecteur-lien { font-size: 14px; color: #ddd; }
.tl__lecteur-fermer { position: absolute; top: 18px; right: 18px; }
.tl .tag[data-theme="0"] { background: var(--theme-0); color: var(--blanc); }
.tl .tag[data-theme="1"] { background: var(--theme-1); color: var(--noir); }
.tl .tag[data-theme="2"] { background: var(--theme-2); color: var(--noir); }
.tl__fleche { position: absolute; top: 50%; z-index: 2; display: flex; align-items: center; gap: 10px; transform: translateY(-50%); padding: 0; border: 0; background: none; color: var(--blanc); font: inherit; cursor: pointer; }
.tl__fleche[hidden] { display: none; }
.tl__fleche--prec { left: 20px; }
.tl__fleche--suiv { right: 20px; }
.tl__fleche-icone { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border: var(--bord); border-radius: 50%; background: var(--blanc); color: var(--noir); transition: transform 0.2s; }
.tl__fleche:hover .tl__fleche-icone { transform: scale(1.08); }
/* Titre de l'œuvre voisine, au survol de la flèche, comme dans TimelineJS. */
.tl__fleche-label { max-width: 180px; font-size: 14px; font-weight: 700; line-height: 1.25; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); opacity: 0; transition: opacity 0.2s; }
.tl__fleche--suiv .tl__fleche-label { text-align: right; }
.tl__fleche:hover .tl__fleche-label, .tl__fleche:focus-visible .tl__fleche-label { opacity: 1; }
.tl__nav { position: relative; height: 200px; margin-inline: 56px; }
.tl__axe { position: absolute; left: 0; right: 0; bottom: 34px; height: 3px; background: var(--noir); }
.tl__graduation { position: absolute; top: 10px; transform: translateX(-50%); font-family: var(--titre); font-weight: 800; font-size: 13px; white-space: nowrap; }
.tl__graduation::before { content: ""; position: absolute; left: 50%; top: -14px; width: 1px; height: 8px; background: var(--noir); }
.tl__repere {
	position: absolute; bottom: calc(52px + var(--rang) * 56px); transform: translateX(-50%);
	width: 36px; height: 48px; padding: 3px; border: var(--bord); border-radius: 6px; cursor: pointer;
	transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
}
.tl__repere::after { content: ""; pointer-events: none; position: absolute; left: 50%; top: 100%; width: 1px; height: calc(18px + var(--rang) * 56px); background: var(--noir); }
.tl__repere img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; background: var(--blanc); }
/* Titre de l'œuvre au survol, et en permanence pour l'œuvre affichée. */
.tl__repere span {
	position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
	width: max-content; max-width: 200px; padding: 4px 8px; border: var(--bord); border-radius: 6px;
	background: var(--blanc); color: var(--noir); font-size: 12px; font-weight: 700; line-height: 1.2;
	opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.tl__repere:hover, .tl__repere:focus-visible, .tl__repere.is-active { z-index: 2; transform: translate(-50%, -6px); box-shadow: 0 6px 0 var(--noir); }
.tl__repere:hover span, .tl__repere:focus-visible span, .tl__repere.is-active span { opacity: 1; }
.tl__repere:hover span { z-index: 3; }
/* Près des bords, l'étiquette s'aligne sur le repère au lieu d'être centrée. */
.tl__repere--debut span { left: -4px; transform: none; }
.tl__repere--fin span { left: auto; right: -4px; transform: none; }
.tl__repere.is-active { outline: 3px solid var(--noir); outline-offset: 2px; }
.tl__compteur { padding-block: 4px 18px; }

/* Fiche d'une œuvre -------------------------------------------------------- */

.fiche {
	width: 100%; max-width: 640px; max-height: 92vh;
	margin: auto auto 0; padding: 0;
	border: var(--bord); border-bottom: 0; border-radius: 20px 20px 0 0;
	background: var(--blanc); color: var(--noir);
	overflow-y: auto; overscroll-behavior: contain;
}
/* Calque fixe sur toute la fenêtre, quels que soient les styles d'autres extensions. */
dialog.fiche[open] { position: fixed; inset: 0; z-index: 100000; }
html.fiche-ouverte { overflow: hidden; }
.fiche__bandeau { margin: -20px calc(-1 * var(--gouttiere)) 0; height: 150px; overflow: hidden; border-bottom: var(--bord); background: var(--gris); }
.fiche__bandeau[hidden] { display: none; }
.fiche__bandeau img { width: 100%; height: 100%; object-fit: cover; }
.fiche--fond .fiche__tete { padding-right: 0; }
.fiche::backdrop { background: rgba(17, 17, 17, 0.5); }
.fiche__inner { position: relative; display: grid; gap: 16px; padding: 20px var(--gouttiere) 24px; }
.fiche__fermer { position: absolute; top: 12px; right: 12px; }
.fiche__tete { display: flex; gap: 14px; padding-right: 52px; }
.fiche__couv { flex: 0 0 96px; width: 96px; height: 128px; object-fit: cover; border: var(--bord); border-radius: 10px; background: var(--gris); }
.fiche__infos { display: grid; gap: 4px; align-content: start; justify-items: start; }
.fiche__titre { margin: 0; font-family: var(--titre); font-weight: 800; font-size: 22px; line-height: 1.1; }
.fiche__auteur { margin: 0; font-size: 15px; }
.fiche__texte { font-size: 16px; }
.fiche__actions { display: grid; gap: 10px; }
.fiche__video { position: relative; aspect-ratio: 16 / 9; border: var(--bord); border-radius: 12px; overflow: hidden; background: var(--noir); }
.fiche__video[hidden], .fiche__video-lien[hidden] { display: none; }
.fiche__video-lien { margin-top: -8px; font-size: 14px; color: var(--gris-texte); }
.fiche__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fiche__lecture { margin-top: 6px; gap: 6px; }
.fiche__lecture[hidden] { display: none; }
.fiche__actions [hidden] { display: none; }
.fiche__nav { display: flex; align-items: center; justify-content: space-between; }
.fiche .tag[data-theme="0"] { background: var(--theme-0); color: var(--blanc); }
.fiche .tag[data-theme="1"] { background: var(--theme-1); }
.fiche .tag[data-theme="2"] { background: var(--theme-2); }

/* Pages simples et recherche ----------------------------------------------- */

.page-simple { padding-top: 32px; display: grid; gap: 20px; }
.resultats { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.resultat { display: flex; gap: 12px; align-items: center; }
.resultat img { width: 56px; height: 76px; object-fit: cover; border: var(--bord); border-radius: 6px; }
.resultat__titre { font-weight: 700; }
.oeuvre-seule__couv { max-width: 220px; border: var(--bord); border-radius: 12px; }

/* Écrans plus larges ------------------------------------------------------- */

@media (min-width: 720px) {
	.logo img { height: 54px; }
	.sel-card__chapeau { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	:root { --gouttiere: 32px; }
	.grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
	.fiche { margin-bottom: auto; border-bottom: var(--bord); border-radius: 20px; }
	.fiche__bandeau { height: 220px; }
	.rangee li { flex-basis: 152px; }
	.oeuvre-card__couv { height: 204px; }
}

@media (min-width: 1024px) {
	/* La timeline passe à l'horizontale ; le fil vertical reste pour les écrans plus petits. */
	.tl { display: block; }
	.tl ~ .fil { display: none; }
	.home-une .une-card { display: grid; grid-template-columns: 3fr 2fr; }
	.home-une .une-card__texte { border-top: 0; border-left: var(--bord); align-content: start; padding: 28px; }
	.rangee { overflow: visible; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.rangee li { flex: none; }
	.frise { justify-content: center; }
	.frise li { flex-basis: 110px; }
}

/* Mouvement des cartes ----------------------------------------------------- */

/* Au survol la carte monte, au clic elle redescend. */
.sel-card__visuel, .oeuvre-card__couv, .fil__carte, .frise__item img { transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sel-card:hover .sel-card__visuel, .sel-card:focus-visible .sel-card__visuel,
.oeuvre-card:hover .oeuvre-card__couv, .oeuvre-card:focus-visible .oeuvre-card__couv,
.fil__carte:hover, .fil__carte:focus-visible,
.frise__item:hover img, .frise__item:focus-visible img { transform: translateY(-6px); box-shadow: 0 8px 0 var(--noir); }
.sel-card:active .sel-card__visuel, .oeuvre-card:active .oeuvre-card__couv,
.fil__carte:active, .frise__item:active img { transform: translateY(0); box-shadow: 0 0 0 var(--noir); transition-duration: 0.08s; }

/* À l'apparition à l'écran, les cartes montent en vague (classe posée par app.js). */
.apparition { opacity: 0; transform: translateY(28px); transition: opacity 0.5s ease var(--delai, 0ms), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) var(--delai, 0ms); }
.apparition.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.sel-card__visuel, .oeuvre-card__couv, .fil__carte, .frise__item img { transition: none; }
	.sel-card:hover .sel-card__visuel, .oeuvre-card:hover .oeuvre-card__couv, .fil__carte:hover, .frise__item:hover img { transform: none; }
}
