/* Row Émissions (module webradio) : cartes en colonnes ou liste, podcasts repliables (lecture dans la barre de la radio). Site et éditeur. Couleurs du thème du projet (--theme-*) ; les cards suivent Design > Cartes, puis le module et la row (--cd-*, CardDesignLib) */

.wr-emissions {
	--wr-border: color-mix(in srgb, currentColor 18%, transparent);
	--wr-muted: color-mix(in srgb, currentColor 62%, transparent);
	--wr-radius: var(--row-radius, var(--r-radius, var(--cd-radius, var(--theme-card-radius, .75rem))));
	width: 100%;
}

.wr-emissions-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.wr-emissions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
	.wr-emissions-grid { grid-template-columns: repeat(var(--wr-cols, 3), minmax(0, 1fr)); }
}

.wr-emissions-list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.wr-emission {
	--wr-color: var(--theme-primary, currentColor);
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
}

@media (min-width: 640px) {
	.wr-emissions-list .wr-emission { flex-direction: row; }
	.wr-emissions-list .wr-emission-picture { flex: 0 0 14rem; aspect-ratio: 1 / 1; border-right: 4px solid var(--wr-color); border-bottom: 0; }
}

/* La couleur de l'émission borde la photo : dessous en card verticale, à droite en liste */
.wr-emission-picture {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	border-bottom: 4px solid var(--wr-color);
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.wr-emission-picture img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wr-emission-body {
	flex: 1 1 auto;
	min-width: 0;
	padding: 1rem 1.1rem 1.1rem;
}

.wr-emission-name {
	margin: 0 0 .25rem;
	font-family: var(--theme-font-title, inherit);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
}

.wr-emission-author {
	margin: 0 0 .6rem;
	color: var(--wr-muted);
	font-size: .9rem;
}

.wr-emission-description {
	margin: 0 0 .8rem;
	overflow-wrap: anywhere;
}

/* Podcasts */
.wr-podcasts {
	padding-top: .2rem;
}

.wr-podcasts-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

.wr-podcasts-summary::-webkit-details-marker { display: none; }

.wr-chevron { flex: 0 0 auto; transition: transform .15s ease; }
.wr-podcasts[open] .wr-chevron { transform: rotate(180deg); }

.wr-podcasts-list {
	margin: .75rem 0 0;
	padding: 0;
	list-style: none;
}

.wr-podcast { display: flex; align-items: flex-start; gap: .75rem; }

.wr-podcast + .wr-podcast {
	margin-top: .9rem;
	padding-top: .9rem;
	border-top: 1px dashed var(--wr-border);
}

.wr-podcast-play {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--theme-primary, #0d6efd);
	color: var(--theme-primary-text, #fff);
	cursor: pointer;
}

.wr-podcast-play:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.wr-podcast-play .fa-play { margin-left: .12rem; }
.wr-podcast.is-playing .wr-podcast-title { color: var(--theme-primary, inherit); }

.wr-podcast-text { flex: 1 1 auto; min-width: 0; }
.wr-podcast-title { font-weight: 600; line-height: 1.25rem; }

.wr-podcast-description {
	margin: .2rem 0 0;
	color: var(--wr-muted);
	font-size: .9rem;
}

/* Row Grille des programmes (module webradio) : une carte par jour, 7 colonnes quand la place le permet (selon la largeur de la row, pas de l'écran), sinon 2 colonnes puis une liste. L'émission en cours est repérée par webradio-row.js */
.wr-schedule {
	--wr-border: color-mix(in srgb, currentColor 14%, transparent);
	--wr-muted: color-mix(in srgb, currentColor 58%, transparent);
	--wr-radius: var(--row-radius, var(--r-radius, var(--cd-radius, var(--theme-card-radius, 1rem))));
	container-type: inline-size;
	width: 100%;
}

.wr-week {
	display: grid;
	gap: .75rem;
	grid-template-columns: 1fr;
}

@container (min-width: 30rem) {
	.wr-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 60rem) {
	.wr-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
}

.wr-schedule-today.is-ready .wr-day:not(.is-today) {
	display: none;
}

.wr-day {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 1rem .75rem .75rem;
}

.wr-day.is-today {
	border-color: var(--theme-primary, currentColor);
	box-shadow: 0 0 0 1px var(--theme-primary, currentColor), var(--cd-shadow, var(--theme-card-shadow, none));
}

.wr-day-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem .5rem;
	margin: 0 0 .75rem;
	padding: 0 .25rem .65rem;
	border-bottom: 1px solid var(--wr-border);
	font-family: var(--theme-font-title, inherit);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
}

.wr-day.is-today .wr-day-title {
	color: var(--theme-primary, inherit);
}

@container (min-width: 60rem) {
	.wr-day-title { flex-direction: column; gap: .15rem; }
}

.wr-day-date {
	color: var(--wr-muted);
	font-size: .75rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.wr-day-list {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wr-slot-item {
	--wr-color: var(--theme-primary, currentColor);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .2rem;
	padding: .55rem .65rem .6rem;
	border-radius: 0;
	background: color-mix(in srgb, var(--wr-color) 11%, transparent);
	box-shadow: inset 3px 0 0 var(--wr-color);
	overflow-wrap: anywhere;
	transition: background-color .2s ease;
}

.wr-slot-item.is-live {
	background: color-mix(in srgb, var(--wr-color) 24%, transparent);
}

.wr-slot-time {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	color: var(--wr-muted);
	font-size: .75rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.wr-slot-label {
	font-size: .85rem;
	font-weight: 600;
	line-height: 1.25;
}

.wr-live {
	margin-top: .2rem;
	padding: .1rem .55rem;
	border-radius: 1rem;
	background: var(--wr-color);
	color: #fff;
	font-size: .65rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.wr-live[hidden] {
	display: none;
}

.wr-day-empty {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 3.5rem;
	margin: 0;
	padding: .75rem;
	border: 1px dashed var(--wr-border);
	border-radius: calc(var(--wr-radius) * .6);
	color: var(--wr-muted);
	font-size: .85rem;
	text-align: center;
}

/* Row Playlist (module webradio) : les derniers titres diffusés, regroupés par jour */
.wr-playlist {
	--wr-border: color-mix(in srgb, currentColor 14%, transparent);
	--wr-muted: color-mix(in srgb, currentColor 62%, transparent);
	--wr-radius: var(--row-radius, var(--r-radius, var(--cd-radius, var(--theme-card-radius, 1rem))));
	width: 100%;
	padding: 1.25rem 1.25rem 1rem;
}

.wr-playlist-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wr-playlist-day {
	margin: 1.25rem 0 .4rem;
	color: var(--wr-muted);
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.wr-playlist-day:first-child {
	margin-top: 0;
}

.wr-track {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .55rem 0;
	border-bottom: 1px solid var(--wr-border);
}

.wr-track-cover {
	flex: 0 0 auto;
	width: 3rem;
	height: 3rem;
	margin-bottom: 0;
	border: 0;
	border-radius: .4rem;
	object-fit: cover;
}

.wr-track-info {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.wr-track-title {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wr-track-artist {
	overflow: hidden;
	color: var(--wr-muted);
	font-size: .9rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wr-track-time {
	flex: 0 0 auto;
	color: var(--wr-muted);
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
}

.wr-track-buy {
	flex: 0 0 auto;
	color: inherit;
	opacity: .75;
}

.wr-track-buy.is-disabled {
	opacity: .25;
	cursor: default;
	pointer-events: none;
}

.wr-track-buy:hover {
	opacity: 1;
}

/* Choix du service de musique de la loupe (page des favoris) : un bouton par service, avec son logo */
.wr-search-pick {
	margin: 0 0 1.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--wr-border);
}

.wr-search-pick-label {
	display: block;
	margin-bottom: .6rem;
	color: var(--wr-muted);
	font-size: .85rem;
	font-weight: 600;
}

.wr-search-options {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.wr-search-option {
	--wr-brand: currentColor;
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .45rem .9rem .45rem .6rem;
	border: 1px solid var(--wr-border);
	border-radius: 2rem;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.wr-search-option i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wr-brand) 14%, transparent);
	color: var(--wr-brand);
	font-size: .95rem;
	font-weight: 400;
}

.wr-search-option:hover {
	border-color: var(--wr-brand);
}

.wr-search-option:focus-visible {
	outline: 2px solid var(--wr-brand);
	outline-offset: 2px;
}

.wr-search-option.is-active {
	border-color: var(--wr-brand);
	background: color-mix(in srgb, var(--wr-brand) 10%, transparent);
	box-shadow: 0 0 0 1px var(--wr-brand);
}

.wr-search-option.is-active i {
	background: var(--wr-brand);
	color: #fff;
}

/* Icône loupe en fin de ligne : cherche le titre chez le service de musique choisi dans les paramètres du module */
.wr-track-search {
	flex: 0 0 auto;
	color: inherit;
	opacity: .75;
}

.wr-track-search.is-disabled {
	opacity: .25;
	cursor: default;
	pointer-events: none;
}

.wr-track-search:hover {
	opacity: 1;
}

/* Cœur d'un titre ou d'un podcast (module Webradio > Paramètres > favoris) : contour, plein une fois en favori. Dans la page des favoris, il retire le titre de la liste */
.wr-track-fav {
	flex: 0 0 auto;
	margin-left: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: .75;
}

.wr-track-info + .wr-track-fav,
.wr-track-time + .wr-track-fav {
	margin-left: 0;
}

.wr-track-fav i {
	font-weight: 400;
}

.wr-track-fav.is-on i {
	font-weight: 900;
}

.wr-track-fav.is-on {
	opacity: 1;
	color: var(--theme-primary);
}

.wr-track-fav:hover {
	opacity: 1;
}

.wr-track-fav:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.wr-track-fav.is-busy {
	opacity: .35;
	pointer-events: none;
}

/* Podcast d'un favori : la même ligne qu'un titre, avec le bouton lecture */
.wr-track.wr-podcast + .wr-podcast {
	margin-top: 0;
	padding-top: .55rem;
	border-top: 0;
}

.wr-track.wr-podcast {
	align-items: center;
}

/* Cœur de la card « Webradio en cours » : sur la pochette, il reprend celui de la barre de la radio */
.wr-now-fav {
	position: absolute;
	top: .6rem;
	right: .6rem;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	cursor: pointer;
}

.wr-now-fav[hidden] { display: none; }
.wr-now-fav:hover { background: rgba(0, 0, 0, .65); }
.wr-now-fav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wr-now-fav i { font-weight: 400; }
.wr-now-fav.is-on { color: var(--theme-primary); }
.wr-now-fav.is-on i { font-weight: 900; }
.wr-now-fav.is-busy { opacity: .5; pointer-events: none; }

.wr-track:last-child {
	border-bottom: 0;
}

.wr-playlist-none {
	margin: 0;
	padding: .5rem 0;
	color: var(--wr-muted);
	text-align: center;
}

.wr-playlist-none[hidden],
.wr-playlist .wr-playlist-more[hidden] {
	display: none;
}

.wr-playlist .wr-playlist-more {
	display: block;
	width: fit-content;
	margin: 1rem auto 0;
}

/* Exceptions de la grille (créneau d'un seul jour) */
.wr-exception {
	margin-top: .2rem;
	padding: .05rem .5rem;
	border: 1px solid var(--wr-color);
	border-radius: 1rem;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

/* Row Webradio en cours : pochette, titre, album et artiste du morceau (ou du podcast) lu dans la barre de la radio, avec la pochette floutée en fond. Remplie par webradio-row.js */
.wr-now {
	--wr-radius: var(--row-radius, var(--r-radius, var(--cd-radius, .3rem)));
	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
	padding: 3rem 1rem;
	overflow: hidden;
	border-radius: var(--wr-radius);
}

.wr-now-background {
	position: absolute;
	inset: -2rem;
	background-position: center;
	background-size: cover;
	filter: blur(28px) brightness(.55);
	transition: background-image .4s ease;
}

.wr-now-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(100%, 18rem);
	overflow: hidden;
	background: var(--cd-bg, var(--theme-dark, #0b2239));
	color: var(--cd-text, #fff);
	border: var(--cd-border, none);
	border-radius: var(--wr-radius);
	box-shadow: var(--cd-shadow, 0 .5rem 2rem rgba(0, 0, 0, .35));
	text-align: center;
}

.wr-now-cover { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: rgba(127, 127, 127, .25); }
.wr-now-cover[hidden] { display: none; }

.wr-now-card { padding-bottom: 1.25rem; }
.wr-now-info { display: flex; flex-direction: column; gap: .15rem; padding: 1.25rem 1rem 0; min-width: 0; }
.wr-now-title { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.wr-now-album { font-size: 1rem; opacity: .9; overflow-wrap: anywhere; }
.wr-now-artist { margin-top: .4rem; font-size: .85rem; opacity: .8; overflow-wrap: anywhere; }
.wr-now-album[hidden], .wr-now-artist[hidden] { display: none; }
.wr-now-progress { position: relative; height: 5px; margin: .9rem 1rem 0; border-radius: 3px; background: rgba(127, 127, 127, .35); cursor: pointer; touch-action: none; }
.wr-now-progress::before { content: ''; position: absolute; top: -10px; right: 0; bottom: -10px; left: 0; }
.wr-now-progress span { display: block; height: 100%; border-radius: inherit; background: var(--theme-primary, currentColor); transform: scaleX(0); transform-origin: left center; transition: transform .5s linear; }
.wr-now-progress[hidden] { display: none; }
.wr-now-progress.is-seeking span { transition: none; }
.wr-now-progress + .wr-now-time { margin-top: .4rem; }
.wr-now-time { margin-top: .6rem; font-size: .8rem; font-variant-numeric: tabular-nums; opacity: .8; }
.wr-now-time[hidden], .wr-now-more-box[hidden] { display: none; }

/* « + d'infos » : la description du podcast dans un tiroir qui s'ouvre sous le titre */
.wr-now-more-box { padding: 0 1rem; }
.wr-now-more { margin-top: .6rem; padding: .25rem .75rem; border: 1px solid currentColor; border-radius: 1rem; background: transparent; color: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.wr-now-more:hover { background: rgba(127, 127, 127, .2); }
.wr-now-more:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.wr-now-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.wr-now.is-open .wr-now-drawer { grid-template-rows: 1fr; }
.wr-now-description { min-height: 0; overflow: hidden; visibility: hidden; font-size: .9rem; text-align: left; white-space: pre-line; overflow-wrap: anywhere; opacity: .9; transition: visibility .25s; }
.wr-now.is-open .wr-now-description { visibility: visible; padding-top: .75rem; }
@media (prefers-reduced-motion: reduce) { .wr-now-drawer, .wr-now-description { transition: none; } }

/* Lien du nom d'une émission vers sa page */
.wr-emission-link {
	color: inherit;
	text-decoration: none;
}

.wr-emission-link:hover {
	text-decoration: underline;
}

/* Page d'une émission : photo, texte et flux de podcast, puis la liste des podcasts, dans une card */
.wr-detail {
	--wr-border: color-mix(in srgb, currentColor 14%, transparent);
	--wr-muted: color-mix(in srgb, currentColor 62%, transparent);
	--wr-color: var(--theme-primary, currentColor);
	--wr-radius: var(--row-radius, var(--r-radius, var(--cd-radius, var(--theme-card-radius, 1rem))));
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
}

.wr-detail-head {
	display: flex;
	flex-direction: column;
}

.wr-detail-picture {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-bottom: 4px solid var(--wr-color);
}

.wr-detail-main {
	min-width: 0;
	padding: 1.25rem 1.25rem 1rem;
}

.wr-detail-name {
	margin: 0;
	font-family: var(--theme-font-title, inherit);
	font-size: 1.75rem;
	line-height: 1.2;
}

.wr-detail-author {
	margin: .35rem 0 0;
	color: var(--wr-muted);
}

.wr-detail-description {
	margin-top: .9rem;
	overflow-wrap: anywhere;
}

.wr-detail-feed {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: 1.1rem;
}

.wr-detail-feed .btn {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
}

.wr-detail-help {
	margin: 1rem 0 0;
	color: var(--wr-muted);
	font-size: .85rem;
}

.wr-detail-podcasts {
	padding: 1rem 1.25rem 1.25rem;
	border-top: 1px solid var(--wr-border);
}

.wr-detail-title {
	margin: 0 0 .9rem;
	font-family: var(--theme-font-title, inherit);
	font-size: 1.15rem;
}

.wr-detail-none {
	margin: 0;
	color: var(--wr-muted);
}

.wr-podcast-duration {
	margin-left: .35rem;
	color: var(--wr-muted);
	font-size: .8rem;
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
	.wr-detail-head { flex-direction: row; }
	.wr-detail-picture { flex: 0 0 18rem; width: 18rem; height: auto; aspect-ratio: 1 / 1; border-right: 4px solid var(--wr-color); border-bottom: 0; }
	.wr-detail-main { flex: 1 1 auto; padding: 1.5rem; }
}

.wr-detail-back {
	margin: 0 0 .9rem;
}

.wr-detail-back a {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	color: inherit;
	font-weight: 600;
	text-decoration: none;
	opacity: .75;
}

.wr-detail-back a:hover {
	opacity: 1;
}
