/* Won't Walk – schwebende Podcast-Playbar */

/* Platz unten freihalten, solange die Bar offen ist (auch für Fokus, WCAG 2.4.11) */
html {
	scroll-padding-bottom: var(--ww-playbar-space, 0px);
}

body {
	padding-bottom: var(--ww-playbar-space, 0px);
}

/* Seite im Rahmen: eigene Bar ausblenden (die äußere spielt) */
.ww-in-shell .ww-playbar {
	display: none !important;
}

/* Äußeres Dokument im Rahmen-Modus */
html.ww-shell,
html.ww-shell body {
	height: 100%;
	overflow: hidden;
	padding-bottom: 0;
}

.ww-shell-frame.is-preparing {
	visibility: hidden;
	pointer-events: none;
}

/* Ladeanzeige beim Seitenwechsel im Rahmen */
html.ww-shell-loading::after {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100;
	width: 100%;
	height: 3px;
	background: var(--wp--preset--color--accent);
	transform-origin: left;
	animation: ww-shell-load 1.2s ease-out forwards;
}

@keyframes ww-shell-load {
	from { transform: scaleX(.05); }
	to { transform: scaleX(.85); }
}

@media (prefers-reduced-motion: reduce) {
	html.ww-shell-loading::after {
		animation: none;
		transform: scaleX(.6);
	}
}

.ww-shell-frame {
	position: fixed;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	border: 0;
	background: var(--wp--preset--color--black);
}

.ww-playbar {
	--ww-pb-lift: 0px;
	position: fixed;
	right: 0;
	bottom: var(--ww-pb-lift);
	left: 0;
	z-index: 90;
	pointer-events: none;
}

.ww-playbar[hidden] {
	display: none;
}

/* ---------------------------------------------------------------
   Volle Bar
   --------------------------------------------------------------- */
.ww-playbar__bar {
	position: relative;
	padding-bottom: env(safe-area-inset-bottom);
	border-top: 1px solid var(--wp--preset--color--line-strong);
	background: rgba(10, 15, 14, .96);
	box-shadow: 0 -8px 24px rgba(0, 0, 0, .45);
	pointer-events: auto;
}

@supports (backdrop-filter: blur(1px)) {
	.ww-playbar__bar {
		background: rgba(10, 15, 14, .86);
		backdrop-filter: blur(14px);
	}
}

.ww-playbar.is-collapsed .ww-playbar__bar {
	display: none;
}

.ww-playbar__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto auto;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
	max-width: 1360px;
	margin: 0 auto;
	padding: 10px var(--ww-gutter) 12px;
}

.ww-playbar__cover {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 6px;
	object-fit: cover;
	scale: 1;
}

.ww-playbar__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ww-playbar__kicker {
	color: var(--wp--preset--color--accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.ww-playbar__title {
	overflow: hidden;
	color: var(--wp--preset--color--white);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ww-playbar__title:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ww-playbar__note {
	color: var(--wp--preset--color--text-4);
	font-size: 12px;
	line-height: 1.3;
}

.ww-playbar.is-started .ww-playbar__note {
	display: none;
}

.ww-playbar__controls {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ww-playbar__btn,
.ww-playbar__play,
.ww-playbar__fab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	font: inherit;
	cursor: pointer;
}

.ww-playbar__btn {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--text-2);
	transition: color .2s ease, background-color .2s ease;
}

.ww-playbar__btn:hover {
	background: rgba(255, 255, 255, .08);
	color: var(--wp--preset--color--white);
}

.ww-playbar__play {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--black);
	transition: background-color .2s ease;
}

.ww-playbar__play:hover {
	background: var(--wp--preset--color--white);
}

.ww-playbar__icon-pause,
.ww-playbar.is-playing .ww-playbar__icon-play {
	display: none;
}

.ww-playbar.is-playing .ww-playbar__icon-pause,
.ww-playbar__icon-play {
	display: inline-flex;
}

/* Ton aus: kleiner, direkt links neben „Verkleinern“ */
/* Ton aus und Verkleinern als Paar (ohne Überlappung der Tippflächen) */
.ww-playbar__collapse {
	margin-left: -12px;
}

.ww-playbar__mute svg {
	width: 20px;
	height: 20px;
}

.ww-playbar__icon-muted,
.ww-playbar.is-muted .ww-playbar__icon-vol {
	display: none;
}

.ww-playbar__icon-vol,
.ww-playbar.is-muted .ww-playbar__icon-muted {
	display: inline-flex;
}

.ww-playbar.is-muted .ww-playbar__mute {
	color: var(--wp--preset--color--accent);
}

/* Fortschritt: Zeile über der Bar */
.ww-playbar__progress {
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	max-width: 1360px;
	margin: 0 auto;
	padding: 10px var(--ww-gutter) 0;
}

.ww-playbar__time {
	flex-shrink: 0;
	min-width: 44px;
	color: var(--wp--preset--color--text-3);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.ww-playbar__time:last-child {
	text-align: right;
}

.ww-playbar__range {
	--ww-pb-progress: 0%;
	flex: 1 1 auto;
	height: 24px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	appearance: none;
}

.ww-playbar__range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent) var(--ww-pb-progress), var(--wp--preset--color--line-strong) var(--ww-pb-progress));
}

.ww-playbar__range::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--wp--preset--color--accent) var(--ww-pb-progress), var(--wp--preset--color--line-strong) var(--ww-pb-progress));
}

.ww-playbar__range::-webkit-slider-thumb {
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	appearance: none;
}

.ww-playbar__range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
}

/* ---------------------------------------------------------------
   Kleiner Button rechts unten
   --------------------------------------------------------------- */
.ww-playbar__fab {
	position: absolute;
	right: max(20px, env(safe-area-inset-right));
	bottom: calc(20px + env(safe-area-inset-bottom));
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--wp--preset--color--surface-1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
	pointer-events: auto;
}

.ww-playbar:not(.is-collapsed) .ww-playbar__fab {
	display: none;
}

.ww-playbar__fab-cover {
	position: absolute;
	inset: 5px;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	object-fit: cover;
	scale: 1.03;
}

.ww-playbar__ring {
	position: absolute;
	inset: 0;
	width: 64px;
	height: 64px;
	transform: rotate(-90deg);
}

.ww-playbar__ring circle {
	fill: none;
	stroke: var(--wp--preset--color--accent);
	stroke-dasharray: 100;
	stroke-dashoffset: 100;
	stroke-linecap: round;
	stroke-width: 3;
}

.ww-playbar__fab-state {
	position: absolute;
	right: -2px;
	bottom: -2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 2px solid var(--wp--preset--color--black);
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--black);
}

.ww-playbar__fab:hover .ww-playbar__fab-state {
	background: var(--wp--preset--color--white);
}

/* ---------------------------------------------------------------
   Mobil
   --------------------------------------------------------------- */
@media (max-width: 760px) {
	.ww-playbar__progress {
		position: absolute;
		top: -1px;
		right: 0;
		left: 0;
		padding: 0;
	}

	.ww-playbar__progress .ww-playbar__time {
		display: none;
	}

	.ww-playbar__range {
		height: 16px;
		margin-top: -8px;
	}

	.ww-playbar__inner {
		grid-template-columns: auto minmax(0, 1fr) auto auto auto;
		gap: 4px;
		padding: 12px var(--ww-gutter) 10px;
	}

	.ww-playbar__cover {
		width: 44px;
		height: 44px;
	}

	.ww-playbar__title {
		font-size: 14px;
	}

	.ww-playbar__note {
		display: none;
	}

	.ww-playbar__skip {
		display: none;
	}

	.ww-playbar__collapse {
		margin-left: 0;
	}

	.ww-playbar__controls {
		gap: 0;
	}

	.ww-playbar__fab {
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom));
		width: 56px;
		height: 56px;
	}

	.ww-playbar__fab-cover {
		width: 46px;
		height: 46px;
	}

	.ww-playbar__ring {
		width: 56px;
		height: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ww-playbar__btn,
	.ww-playbar__play {
		transition: none;
	}
}
