/**
 * 51wohnen — Article audio player.
 * Sits between the byline and the featured image on single-post.
 */

.art-audio {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 760px;
	margin: 22px auto 8px;
	padding: 12px 14px 12px 12px;
	background: var( --white );
	border: 1px solid var( --line );
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba( 63, 74, 61, 0.05 ), 0 6px 18px -10px rgba( 63, 74, 61, 0.18 );
	font-family: var( --sans );
	color: var( --ink-soft );
	position: relative;
}

.art-audio[hidden] { display: none; }

.art-audio-left { flex: 0 0 auto; }

.art-audio-play {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	background: var( --terracotta );
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.2s ease;
	box-shadow: 0 4px 14px -6px rgba( 196, 122, 90, 0.7 );
	position: relative;
}

.art-audio-play:hover {
	transform: scale( 1.04 );
	background: var( --terracotta-deep );
}

.art-audio-play:active { transform: scale( 0.96 ); }

.art-audio-play:focus-visible {
	outline: 2px solid var( --terracotta );
	outline-offset: 3px;
}

.art-audio-play .ico-play,
.art-audio-play .ico-pause,
.art-audio-play .ico-loading {
	position: absolute;
	inset: 0;
	margin: auto;
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.art-audio-play .ico-pause,
.art-audio-play .ico-loading { opacity: 0; transform: scale( 0.7 ); }

.art-audio[data-state="playing"] .ico-play { opacity: 0; transform: scale( 0.7 ); }
.art-audio[data-state="playing"] .ico-pause { opacity: 1; transform: scale( 1 ); }

.art-audio[data-state="paused"] .ico-play { opacity: 1; transform: scale( 1 ); }
.art-audio[data-state="paused"] .ico-pause { opacity: 0; }

.art-audio-middle {
	flex: 1 1 auto;
	min-width: 0;
}

.art-audio-label {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
	line-height: 1.2;
}

.art-audio-title {
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.01em;
	color: var( --olive-deep );
}

.art-audio-voice {
	font-size: 11.5px;
	color: var( --olive );
	letter-spacing: 0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 260px;
}

.art-audio-progress {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}

.art-audio-bar {
	flex: 1 1 auto;
	height: 4px;
	background: var( --line );
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.art-audio-bar span {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient( to right, var( --terracotta ), var( --sage ) );
	border-radius: 999px;
	transition: width 0.3s ease;
}

.art-audio-time {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	color: var( --olive );
	white-space: nowrap;
}

.art-audio-time-sep { opacity: 0.5; }

.art-audio-right {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.art-audio-speed,
.art-audio-stop {
	border: 1px solid var( --line );
	background: transparent;
	color: var( --olive-deep );
	border-radius: 10px;
	height: 34px;
	padding: 0 10px;
	min-width: 38px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.art-audio-speed:hover,
.art-audio-stop:hover {
	background: rgba( 196, 122, 90, 0.08 );
	border-color: rgba( 196, 122, 90, 0.45 );
	color: var( --terracotta );
}

.art-audio-stop {
	width: 34px;
	padding: 0;
}

.art-audio-speed:focus-visible,
.art-audio-stop:focus-visible {
	outline: 2px solid var( --terracotta );
	outline-offset: 2px;
}

.art-audio[data-state="playing"] .art-audio-play {
	animation: wohnen51-audio-pulse 2.2s ease-in-out infinite;
}

@keyframes wohnen51-audio-pulse {
	0%, 100% { box-shadow: 0 4px 14px -6px rgba( 196, 122, 90, 0.7 ), 0 0 0 0 rgba( 196, 122, 90, 0.45 ); }
	50%      { box-shadow: 0 4px 14px -6px rgba( 196, 122, 90, 0.7 ), 0 0 0 10px rgba( 196, 122, 90, 0 ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.art-audio[data-state="playing"] .art-audio-play { animation: none; }
	.art-audio-bar span { transition: none; }
	.art-audio-play, .art-audio-play .ico-play, .art-audio-play .ico-pause { transition: none; }
}

@media ( max-width: 620px ) {
	.art-audio {
		gap: 10px;
		padding: 10px 10px 10px 10px;
		border-radius: 10px;
		margin: 18px 0 6px;
	}
	.art-audio-play {
		width: 40px;
		height: 40px;
	}
	.art-audio-title { font-size: 13px; }
	.art-audio-voice { max-width: 140px; font-size: 11px; }
	.art-audio-speed,
	.art-audio-stop {
		height: 30px;
		font-size: 12px;
	}
	.art-audio-stop { width: 30px; }
	.art-audio-time { font-size: 11px; }
}

@media ( max-width: 420px ) {
	.art-audio-voice { display: none; }
}
