/* Podcast and media lists (techniques/podcasts*.html, media_list.html): compact show cards, filters, notices and the
   continue-listening row. The player itself (episode and clip pages) is css/media-player.css. Only the site's tokens
   (app.css :root), so light/dark and RTL follow the rest of the site. */

.pod-filters { display: grid; gap: 2px; margin-block-end: 6px; }
.pod-filters .filters { align-items: center; margin-block-end: 8px; }
.pod-filter-h { flex: none; min-inline-size: 44px; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; }
.pod-filters .pill small { color: inherit; opacity: 0.7; font-weight: 500; }
.pod-filters .pill .ic { inline-size: 14px; block-size: 14px; }
.pod-count { margin-block: 0 12px; }

.pod-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.pod-card { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: var(--r-lg); background: var(--card);
  border: 1px solid var(--hair); color: var(--ink); text-decoration: none; transition: transform 200ms var(--ease-out), box-shadow 200ms; }
@media (hover: hover) and (pointer: fine) { .pod-card:hover { transform: translateY(-2px); box-shadow: var(--e2); } }
.pod-card:active { transform: scale(0.985); }
.pod-card:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.pod-sq { display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 1; border-radius: var(--r-md); color: #fff; }
.pod-sq .ic { inline-size: 22px; block-size: 22px; opacity: 0.9; }
.pod-sq b { font-size: var(--fs-xs); line-height: 1; letter-spacing: 0.02em; white-space: nowrap; }
.pod-body { display: grid; gap: 4px; min-inline-size: 0; font-size: var(--fs-sm); }
.pod-title { line-height: 1.5; }
.pod-en { color: var(--ink-2); text-align: end; }
.pod-tags { gap: 4px; }
.pod-desc { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.7; }
.tag.warn { background: color-mix(in srgb, var(--saffron) 26%, var(--card)); color: var(--ink); }
@media (max-width: 480px) {
  .pod-card { grid-template-columns: 56px 1fr; padding: 10px; gap: 10px; }
  .pod-sq .ic { inline-size: 18px; block-size: 18px; }
}

.pod-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.8;
  background: var(--paper-2); color: var(--ink); }
.pod-notice .ic { flex: none; inline-size: 18px; block-size: 18px; margin-block-start: 4px; }
.pod-notice.warn { background: color-mix(in srgb, var(--saffron) 22%, var(--card)); }
.pod-notice.ok { background: color-mix(in srgb, var(--ok) 13%, var(--card)); }
.pod-notice[hidden] { display: none; }
.pod-licence { margin-block-start: 14px; }
.pod-licence summary { cursor: pointer; min-block-size: 32px; }

/* an episode or chapter without timed text: one calm note under the player (icon, a bold line, a short line, quiet links) */
.pod-callout { display: flex; gap: 12px; align-items: flex-start; margin: 2px 0 14px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--paper-2); border: 1px solid var(--hair); color: var(--ink); font-size: var(--fs-sm); line-height: 1.85; }
.pod-callout > .ic { flex: none; inline-size: 20px; block-size: 20px; margin-block-start: 3px; color: var(--indigo); }
.pod-callout .pc-tx { display: grid; gap: 2px; min-inline-size: 0; }
.pod-callout .pc-tx p { margin: 0; color: var(--ink-2); }
.pod-callout a { color: var(--indigo); font-weight: 650; text-decoration: none; }
.pod-callout a:hover { text-decoration: underline; }
.pod-callout .pc-links { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-block-start: 4px; }
.pod-callout .pc-links a { display: inline-flex; align-items: center; gap: 4px; min-block-size: 32px; }
.pod-callout .pc-links .ic { inline-size: 13px; block-size: 13px; }

/* an audiobook's own content on its page: our Persian intro, its facts, books of the same level */
.bk-about { margin-block-start: 30px; }
.bk-about-body { display: grid; gap: 20px; align-items: start; }
.bk-about-tx { max-inline-size: 64ch; }
.bk-about-tx p { margin: 0 0 1em; line-height: 2; text-wrap: pretty; }
.bk-about-tx p:last-child { margin-block-end: 0; }
/* the facts: one quiet panel, a row per fact (label at the start, value at the end), hairlines between rows */
.bk-info { padding: 6px 18px 4px; border-radius: var(--r-lg); background: var(--paper-2); }
.bk-info-h { margin: 10px 0 2px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.bk-facts { margin: 0; }
.bk-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 11px;
  border-block-start: 1px solid var(--hair); }
.bk-facts > div:first-child { border-block-start: 0; }
.bk-facts dt { flex: none; font-size: var(--fs-sm); color: var(--ink-2); }
.bk-facts dd { display: grid; justify-items: end; gap: 1px; margin: 0; min-inline-size: 0; text-align: end;
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.bk-facts .bk-en { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); }
@media (min-width: 820px) {
  .bk-about-body { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); column-gap: 40px; }
}
/* books of the same level: a shelf of covers (the library's cover + spine), scrolling sideways inside itself */
.bk-more { margin-block-start: 30px; }
.bk-shelf { list-style: none; margin: 6px 0 0; padding: 4px 2px 12px; display: grid; grid-auto-flow: column;
  grid-auto-columns: clamp(124px, 34vw, 156px); gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 2px; scrollbar-width: none; }
.bk-shelf::-webkit-scrollbar { display: none; }
.bk-shelf li { scroll-snap-align: start; min-inline-size: 0; }
.bk-book { display: grid; gap: 4px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.bk-book .pc-art { margin-block-end: 6px; }
.bk-book .pod-cover { box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 24px -16px rgb(0 0 0 / 0.5); }
.bk-book .pod-sq { inline-size: 100%; border-radius: 4px 14px 14px 4px; }
.bk-book-t { font-size: var(--fs-sm); font-weight: 700; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.bk-book-m { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: start; color: var(--ink-2); font-size: var(--fs-xs); }
html[dir="rtl"] .bk-book-m[dir="ltr"] { text-align: right; }  /* an English line under a Persian title: same edge, ellipsis at its own end */
.bk-book:focus-visible { outline: none; }
.bk-book:focus-visible .pod-cover, .bk-book:focus-visible .pod-sq { outline: 3px solid var(--indigo); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  html:is([data-motion="2"], [data-motion="3"]) .bk-book .pod-cover { transition: transform var(--dur-2, 240ms) var(--ease-out, ease); }
  html:is([data-motion="2"], [data-motion="3"]) .bk-book:hover .pod-cover { transform: translateY(-3px); }
  .bk-book:hover .bk-book-t { color: var(--indigo); }
}

/* the audiobook shelf's guide (core/intros/audiobooks.md) has headings: give them room */
.lib .page-intro h3 { margin-block: 1.6em 0.4em; font-size: var(--fs-md); color: var(--ink); }
.lib .page-intro h3:first-child { margin-block-start: 0; }
.lib .page-intro ul, .lib .page-intro ol { margin-block: 0.4em 0.8em; }

/* an audiobook's credits (book and chapter page): small, quiet, one labelled row per fact */
.bk-credits { margin-block-start: 22px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--paper-2); color: var(--ink-2);
  font-size: var(--fs-xs); line-height: 1.9; }
.bk-credits-h { margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.bk-credits dl { margin: 0; display: grid; gap: 4px; }
.bk-credits dl > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px; }
.bk-credits dt { font-weight: 650; color: var(--ink-2); }
.bk-credits dd { margin: 0; color: var(--ink); }
.bk-credits a { color: var(--indigo); text-decoration: none; }
.bk-credits a:hover { text-decoration: underline; }
@media (max-width: 420px) { .bk-credits dl > div { grid-template-columns: 1fr; gap: 0; } .bk-credits dl { gap: 8px; } }

/* continue listening */
.pod-continue { margin-block-end: 18px; }
.pod-continue[hidden] { display: none; }
.pod-continue-list { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.pod-continue-list::-webkit-scrollbar { display: none; }
.pod-continue-list li { flex: 0 0 min(78%, 280px); scroll-snap-align: start; }
.pod-resume { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hair); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
.pod-resume small { color: var(--ink-2); }
.pod-resume b { line-height: 1.5; text-align: start; }
.pod-resume i { display: block; block-size: 4px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.pod-resume i > span { display: block; block-size: 100%; background: var(--indigo); transform-origin: left center; }
:root[dir="rtl"] .pod-resume i > span, [dir="rtl"] .pod-resume i > span { transform-origin: right center; }
@media (hover: hover) and (pointer: fine) { .pod-resume:hover { border-color: var(--indigo); } }

/* media library on a phone: two cards per row (the 16:9 art made one card fill the screen; a series has dozens of lessons) */
@media (max-width: 520px) {
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .media-grid .mc-body { padding: 8px 10px 10px; gap: 3px; font-size: var(--fs-xs); }
  .media-grid .mc-body b { font-size: var(--fs-sm); line-height: 1.5; }
  .media-grid .mc-body .row { gap: 4px; flex-wrap: wrap; }
  .media-grid .mc-body .tag, .media-grid .mc-body .lvl { font-size: 0.7rem; padding-inline: 6px; }
  .media-grid .mc-body small { display: none; }
}

.pod-body small .ic { inline-size: 13px; block-size: 13px; vertical-align: -2px; }

/* an episode that has our own learner notes (techniques/podcast_notes.py) */
.tag.pn-chip { background: color-mix(in srgb, var(--indigo) 14%, var(--card)); color: var(--indigo); }

/* an audiobook section: «فصل ۳» above its title (LibriVox books, listed in reading order) */
.ep-list .ep-sec { color: var(--muted); font-size: .8rem; font-weight: 600; }

/* show artwork (our own static copies: static/podcasts/covers, techniques/podcast_covers.py) with the level on its corner.
   Explicit sizes (img width/height + aspect-ratio) so nothing shifts while it loads; without a cover the tile stays. */
.pod-card { grid-template-columns: 88px minmax(0, 1fr); }
@media (max-width: 480px) { .pod-card { grid-template-columns: 72px minmax(0, 1fr); } }
.pod-cover { position: relative; display: block; inline-size: 100%; aspect-ratio: 1; border-radius: var(--r-md); background: var(--paper-2); }
.pod-cover img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 1; object-fit: cover; border-radius: inherit;
  outline: 1px solid rgb(0 0 0 / 0.08); outline-offset: -1px; }
/* physical insets: .lvl is direction:ltr, so logical ones would flip (same as dictionary.css) */
.pod-cover .pod-lvl.lvl { position: absolute; bottom: 4px; right: 4px; min-inline-size: 0; padding: 0 5px; border-radius: var(--r-xs);
  font-size: 0.7rem; line-height: 1.6; white-space: nowrap; color: var(--ink); background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
html[dir="ltr"] .pod-cover .pod-lvl.lvl { right: auto; left: 4px; }
/* the .lvl colours of ui.css (tokens, so dark mode follows); a WebView before color-mix (Chrome 111) gets the plain card:
   a declaration with var() always parses, so a fallback line in front of it would never be used; @supports is needed */
.pod-cover .pod-lvl.A1, .pod-cover .pod-lvl.A2 { background: color-mix(in srgb, var(--teal-deco) 18%, var(--card)); }
.pod-cover .pod-lvl.B1, .pod-cover .pod-lvl.B2 { background: color-mix(in srgb, var(--indigo) 16%, var(--card)); }
.pod-cover .pod-lvl.C1, .pod-cover .pod-lvl.C2 { background: color-mix(in srgb, var(--saffron) 30%, var(--card)); }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .pod-cover .pod-lvl.lvl { background: var(--card); }
}

/* show page header: the cover beside the tags and title (phone: the description runs full width under both) */
.intro-hero.has-cover { grid-template-columns: 88px minmax(0, 1fr); column-gap: 14px; align-items: start; }
.intro-hero.has-cover > * { grid-column: 1 / -1; }
.intro-hero.has-cover > .pod-cover { grid-column: 1; grid-row: 1 / span 2; }
.intro-hero.has-cover > .row, .intro-hero.has-cover > h1 { grid-column: 2; }
@media (min-width: 640px) {
  .intro-hero.has-cover { grid-template-columns: 132px minmax(0, 1fr); column-gap: 20px; }
  .intro-hero.has-cover > * { grid-column: 2; }
  .intro-hero.has-cover > .pod-cover { grid-column: 1; grid-row: 1 / span 3; }
}
.pod-cover.lg { box-shadow: 0 6px 18px rgb(0 0 0 / 0.35); }
.pod-cover.lg img { outline-color: rgb(255 255 255 / 0.18); }
.pod-cover.lg .pod-lvl.lvl { bottom: 6px; right: 6px; font-size: var(--fs-xs); padding: 1px 7px; }
html[dir="ltr"] .pod-cover.lg .pod-lvl.lvl { right: auto; left: 6px; }

/* episode page header, ready for templates/techniques/podcast_episode.html: <header class="stack mp-head has-cover"> with
   {% include "techniques/_pod_cover.html" with p=show size=64 cls="sm" eager=True %} as its first child */
.mp-head.has-cover { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.mp-head.has-cover > * { grid-column: 2; }
.mp-head.has-cover > .pod-cover { grid-column: 1; grid-row: 1 / span 2; }
.pod-cover.sm .pod-lvl.lvl { bottom: 3px; right: 3px; padding: 0 4px; font-size: 0.62rem; }
html[dir="ltr"] .pod-cover.sm .pod-lvl.lvl { right: auto; left: 3px; }
