/* TTFN Podcasts — shows carousel, show panel, season tabs, episode list.
 * Copyright (c) 2026 TTFN TV Limited. All rights reserved.
 * Everything is scoped to .bbcpod so the tagDiv Newspaper theme's own rules for
 * lists, headings and buttons can't leak in, and nothing here leaks out. Fonts are
 * inherited from the page. */

.bbcpod {
	--bbcpod-accent: #1e73be;        /* the site's theme colour */
	--bbcpod-accent-dark: #005db6;
	--bbcpod-ink: #16181d;
	--bbcpod-muted: #5d6470;
	--bbcpod-line: #e2e5ea;
	--bbcpod-soft: #f3f5f8;
	--bbcpod-new: #febe2b;
	--bbcpod-radius: 10px;
	--bbcpod-gap: 16px;
	--bbcpod-visible: 5;             /* tiles across in the carousel */
	--bbcpod-cols: 5;                /* tiles across in the grid: never more than 5 */

	color: var(--bbcpod-ink);
	font-size: 16px;
	line-height: 1.5;
	margin: 0 0 40px;
	position: relative;
	/* The shows' layout follows the width the page gives the block, not the
	 * screen's: a theme's content column can be narrow on a wide screen. */
	container: bbcpod / inline-size;
}

.bbcpod *, .bbcpod *::before, .bbcpod *::after { box-sizing: border-box; }
.bbcpod ul, .bbcpod ol { list-style: none; margin: 0; padding: 0; }
.bbcpod li { margin: 0; padding: 0; }
.bbcpod li::before, .bbcpod li::marker { content: none; }
.bbcpod h2, .bbcpod h3, .bbcpod h4, .bbcpod p { margin: 0; padding: 0; }
.bbcpod img { display: block; max-width: 100%; height: auto; border: 0; }
.bbcpod a { text-decoration: none; }
.bbcpod button {
	font: inherit; color: inherit; background: none; border: 0; border-radius: 0;
	padding: 0; margin: 0; cursor: pointer; text-transform: none; letter-spacing: normal;
	line-height: inherit; box-shadow: none; min-height: 0; width: auto;
}
.bbcpod :focus-visible { outline: 3px solid var(--bbcpod-accent); outline-offset: 2px; }
.bbcpod [hidden] { display: none !important; }
.bbcpod .bbcpod-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Heading row --------------------------------------------------------- */

.bbcpod .bbcpod-head {
	display: flex; align-items: flex-end; justify-content: space-between;
	gap: 16px; margin-bottom: 16px;
}
.bbcpod .bbcpod-title { font-size: 30px; line-height: 1.15; font-weight: 700; }
.bbcpod .bbcpod-sub { color: var(--bbcpod-muted); font-size: 15px; margin-top: 4px; }

.bbcpod .bbcpod-arrows { display: flex; gap: 8px; flex: none; }
.bbcpod .bbcpod-arrow {
	width: 40px; height: 40px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: #fff; box-shadow: inset 0 0 0 1px var(--bbcpod-line);
	color: var(--bbcpod-ink); transition: background .15s, color .15s, opacity .15s;
}
.bbcpod .bbcpod-arrow:hover { background: var(--bbcpod-accent); color: #fff; box-shadow: none; }
.bbcpod .bbcpod-arrow[disabled] { opacity: .35; cursor: default; background: #fff; color: var(--bbcpod-ink); box-shadow: inset 0 0 0 1px var(--bbcpod-line); }
.bbcpod .bbcpod-arrow svg { width: 18px; height: 18px; }
.bbcpod[data-layout="grid"] .bbcpod-arrows,
.bbcpod[data-layout="auto"] .bbcpod-arrows { display: none; }
.bbcpod:not(.bbcpod-js) .bbcpod-arrows { display: none; }

/* ---- Shows: carousel, grid, or auto -------------------------------------
 * auto (the default) is the grid wherever there is room (desktops, tablets)
 * and the carousel in a phone-width space, where rows of artwork would push the
 * episodes off the screen. The grid is never more than 5 across.
 * Widths below are the block's own width (container queries):
 *   900 px and up  5 across     700-899  4     560-699  3     under 560  phone */

.bbcpod .bbcpod-shows {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--bbcpod-visible) - 1) * var(--bbcpod-gap)) / var(--bbcpod-visible));
	gap: var(--bbcpod-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 6px 6px 14px;
	margin: -6px -6px 0;
}
.bbcpod .bbcpod-shows::-webkit-scrollbar { display: none; }

.bbcpod[data-layout="grid"] .bbcpod-shows {
	grid-auto-flow: row;
	grid-auto-columns: auto;
	grid-template-columns: repeat(var(--bbcpod-cols), minmax(0, 1fr));
	row-gap: 24px;
	overflow: visible;
	scroll-snap-type: none;
}
@container bbcpod (min-width: 560px) {
	.bbcpod[data-layout="auto"] .bbcpod-shows {
		grid-auto-flow: row;
		grid-auto-columns: auto;
		grid-template-columns: repeat(var(--bbcpod-cols), minmax(0, 1fr));
		row-gap: 24px;
		overflow: visible;
		scroll-snap-type: none;
	}
}
@container bbcpod (max-width: 899px) {
	.bbcpod .bbcpod-shows { --bbcpod-visible: 4; --bbcpod-cols: 4; }
}
@container bbcpod (max-width: 699px) {
	.bbcpod .bbcpod-shows { --bbcpod-visible: 3; --bbcpod-cols: 3; }
}
@container bbcpod (max-width: 559px) {
	.bbcpod .bbcpod-shows { --bbcpod-gap: 12px; --bbcpod-cols: 2; grid-auto-columns: 40%; }
	.bbcpod .bbcpod-arrows { display: none; }
}

.bbcpod .bbcpod-tile {
	display: block; color: inherit; scroll-snap-align: start; border-radius: var(--bbcpod-radius);
}
.bbcpod .bbcpod-tile:hover, .bbcpod .bbcpod-tile:focus { color: inherit; }

.bbcpod .bbcpod-art {
	display: block; position: relative; aspect-ratio: 1 / 1; overflow: hidden;
	border-radius: var(--bbcpod-radius); background: var(--bbcpod-soft);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 6px 16px rgba(16, 24, 40, .08);
	outline: 3px solid transparent; outline-offset: 3px;
	transition: outline-color .15s, transform .15s;
}
.bbcpod .bbcpod-art img { width: 100%; height: 100%; object-fit: cover; }
.bbcpod .bbcpod-tile:hover .bbcpod-art { transform: translateY(-2px); }
.bbcpod .bbcpod-tile[aria-current="true"] .bbcpod-art { outline-color: var(--bbcpod-accent); }

.bbcpod .bbcpod-new {
	position: absolute; top: 8px; left: 8px;
	background: var(--bbcpod-new); color: #1b1b1b;
	font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	padding: 2px 7px; border-radius: 4px;
}

.bbcpod .bbcpod-tile-name {
	display: block; margin-top: 12px; font-size: 16px; line-height: 1.25; font-weight: 700;
}
.bbcpod .bbcpod-tile[aria-current="true"] .bbcpod-tile-name { color: var(--bbcpod-accent-dark); }
.bbcpod .bbcpod-tile-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--bbcpod-muted); }

/* ---- Show panel ---------------------------------------------------------- */

.bbcpod .bbcpod-panel {
	margin-top: 22px; padding-top: 24px;
	border-top: 3px solid var(--bbcpod-accent);
	scroll-margin-top: 90px;          /* clear the theme's sticky menu */
}
.bbcpod:not(.bbcpod-js) .bbcpod-panel + .bbcpod-panel { margin-top: 48px; }
.bbcpod-js .bbcpod-panel { display: none; }
.bbcpod-js .bbcpod-panel.is-open { display: block; animation: bbcpod-in .2s ease-out; }
@keyframes bbcpod-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bbcpod .bbcpod-panel-head {
	display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: start;
}
.bbcpod .bbcpod-panel-art { border-radius: 8px; overflow: hidden; background: var(--bbcpod-soft); aspect-ratio: 1 / 1; }
.bbcpod .bbcpod-panel-art img { width: 100%; height: 100%; object-fit: cover; }
.bbcpod .bbcpod-panel-name { font-size: 28px; line-height: 1.15; font-weight: 700; }
.bbcpod .bbcpod-host { margin-top: 6px; font-size: 15px; color: var(--bbcpod-muted); }
.bbcpod .bbcpod-desc {
	margin-top: 10px; font-size: 15.5px; color: #30343b; max-width: 72ch;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.bbcpod .bbcpod-desc.is-full { display: block; -webkit-line-clamp: unset; }
.bbcpod .bbcpod-desc-toggle {
	margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--bbcpod-accent-dark) !important;
}
.bbcpod .bbcpod-stats { margin-top: 10px; font-size: 13.5px; color: var(--bbcpod-muted); }

/* ---- Season tabs --------------------------------------------------------- */

.bbcpod .bbcpod-tabs {
	display: flex; gap: 4px; margin-top: 26px;
	border-bottom: 1px solid var(--bbcpod-line);
	overflow-x: auto; scrollbar-width: none;
}
.bbcpod .bbcpod-tab {
	padding: 10px 16px; font-size: 15px; font-weight: 600; white-space: nowrap;
	color: var(--bbcpod-muted); border-bottom: 3px solid transparent !important; margin-bottom: -1px;
}
.bbcpod .bbcpod-tab:hover { color: var(--bbcpod-ink); }
.bbcpod .bbcpod-tab[aria-selected="true"] { color: var(--bbcpod-accent-dark); border-bottom-color: var(--bbcpod-accent) !important; }
.bbcpod .bbcpod-tab-count { font-weight: 400; color: var(--bbcpod-muted); }
.bbcpod .bbcpod-tab-count .bbcpod-dot { margin: 0 6px; }

.bbcpod .bbcpod-list-label {
	margin-top: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--bbcpod-line);
	font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
	color: var(--bbcpod-muted);
}
.bbcpod-js .bbcpod-season { display: none; }
.bbcpod-js .bbcpod-season.is-open { display: block; }

/* ---- Episodes ------------------------------------------------------------ */

.bbcpod .bbcpod-ep {
	display: grid; grid-template-columns: 1fr; gap: 16px;
	padding: 18px 0; border-bottom: 1px solid var(--bbcpod-line);
}
.bbcpod .bbcpod-ep-thumb { display: none; }
.bbcpod[data-thumbs="on"] .bbcpod-ep { grid-template-columns: 160px 1fr; }
.bbcpod[data-thumbs="on"] .bbcpod-ep-thumb {
	display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--bbcpod-soft);
}
.bbcpod .bbcpod-ep-thumb img { width: 100%; height: 100%; object-fit: cover; }

.bbcpod .bbcpod-ep-meta { font-size: 13.5px; color: var(--bbcpod-muted); }
.bbcpod .bbcpod-ep-meta .bbcpod-dot { margin: 0 6px; }
.bbcpod .bbcpod-ep-title { margin-top: 2px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.bbcpod .bbcpod-ep-sum {
	margin-top: 4px; font-size: 15px; color: #3a3f47;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.bbcpod .bbcpod-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }

.bbcpod .bbcpod-play {
	display: inline-flex !important; align-items: center; gap: 8px;
	background: var(--bbcpod-accent) !important; color: #fff !important;
	border-radius: 999px !important; padding: 7px 18px 7px 12px !important;
	font-size: 14.5px; font-weight: 600; transition: background .15s;
}
.bbcpod .bbcpod-play:hover { background: var(--bbcpod-accent-dark) !important; }
.bbcpod .bbcpod-play svg { width: 16px; height: 16px; flex: none; }
.bbcpod .bbcpod-play .bbcpod-icon-close { display: none; }
.bbcpod .bbcpod-play[aria-expanded="true"] {
	background: #fff !important; color: var(--bbcpod-accent-dark) !important;
	box-shadow: inset 0 0 0 2px var(--bbcpod-accent) !important;
}
.bbcpod .bbcpod-play[aria-expanded="true"] .bbcpod-icon-play { display: none; }
.bbcpod .bbcpod-play[aria-expanded="true"] .bbcpod-icon-close { display: block; }

.bbcpod .bbcpod-page { font-size: 14.5px; font-weight: 600; color: var(--bbcpod-accent-dark) !important; }
.bbcpod .bbcpod-page:hover { text-decoration: underline; }

.bbcpod .bbcpod-player { margin-top: 14px; }
.bbcpod .bbcpod-player iframe { display: block; width: 100%; height: 180px; border: 0; border-radius: 8px; background: var(--bbcpod-soft); }

.bbcpod .bbcpod-more {
	display: block !important; margin: 20px auto 0 !important; padding: 9px 22px !important;
	border-radius: 999px !important; box-shadow: inset 0 0 0 1px var(--bbcpod-line) !important;
	font-size: 14.5px; font-weight: 600; color: var(--bbcpod-accent-dark) !important; background: #fff !important;
}
.bbcpod .bbcpod-more:hover { box-shadow: inset 0 0 0 2px var(--bbcpod-accent) !important; }
.bbcpod:not(.bbcpod-js) .bbcpod-more { display: none !important; }
.bbcpod:not(.bbcpod-js) .bbcpod-ep[hidden] { display: grid !important; }

/* ---- Latest episodes (the opening view) ---------------------------------- */

.bbcpod .bbcpod-latest .bbcpod-stats { margin-top: 4px; margin-bottom: 6px; }
.bbcpod .bbcpod-ep.bbcpod-ep--mixed,
.bbcpod[data-thumbs="on"] .bbcpod-ep.bbcpod-ep--mixed { grid-template-columns: 80px 1fr; gap: 18px; }
.bbcpod .bbcpod-ep-art {
	display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--bbcpod-soft);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}
.bbcpod .bbcpod-ep-art img { width: 100%; height: 100%; object-fit: cover; }
.bbcpod .bbcpod-ep-kicker {
	font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
	color: var(--bbcpod-muted); margin-bottom: 2px;
}
.bbcpod .bbcpod-ep-show { color: var(--bbcpod-accent-dark) !important; }
.bbcpod .bbcpod-ep-show:hover { text-decoration: underline; }

.bbcpod .bbcpod-back {
	display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 18px;
	font-size: 14.5px; font-weight: 600; color: var(--bbcpod-accent-dark) !important;
}
.bbcpod .bbcpod-back:hover { text-decoration: underline; }
.bbcpod .bbcpod-back svg { width: 16px; height: 16px; }
.bbcpod:not(.bbcpod-js) .bbcpod-back,
.bbcpod:not([data-open="latest"]) .bbcpod-back { display: none; }

/* ---- Narrower screens ---------------------------------------------------- */

@media (max-width: 767px) {
	.bbcpod .bbcpod-title { font-size: 26px; }
	.bbcpod .bbcpod-panel-head { grid-template-columns: 96px 1fr; gap: 16px; }
	.bbcpod .bbcpod-panel-name { font-size: 22px; }
	.bbcpod .bbcpod-tab { padding: 10px 12px; }
	.bbcpod .bbcpod-desc { font-size: 15px; }
	.bbcpod[data-thumbs="on"] .bbcpod-ep { grid-template-columns: 104px 1fr; gap: 12px; }
	.bbcpod .bbcpod-ep.bbcpod-ep--mixed,
	.bbcpod[data-thumbs="on"] .bbcpod-ep.bbcpod-ep--mixed { grid-template-columns: 60px 1fr; gap: 14px; }
	.bbcpod .bbcpod-ep-title { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
	.bbcpod .bbcpod-shows { scroll-behavior: auto; }
	.bbcpod .bbcpod-art, .bbcpod-js .bbcpod-panel.is-open { transition: none; animation: none; }
}
