/* The museum's own audio player. See museum_elmina_audio_player(). */

.me-player {
	display: flex;
	gap: 16px;
	align-items: stretch;
	margin: 0 0 16px;
	padding: 14px 16px;
	max-width: 640px;
	background: rgba(11, 17, 32, 0.72);
	border: 1px solid rgba(234, 179, 8, 0.22);
	border-radius: 10px;
	box-sizing: border-box;
}

.me-player-pic {
	flex: 0 0 84px;
	width: 84px;
	height: 84px;
	object-fit: cover;
	border-radius: 6px;
	align-self: center;
}

.me-player-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.me-player-top { display: flex; align-items: center; gap: 12px; }

.me-player-btn {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: #0B1120;
	background: #EAB308;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.45);
	transition: transform 0.15s ease, box-shadow 0.3s ease;
}
.me-player-btn:hover { transform: scale(1.06); }
.me-player-btn:focus-visible { outline: 2px solid #F8FAFC; outline-offset: 3px; }
.me-player.is-playing .me-player-btn { box-shadow: 0 0 0 6px rgba(234, 179, 8, 0.14); }
.me-player-icon--pause, .me-player.is-playing .me-player-icon--play { display: none; }
.me-player.is-playing .me-player-icon--pause { display: block; }
.me-player-icon--play { margin-left: 2px; }

.me-player-text { flex: 1; min-width: 0; }
/* Plain upright text, not the display serif: this line is a label to be read
   at a glance, next to the button. */
.me-player-title {
	margin: 0;
	font-family: Inter, system-ui, sans-serif;
	font-style: normal;
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.01em;
	line-height: 1.3;
	color: #EAB308;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.me-player-by {
	margin: 2px 0 0;
	font-family: Inter, system-ui, sans-serif;
	font-size: 0.66rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(248, 250, 252, 0.55);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.me-player-time {
	margin: 0;
	flex: 0 0 auto;
	font-family: Inter, system-ui, sans-serif;
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
	color: rgba(248, 250, 252, 0.6);
}

/* The waveform: the same picture twice, dim underneath and full gold on top,
   the top one revealed as far as the recording has played. */
.me-player-wave {
	position: relative;
	height: 44px;
	cursor: pointer;
	border-radius: 4px;
}
.me-player-wave:focus-visible { outline: 2px solid rgba(234, 179, 8, 0.6); outline-offset: 3px; }
.me-wave {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	user-select: none;
	pointer-events: none;
}
.me-wave--base { opacity: 0.28; }
.me-wave--fill { clip-path: inset(0 calc(100% - var(--me-p, 0%)) 0 0); }

/* A recording without a waveform gets a plain bar. */
.me-player-wave--plain { height: 22px; }
.me-bar { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; }
.me-bar--base { right: 0; background: rgba(234, 179, 8, 0.22); }
.me-bar--fill { width: var(--me-p, 0%); background: #EAB308; }

.me-player.is-unavailable { opacity: 0.55; }
.me-player.is-unavailable .me-player-btn { cursor: not-allowed; background: rgba(234, 179, 8, 0.4); }

@media (max-width: 520px) {
	.me-player { padding: 12px; gap: 12px; }
	.me-player-pic { flex-basis: 60px; width: 60px; height: 60px; }
	.me-player-wave { height: 36px; }
}
