/**
 * Kap TV — affichage public.
 *
 * Habillage conforme au guide d'édition visuelle Kap TV (mars 2024) :
 * palette Nature / Océan / Soleil / Sucrerie / Pourpre / Perle, trame florale,
 * filet de 4 px et bandeaux d'intervention.
 *
 * Typographie de la charte : Sofia Pro. Tant que la fonte sous licence n'est
 * pas installée sur le serveur, on utilise Poppins (même construction
 * géométrique) ; il suffira de déposer Sofia Pro et de redéfinir
 * --wt-police pour basculer.
 */

.rr-webtv {
	/* Palette officielle Kap TV */
	--wt-nature: #AFCA0B;
	--wt-ocean: #38B6AB;
	--wt-soleil: #F08262;
	--wt-sucrerie: #EA516D;
	--wt-pourpre: #A8769B;
	--wt-perle: #E7EAEC;
	--wt-encre: #1F2A28;

	/* Rôles d'interface */
	--wt-bleu-nuit: var(--wt-encre);
	--wt-bleu: #2A9A90;
	--wt-jaune: var(--wt-nature);
	--wt-fuchsia: #D94460;
	--wt-fond: #F4F8F7;
	--wt-bord: #DCE7E5;
	--wt-texte: #24302E;
	--wt-gris: #69807D;
	--wt-radius: 18px;
	--wt-ombre: 0 10px 30px rgba(31, 42, 40, .09);
	--wt-police: 'Poppins', 'Sofia Pro', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

	color: var(--wt-texte);
	font-family: var(--wt-police);
}

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

.rr-webtv h1,
.rr-webtv h2,
.rr-webtv h3,
.rr-webtv h4,
.rr-webtv p,
.rr-webtv a,
.rr-webtv span,
.rr-webtv li,
.rr-webtv button,
.rr-webtv input {
	font-family: var(--wt-police);
}

.rr-webtv-wrap {
	width: min(1240px, 100% - 40px);
	margin-inline: auto;
}

/* En-tête de chaîne — charte Kap TV ------------------------------------- */

.rr-webtv-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin-bottom: 40px;
	padding: 46px 0 44px;
	background: var(--wt-ocean);
	color: #fff;
}

.rr-webtv-hero__trame {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-size: 760px auto;
	background-repeat: repeat;
	background-position: center;
	opacity: .26;
	pointer-events: none;
}

.rr-webtv-hero__filet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: var(--wt-nature);
}

.rr-webtv-hero__inner {
	display: flex;
	align-items: center;
	gap: clamp(22px, 4vw, 48px);
}

.rr-webtv-hero__logo {
	flex: 0 0 auto;
	width: clamp(150px, 17vw, 218px);
	height: auto;
}

.rr-webtv-hero__txt {
	min-width: 0;
}

.rr-webtv-hero__eyebrow {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	opacity: .92;
}

.rr-webtv .rr-webtv-hero h1.rr-webtv-hero__titre,
.rr-webtv-hero__titre {
	margin: 0;
	font-size: clamp(2rem, 4vw, 3.1rem);
	font-weight: 800;
	line-height: 1.05;
	color: #fff;
}

.rr-webtv .rr-webtv-hero .rr-webtv-hero__eyebrow,
.rr-webtv .rr-webtv-hero .rr-webtv-hero__baseline {
	color: #fff;
}

.rr-webtv-hero__titre::after {
	content: "";
	display: block;
	width: 74px;
	height: 4px;
	margin-top: 14px;
	border-radius: 999px;
	background: var(--wt-nature);
}

.rr-webtv-hero__baseline {
	margin: 14px 0 0;
	font-size: 1.05rem;
	font-weight: 500;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .95;
}

@media (max-width: 720px) {
	.rr-webtv-hero__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 18px;
	}
	.rr-webtv-hero__logo { width: 148px; }
}

/* Sections --------------------------------------------------------------- */

.rr-webtv-section {
	margin-bottom: 50px;
}

.rr-webtv-tete {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.rr-webtv-tete h2 {
	position: relative;
	margin: 0;
	padding-left: 16px;
	font-size: clamp(1.25rem, 2vw, 1.6rem);
	font-weight: 800;
	color: var(--wt-bleu-nuit);
}

.rr-webtv-tete h2::before {
	content: "";
	position: absolute;
	left: 0;
	top: .18em;
	bottom: .18em;
	width: 4px;
	border-radius: 999px;
	background: var(--wt-jaune);
}

.rr-webtv-tete a {
	font-size: .9rem;
	font-weight: 600;
	color: var(--wt-bleu);
	text-decoration: none;
}

.rr-webtv-tete a:hover {
	text-decoration: underline;
}

.rr-webtv-vide {
	padding: 40px;
	text-align: center;
	color: var(--wt-gris);
	background: var(--wt-fond);
	border-radius: var(--wt-radius);
}

/* Lecteur ---------------------------------------------------------------- */

.rr-webtv-player {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--wt-radius);
	overflow: hidden;
	background: #14201F;
	box-shadow: var(--wt-ombre);
}

.rr-webtv-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.rr-webtv-player--vide {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #BBD6D2;
	text-align: center;
	padding: 20px;
}

/* Direct / à la une ------------------------------------------------------ */

.rr-webtv-direct {
	display: grid;
	grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
	gap: 26px;
	align-items: start;
}

.rr-webtv-direct__player {
	position: relative;
}

.rr-webtv-live-pastille,
.rr-webtv-pastille {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border-radius: 999px;
	background: var(--wt-fuchsia);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
}

.rr-webtv-pastille {
	background: var(--wt-nature);
	color: var(--wt-encre);
}

.rr-webtv-live-point {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	animation: rr-webtv-pulse 1.4s ease-in-out infinite;
}

@keyframes rr-webtv-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: .35; transform: scale(.75); }
}

.rr-webtv-direct__info {
	padding: 26px 26px 28px;
	background: #fff;
	border: 1px solid var(--wt-bord);
	border-radius: var(--wt-radius);
	box-shadow: var(--wt-ombre);
}

.rr-webtv-direct__info h2 {
	margin: 0 0 12px;
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--wt-bleu-nuit);
}

.rr-webtv-direct__meta {
	margin: 0 0 12px;
	font-size: .88rem;
	color: var(--wt-gris);
}

.rr-webtv-creneau {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 12px;
	padding: 14px 0;
	border-top: 1px solid var(--wt-bord);
}

.rr-webtv-creneau__label {
	grid-column: 1 / -1;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wt-fuchsia);
}

.rr-webtv-creneau--suivant .rr-webtv-creneau__label {
	color: var(--wt-gris);
}

.rr-webtv-creneau__heure {
	font-weight: 800;
	color: var(--wt-bleu);
}

.rr-webtv-creneau__titre {
	font-weight: 600;
}

/* Boutons ---------------------------------------------------------------- */

.rr-webtv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--wt-nature, #AFCA0B);
	color: var(--wt-encre, #1F2A28);
	font-size: .95rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease;
}

.rr-webtv-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(10, 52, 89, .16);
	color: var(--wt-bleu-nuit);
}

.rr-webtv-btn--clair {
	background: var(--wt-fond);
	border: 1px solid var(--wt-bord);
	color: var(--wt-bleu-nuit);
	font-size: .85rem;
	padding: 9px 18px;
}

/* Filtres ---------------------------------------------------------------- */

.rr-webtv-filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-bottom: 40px;
}

.rr-webtv-filtre {
	display: inline-block;
	padding: 8px 17px;
	border: 1px solid var(--wt-bord);
	border-radius: 999px;
	background: #fff;
	color: var(--wt-bleu-nuit);
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.rr-webtv-filtre:hover,
.rr-webtv-filtre.est-actif {
	background: var(--wt-bleu);
	border-color: var(--wt-bleu);
	color: #fff;
}

/* Cartes ----------------------------------------------------------------- */

.rr-webtv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 22px;
}

.rr-webtv-piste {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(268px, 1fr);
	gap: 22px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 12px;
	scrollbar-width: thin;
}

.rr-webtv-piste > * {
	scroll-snap-align: start;
}

.rr-webtv-piste--courts {
	grid-auto-columns: minmax(180px, 200px);
}

.rr-webtv-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--wt-bord);
	border-radius: var(--wt-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform .25s ease, box-shadow .25s ease;
}

.rr-webtv-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--wt-ombre);
	color: inherit;
}

.rr-webtv-card__media {
	position: relative;
	display: block;
	flex: none;
	min-height: 0;
	aspect-ratio: 16 / 9;
	background: var(--wt-perle, #E7EAEC);
	overflow: hidden;
}

.rr-webtv-card--court .rr-webtv-card__media {
	aspect-ratio: 9 / 16;
}

.rr-webtv-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter .3s ease;
}

.rr-webtv-card:hover .rr-webtv-card__media img {
	filter: saturate(1.12);
}

.rr-webtv-card__play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 52px;
	height: 52px;
	transform: translate(-50%, -50%) scale(.9);
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
}

.rr-webtv-card__play::before {
	content: "";
	position: absolute;
	left: 54%;
	top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent var(--wt-bleu-nuit);
}

.rr-webtv-card:hover .rr-webtv-card__play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.rr-webtv-card__duree {
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 3px 9px;
	border-radius: 6px;
	background: rgba(10, 52, 89, .86);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.rr-webtv-card__corps {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px 18px;
}

.rr-webtv-card__cat {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wt-bleu);
}

.rr-webtv-card__titre {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wt-bleu-nuit);
}

.rr-webtv-card__date {
	font-size: .8rem;
	color: var(--wt-gris);
}

/* Émissions -------------------------------------------------------------- */

.rr-webtv-emissions {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
	gap: 16px;
}

/*
 * Tuiles d'émission : reprise des « trames de publications » de la charte —
 * aplat de couleur Kap TV, trame florale et texte en blanc. Les cinq couleurs
 * de la palette se succèdent d'une tuile à l'autre.
 */
.rr-webtv-emission {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 6px;
	min-height: 132px;
	padding: 22px 24px;
	border: 0;
	border-radius: var(--wt-radius);
	background: var(--wt-ocean);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}

.rr-webtv-emission::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--wt-trame);
	background-size: 360px auto;
	background-position: -30px -20px;
	opacity: .3;
}

.rr-webtv-emission::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: rgba(255, 255, 255, .65);
}

/* Voile bas : garantit la lisibilité du texte blanc sur les cinq aplats. */
.rr-webtv-emission > * {
	position: relative;
	z-index: 1;
}

.rr-webtv-emission {
	background-blend-mode: normal;
}

.rr-webtv-emission::before {
	box-shadow: inset 0 -110px 70px -60px rgba(20, 32, 31, .55);
}

.rr-webtv-emissions > :nth-child(5n+2) { background: var(--wt-nature); }
.rr-webtv-emissions > :nth-child(5n+3) { background: var(--wt-soleil); }
.rr-webtv-emissions > :nth-child(5n+4) { background: var(--wt-pourpre); }
.rr-webtv-emissions > :nth-child(5n+5) { background: var(--wt-sucrerie); }

.rr-webtv-emission:hover {
	transform: translateY(-3px);
	box-shadow: var(--wt-ombre);
}

.rr-webtv-emission__nom {
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.2;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: .02em;
}

.rr-webtv-emission__nombre {
	font-size: .82rem;
	font-weight: 600;
	color: rgba(255, 255, 255, .9);
}

/* Grille de programmes --------------------------------------------------- */

.rr-webtv-grille-prog {
	list-style: none;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid var(--wt-bord);
	border-radius: var(--wt-radius);
	overflow: hidden;
}

.rr-webtv-grille-prog li {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 16px;
	padding: 14px 22px;
	border-bottom: 1px solid var(--wt-bord);
}

.rr-webtv-grille-prog li:last-child {
	border-bottom: 0;
}

.rr-webtv-grille-prog li.est-en-cours {
	background: var(--wt-fond);
	box-shadow: inset 4px 0 0 var(--wt-fuchsia);
}

.rr-webtv-grille-prog__heure {
	font-weight: 800;
	color: var(--wt-bleu);
}

/* Fiche vidéo ------------------------------------------------------------ */

.rr-webtv--single {
	padding-top: 30px;
}

.rr-webtv-fil {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
	font-size: .85rem;
	color: var(--wt-gris);
}

.rr-webtv-fil a {
	color: var(--wt-bleu);
	text-decoration: none;
}

.rr-webtv-fil a:hover {
	text-decoration: underline;
}

.rr-webtv-fiche {
	margin-bottom: 50px;
}

.rr-webtv-fiche__corps {
	display: grid;
	grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
	gap: 32px;
	margin-top: 28px;
}

.rr-webtv-fiche__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}

.rr-webtv-fiche__titre {
	margin: 0 0 10px;
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--wt-bleu-nuit);
}

.rr-webtv-fiche__meta {
	margin: 0 0 22px;
	font-size: .9rem;
	color: var(--wt-gris);
}

.rr-webtv-tag-replay {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: #FBE4E8;
	color: var(--wt-fuchsia);
	font-size: 11px;
	font-weight: 800;
}

.rr-webtv-fiche__texte {
	font-size: 1.02rem;
	line-height: 1.75;
}

.rr-webtv-fiche__cote {
	padding: 22px 24px;
	background: var(--wt-fond);
	border: 1px solid var(--wt-bord);
	border-radius: var(--wt-radius);
}

.rr-webtv-partage__titre {
	margin: 0 0 12px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wt-gris);
}

.rr-webtv-partage {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1024px) {
	.rr-webtv-direct,
	.rr-webtv-fiche__corps {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.rr-webtv-wrap {
		width: min(1240px, 100% - 32px);
	}

	.rr-webtv-hero {
		padding: 38px 0 30px;
		margin-bottom: 26px;
	}

	.rr-webtv-section {
		margin-bottom: 38px;
	}

	.rr-webtv-piste {
		grid-auto-columns: minmax(230px, 76%);
	}

	.rr-webtv-piste--courts {
		grid-auto-columns: minmax(150px, 46%);
	}

	.rr-webtv-grille-prog li {
		grid-template-columns: 70px 1fr;
		padding: 12px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rr-webtv * {
		animation: none !important;
		transition: none !important;
	}
}

/* =======================================================================
 * Bloc Kap TV dans l'application (PWA)
 * ==================================================================== */

.rr-app-webtv {
	--wt-nature: #AFCA0B;
	--wt-ocean: #38B6AB;
	--wt-perle: #E7EAEC;
	--wt-bleu-nuit: #1F2A28;
	--wt-bleu: #2A9A90;
	--wt-jaune: #AFCA0B;
	--wt-fuchsia: #D94460;
	--wt-bord: #DCE7E5;
	--wt-gris: #69807D;

	margin: 0 0 26px;
}

.rr-app-webtv *,
.rr-app-webtv *::before {
	box-sizing: border-box;
}

.rr-app-webtv__tete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.rr-app-webtv__logo {
	flex: 0 0 auto;
	width: 46px;
	height: auto;
}

.rr-app-webtv__tete a {
	margin-left: auto;
}

.rr-app-webtv__tete h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: .01em;
	color: var(--wt-bleu-nuit);
}

.rr-app-webtv__tete a {
	font-size: .82rem;
	font-weight: 700;
	color: var(--wt-bleu);
	text-decoration: none;
}

.rr-app-webtv__direct {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 16px;
	margin-bottom: 14px;
	border-radius: 14px;
	background: linear-gradient(120deg, var(--wt-bleu-nuit), var(--wt-bleu));
	color: #fff;
	text-decoration: none;
}

.rr-app-webtv__live {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 11px;
	border-radius: 999px;
	background: var(--wt-fuchsia);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .08em;
	white-space: nowrap;
}

.rr-app-webtv__point {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
	animation: rr-webtv-pulse 1.4s ease-in-out infinite;
}

.rr-app-webtv__direct-titre {
	font-size: .9rem;
	font-weight: 700;
	line-height: 1.25;
}

.rr-app-webtv__une {
	display: block;
	margin-bottom: 16px;
	text-decoration: none;
	color: inherit;
}

.rr-app-webtv__une-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: 16px;
	overflow: hidden;
	background: var(--wt-perle, #E7EAEC);
}

.rr-app-webtv__une-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rr-app-webtv__play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 50px;
	height: 50px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
}

.rr-app-webtv__play::before {
	content: "";
	position: absolute;
	left: 54%;
	top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent var(--wt-bleu-nuit);
}

.rr-app-webtv__une-titre {
	display: block;
	margin-top: 10px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wt-bleu-nuit);
}

.rr-app-webtv__une-meta {
	display: block;
	margin-top: 3px;
	font-size: .78rem;
	color: var(--wt-gris);
}

.rr-app-webtv__piste {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 62%;
	gap: 13px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 6px;
	margin-inline: -4px;
	padding-inline: 4px;
	scrollbar-width: none;
}

.rr-app-webtv__piste::-webkit-scrollbar {
	display: none;
}

.rr-app-webtv__carte {
	scroll-snap-align: start;
	text-decoration: none;
	color: inherit;
}

.rr-app-webtv__carte-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	background: var(--wt-perle, #E7EAEC);
}

.rr-app-webtv__carte-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rr-app-webtv__duree {
	position: absolute;
	right: 7px;
	bottom: 7px;
	padding: 2px 7px;
	border-radius: 5px;
	background: rgba(10, 52, 89, .86);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
}

.rr-app-webtv__carte-titre {
	display: block;
	margin-top: 8px;
	font-size: .85rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wt-bleu-nuit);
}
