/*
 * TWL Episodes: styles for the Episodes page and single episodes.
 * Colours and fonts come from the theme's presets (camilla-theme), with the
 * design's values as fallbacks. Mobile first.
 */

:root {
	--twl-green: var(--wp--preset--color--base, #0f3026);
	--twl-green-deep: var(--wp--preset--color--contrast, #0a231c);
	--twl-ivory: var(--wp--preset--color--accent-1, #f2ebdd);
	--twl-ivory-light: var(--wp--preset--color--accent-2, #fbf7ef);
	--twl-burgundy: var(--wp--preset--color--accent-3, #4b1425);
	--twl-brown: var(--wp--preset--color--accent-4, #30221d);
	--twl-gold: var(--wp--preset--color--accent-5, #d5b77d);
	--twl-muted: var(--wp--preset--color--accent-6, #6b5a50);
	--twl-muted-on-green: var(--wp--preset--color--custom-color-1, #c9c2b2);
	--twl-serif: var(--wp--preset--font-family--bodoni-moda, "Bodoni Moda", Didot, Georgia, serif);
	--twl-sans: var(--wp--preset--font-family--poppins, Poppins, system-ui, sans-serif);
	--twl-gutter: clamp(20px, 4.5vw, 64px);
	--twl-line-gold: rgba(213, 183, 125, 0.35);
}

.twl-episodes {
	background: var(--twl-ivory);
	color: var(--twl-brown);
	font-family: var(--twl-sans);
	overflow-x: clip;
}

.twl-episodes *,
.twl-episodes *::before,
.twl-episodes *::after {
	box-sizing: border-box;
}

.twl-episodes [hidden] {
	display: none !important;
}

.twl-episodes a {
	text-decoration: none;
}

.twl-episodes .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.twl-episodes :focus-visible {
	outline: 2px solid var(--twl-gold);
	outline-offset: 3px;
}

.twl-icon {
	width: 0.75em;
	height: 0.9em;
	fill: currentColor;
	flex: none;
}

/* Layout wrapper ------------------------------------------------------- */

.twl-episodes .twl-wrap {
	width: 100%;
	max-width: 1440px;
	margin-inline: auto;
	padding-inline: var(--twl-gutter);
}

.twl-episodes > * + * {
	margin-block-start: 0;
}

/* Green band (page title + feature) ------------------------------------ */

.twl-episodes .twl-band {
	background: var(--twl-green);
	color: var(--twl-ivory);
	padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px);
	margin: 0;
}

.twl-episodes .twl-band--single {
	padding-block-start: clamp(24px, 4vw, 56px);
}

.twl-episodes .twl-band__head {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-block-end: clamp(28px, 4vw, 48px);
}

.twl-episodes .twl-eyebrow {
	margin: 0;
	font-size: 11px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--twl-gold);
}

/* Hide "The Women's Lawyer — The Podcast" above the page title on phones. */
@media (max-width: 599px) {
	.twl-episodes .twl-eyebrow {
		display: none;
	}
}

.twl-episodes .twl-band__title {
	margin: 0;
	font-family: var(--twl-serif);
	font-weight: 400;
	font-size: clamp(44px, 7vw, 96px);
	line-height: 1;
	letter-spacing: -0.015em;
	color: var(--twl-ivory);
}

/* Feature panel ------------------------------------------------------- */

.twl-feature {
	display: flex;
	flex-wrap: wrap;
	background: var(--twl-green-deep);
	border: 1px solid var(--twl-line-gold);
	color: var(--twl-ivory);
}

.twl-feature__media {
	position: relative;
	flex: 1 1 320px;
	max-width: 100%;
	aspect-ratio: 1 / 1;
	background: #000;
	overflow: hidden;
}

@media (min-width: 900px) {
	.twl-feature__media {
		max-width: 560px;
	}
}

.twl-feature__panel,
.twl-video,
.twl-cover {
	position: absolute;
	inset: 0;
}

.twl-feature__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 25%;
	display: block;
}

.twl-video__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(10, 35, 28, 0) 50%, rgba(10, 35, 28, 0.85) 100%);
	pointer-events: none;
}

.twl-video__play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background: rgba(242, 235, 221, 0.92);
	color: var(--twl-burgundy);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.twl-video__play .twl-icon {
	width: 24px;
	height: 28px;
	margin-left: 6px;
}

.twl-video__play:hover {
	transform: translate(-50%, -50%) scale(1.06);
	background: var(--twl-ivory);
}

.twl-video__bar {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--twl-ivory);
	pointer-events: none;
}

.twl-video__time {
	background: rgba(10, 35, 28, 0.8);
	padding: 6px 10px;
	letter-spacing: 0.08em;
}

/* Once playing, the YouTube player fills the square, centred at 16:9. */
.twl-video.is-playing {
	display: flex;
	align-items: center;
	background: #000;
}

.twl-video.is-playing video {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	display: block;
}

.twl-video.is-playing iframe {
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
	display: block;
}

.twl-tag {
	position: absolute;
	left: 16px;
	top: 16px;
	background: var(--twl-burgundy);
	color: var(--twl-ivory);
	font-size: 10px;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	padding: 8px 12px;
	pointer-events: none;
}

.twl-video.is-playing ~ .twl-tag,
.twl-feature__media:has(.is-playing) .twl-tag {
	display: none;
}

.twl-feature__body {
	flex: 1 1 360px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 36px;
	padding: clamp(24px, 4vw, 56px);
}

.twl-feature__text {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.twl-feature__back {
	align-self: flex-start;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--twl-muted-on-green);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-block: -12px -8px;
}

.twl-feature__back:hover {
	color: var(--twl-gold);
}

.twl-feature__meta {
	margin: 0;
	font-size: 11px;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--twl-gold);
}

.twl-episodes .twl-feature__title {
	margin: 0;
	font-family: var(--twl-serif);
	font-weight: 400;
	font-size: clamp(30px, 3.6vw, 48px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-wrap: pretty;
	color: var(--twl-ivory);
}

.twl-feature__title a {
	color: inherit;
}

.twl-feature__title a:hover {
	color: var(--twl-gold);
}

.twl-feature__desc {
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
	color: #d9d2c2;
	max-width: 620px;
}

.twl-feature__date {
	margin: 0;
	font-size: 13px;
	color: var(--twl-muted-on-green);
}

.twl-feature__controls {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.twl-feature__more {
	align-self: flex-start;
	font-size: 11px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--twl-ivory);
	border-bottom: 1px solid var(--twl-gold);
	padding-block: 12px 4px;
}

.twl-feature__more:hover {
	color: var(--twl-gold);
}

/* Video / Audio switch */
.twl-switch {
	display: flex;
	align-self: flex-start;
	border: 1px solid rgba(213, 183, 125, 0.5);
}

.twl-switch__btn {
	font-family: var(--twl-sans);
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	padding: 12px 22px;
	min-height: 44px;
	cursor: pointer;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--twl-ivory);
}

.twl-switch__btn[aria-pressed="true"] {
	background: var(--twl-gold);
	color: var(--twl-green-deep);
}

.twl-switch__btn:not([aria-pressed="true"]):hover {
	color: var(--twl-gold);
}

/* Buttons */
.twl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.twl-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 16px 26px;
	min-height: 44px;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 500;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.twl-btn--light {
	background: var(--twl-ivory);
	color: var(--twl-green);
}

.twl-btn--light .twl-icon {
	color: var(--twl-burgundy);
}

.twl-btn--light:hover {
	background: var(--twl-gold);
	color: var(--twl-green-deep);
}

.twl-btn--outline {
	border: 1px solid rgba(242, 235, 221, 0.5);
	color: var(--twl-ivory);
	font-weight: 400;
}

.twl-btn--outline:hover {
	border-color: var(--twl-gold);
	color: var(--twl-gold);
}

/* Audio player */
.twl-listen {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.twl-player {
	display: flex;
	align-items: center;
	gap: 18px;
}

.twl-player audio {
	width: 100%;
}

.twl-player:not(.is-enhanced) > :not(audio) {
	display: none;
}

.twl-player.is-enhanced audio {
	display: none;
}

.twl-player__toggle {
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	cursor: pointer;
	background: var(--twl-ivory);
	color: var(--twl-burgundy);
	display: flex;
	align-items: center;
	justify-content: center;
}

.twl-player__toggle:hover {
	background: var(--twl-gold);
}

.twl-player__toggle .twl-icon {
	width: 16px;
	height: 20px;
}

.twl-player__icon-play .twl-icon {
	margin-left: 4px;
}

.twl-player__icon-pause,
.twl-player.is-playing .twl-player__icon-play {
	display: none;
}

.twl-player.is-playing .twl-player__icon-pause {
	display: flex;
}

.twl-player__icon-play {
	display: flex;
}

.twl-player__seek {
	flex: 1;
	min-width: 60px;
	height: 24px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	--twl-progress: 0%;
}

.twl-player__seek::-webkit-slider-runnable-track {
	height: 2px;
	background: linear-gradient(to right, var(--twl-gold) var(--twl-progress), rgba(242, 235, 221, 0.25) var(--twl-progress));
}

.twl-player__seek::-moz-range-track {
	height: 2px;
	background: rgba(242, 235, 221, 0.25);
}

.twl-player__seek::-moz-range-progress {
	height: 2px;
	background: var(--twl-gold);
}

.twl-player__seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 12px;
	height: 12px;
	margin-top: -5px;
	border-radius: 50%;
	background: var(--twl-gold);
	border: 0;
}

.twl-player__seek::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--twl-gold);
	border: 0;
}

.twl-player__time {
	font-size: 13px;
	color: var(--twl-muted-on-green);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.twl-spotify iframe {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 12px;
}

.twl-listen__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 22px;
	margin: 0;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.twl-listen__links span:first-child {
	color: var(--twl-muted-on-green);
}

.twl-listen__links a {
	color: var(--twl-ivory);
	border-bottom: 1px solid var(--twl-gold);
	padding-block: 12px 2px;
}

.twl-listen__links a:hover {
	color: var(--twl-gold);
}

/* Episode list -------------------------------------------------------- */

.twl-episodes .twl-list {
	padding-block: clamp(48px, 7vw, 96px) clamp(64px, 8vw, 120px);
	display: flex;
	flex-direction: column;
	gap: clamp(28px, 4vw, 48px);
}

.twl-episodes .twl-list > * {
	margin: 0;
}

.twl-list__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 24px;
}

.twl-list__head > * {
	margin: 0;
	max-width: 100%;
}

.twl-episodes .twl-section-title {
	margin: 0;
	font-family: var(--twl-serif);
	font-weight: 400;
	font-size: clamp(34px, 4.4vw, 56px);
	line-height: 1;
	color: var(--twl-brown);
}

.twl-episodes .twl-section-title--small {
	font-size: clamp(28px, 3vw, 40px);
}

/* Filters: scroll sideways on small screens rather than wrapping */
.twl-filter-rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 100%;
}

.twl-filters ul {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0 0 2px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.twl-filters li {
	flex: none;
	margin: 0;
}

.twl-pill {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 12px 18px;
	border: 1px solid var(--twl-green);
	color: var(--twl-green);
	font-size: 11px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.twl-pill:hover {
	background: rgba(15, 48, 38, 0.08);
	color: var(--twl-green);
}

.twl-pill.is-active {
	background: var(--twl-green);
	color: var(--twl-ivory);
}

/* Grid */
.twl-episodes .twl-query {
	margin: 0;
}

.twl-episodes .twl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: clamp(14px, 2vw, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.twl-episodes .twl-grid > li {
	margin: 0;
	display: flex;
}

.twl-card {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: clamp(24px, 2.6vw, 36px);
	min-height: 220px;
	background: var(--twl-ivory-light);
	border: 1px solid rgba(48, 34, 29, 0.12);
	color: var(--twl-brown);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.twl-card:hover {
	border-color: rgba(48, 34, 29, 0.3);
	box-shadow: 0 6px 24px rgba(48, 34, 29, 0.08);
}

.twl-card__top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--twl-muted);
}

.twl-card__num {
	font-family: var(--twl-serif);
	font-style: italic;
	font-size: 38px;
	line-height: 1;
	letter-spacing: 0;
	color: var(--twl-burgundy);
}

.twl-card__info {
	text-align: right;
}

.twl-episodes .twl-card__title {
	margin: 0;
	font-family: var(--twl-serif);
	font-weight: 400;
	font-size: 23px;
	line-height: 1.25;
	letter-spacing: -0.01em;
	text-wrap: pretty;
}

.twl-card__title a {
	color: var(--twl-brown);
}

/* Whole card is clickable; the Watch/Listen buttons sit above that link. */
.twl-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.twl-card:hover .twl-card__title a {
	color: var(--twl-burgundy);
}

.twl-card__desc {
	margin: 0;
	flex: 1;
	font-size: 14px;
	line-height: 1.6;
	color: var(--twl-muted);
}

.twl-card__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid rgba(48, 34, 29, 0.1);
	font-size: 12px;
	color: var(--twl-muted);
}

.twl-card__actions {
	position: relative;
	z-index: 1;
	display: flex;
	gap: 8px;
}

.twl-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--twl-green);
	color: var(--twl-green);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.twl-chip .twl-icon {
	color: var(--twl-burgundy);
	width: 10px;
	height: 10px;
}

.twl-chip:hover {
	background: rgba(15, 48, 38, 0.08);
	color: var(--twl-green);
}

.twl-chip--solid {
	background: var(--twl-green);
	color: var(--twl-ivory);
}

.twl-chip--solid .twl-icon {
	color: var(--twl-gold);
	width: 8px;
}

.twl-chip--solid:hover {
	background: var(--twl-green-deep);
	color: var(--twl-ivory);
}

/* Pagination styled like the design's "Load more episodes" */
.twl-episodes .twl-pagination {
	margin-block-start: clamp(28px, 4vw, 48px);
	gap: 12px;
}

.twl-episodes .twl-pagination a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 18px 40px;
	border: 1px solid var(--twl-green);
	color: var(--twl-green);
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.twl-episodes .twl-pagination a:hover {
	background: var(--twl-green);
	color: var(--twl-ivory);
}

.twl-episodes .twl-empty {
	margin: 0;
	color: var(--twl-muted);
}

/* Single episode: show notes + transcript ------------------------------ */

.twl-episodes .twl-notes {
	max-width: calc(760px + 2 * var(--twl-gutter));
	padding-block: clamp(48px, 7vw, 96px) 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.twl-episodes .twl-notes > * {
	margin: 0;
}

.twl-notes__content {
	font-size: 16px;
	line-height: 1.75;
}

.twl-notes__content > * + * {
	margin-block-start: 1em;
}

.twl-notes__content a {
	color: var(--twl-burgundy);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.twl-transcript {
	border-top: 1px solid rgba(48, 34, 29, 0.15);
	border-bottom: 1px solid rgba(48, 34, 29, 0.15);
}

.twl-transcript summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 56px;
	cursor: pointer;
	list-style: none;
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--twl-green);
}

.twl-transcript summary::-webkit-details-marker {
	display: none;
}

.twl-transcript summary::after {
	content: "+";
	font-size: 22px;
	line-height: 1;
	color: var(--twl-burgundy);
}

.twl-transcript[open] summary::after {
	content: "–";
}

.twl-transcript__body {
	padding-block: 8px 28px;
	font-size: 15px;
	line-height: 1.75;
	max-height: 70vh;
	overflow-y: auto;
}

.twl-episodes .twl-disclaimer {
	font-size: 13px;
	line-height: 1.6;
	color: var(--twl-muted);
}

.twl-episodes .twl-list--more {
	padding-block-start: clamp(48px, 6vw, 80px);
}

/* Call to action band ------------------------------------------------- */

.twl-episodes .twl-cta {
	background: var(--twl-green);
	color: var(--twl-ivory);
	padding-block: clamp(56px, 7vw, 96px);
	margin: 0;
}

.twl-episodes .twl-cta__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 32px 64px;
}

.twl-episodes .twl-cta__text {
	flex: 1 1 420px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.twl-episodes .twl-cta__text > * {
	margin: 0;
}

.twl-episodes .twl-cta__title {
	font-family: var(--twl-serif);
	font-weight: 400;
	font-size: clamp(32px, 4vw, 52px);
	line-height: 1.1;
	color: var(--twl-ivory);
}

.twl-episodes .twl-cta__areas {
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	line-height: 1.7;
	color: var(--twl-muted-on-green);
}

.twl-episodes .twl-cta__buttons {
	margin: 0;
}

.twl-episodes .twl-cta__button .wp-block-button__link {
	padding: 22px 40px;
	border-radius: 0;
	background: var(--twl-ivory);
	color: var(--twl-green);
	font-family: var(--twl-sans);
	font-size: 13px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 500;
}

.twl-episodes .twl-cta__button .wp-block-button__link:hover {
	background: var(--twl-gold);
	color: var(--twl-green-deep);
}

/* Small screens ------------------------------------------------------- */

@media (max-width: 600px) {
	.twl-video__play {
		width: 72px;
		height: 72px;
	}

	.twl-actions .twl-btn {
		flex: 1 1 100%;
		justify-content: center;
	}

	.twl-player__toggle {
		width: 56px;
		height: 56px;
	}

	.twl-card__num {
		font-size: 32px;
	}

	.twl-card__title {
		font-size: 21px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.twl-episodes * {
		transition: none !important;
	}
}

/* Homepage "Latest episodes" block ---------------------------------------- */
.twl-home {
	padding-block-end: clamp(40px, 6vw, 72px);
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 2vw, 24px);
}

.twl-home > * {
	margin: 0;
}

.twl-home .twl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: clamp(14px, 2vw, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.twl-home .twl-grid > li {
	margin: 0;
	display: flex;
}

.twl-home__all {
	text-align: right;
	font-size: 13px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.twl-home__all a {
	color: var(--twl-burgundy);
	text-decoration: none;
	border-bottom: 1px solid var(--twl-gold);
	padding-block: 12px 2px;
}
