/* ==========================================================================
   Downloads / Presskit
   ========================================================================== */

.downloads-section {
	padding-block: var(--section-py);
}

.main--downloads .downloads-section:first-of-type {
	padding-top: var(--sp-5);
}

.downloads-section + .downloads-section {
	padding-top: 0;
}

.downloads-section--alt {
	background: var(--color-bg-alt);
}

.downloads-section__intro {
	max-width: 720px;
	margin-inline: auto;
	margin-bottom: var(--sp-7);
	text-align: center;
}

.downloads-section__title {
	font-size: var(--fs-2xl);
	margin-bottom: var(--sp-3);
}

.downloads-section__lead {
	color: var(--color-text-muted);
}

.downloads-grid {
	display: grid;
	gap: var(--sp-4);
	grid-template-columns: 1fr;
	max-width: 880px;
	margin-inline: auto;
}

.downloads-by-project {
	display: flex;
	flex-direction: column;
	gap: var(--sp-7);
}

.project-downloads-block {
	border-top: 1px solid var(--color-border);
	padding-top: var(--sp-6);
}

.project-downloads-block__title {
	font-family: var(--font-display);
	font-size: var(--fs-xl);
	margin-bottom: var(--sp-5);
	display: flex;
	align-items: center;
	gap: var(--sp-3);
}

.project-downloads-block__title::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--color-border);
}

/* --- Downloads-Filter (Dropdown für „Nach Projekten") -------------------- */
/* Verwendet die gleichen filter-bar__*-Klassen wie die Termine-Seite, damit
   beide Seiten exakt dieselbe Optik haben (Pill-Form, Gold-Chevron, dunkle
   Surface). Hier nur Layout-Override: zentriert, breiter, einladender. */

.downloads-filter {
	display: flex;
	justify-content: center;
	margin: 0 auto var(--sp-7);
}

.downloads-filter .filter-bar__select-group {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-3);
	width: 100%;
	max-width: 480px;
}

.downloads-filter .filter-bar__select {
	min-width: 0;
	max-width: none;
	flex: 1;
}

/* Custom-Dropdown (filter-dropdown.js) — Toggle-Button füllt die Gruppe. */
.downloads-filter .filter-dropdown {
	flex: 1;
	min-width: 0;
}

.downloads-filter .filter-dropdown__toggle {
	width: 100%;
}

.downloads-grid__cell {
	min-width: 0;
}

.downloads-grid__cell[hidden] {
	display: none;
}

@media (max-width: 540px) {
	.downloads-filter .filter-bar__select-group {
		flex-direction: column;
		align-items: stretch;
		flex: 1 1 100%;
		gap: var(--sp-2);
	}
	.downloads-filter .filter-bar__select {
		min-width: 0;
	}
}

/* ==========================================================================
   Audio-Variante: eingebauter Mini-Player
   ========================================================================== */

.download-item--audio {
	display: block;
	padding: var(--sp-4) var(--sp-5);
	position: relative;
}

/* Kopfzeile: Play-Button | Info | Download-Icon */
.download-item__top {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	align-items: center;
	gap: var(--sp-4);
}

.download-item__play {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--color-accent);
	color: var(--color-bg);
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
	flex-shrink: 0;
}

.download-item__play svg { margin-left: 2px; }

.download-item__play:hover,
.download-item__play:focus-visible {
	background: var(--color-accent-soft);
	transform: scale(1.06);
	box-shadow: 0 0 0 6px rgba(200, 169, 110, 0.16);
	outline: none;
}

.download-item__play .icon-pause { display: none; }
.download-item--audio.is-playing .download-item__play .icon-play  { display: none; }
.download-item--audio.is-playing .download-item__play .icon-pause { display: block; }
.download-item--audio.is-playing .download-item__play svg { margin-left: 0; }

.download-item--audio.is-playing .download-item__play {
	animation: audio-pulse 2.2s ease-in-out infinite;
}

@keyframes audio-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0.35); }
	50%      { box-shadow: 0 0 0 8px rgba(200, 169, 110, 0); }
}

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

.download-item__title {
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: 500;
	color: var(--color-white);
	margin: 0;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.download-item__meta {
	font-family: var(--font-sans);
	font-size: var(--fs-xs);
	text-transform: uppercase;
	letter-spacing: var(--ls-wider);
	color: var(--color-text-muted);
	margin: 0;
}

.download-item__dl {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--color-text-muted);
	border: 1px solid var(--color-border);
	border-radius: 50%;
	transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
	text-decoration: none;
	flex-shrink: 0;
}

.download-item__dl:hover,
.download-item__dl:focus-visible {
	color: var(--color-accent);
	border-color: var(--color-accent);
	background: rgba(200, 169, 110, 0.1);
	transform: translateY(-1px);
	outline: none;
}

/* Player-Zeile: Progress | Time | Volume */
.download-item__player {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: var(--sp-4);
	margin-top: var(--sp-4);
	padding-left: 60px; /* Align with info column */
}

/* Progress-Bar */
.download-item__progress {
	position: relative;
	height: 3px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 2px;
	cursor: pointer;
	outline: none;
	transition: height var(--dur-fast) var(--ease);
}

.download-item__progress:hover,
.download-item__progress:focus-visible {
	height: 5px;
}

.download-item__progress-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: var(--color-accent);
	border-radius: 2px;
	transition: width 0.08s linear;
}

.download-item__progress-handle {
	position: absolute;
	top: 50%;
	left: 0;
	transform: translate(-50%, -50%);
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 0 0 2px var(--color-bg);
	transition: left 0.08s linear;
}

/* Zeit */
.download-item__time {
	font-family: var(--font-sans);
	font-size: var(--fs-xs);
	color: rgba(255, 255, 255, 0.72);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	letter-spacing: 0.03em;
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

.download-item__time-sep {
	opacity: 0.5;
}

/* Lautstärke */
.download-item__volume-wrap {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
}

.download-item__mute {
	width: 28px;
	height: 28px;
	border: none;
	background: transparent;
	color: var(--color-accent);
	cursor: pointer;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.download-item__mute:hover,
.download-item__mute:focus-visible {
	color: var(--color-accent-soft);
	background: rgba(200, 169, 110, 0.12);
	outline: none;
}

.download-item__mute .icon-mute { display: none; }
.download-item--audio.is-muted .download-item__mute .icon-vol  { display: none; }
.download-item--audio.is-muted .download-item__mute .icon-mute { display: block; }

.download-item__volume {
	position: relative;
	width: 70px;
	height: 3px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 2px;
	cursor: pointer;
	outline: none;
}

.download-item__volume:hover,
.download-item__volume:focus-visible {
	height: 5px;
}

.download-item__volume-fill {
	position: absolute;
	inset: 0 auto 0 0;
	height: 100%;
	width: 80%;
	background: var(--color-accent);
	border-radius: 2px;
}

.download-item__volume-handle {
	position: absolute;
	top: 50%;
	left: 80%;
	transform: translate(-50%, -50%);
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--color-accent);
	box-shadow: 0 0 0 2px var(--color-bg);
}

/* Beschreibungszeile */
.download-item--audio .download-item__desc {
	margin-top: var(--sp-3);
	padding-left: 60px;
	color: var(--color-text-muted);
	font-size: var(--fs-sm);
}

/* Responsive */
@media (max-width: 640px) {
	.download-item--audio {
		padding: var(--sp-4);
	}
	.download-item__player {
		padding-left: 0;
		grid-template-columns: 1fr;
		gap: var(--sp-3);
	}
	.download-item__volume-wrap {
		justify-content: space-between;
	}
	.download-item__volume {
		flex: 1;
	}
	.download-item--audio .download-item__desc {
		padding-left: 0;
	}
}
