/**
 * Podcast post type styles.
 * Loaded only on podcast singles, the podcast archive and podcast taxonomy
 * archives. See macad_enqueue_podcast_styles() in functions.php.
 */

:root {
	--podcast-navy: rgb(28, 31, 69);
	--podcast-navy-light: rgb(52, 58, 118);
	--podcast-accent: rgb(46, 134, 171);
	--podcast-ink: rgb(34, 34, 34);
	--podcast-muted: rgb(110, 110, 120);
	--podcast-hairline: rgb(226, 230, 238);
}

/* ---------------------------------------------------------------- Hero --- */

/*
 * Every podcast view uses the same header as the legacy episode pages and the
 * /podcast hub: transparent, light, with header padding off (see
 * macad_podcast_header_settings()). With padding off the parent theme leaves the
 * header spacer at zero height, so the hero starts at the very top of the page
 * and runs under the header. Its vertical padding is taken from the legacy hero
 * row (.vc_custom_1590706613413: 22vh top, 14vh bottom), which is what keeps the
 * title clear of the menu at every viewport height, instead of a fixed height.
 */
.podcast-hero {
	position: relative;
	width: 100%;
	background-color: var(--podcast-navy);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	margin-bottom: 2rem;
}

/*
 * Client-chosen values. The flat 0.72 wash read as too dark next to the legacy
 * episode pages, which use this same photograph with no overlay at all. This
 * sits close to that original look: a 0.19 field with a soft 0.22 scrim behind
 * the words, about 0.37 effective coverage where the text sits.
 *
 * Measured against the actual hero artwork rather than a worst case, because
 * macad_podcast_hero_style() serves one fixed image to every episode: the
 * brightest 5% of the region behind the text lands near 3.1:1 for white, which
 * clears the 3:1 floor for the large title. The small genre link below it is
 * the marginal element on those patches. If the hero image is ever swapped via
 * the macad_podcast_hero_image filter, re-check these numbers against the new
 * artwork - a lighter photograph would need more scrim.
 */
.podcast-hero .hero-overlay {
	/* In flow, so the padding sets the hero's height and the wash covers all of it. */
	position: relative;
	padding: 22vh 0 14vh;
	background-color: rgba(28, 31, 69, 0.19);
	background-image: radial-gradient(
		ellipse 80% 70% at 50% 50%,
		rgba(28, 31, 69, 0.22) 0%,
		rgba(28, 31, 69, 0.07) 60%,
		rgba(28, 31, 69, 0) 100%
	);
	display: flex;
	align-items: center;
	justify-content: center;
}

.podcast-hero .hero-content {
	text-align: center;
	color: #fff;
	padding: 2rem;
	max-width: 860px;
	margin: 0 auto;
	/* Insurance for the brightest patches of an unpredictable hero photo. */
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.podcast-hero .podcast-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.8rem;
	margin: 0 0 0.75rem;
	opacity: 0.85;
}

.podcast-hero .main-podcast-title,
.podcast-hero .archive-title {
	font-size: 2.75rem;
	line-height: 1.15;
	margin: 0 0 1rem;
	color: #fff;
}

.podcast-hero .archive-subtitle {
	font-size: 1.15rem;
	margin: 0;
	opacity: 0.9;
}

.podcast-hero .podcast-genres {
	font-size: 1.1rem;
	margin-top: 1rem;
}

.podcast-hero .podcast-genres a {
	color: #fff;
	text-decoration: none;
	transition: opacity 0.2s;
}

.podcast-hero .podcast-genres a:hover {
	opacity: 0.75;
}

@media (max-width: 768px) {
	.podcast-hero .main-podcast-title,
	.podcast-hero .archive-title {
		font-size: 2rem;
	}

	.podcast-hero .archive-subtitle {
		font-size: 1rem;
	}
}

/* ------------------------------------------------------------- Archive --- */

/* Matches .class-single-container so podcast pages sit on the same measure
   as the rest of the site. */
.podcast-archive-container,
.podcast-single-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem;
}

@media (max-width: 600px) {
	.podcast-archive-container,
	.podcast-single-container {
		padding: 1.25rem 1rem 2rem;
	}
}

.podcast-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin-top: 2.5rem;
}

@media (min-width: 640px) {
	.podcast-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1000px) {
	.podcast-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.podcast-card {
	position: relative;
	height: 100%;
	background: #fff;
	border: 1px solid var(--podcast-hairline);
	border-radius: 16px;
	overflow: hidden;
	transition: box-shadow 0.2s, transform 0.2s;
}

.podcast-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
	transform: translateY(-2px);
}

.podcast-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.podcast-card-media {
	aspect-ratio: 16 / 9;
	background: var(--podcast-navy);
	overflow: hidden;
}

.podcast-card-media img,
.podcast-card-media-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.podcast-card-media-placeholder {
	background: linear-gradient(140deg, var(--podcast-navy) 0%, var(--podcast-navy-light) 100%);
}

.podcast-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem 1.1rem 1.25rem;
	flex: 1 1 auto;
}

.podcast-card-title {
	font-size: 1.1rem;
	line-height: 1.3;
	margin: 0;
	color: var(--podcast-ink);
}

.podcast-card-date {
	font-size: 0.85rem;
	color: var(--podcast-muted);
	margin: 0;
}

.podcast-card .listen-button {
	margin-top: auto;
	align-self: flex-start;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--podcast-accent);
}

.podcast-card-genre-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
}

.podcast-card-genre-badge-link {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--podcast-navy);
	font-size: 0.75rem;
	font-weight: 600;
	text-decoration: none;
}

.podcast-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--podcast-muted);
}

/* -------------------------------------------------------------- Single --- */

/* Show title and guest line, mirroring the centred heading block the legacy
   episode pages carried under the hero. */
.episode-showhead {
	text-align: center;
	margin: 0 0 2.5rem;
}

/* Sized to the original episode pages, which ran the show title at roughly
   60px. Heading elements so they inherit the theme's brand font and its
   -0.03em letter-spacing rather than falling back to body type. */
.episode-showhead .show-name {
	font-size: clamp( 2.1rem, 5vw, 3.75rem );
	line-height: 1.1;
	font-weight: 700;
	margin: 0;
}

.episode-showhead .episode-guest-line {
	font-size: clamp( 1.35rem, 2.6vw, 2rem );
	line-height: 1.25;
	font-weight: 600;
	margin: 0.5rem 0 0;
}

/* Main column plus the promo rail, 3/4 and 1/4 as in the original. */
.podcast-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	align-items: start;
}

@media (min-width: 1000px) {
	.podcast-layout {
		grid-template-columns: 3fr 1fr;
	}
}

.podcast-main {
	min-width: 0;
}

/* The player runs the full width of the content column. The headshot that used
   to sit beside it has moved down next to the guest bio. */
.episode-top {
	display: block;
}

.episode-primary {
	min-width: 0;
}

/* "Watch on YouTube" badge, directly under the player it belongs to. */
.episode-watch {
	margin: 1rem 0 0;
}

.episode-watch .platform-badge img {
	margin: 0;
}

/* Guest block: headshot beside the bio, stacking on narrow screens. */
.episode-guest {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	align-items: start;
	margin-top: 2rem;
}

@media (min-width: 600px) {
	.episode-guest.has-headshot {
		grid-template-columns: 170px 1fr;
	}
}

.episode-guest .guest-headshot img {
	width: 100%;
	max-width: 170px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid var(--podcast-navy);
	padding: 4px;
}

/* The bio heading leads the block, so it should not also push it down. */
.episode-guest .episode-guest-bio {
	margin-top: 0;
}

.episode-guest .episode-guest-bio h3:first-child {
	margin-top: 0;
}

.player-embed iframe {
	display: block;
	width: 100%;
	border: 0;
}

/* Providers send a fixed width and height. Once the width is forced to 100%
   that height is wrong, so each provider gets the shape it actually needs. */
.player-embed iframe[src*="youtube.com"],
.player-embed iframe[src*="youtube-nocookie.com"],
.player-embed iframe[src*="vimeo.com"] {
	aspect-ratio: 16 / 9;
	height: auto;
}

/* SoundCloud's compact waveform strip. */
.player-embed iframe[src*="soundcloud.com"] {
	height: 166px;
}

/* Spotify's episode player. */
.player-embed iframe[src*="spotify.com"] {
	height: 232px;
}

/* Platform badges are the site's own artwork, as on the legacy pages. */
.platform-badge {
	display: block;
	text-decoration: none;
	line-height: 0;
	transition: opacity 0.2s;
}

.platform-badge:hover {
	opacity: 0.82;
}

.platform-badge img {
	display: block;
	width: 100%;
	max-width: 180px;
	height: auto;
	margin: 0 auto;
}

.episode-show-notes,
.episode-body,
.episode-guest-bio {
	font-size: 1.1em;
	line-height: 1.7;
	margin-top: 1.5rem;
}

.episode-show-notes p,
.episode-body p,
.episode-guest-bio p,
.episode-featured li {
	margin-bottom: 1rem;
}

.episode-primary h3,
.episode-featured h3 {
	font-size: 1.3rem;
	margin: 1.75rem 0 0.75rem;
	color: var(--podcast-navy);
}

/* Chapter markers. Rendered as plain text unless podcast.js confirms the
   embedded player can actually be seeked. */
.episode-timestamps {
	margin-top: 2rem;
}

.timestamp-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.timestamp-list li {
	display: flex;
	gap: 0.65rem;
	align-items: baseline;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--podcast-hairline);
}

.timestamp-list li:last-child {
	border-bottom: 0;
}

.timestamp-list .timestamp {
	flex: 0 0 auto;
	font-family: monospace;
	font-size: 0.85em;
	color: var(--podcast-accent);
	background: rgb(240, 244, 248);
	border: 1px solid rgb(208, 220, 232);
	border-radius: 3px;
	padding: 2px 7px;
	/* Overrides the global .timestamp rule that the classes work adds. */
	cursor: default;
	transition: background 0.2s;
}

.episode-player.is-seekable .timestamp-list .timestamp,
.is-seekable .timestamp-list .timestamp {
	cursor: pointer;
}

.is-seekable .timestamp-list .timestamp:hover,
.is-seekable .timestamp-list .timestamp:focus-visible {
	background: rgb(208, 234, 247);
	text-decoration: underline;
}

.timestamp-list .timestamp-label {
	line-height: 1.4;
}

/* The grey "Featured On the Show" panel from the legacy pages. */
.episode-featured {
	background: #dddddd;
	padding: 1.25rem 1.75rem 1.5rem;
	margin: 2.5rem 0;
}

.episode-featured h3 {
	margin-top: 0.5rem;
}

.episode-featured ul {
	margin: 0;
	padding-left: 1.25rem;
}

/* Standing show description with the subscribe badges beside it. */
.episode-footer {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	align-items: start;
	margin-top: 2rem;
}

@media (min-width: 700px) {
	.episode-footer {
		grid-template-columns: 3fr 1fr;
	}
}

.episode-footer .show-blurb {
	line-height: 1.7;
}

.platform-badges {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: center;
}

/* Promo rail down the right hand side. */
.podcast-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.podcast-promo img {
	display: block;
	width: 100%;
	height: auto;
}

@media (max-width: 999px) {
	.podcast-sidebar {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
	}

	.podcast-promo {
		flex: 0 1 220px;
	}
}

.episode-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 2.5rem;
}

.episode-tag-chip {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgb(240, 244, 248);
	color: var(--podcast-navy);
	font-size: 0.8rem;
	text-decoration: none;
}

/* Legacy WPBakery episodes keep their original layout, so only the wrapper
   needs neutralising. */
.podcast-single-container.legacy-layout {
	max-width: 100%;
	padding: 0;
}

/* --------------------------------------------------- Back / more block --- */

.podcast-library-button-wrapper {
	text-align: center;
	margin: 3rem 0 1rem;
}

.podcast-library-button {
	display: inline-block;
	padding: 0.75rem 1.75rem;
	border-radius: 999px;
	background: var(--podcast-navy);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	transition: background 0.2s;
}

.podcast-library-button:hover {
	background: var(--podcast-navy-light);
	color: #fff;
}

.more-episodes-wrapper {
	background: rgb(248, 249, 252);
	padding: 2.5rem 1em 3rem;
}

.more-episodes-section {
	max-width: 1200px;
	margin: 0 auto;
}

.more-episodes-section h2 {
	text-align: center;
	margin: 0;
}
