/* ==========================================================================
   Peter Wächtler – Studio Writings (AudioCast)
   Only loaded on page-customPeterWaechtler.php. Mobile first.
   ========================================================================== */

/* Page chrome. The player (.pw-player) is outside #content and keeps its own colors. */

.footer-container,
.header,
#menu-icon,
.cc-window,
.cc-revoke {
	display: none !important;
}

/* #logo > a {
	opacity: 0;
	pointer-events: none;
} */

html,
body,
.header,
#content,
.hentry {
	--font-size-subtitle: 1.6rem;
	background-color: #000;
	color: #fff;
}

#main {
	margin-top: -2.2rem;
}

@media (max-width: 1023px) {
	#language-switcher {
		display: flex;
		margin-left: auto;
		position: absolute;
		top: 12px;
		right: 12px;
		z-index: 90;
	}
}

#language-switcher a,
#content,
#content a,
#content a:hover,
#content a:focus,
#content a:visited,
#content a:active {
	color: #fff !important;
}

#content a,
#content a:hover,
#content a:focus,
#content a:visited,
#content a:active {
	border-bottom-color: #fff !important;
}

.pw-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Overview list ---------- */

.text-wrapper .pw-list {
	list-style: none;
	padding: 0;
	margin: 3.5rem 0 0;
}

.text-wrapper .pw-list .pw-list__item {
	padding: 0;
	margin: 0 0 1.8rem;
}

.pw-teaser {
	display: flex;
	align-items: center;
	gap: 0.9em;
	min-width: 0;
	min-height: 44px;
	margin-top: 0 !important; /* theme sets button { margin-top: 30px !important } */
	padding: 0.2em 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.pw-teaser__thumb {
	flex: 0 0 auto;
	width: 3.4em;
	height: 3.4em;
	overflow: hidden;
	background-color: #ddd;
}

.pw-teaser__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	-o-object-fit: cover;
	object-fit: cover;
}

.pw-teaser:hover .pw-teaser__title,
.pw-teaser:focus-visible .pw-teaser__title {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

.pw-teaser:focus {
	outline: none;
}

.pw-teaser:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ---------- Supporter logos (below the footer text) ---------- */
/*
   Widths from the layout screenshot, scaled to this page's text size
   (the "Jo Pistorius …" line is 798px there and 529px here).
   Row 1: Hauptstadtkulturfonds, Haus am Waldsee Friends
   Row 2: The Berliner
   Row 3: Senatsverwaltung lockup, Kultur Steglitz-Zehlendorf
*/

.pw-supporters {
	margin-top: 1.8rem;
}

.pw-supporters__group + .pw-supporters__group {
	margin-top: 2.5rem;
}

.pw-supporters__label {
	font-size: 0.85em;
	margin-bottom: 1.2rem;
}

.text-wrapper .pw-supporters__logos {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.6rem 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.text-wrapper .pw-supporters__logos li {
	padding-left: 0;
}

.pw-supporters__logos img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
}

.pw-supporters__group:nth-child(1) .pw-supporters__logos li:nth-child(1) img {
	width: 49px;
}

.pw-supporters__group:nth-child(1) .pw-supporters__logos li:nth-child(2) img {
	width: 149px;
}

.pw-supporters__group:nth-child(2) .pw-supporters__logos li:nth-child(1) img {
	width: 120px;
}

.pw-supporters__group:nth-child(3) .pw-supporters__logos {
	gap: 1.6rem 9.1rem;
}

.pw-supporters__group:nth-child(3) .pw-supporters__logos li:nth-child(1) img {
	width: 510px;
}

.pw-supporters__group:nth-child(3) .pw-supporters__logos li:nth-child(2) img {
	width: 155px;
}

.logos-text {
	margin-top: 5rem;
}

/* ---------- Player (carousel) ---------- */

html.pw-lock,
html.pw-lock body {
	overflow: hidden;
	overscroll-behavior: none;
}

.pw-player {
	--slide-w: 100vw;
	--slide-h: 100%;
	--gap: 0px;
	--pw-focus: #fff;
	--pw-focus-ring: #000;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	overflow: hidden;
	background-color: #000;
	color: #fff;
	-webkit-tap-highlight-color: transparent;
	touch-action: pan-y;
}

.pw-player[hidden] {
	display: none;
}

.pw-player__track {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.pw-slide {
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--slide-w);
	height: var(--slide-h);
	margin-left: calc(var(--slide-w) / -2);
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	transform: translateX(calc(var(--o, 0) * (var(--slide-w) + var(--gap))));
	transition:
		transform 0.45s ease,
		opacity 0.45s ease,
		filter 0.45s ease;
}

.pw-slide.is-far {
	visibility: hidden;
}

.pw-slide.no-anim,
.pw-player.is-instant .pw-slide {
	transition: none;
}

.pw-slide:not(.is-active) > * {
	pointer-events: none;
}

.pw-slide:not(.is-active) {
	cursor: pointer;
}

/* blurred cover as background */
.pw-slide__bg {
	position: absolute;
	top: -15%;
	right: -15%;
	bottom: -15%;
	left: -15%;
	background-color: #333;
	background-position: center;
	background-size: cover;
	filter: blur(40px);
}

.pw-slide__bg.is-sharp {
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	filter: none;
}

.pw-slide__bg::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: rgba(0, 0, 0, 0.28);
}

.pw-slide__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
	padding: 3.5rem 1.75rem 2rem;
	box-sizing: border-box;
}

.pw-slide__cover {
	position: relative;
	width: min(68vw, 42vh);
	aspect-ratio: 1 / 1;
	margin: 0 0 2.75rem;
	background-color: rgba(0, 0, 0, 0.15);
}

.pw-slide__cover img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	-o-object-fit: cover;
	object-fit: cover;
}

/* Dark scrim so the title stays readable on light covers (WCAG 1.4.3). */
.pw-slide__cover::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 42%;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
	pointer-events: none;
	z-index: 1;
}

.pw-slide__title {
	position: absolute;
	top: 50%;
	right: 0.6em;
	left: 0.6em;
	z-index: 2;
	text-align: center;
	font-size: var(--font-size-subtitle);
	transform: translateY(-50%);
}

.pw-controls {
	width: 100%;
}

.pw-progress {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.pw-progress__range {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: linear-gradient(#fff, #fff) center / 100% 1px no-repeat;
	cursor: pointer;
}

.pw-progress__range::-webkit-slider-runnable-track {
	height: 44px;
	background: transparent;
}

.pw-progress__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 12px;
	height: 12px;
	margin-top: 16px; /* (44 - 12) / 2 */
	border: 0;
	border-radius: 50%;
	background: url("../images/peter-waechtler/ProgressDot.svg") center / contain no-repeat;
}

.pw-progress__range::-moz-range-track {
	height: 44px;
	background: transparent;
}

.pw-progress__range::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border: 0;
	border-radius: 50%;
	background: url("../images/peter-waechtler/ProgressDot.svg") center / contain no-repeat;
}

.pw-progress__range:focus {
	outline: none;
}

.pw-times {
	display: flex;
	justify-content: space-between;
	margin-top: 0.15rem;
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
}

.pw-buttons {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;
	margin-top: -2rem;
	margin-bottom: 1.5rem;
	margin-left: -1.8rem;
}

.pw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	width: 30px;
	height: 30px;
	min-width: 30px;
	min-height: 30px;
	margin-top: 0 !important;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	cursor: pointer;
	flex: 0 0 auto;
}

.pw-btn img {
	display: block;
	width: 14px;
	height: auto;
}

.pw-btn--play img {
	width: 15px;
	height: 18px;
	-o-object-fit: contain;
	object-fit: contain;
}

.pw-progress__mute img {
	width: 13px;
}

.pw-btn:focus,
.pw-progress__range:focus {
	outline: none;
}

/* Two-colour ring so the focus mark stays visible on light and dark covers. */
.pw-btn:focus-visible,
.pw-progress__range:focus-visible {
	outline: 2px solid var(--pw-focus, #fff);
	outline-offset: 3px;
	box-shadow: 0 0 0 5px var(--pw-focus-ring, #000);
}

.pw-slide__close {
	position: absolute;
	top: 0.35rem;
	right: 1.3rem;
	z-index: 2;
}

.pw-slide__close img {
	width: 14px;
}

.pw-subtitle {
	font-size: var(--font-size-subtitle);
	min-height: 2.6em;
	max-width: 22em;
	margin: 1.25rem auto 0;
	text-align: center;
	white-space: pre-line;
}

/* ---------- Tablet / desktop: carousel with dimmed neighbours ---------- */

@media (min-width: 768px) {
	#content {
		padding-top: 0 !important;
		margin: 0 !important;
	}
	#main {
		position: relative;
		margin-top: -1rem;
	}

	.pw-player {
		--slide-h: min(calc(100vh - 180px), 860px);
		--slide-w: calc(var(--slide-h) * 0.59);
		--gap: 3vw;
		top: 0;
		background-color: #000;
		color: #fff;
	}

	.pw-slide {
		top: 50%;
		transform: translateX(calc(var(--o, 0) * (var(--slide-w) + var(--gap)))) translateY(-50%);
	}

	.pw-slide:not(.is-active) {
		opacity: 0.5;
		filter: grayscale(1) brightness(1.6) contrast(0.85);
	}

	.pw-slide:not(.is-active) .pw-slide__close {
		visibility: hidden;
	}

	.pw-slide__inner {
		padding: 2.5rem 1.25rem 1.5rem;
	}

	.pw-slide__cover {
		width: 85%;
		margin-bottom: 18%;
	}

	.pw-slide__title {
		font-size: var(--font-size-subtitle);
	}

	.pw-progress {
		margin-bottom: -1rem;
	}

	.pw-progress__mute {
		margin-left: -2.2rem;
	}

	.pw-times {
		margin-top: 0;
		font-size: 0.85em;
	}

	.pw-buttons {
		gap: 0.35rem;
		margin-top: 0rem;
		margin-bottom: 1rem;
		margin-left: -1.7rem;
	}

	.pw-buttons .pw-btn {
		align-items: flex-start;
	}

	.pw-btn img {
		width: 16px;
	}

	.pw-btn--play img {
		width: calc(12px * 1.1);
		height: calc(15px * 1.1);
	}

	.pw-subtitle {
		min-height: 2.6em;
		margin-top: 0.75rem;
	}
}

@media (min-width: 1024px) {
	html,
	body,
	.header,
	#content,
	.hentry {
		--font-size-subtitle: 19px;
	}

	.pw-title h1,
	.text-wrapper-pw-readings,
	.pw-list {
		font-size: 24px;
	}

	.text-wrapper .pw-list {
		margin: 7rem 0 0;
	}

	.text-wrapper .pw-list .pw-list__item {
		margin-bottom: 25px;
	}

	.pw-teaser {
		gap: 25px;
	}

	.pw-teaser__thumb {
		width: 90px;
		height: 90px;
	}

	.pw-btn {
		width: 44px;
		height: 44px;
		min-width: 44px;
		min-height: 44px;
	}

	.pw-btn--prev img,
	.pw-btn--next img,
	.pw-btn--play img {
		width: 25px;
		height: 25px;
	}
}

@media (min-width: 1200px) {
	.pw-slide__title {
		font-size: var(--font-size-subtitle);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pw-slide {
		transition: none;
	}
}
