/*
 * La page Vidéos (page-videos.php), d'après la maquette validée par Toarii
 * le 13 octobre 2026 (documentation/maquettes/videos-2026-10-13/).
 */

/* --- Le bandeau, avec la vidéo à la une -------------------------------- */

.ebooks-videos-une {
	position: relative;
	isolation: isolate;
	padding: clamp(2rem, 5vw, 3.5rem) 0;
	color: #fff;
}

.ebooks-videos-une::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0 -100vmax;
	/*
	 * Le dégradé du héros de l'accueil : c'est la couleur du site (Toarii,
	 * 13 novembre 2026). Jusque-là, un dégradé sombre (#0B3B39 → #0D827E)
	 * choisi sur la maquette pour le contraste du texte blanc.
	 */
	background: linear-gradient(135deg, var(--ebooks-turquoise, #10CFC9) 0%, var(--ebooks-turquoise-fonce, #00ADBB) 100%);
}

.ebooks-videos-une > .container {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: center;
}

/* « body » : « .container-wrap h1 » de Salient. */
body .ebooks-videos-une__titre {
	margin: 0;
	color: #fff;
	font-family: Anton, var(--nectar-body-font, sans-serif);
	font-size: clamp(2.6rem, 6vw, 4.2rem);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.ebooks-videos-une__intro {
	max-width: 34ch;
	margin: 0.9rem 0 1.4rem;
	padding: 0;
	color: #fff;
	font-size: 1.05rem;
}

.ebooks-videos-une__quoi {
	margin: 0 0 0.4rem;
	padding: 0;
	color: #fff;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ebooks-videos-une__video {
	margin: 0 0 0.6rem;
	padding: 0;
	color: #fff;
	font-size: 1.3rem;
	font-weight: 600;
	line-height: 1.3;
}

/* Le lecteur : une image et un bouton ; YouTube ne se charge qu'au clic. */
.ebooks-videos-lecteur {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	background: #000;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

body .ebooks-videos-lecteur img {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.ebooks-videos-lecteur::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.4));
}

.ebooks-videos-lecture {
	position: absolute;
	z-index: 1;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.ebooks-videos-lecture::before {
	content: "";
	margin-left: 6px;
	border-style: solid;
	border-width: 13px 0 13px 21px;
	border-color: transparent transparent transparent var(--ebooks-turquoise-texte, #0D827E);
}

.ebooks-videos-lecteur:hover .ebooks-videos-lecture,
.ebooks-videos-lecteur:focus-visible .ebooks-videos-lecture {
	transform: translate(-50%, -50%) scale(1.08);
}

.ebooks-videos-lecteur:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
}

/* --- Les filtres de langue -------------------------------------------- */

.ebooks-videos-filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.6rem 0 0;
	padding: 0;
	list-style: none;
}

.ebooks-videos-filtres li {
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * « .container-wrap button » de Salient pose rembourrage et fond ; ses styles
 * dynamiques arrondissent tout bouton à 4 px en !important
 * (« body[data-button-style*=slightly_rounded] button ») : seul l'arrondi
 * demande un !important ici, ailleurs le sélecteur suffit.
 */
.container-wrap .ebooks-videos-filtres button {
	min-height: 38px;
	margin: 0;
	padding: 0 1rem;
	border: 1.5px solid rgba(255, 255, 255, 0.55);
	border-radius: 999px !important;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}

.container-wrap .ebooks-videos-filtres button:hover {
	border-color: #fff;
}

.container-wrap .ebooks-videos-filtres button[aria-pressed="true"] {
	border-color: #fff;
	background: #fff;
	color: #0B3B39;
}

.ebooks-videos-filtres small {
	margin-left: 0.35em;
	font-size: 0.85em;
	opacity: 0.7;
}

/* --- Les pastilles : langue, année, rediffusion ------------------------ */

.ebooks-video-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.45rem;
	margin: 0;
	padding: 0;
	font-size: 12.5px;
}

.ebooks-video-meta__langue {
	padding: 1px 7px;
	border-radius: 4px;
	background: var(--ebooks-turquoise-fonce, #00ADBB);
	color: #fff;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.6;
}

.ebooks-video-meta__langue--lsf {
	background: #0B3B39;
}

.ebooks-video-meta__annee,
.ebooks-video-meta__redif {
	color: #5A6B6A;
}

.ebooks-video-meta__redif {
	font-style: italic;
}

.ebooks-videos-une .ebooks-video-meta__annee,
.ebooks-videos-une .ebooks-video-meta__redif {
	color: #fff;
}

/* Sur le turquoise du bandeau, l'étiquette de langue (#00ADBB) se fondait : à l'encre, comme le bouton du héros. */
.ebooks-videos-une .ebooks-video-meta__langue {
	background: #0B3B39;
}

/* --- Les rubriques : une rangée qui défile ------------------------------ */

.ebooks-videos-rubrique {
	padding-top: clamp(2rem, 5vw, 3rem);
}

.ebooks-videos-rubrique[hidden] {
	display: none;
}

.ebooks-videos-rubrique__tete {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ebooks-videos-rubrique__tete .ebooks-section__titre {
	flex: 1;
}

.ebooks-videos-rubrique__compte {
	display: block;
	margin-top: 0.15rem;
	color: #5A6B6A;
	font-size: 12px;
	letter-spacing: 0.08em;
}

.ebooks-videos-fleches {
	display: flex;
	gap: 0.4rem;
	margin-top: 1rem;
}

.ebooks-videos-fleches[hidden] {
	display: none;
}

.container-wrap .ebooks-videos-fleches button {
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(13, 130, 126, 0.3);
	border-radius: 50% !important; /* Voir les filtres. */
	background: #fff;
	color: var(--ebooks-turquoise-texte, #0D827E);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.container-wrap .ebooks-videos-fleches button:hover:not(:disabled) {
	border-color: var(--ebooks-turquoise-texte, #0D827E);
	background: #E8F5F4;
}

.container-wrap .ebooks-videos-fleches button:disabled {
	opacity: 0.35;
	cursor: default;
}

/*
 * La rangée, en sous-grille comme les cartes de notices : titres et
 * pastilles d'une même rangée partent des mêmes lignes.
 */
.ebooks-videos-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(220px, 260px);
	grid-template-rows: repeat(3, auto);
	gap: 0 clamp(0.9rem, 2vw, 1.4rem);
	margin: 0;
	padding: 0 0 0.9rem;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	scrollbar-color: var(--ebooks-turquoise, #10CFC9) transparent;
}

.ebooks-video {
	display: grid;
	grid-row: span 3;
	grid-template-rows: subgrid;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.ebooks-video[hidden] {
	display: none;
}

.ebooks-video > a {
	display: grid;
	grid-row: 1 / -1;
	grid-template-rows: subgrid;
	color: inherit;
	text-decoration: none;
}

.ebooks-video__image {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: #E3EEEE;
	box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
}

body .ebooks-video__image img {
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.ebooks-video__image .ebooks-videos-lecture {
	width: 46px;
	height: 46px;
	opacity: 0;
}

.ebooks-video__image .ebooks-videos-lecture::before {
	margin-left: 4px;
	border-width: 8px 0 8px 13px;
}

.ebooks-video > a:hover img,
.ebooks-video > a:focus-visible img {
	transform: scale(1.05);
}

.ebooks-video > a:hover .ebooks-videos-lecture,
.ebooks-video > a:focus-visible .ebooks-videos-lecture {
	opacity: 1;
}

.ebooks-video > a:focus-visible {
	outline: 3px solid var(--ebooks-turquoise-texte, #0D827E);
	outline-offset: 4px;
	border-radius: 10px;
}

.ebooks-video__titre {
	display: -webkit-box;
	overflow: hidden;
	margin: 0.7rem 0 0.35rem;
	color: var(--ebooks-bleu, #6EC1E4);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.ebooks-videos-playlist {
	display: inline-flex;
	gap: 0.4rem;
	margin-top: 0.4rem;
	color: var(--ebooks-turquoise-texte, #0D827E);
	font-weight: 500;
	text-decoration: none;
}

.ebooks-videos-playlist:hover {
	text-decoration: underline;
}

/* --- Les chants -------------------------------------------------------- */

.ebooks-videos-chants {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 1.5rem;
	padding-bottom: clamp(2rem, 5vw, 3rem);
}

.ebooks-videos-chant {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 1.2rem;
	align-items: center;
	padding: 1.2rem;
	border-radius: 14px;
	background: #F2F7F7;
}

.ebooks-videos-chant__livre .ebooks-livre {
	width: 100%;
	height: auto;
}

body .ebooks-videos-chant h3 {
	margin: 0 0 0.7rem;
	color: #0B3B39;
	font-size: 1.05rem;
	line-height: 1.35;
}

.ebooks-videos-chant__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.ebooks-videos-bouton {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	min-height: 40px;
	padding: 0 1.1rem;
	border: 1px solid var(--ebooks-turquoise-texte, #0D827E);
	border-radius: 999px;
	color: var(--ebooks-turquoise-texte, #0D827E);
	font-weight: 500;
	text-decoration: none;
}

.ebooks-videos-bouton--plein {
	background: var(--ebooks-turquoise-texte, #0D827E);
	color: #fff;
}

.ebooks-videos-bouton:hover {
	background: var(--ebooks-turquoise-appui, #0B6F6C);
	border-color: var(--ebooks-turquoise-appui, #0B6F6C);
	color: #fff;
}

/* --- Petits écrans ----------------------------------------------------- */

@media (max-width: 860px) {
	.ebooks-videos-une > .container {
		grid-template-columns: 1fr;
	}

	.ebooks-videos-une__intro {
		max-width: none;
	}

	.ebooks-videos-fleches {
		display: none;
	}

	.ebooks-videos-rail {
		grid-auto-columns: 72%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ebooks-videos-lecture,
	body .ebooks-video__image img {
		transition: none;
	}
}

/*
 * Le titre de rubrique, comme ceux des fiches (fiche.css, qui ne se charge
 * pas ici) : centré, bleu de la production, entre deux filets turquoise.
 */
body .ebooks-videos-page h2.ebooks-section__titre {
	display: grid;
	grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr);
	align-items: center;
	gap: 1.25rem;
	margin: 0 0 1.2rem;
	color: var(--ebooks-bleu, #6EC1E4);
	font-size: 1.3125rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-align: center;
	text-transform: uppercase;
}

.ebooks-videos-page .ebooks-section__titre::before,
.ebooks-videos-page .ebooks-section__titre::after {
	content: "";
	height: 2px;
	background: var(--ebooks-turquoise, #10CFC9);
}
