/* QC Podcast Portable Player (story 129387, QC-HOME-011, T61).

   Floating "mini player" bar pinned to the bottom of every page.

   This bar is the SAME player as the Home podcast section (qc-home-podcast),
   in a compact form factor, so every visual token here is deliberately copied
   from that fragment's styles.css rather than re-invented: the maroon->gold
   band gradient, the pink skip buttons on maroon, the maroon play button with
   its glow, the light scrub track with the deep-maroon fill, the chip-style
   eyebrow, and the gold focus ring. Keep the two files in sync — if a token
   changes in the section, change it here too.

   Logical properties so it mirrors under dir="rtl"; :hover affordances gated
   behind (hover:hover) and (pointer:fine) (qc-touch-hover-gotcha). */

.qc-ppl {
	/* mirrors .qc-home-podcast's palette (styles.css of qc-home-podcast) */
	--_ppl-primary: var(--qc-color-primary, #911731);
	--_ppl-primary-800: #580f2a;
	--_ppl-primary-50: #f4e7ea;
	--_ppl-gold: #422c1b;
	--_ppl-ink: #ffffff;
	--_ppl-muted: rgba(255, 255, 255, 0.82);
	--_ppl-track: #ededed;
	--_ppl-buf: rgba(88, 15, 42, 0.4);
	--_ppl-focus: #e7b96b;

	position: fixed;
	inset-block-end: 0;
	inset-inline: 0;
	/* below Liferay/QC modals and popups (>=1050) so they always cover the player */
	z-index: 1000;
	background: linear-gradient(
			270deg, 
			rgba(29, 29, 27, 0.24) 20.14%, 
			rgba(29, 29, 27, 0.40) 79.87%
		), 
		linear-gradient(90deg, #911731 15.74%, #422C1B 84.32%);
	color: var(--_ppl-ink);
	font-family: var(--qc-font-family-base, 'Cairo', sans-serif);
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
	animation: qc-ppl-in 0.28s ease;
}

/* the band's gradient runs gold -> primary along the INLINE axis, so it has to
   flip with the document direction exactly like the section's does. */
[dir='rtl'] .qc-ppl,
.qc-ppl[dir='rtl'] {
	background-image: linear-gradient(
			90deg,
			rgba(29, 29, 27, 0.24) 20.14%,
			rgba(29, 29, 27, 0.4) 79.87%
		),
		linear-gradient(270deg, #911731 15.74%, #422c1b 84.32%);
}

@keyframes qc-ppl-in {
	from {
		transform: translateY(100%);
	}

	to {
		transform: translateY(0);
	}
}

.qc-ppl[hidden] {
	display: none;
}

.qc-ppl-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	max-width: var(--container-max-xl, 1320px);
	margin-inline: auto;
	padding-block: 12px;
	padding-inline: 16px;
}

/* ---- episode meta ---- */
.qc-ppl-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 0 1 280px;
}

/* same 8px rounding as the section's episode artwork */
.qc-ppl-thumb {
	inline-size: 48px;
	block-size: 48px;
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.12);
	background-size: cover;
	background-position: center;
	flex: 0 0 auto;
}

.qc-ppl-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}

/* the section renders its episode/frequency labels as translucent dark chips
   (.qc-pod-tag); the eyebrow is the bar's single-chip equivalent. */
.qc-ppl-eyebrow {
	display: inline-flex;
	align-items: center;
	max-inline-size: 100%;
	background-color: rgba(29, 29, 27, 0.4);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	color: var(--_ppl-ink);
	font-size: 12px;
	line-height: 18px;
	padding-block: 2px;
	padding-inline: 8px;
	border-radius: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qc-ppl-eyebrow:empty {
	display: none;
}

.qc-ppl-title {
	font-size: 16px;
	line-height: 24px;
	font-weight: 700;
	color: var(--_ppl-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-inline-size: 100%;
}

/* ---- transport controls (identical treatment to .qc-pod-ctrl) ---- */
.qc-ppl-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.qc-ppl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	cursor: pointer;
	border-radius: 9999px;
	padding: 0;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.qc-ppl-back,
.qc-ppl-fwd {
	inline-size: 36px;
	block-size: 36px;
	background-color: var(--_ppl-primary-50);
	color: var(--_ppl-primary);
}

/* the skip glyphs are directional, so they flip with the document like the
   section's do. */
[dir='rtl'] .qc-ppl-back,
[dir='rtl'] .qc-ppl-fwd,
.qc-ppl[dir='rtl'] .qc-ppl-play,
.qc-ppl[dir='rtl'] .qc-ppl-back,
.qc-ppl[dir='rtl'] .qc-ppl-fwd {
	transform: rotate(180deg);
}

/* the volume glyph is directional too (the speaker cone points toward the
   sound waves), so it flips with the document like the skip/play glyphs. */
[dir='rtl'] .qc-ppl-mute,
.qc-ppl[dir='rtl'] .qc-ppl-mute {
	transform: rotate(180deg);
}

.qc-ppl-play {
	inline-size: 48px;
	block-size: 48px;
	background-color: var(--_ppl-primary);
	color: #ffffff;
	box-shadow: 0 0 18px var(--qc-color-primary-400, #a13a50);
}

.qc-ppl-mute {
	inline-size: 32px;
	block-size: 32px;
	background-color: transparent;
	color: var(--_ppl-ink);
}

@media (hover: hover) and (pointer: fine) {
	.qc-ppl-back:hover,
	.qc-ppl-fwd:hover {
		background-color: #ecd4da;
	}

	.qc-ppl-play:hover {
		transform: scale(1.06);
	}

	.qc-ppl-mute:hover {
		background-color: rgba(255, 255, 255, 0.16);
	}
}

[dir='rtl'] .qc-ppl-back:hover,
[dir='rtl'] .qc-ppl-fwd:hover,
.qc-ppl[dir='rtl'] .qc-ppl-back:hover,
.qc-ppl[dir='rtl'] .qc-ppl-fwd:hover {
	transform: rotate(180deg);
}

.qc-ppl-btn:focus-visible {
	outline: 2px solid var(--_ppl-focus);
	outline-offset: 2px;
}

.qc-ppl-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---- progress ---- */
.qc-ppl-progress-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
}

.qc-ppl-time {
	font-size: 14px;
	line-height: 22px;
	font-weight: 500;
	color: var(--_ppl-ink);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	flex: 0 0 auto;
	min-inline-size: 40px;
	text-align: center;
}

.qc-ppl-bar {
	position: relative;
	flex: 1 1 auto;
	min-inline-size: 0;
	block-size: 8px;
	border-radius: 4px;
	background-color: var(--_ppl-track);
	cursor: pointer;
	touch-action: none;
}

.qc-ppl-bar-buf,
.qc-ppl-bar-fill {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	border-radius: 4px;
}

.qc-ppl-bar-buf {
	background-color: var(--_ppl-buf);
	width: 0;
}

.qc-ppl-bar-fill {
	background-color: var(--_ppl-primary-800);
	width: 0;
}

.qc-ppl-bar-knob {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 0;
	inline-size: 14px;
	block-size: 14px;
	border-radius: 50%;
	background-color: #ffffff;
	transform: translate(-50%, -50%);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	pointer-events: none;
}

[dir='rtl'] .qc-ppl-bar-knob {
	transform: translate(50%, -50%);
}

.qc-ppl-bar:focus-visible {
	outline: 2px solid var(--_ppl-focus);
	outline-offset: 3px;
}

/* ---- embed (AC-18: external podcast player, replaces the local transport) ---- */
.qc-ppl-embed {
	flex: 1 1 auto;
	min-inline-size: 0;
	block-size: 52px;
}

.qc-ppl-embed[hidden] {
	display: none;
}

.qc-ppl-embed-frame {
	inline-size: 100%;
	block-size: 100%;
	border: 0;
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.08);
}

/* embed mode: this controller has no transport over the iframe's content, so
   its own controls/progress/volume are hidden rather than left inert. */
.qc-ppl.is-embed .qc-ppl-controls,
.qc-ppl.is-embed .qc-ppl-progress-wrap,
.qc-ppl.is-embed .qc-ppl-vol {
	display: none;
}

/* ---- volume ----
   Slider stays on desktop; only the ≤991px mobile media query below hides
   it (matches Figma's mobile frame — desktop keeps the track). */
.qc-ppl-vol {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.qc-ppl-vol-range {
	inline-size: 88px;
	accent-color: #ffffff;
	cursor: pointer;
}

/* ---- spinner / error ---- */
.qc-ppl-spinner {
	inline-size: 18px;
	block-size: 18px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: var(--_ppl-ink);
	animation: qc-ppl-spin 0.7s linear infinite;
	flex: 0 0 auto;
}

@keyframes qc-ppl-spin {
	to {
		transform: rotate(360deg);
	}
}

.qc-ppl-error {
	font-size: 14px;
	color: #ffdada;
	flex: 0 1 auto;
}

.qc-ppl-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: var(--_ppl-muted);
	cursor: pointer;
	inline-size: 32px;
	block-size: 32px;
	border-radius: 50%;
	flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
	.qc-ppl-close:hover {
		color: var(--_ppl-ink);
		background-color: rgba(255, 255, 255, 0.14);
	}
}

.qc-ppl-close:focus-visible {
	outline: 2px solid var(--_ppl-focus);
	outline-offset: 2px;
}

/* ---- responsive ----
   Breakpoint matches the section's own mobile switch (991px) so the two
   players never disagree about what a given viewport is.

   Mobile is TWO rows, per the design:
     row 1  title .............................. close (X)
     row 2  back  play  fwd   0:10 / 0:35  [====----]  speaker

   That means no artwork and no eyebrow chip (row 1 is the title alone), and
   the transport, time, track and speaker all share row 2 — the volume SLIDER
   is the only thing dropped, not the mute button with it. */
@media (max-width: 991px) {
	.qc-ppl-inner {
		flex-wrap: wrap;
		gap: 14px 12px;
		padding-block: 16px;
		padding-inline: 16px;
	}

	/* row 1: the title grows to fill, which pushes everything after the close
	   button onto row 2. */
	.qc-ppl-meta {
		flex: 1 1 auto;
		order: 1;
	}

	.qc-ppl-thumb,
	.qc-ppl-eyebrow {
		display: none;
	}

	.qc-ppl-title {
		font-size: 18px;
		line-height: 26px;
	}

	.qc-ppl-close {
		order: 2;
		inline-size: 36px;
		block-size: 36px;
	}

	/* row 2 */
	.qc-ppl-controls {
		order: 3;
		flex: 0 0 auto;
		gap: 10px;
	}

	.qc-ppl-back,
	.qc-ppl-fwd {
		inline-size: 40px;
		block-size: 40px;
	}

	.qc-ppl-play {
		inline-size: 52px;
		block-size: 52px;
	}

	.qc-ppl-progress-wrap {
		order: 4;
		flex: 1 1 auto;
		min-inline-size: 0;
		gap: 10px;
	}

	.qc-ppl-vol {
		order: 5;
		display: flex;
	}

	/* speaker icon stays as the mute toggle; the slider is what does not fit */
	.qc-ppl-vol-range {
		display: none;
	}

	.qc-ppl-mute {
		inline-size: 36px;
		block-size: 36px;
	}
}

/* ---- ADO 152851: page reserve + floating mini-player ---- */

/* on the podcast pages the full bar is in flow-reserve: the page keeps bottom
   spacing equal to the bar's height (set from JS as --qc-ppl-h). */
body.qc-ppl-reserve {
	padding-block-end: var(--qc-ppl-h, 0px);
}

.qc-ppl-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: var(--_ppl-muted);
	cursor: pointer;
	inline-size: 32px;
	block-size: 32px;
	border-radius: 50%;
	flex: 0 0 auto;
}

.qc-ppl-toggle[hidden] {
	display: none;
}

.qc-ppl-toggle:focus-visible,
.qc-ppl-thumb:focus-visible {
	outline: 2px solid var(--_ppl-focus);
	outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
	.qc-ppl-toggle:hover {
		color: var(--_ppl-ink);
		background-color: rgba(255, 255, 255, 0.14);
	}
}

/* mini: a compact floating pill in the bottom corner. It sits beside the chat
   launcher (64px, 24px from the inline-end edge, 75px from the bottom), never
   on top of it. inset-inline-end follows the document direction, so it is
   bottom-right in English and bottom-left in Arabic. */
.qc-ppl.is-mini {
	inset-inline: auto;
	inset-inline-end: 100px;
	inset-block-end: 75px;
	inline-size: 300px;
	max-inline-size: calc(100vw - 32px);
	border-radius: 9999px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
	animation: none;
}

.qc-ppl.is-mini .qc-ppl-inner {
	gap: 10px;
	padding-block: 8px;
	padding-inline: 8px 8px;
	max-inline-size: none;
	margin: 0;
	flex-wrap: nowrap;
}

.qc-ppl.is-mini .qc-ppl-meta {
	flex: 0 0 auto;
	order: 0;
}

.qc-ppl.is-mini .qc-ppl-thumb {
	display: block;
	inline-size: 44px;
	block-size: 44px;
	border-radius: 50%;
	cursor: pointer;
}

.qc-ppl.is-mini .qc-ppl-text,
.qc-ppl.is-mini .qc-ppl-back,
.qc-ppl.is-mini .qc-ppl-fwd,
.qc-ppl.is-mini .qc-ppl-time,
.qc-ppl.is-mini .qc-ppl-vol,
.qc-ppl.is-mini .qc-ppl-embed {
	display: none;
}

.qc-ppl.is-mini .qc-ppl-controls {
	order: 1;
	gap: 0;
}

.qc-ppl.is-mini .qc-ppl-play {
	inline-size: 40px;
	block-size: 40px;
	box-shadow: none;
	background-color: rgba(255, 255, 255, 0.16);
}

.qc-ppl.is-mini .qc-ppl-progress-wrap {
	order: 2;
	flex: 1 1 auto;
	pointer-events: none;
}

.qc-ppl.is-mini .qc-ppl-bar {
	block-size: 6px;
}

.qc-ppl.is-mini .qc-ppl-bar-knob {
	display: none;
}

.qc-ppl.is-mini .qc-ppl-toggle {
	order: 3;
}

.qc-ppl.is-mini .qc-ppl-close {
	order: 4;
	inline-size: 32px;
	block-size: 32px;
}

/* an external embed cannot be driven from the mini bar: artwork + expand + X */
.qc-ppl.is-mini.is-embed .qc-ppl-progress-wrap {
	display: none;
}

.qc-ppl.is-mini.is-embed .qc-ppl-toggle {
	margin-inline-start: auto;
}

@media (max-width: 575px) {
	/* too narrow to sit beside the chat launcher: stack above it */
	.qc-ppl.is-mini {
		inset-inline-end: 16px;
		inset-block-end: 155px;
		inline-size: 280px;
	}
}

/* the full bar on a non-podcast page (expanded from the mini) keeps its
   usual width; the mobile two-row layout also applies. */
