/* EA Template Kit - Podcast widget.
 *
 * Every value is a custom property. Widget style controls set --eatk-pc-*; otherwise the kit's global colors
 * (--e-global-color-eatk*) and responsive tokens (--eatk-*) apply, then plain fallbacks.
 */

.eatk-podcast {
	--_accent: var(--eatk-pc-accent, var(--e-global-color-eatkbrand, #3d2b4f));
	--_title: var(--eatk-pc-title, var(--e-global-color-eatkink, #22182b));
	--_text: var(--eatk-pc-text, var(--e-global-color-eatkbody, #544a5c));
	--_muted: var(--eatk-pc-muted, color-mix(in srgb, var(--_text) 75%, transparent));
	--_card: var(--eatk-pc-card, var(--e-global-color-eatkwhite, #fff));
	--_border: var(--eatk-pc-border, var(--e-global-color-eatkline, #e5d8bf));
	--_button: var(--eatk-pc-button, var(--_accent));
	--_button-text: var(--eatk-pc-button-text, #fff);
	--_track: color-mix(in srgb, var(--_accent) 18%, transparent);
	--_gap: var(--eatk-pc-gap, var(--eatk-gap-md, 24px));
	--_cover: var(--eatk-pc-cover, 128px);
	--_radius: var(--eatk-pc-radius, var(--eatk-radius-md, 14px));
	--_pad: var(--eatk-pc-pad, clamp(16px, 2.4vw, 28px));
	--_columns: var(--eatk-pc-columns, 3);

	display: flex;
	flex-direction: column;
	gap: var(--_gap);
	color: var(--_text);
	font-size: var(--eatk-fs-body, 16px);
	line-height: 1.6;
	container-type: inline-size;
}

.eatk-podcast--dark {
	--_title: var(--eatk-pc-title, var(--e-global-color-eatkwhite, #fff));
	--_text: var(--eatk-pc-text, var(--e-global-color-eatkmuted, #d9cde2));
	--_card: var(--eatk-pc-card, rgba(255, 255, 255, 0.06));
	--_border: var(--eatk-pc-border, rgba(255, 255, 255, 0.16));
	--_accent: var(--eatk-pc-accent, var(--e-global-color-eatkaccent, #c9a15a));
	--_button-text: var(--eatk-pc-button-text, var(--e-global-color-eatkdark, #231a2c));
	--_track: rgba(255, 255, 255, 0.2);
}

.eatk-podcast *,
.eatk-podcast *::before,
.eatk-podcast *::after {
	box-sizing: border-box;
}

.eatk-podcast :where(ol, ul) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.eatk-podcast .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ Episodes */

.eatk-podcast__list {
	display: grid;
	gap: var(--_gap);
}

.eatk-episode__inner {
	display: flex;
	gap: clamp(14px, 2vw, 24px);
	align-items: flex-start;
	height: 100%;
	padding: var(--_pad);
	background: var(--_card);
	border: 1px solid var(--_border);
	border-radius: var(--_radius);
}

.eatk-podcast--shadow .eatk-episode__inner {
	border-color: transparent;
	box-shadow: 0 10px 30px -14px rgba(20, 10, 30, 0.28);
}

.eatk-podcast--filled .eatk-episode__inner {
	border-color: transparent;
	background: var(--eatk-pc-card, var(--e-global-color-eatksurface, #f6efe2));
}

.eatk-podcast--dark.eatk-podcast--filled .eatk-episode__inner {
	background: var(--eatk-pc-card, rgba(255, 255, 255, 0.08));
}

.eatk-podcast--plain .eatk-episode__inner {
	padding: 0 0 var(--_gap);
	background: none;
	border: 0;
	border-bottom: 1px solid var(--_border);
	border-radius: 0;
}

.eatk-podcast--plain .eatk-episode:last-child .eatk-episode__inner {
	border-bottom: 0;
	padding-bottom: 0;
}

.eatk-episode__cover {
	flex: 0 0 var(--_cover);
	width: var(--_cover);
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: calc(var(--_radius) * 0.7);
	background: var(--_track);
}

.eatk-episode__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.eatk-episode__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
}

.eatk-episode__meta {
	margin: 0;
	color: var(--_muted);
	font-size: var(--eatk-fs-small, 14px);
	letter-spacing: 0.02em;
}

.eatk-episode__label {
	color: var(--_accent);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.86em;
}

.eatk-episode__title {
	margin: 0;
	color: var(--_title);
	font-size: var(--eatk-fs-h3, 22px);
	line-height: 1.25;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.eatk-episode__title a {
	color: inherit;
	text-decoration: none;
}

.eatk-episode__title a:hover,
.eatk-episode__title a:focus-visible {
	color: var(--_accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.eatk-episode__text {
	color: var(--_text);
}

.eatk-episode__text > :first-child {
	margin-top: 0;
}

.eatk-episode__text > :last-child {
	margin-bottom: 0;
}

.eatk-episode__text a {
	color: var(--_accent);
}

.eatk-episode__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	align-items: center;
	margin-top: 4px;
}

.eatk-episode__more,
.eatk-episode__download {
	color: var(--_accent);
	font-weight: 600;
	font-size: var(--eatk-fs-small, 14px);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Featured layout: the newest episode spans the full width with a large cover. */
.eatk-podcast--featured .eatk-podcast__list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eatk-podcast--featured .eatk-episode--featured {
	grid-column: 1 / -1;
}

.eatk-podcast--featured .eatk-episode--featured .eatk-episode__inner {
	--_cover: var(--eatk-pc-cover, clamp(180px, 30%, 360px));
	align-items: center;
}

.eatk-podcast--featured .eatk-episode--featured .eatk-episode__title {
	font-size: var(--eatk-fs-h2, 34px);
}

.eatk-podcast--featured .eatk-podcast__offer-slot {
	grid-column: 1 / -1;
}

.eatk-podcast--featured .eatk-episode:not(.eatk-episode--featured) .eatk-episode__inner {
	--_cover: var(--eatk-pc-cover, 88px);
}

/* Grid layout: cover on top. */
.eatk-podcast--grid .eatk-podcast__list {
	grid-template-columns: repeat(var(--_columns), minmax(0, 1fr));
}

.eatk-podcast--grid .eatk-episode__inner {
	flex-direction: column;
}

.eatk-podcast--grid .eatk-episode__cover {
	flex-basis: auto;
	width: 100%;
}

/* Compact playlist: no covers or notes, one line per episode. */
.eatk-podcast--compact .eatk-podcast__list {
	gap: 0;
	border: 1px solid var(--_border);
	border-radius: var(--_radius);
	background: var(--_card);
	overflow: hidden;
}

.eatk-podcast--compact .eatk-episode + .eatk-episode {
	border-top: 1px solid var(--_border);
}

.eatk-podcast--compact .eatk-episode__inner {
	padding: 14px clamp(14px, 2vw, 22px);
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.eatk-podcast--compact .eatk-episode__cover,
.eatk-podcast--compact .eatk-episode__text {
	display: none;
}

.eatk-podcast--compact .eatk-episode__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(220px, 42%);
	align-items: center;
	gap: 6px 18px;
}

.eatk-podcast--compact .eatk-episode__meta,
.eatk-podcast--compact .eatk-episode__title {
	grid-column: 1;
}

.eatk-podcast--compact .eatk-episode__title {
	font-size: var(--eatk-fs-h4, 18px);
}

.eatk-podcast--compact .eatk-player {
	grid-column: 2;
	grid-row: 1 / span 2;
}

.eatk-podcast--compact .eatk-episode__actions {
	grid-column: 1 / -1;
}

/* ------------------------------------------------------------------ Player */

.eatk-player {
	width: 100%;
}

.eatk-player__audio {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 44px;
}

.eatk-player.is-enhanced .eatk-player__audio {
	display: none;
}

.eatk-player__ui {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
}

.eatk-player__ui[hidden] {
	display: none;
}

.eatk-podcast button.eatk-player__play,
.eatk-podcast button.eatk-player__skip,
.eatk-podcast button.eatk-player__rate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.eatk-podcast button.eatk-player__play {
	width: 48px;
	height: 48px;
	background: var(--_accent);
	color: var(--_button-text);
}

.eatk-podcast button.eatk-player__play:hover {
	transform: scale(1.05);
}

.eatk-player__play svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.eatk-player .eatk-i-pause,
.eatk-player.is-playing .eatk-i-play {
	display: none;
}

.eatk-player.is-playing .eatk-i-pause {
	display: block;
}

.eatk-podcast button.eatk-player__skip,
.eatk-podcast button.eatk-player__rate {
	min-width: 44px;
	height: 36px;
	padding: 0 8px;
	background: var(--_track);
	color: var(--_title);
	font-size: 13px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.eatk-podcast button.eatk-player__skip:hover,
.eatk-podcast button.eatk-player__rate:hover {
	background: color-mix(in srgb, var(--_accent) 30%, transparent);
}

.eatk-player__seek {
	--eatk-pc-progress: 0%;
	flex: 1 1 auto;
	min-width: 60px;
	height: 24px;
	margin: 0;
	background: transparent;
	accent-color: var(--_accent);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.eatk-player__seek::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: linear-gradient(to right, var(--_accent) var(--eatk-pc-progress), var(--_track) var(--eatk-pc-progress));
}

.eatk-player__seek::-webkit-slider-thumb {
	width: 16px;
	height: 16px;
	margin-top: -5px;
	border: 0;
	border-radius: 50%;
	background: var(--_accent);
	-webkit-appearance: none;
	appearance: none;
}

.eatk-player__seek::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: var(--_track);
}

.eatk-player__seek::-moz-range-progress {
	height: 6px;
	border-radius: 3px;
	background: var(--_accent);
}

.eatk-player__seek::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border: 0;
	border-radius: 50%;
	background: var(--_accent);
}

.eatk-player__time {
	flex: 0 0 auto;
	color: var(--_muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.eatk-player.has-error .eatk-player__ui {
	opacity: 0.55;
}

.eatk-podcast :is(button, a, input):focus-visible {
	outline: 2px solid var(--_accent);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ Purchase */

.eatk-podcast .eatk-buy {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: 999px;
	background: var(--_button);
	color: var(--_button-text);
	font-weight: 600;
	font-size: var(--eatk-fs-small, 15px);
	line-height: 1.2;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.eatk-podcast a.eatk-buy:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
	color: var(--_button-text);
}

.eatk-podcast .eatk-buy[aria-busy="true"] {
	cursor: progress;
	opacity: 0.8;
}

.eatk-buy__price {
	padding-left: 10px;
	border-left: 1px solid color-mix(in srgb, currentColor 40%, transparent);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.eatk-buy__compare {
	opacity: 0.7;
	font-weight: 400;
}

.eatk-podcast .eatk-buy.is-sold-out {
	background: transparent;
	color: var(--_muted);
	border: 1px solid var(--_border);
	cursor: not-allowed;
}

.eatk-podcast .eatk-buy--large {
	min-height: 52px;
	padding: 14px 26px;
	font-size: var(--eatk-fs-body, 16px);
}

/* ------------------------------------------------------------------ Offer */

.eatk-podcast__offer {
	display: flex;
	gap: clamp(18px, 3vw, 36px);
	align-items: center;
	padding: clamp(20px, 3vw, 40px);
	border-radius: var(--_radius);
	background: var(--eatk-pc-offer, var(--e-global-color-eatksurface, #f6efe2));
	border: 1px solid var(--_border);
}

.eatk-podcast--dark .eatk-podcast__offer {
	background: var(--eatk-pc-offer, rgba(255, 255, 255, 0.08));
}

.eatk-podcast--filled .eatk-podcast__offer {
	background: var(--eatk-pc-offer, color-mix(in srgb, var(--_accent) 8%, var(--e-global-color-eatksurface, #f6efe2)));
}

.eatk-offer__media {
	flex: 0 0 clamp(120px, 26%, 240px);
}

.eatk-offer__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--_radius) * 0.7);
}

.eatk-offer__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.eatk-offer__title {
	margin: 0;
	color: var(--_title);
	font-size: var(--eatk-fs-h3, 24px);
	line-height: 1.25;
}

.eatk-offer__text {
	margin: 0;
}

/* ------------------------------------------------------------------ Platforms */

.eatk-podcast__platforms {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
}

.eatk-podcast__platforms-label {
	color: var(--_muted);
	font-size: var(--eatk-fs-small, 14px);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.eatk-podcast__platforms ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.eatk-platform {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--_border);
	border-radius: 999px;
	color: var(--_title);
	font-size: var(--eatk-fs-small, 14px);
	font-weight: 600;
	text-decoration: none;
}

.eatk-platform:hover {
	border-color: var(--_accent);
	color: var(--_accent);
}

/* ------------------------------------------------------------------ Editor notices */

.eatk-podcast .eatk-editor-notice {
	margin: 0;
	padding: 8px 12px;
	border-left: 3px solid #d63638;
	background: #fcf0f1;
	color: #50575e;
	font-size: 13px;
	line-height: 1.4;
}

/* ------------------------------------------------------------------ Responsive (container queries) */

@container (max-width: 760px) {
	.eatk-podcast--featured .eatk-podcast__list {
		grid-template-columns: minmax(0, 1fr);
	}

	.eatk-podcast--featured .eatk-episode--featured .eatk-episode__inner,
	.eatk-podcast__offer {
		flex-direction: column;
		align-items: stretch;
	}

	.eatk-podcast--featured .eatk-episode--featured .eatk-episode__cover {
		width: 100%;
		flex-basis: auto;
	}

	.eatk-offer__media {
		flex-basis: auto;
		max-width: 260px;
	}

	.eatk-podcast--compact .eatk-episode__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.eatk-podcast--compact .eatk-player {
		grid-column: 1;
		grid-row: auto;
	}
}

@container (max-width: 520px) {
	.eatk-episode__inner {
		flex-direction: column;
	}

	.eatk-episode__cover {
		width: min(100%, var(--_cover) * 1.6);
		flex-basis: auto;
	}

	.eatk-podcast--list .eatk-episode__cover {
		width: 96px;
	}

	.eatk-podcast button.eatk-player__skip {
		display: none;
	}

	.eatk-podcast--grid .eatk-podcast__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.eatk-podcast *,
	.eatk-podcast *::before,
	.eatk-podcast *::after {
		transition: none !important;
	}
}

@media print {
	.eatk-player,
	.eatk-buy,
	.eatk-podcast__platforms {
		display: none !important;
	}
}
