/* RGB Radio Player */
.rgb-rp, .rgb-rp * { box-sizing: border-box; }

.rgb-rp {
	--rgb-bar: #fde84f;
	--rgb-accent: #cf3562;
	--rgb-live: #e10613;
	--rgb-gap: 0px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px 8px 12px;
	background: var(--rgb-bar);
	border-radius: 14px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	line-height: 1;
	color: var(--rgb-accent);
	-webkit-tap-highlight-color: transparent;
}

/* Positions ------------------------------------------------------------ */
.rgb-rp--fixed {
	position: fixed;
	z-index: 99990;
	bottom: 16px;
	width: min(400px, calc(100vw - 24px));
	box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
}
.rgb-rp--bottom-left   { left: 16px; }
.rgb-rp--bottom-right  { right: 16px; }
.rgb-rp--bottom-center { left: 50%; transform: translateX(-50%); }

.rgb-rp--inline { width: 100%; max-width: 420px; }

.rgb-rp--popup {
	width: 100%;
	min-height: 100vh;
	border-radius: 0;
	padding: 8px 12px;
}

/* Logo ----------------------------------------------------------------- */
.rgb-rp__logo {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	background: #fff;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.rgb-rp__logo img { width: 100%; height: 100%; object-fit: contain; display: block; margin: 0; }
.rgb-rp__logo-text { font-weight: 800; font-size: 13px; color: #222; }

/* LIVE ----------------------------------------------------------------- */
.rgb-rp__live { display: flex; align-items: center; gap: 9px; }
.rgb-rp__badge {
	background: var(--rgb-live);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	padding: 5px 8px;
	border-radius: 3px;
	transition: opacity .25s, filter .25s;
}
.rgb-rp__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--rgb-live);
	box-shadow: 0 0 0 3px rgba(225, 6, 19, .22);
	transition: opacity .25s, filter .25s;
}
.rgb-rp:not(.is-playing) .rgb-rp__badge,
.rgb-rp:not(.is-playing) .rgb-rp__dot { opacity: .32; filter: grayscale(1); }
.rgb-rp.is-playing .rgb-rp__dot { animation: rgb-rp-pulse 1.6s ease-out infinite; }

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

.rgb-rp__spacer { flex: 1 1 auto; min-width: 4px; }

/* Boutons (reset fort contre les styles du thème / Elementor) ---------- */
.rgb-rp button.rgb-rp__play,
.rgb-rp button.rgb-rp__volbtn,
.rgb-rp button.rgb-rp__pop {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex: 0 0 auto;
	border: 0 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
}

.rgb-rp button.rgb-rp__play,
.rgb-rp button.rgb-rp__play:hover,
.rgb-rp button.rgb-rp__play:focus {
	width: 52px;
	height: 52px;
	margin: -2px 0;
	border-radius: 6px;
	background: var(--rgb-accent) !important;
	transition: transform .15s;
}
.rgb-rp button.rgb-rp__play:hover { transform: scale(1.04); }
.rgb-rp button.rgb-rp__play:active { transform: scale(.96); }

.rgb-rp__disc {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	color: var(--rgb-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.rgb-rp__ico { display: flex; align-items: center; justify-content: center; }
.rgb-rp__ico svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.rgb-rp__disc .rgb-rp__ico { width: 24px; height: 24px; position: absolute; }

.rgb-rp .rgb-rp__ico--pause,
.rgb-rp.is-playing .rgb-rp__ico--play,
.rgb-rp.is-loading .rgb-rp__ico--play { display: none; }
.rgb-rp.is-playing .rgb-rp__ico--pause,
.rgb-rp.is-loading .rgb-rp__ico--pause { display: flex; }
.rgb-rp.is-loading .rgb-rp__disc { animation: rgb-rp-blink 1s ease-in-out infinite; }

/* Invitation discrète quand la lecture auto est bloquée par le navigateur */
.rgb-rp.is-armed .rgb-rp__play { animation: rgb-rp-nudge 2s ease-in-out infinite; }

/* Volume --------------------------------------------------------------- */
.rgb-rp__vol { position: relative; display: flex; align-items: center; }

.rgb-rp button.rgb-rp__volbtn,
.rgb-rp button.rgb-rp__volbtn:hover,
.rgb-rp button.rgb-rp__volbtn:focus {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	color: var(--rgb-accent) !important;
	background: transparent !important;
}
.rgb-rp .rgb-rp__volbtn .rgb-rp__ico { width: 28px; height: 28px; }
.rgb-rp .rgb-rp__volbtn .rgb-rp__ico--mute,
.rgb-rp.is-muted .rgb-rp__volbtn .rgb-rp__ico--vol { display: none; }
.rgb-rp.is-muted .rgb-rp__volbtn .rgb-rp__ico--mute { display: flex; }

.rgb-rp__range-wrap {
	position: absolute;
	right: -6px;
	bottom: 100%;
	padding-bottom: 12px;
	display: none;
}
.rgb-rp--inline .rgb-rp__range-wrap { bottom: auto; top: 100%; padding: 12px 0 0; }
.rgb-rp__range-wrap::before {
	content: "";
	position: absolute;
	inset: 0 0 12px 0;
	background: var(--rgb-bar);
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
}
.rgb-rp--inline .rgb-rp__range-wrap::before { inset: 12px 0 0 0; }

@media (hover: hover) and (pointer: fine) {
	.rgb-rp__vol:hover .rgb-rp__range-wrap,
	.rgb-rp__vol:focus-within .rgb-rp__range-wrap { display: block; }
}

.rgb-rp input.rgb-rp__range {
	position: relative;
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 120px;
	height: 18px;
	margin: 10px 12px;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
}
.rgb-rp .rgb-rp__range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .18); }
.rgb-rp .rgb-rp__range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .18); }
.rgb-rp .rgb-rp__range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--rgb-accent); border: 0; }
.rgb-rp .rgb-rp__range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--rgb-accent); border: 0; }

/* Appareils tactiles : le volume se règle avec les boutons du téléphone */
@media (hover: none), (pointer: coarse) {
	.rgb-rp__range-wrap { display: none !important; }
}

/* Pop-up : curseur toujours visible dans la barre */
.rgb-rp--popup .rgb-rp__range-wrap { position: static; display: block; padding: 0; }
.rgb-rp--popup .rgb-rp__range-wrap::before { display: none; }
.rgb-rp--popup input.rgb-rp__range { width: 90px; margin: 0 6px 0 0; }
@media (hover: none), (pointer: coarse) {
	.rgb-rp--popup .rgb-rp__range-wrap { display: block !important; }
}
.rgb-rp--popup .rgb-rp__vol { gap: 2px; }

/* Ouvrir en fenêtre ---------------------------------------------------- */
.rgb-rp button.rgb-rp__pop,
.rgb-rp button.rgb-rp__pop:hover,
.rgb-rp button.rgb-rp__pop:focus {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	color: #fff !important;
	background: transparent !important;
	filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35));
}
.rgb-rp .rgb-rp__pop svg { width: 28px; height: 28px; display: block; }

/* Focus clavier visible */
.rgb-rp button:focus-visible,
.rgb-rp input:focus-visible { outline: 3px solid #222 !important; outline-offset: 2px; }

/* Mobile --------------------------------------------------------------- */
@media (max-width: 640px) {
	.rgb-rp--fixed {
		left: 0 !important;
		right: 0 !important;
		bottom: var(--rgb-gap);
		width: 100%;
		transform: none !important;
		border-radius: 14px 14px 0 0;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
		box-shadow: 0 -4px 18px rgba(0, 0, 0, .18);
	}
	.rgb-rp { gap: 10px; }
	.rgb-rp--fixed .rgb-rp__pop { display: none; } /* un pop-up n'a pas de sens sur téléphone */
}

/* Animations ----------------------------------------------------------- */
@keyframes rgb-rp-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(225, 6, 19, .45); }
	70%  { box-shadow: 0 0 0 8px rgba(225, 6, 19, 0); }
	100% { box-shadow: 0 0 0 0 rgba(225, 6, 19, 0); }
}
@keyframes rgb-rp-blink { 50% { opacity: .55; } }
@keyframes rgb-rp-nudge { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.08); } 90% { transform: scale(1); } }

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