/* «انگلیسی واقعی»: the section search and the podcast / audiobook pages, Apple Podcasts / Books in our tokens.
   Linked after podcasts.css (and media-player.css on an episode) by templates/techniques/{podcasts,podcast_show,
   podcast_episode,media_list,media_local,search}.html, so it refines those sheets without touching them.
   - .ls / .lsr*      the search box (_lib_search.html) and its results (_search_results.html)
   - .pod-start       «از اینجا شروع کن» on the list; .pod-grid tiles with level shelves (.pod-shelf-h)
   - .sh-*            the show / book header; .sh-eps .ep-row the episode and chapter rows (progress from js/pod-shelf.js)
   - .ep-*            the episode page: the show strip, prev/next cards, «قسمت‌های قبلی / فصل‌های بعدی»
   Tokens only (app.css), so light and dark follow; logical properties; motion on transform/opacity only and only from
   html[data-motion="1"] up (tier 1: fades, no movement). A blurred cover is decoration under a token scrim (contrast is
   the scrim's, never the image's). */

/* ---- the search box -------------------------------------------------------------------------------------------- */
.ls { position: relative; display: flex; align-items: center; margin-block: 0 16px; }
/* .ls .ls-in: two classes beat ui.css's input[type="search"] and kashi's field rules (both 0,1,1) */
.ls .ls-in { inline-size: 100%; min-block-size: 48px; margin: 0; padding-block: 0; padding-inline: 46px; border: 0; border-radius: 14px;
  background: var(--card); color: var(--ink); font: inherit; font-size: max(16px, var(--fs-md)); -webkit-appearance: none; appearance: none;
  box-shadow: inset 0 0 0 1px var(--hair), 0 1px 2px rgb(0 0 0 / 0.04); }
.ls .ls-in::placeholder { color: var(--ink-2); opacity: 1; text-overflow: ellipsis; }
.ls .ls-in::-webkit-search-cancel-button, .ls .ls-in::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.ls .ls-in:focus { outline: none; }
.ls .ls-in:focus-visible { box-shadow: inset 0 0 0 2px var(--indigo), 0 0 0 4px color-mix(in srgb, var(--indigo) 16%, transparent); }
.ls-ic, .ls-spin { position: absolute; inset-inline-start: 15px; display: grid; color: var(--ink-2); pointer-events: none; }
.ls-ic .ic { inline-size: 19px; block-size: 19px; }
.ls-spin { inline-size: 18px; block-size: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--indigo) 22%, transparent);
  border-block-start-color: var(--indigo); opacity: 0; }
.ls.htmx-request .ls-spin { opacity: 1; animation: ls-spin 0.8s linear infinite; }
.ls.htmx-request .ls-ic { opacity: 0; }
@keyframes ls-spin { to { transform: rotate(1turn); } }
html[data-motion="0"] .ls.htmx-request .ls-spin { animation-duration: 2.4s; }
.ls-x { position: absolute; inset-inline-end: 2px; display: grid; place-items: center; inline-size: 44px; block-size: 44px; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.ls-x .ic { inline-size: 18px; block-size: 18px; padding: 3px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 12%, transparent); box-sizing: content-box; }
.ls-x[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .ls-x:hover { color: var(--ink); } }
.ls-x:focus-visible { outline: 2px solid var(--indigo); outline-offset: -4px; }
.ls-kbd { position: absolute; inset-inline-end: 14px; display: grid; place-items: center; min-inline-size: 22px; block-size: 22px; padding-inline: 5px;
  border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); font: 600 0.75rem/1 var(--f-body); pointer-events: none; }
.ls.has-q .ls-kbd, .ls-in:focus ~ .ls-kbd { display: none; }
@media (hover: none), (pointer: coarse), (max-width: 600px) { .ls-kbd { display: none; } }

/* the list under the box steps aside while results show (js/lib-search.js); a stack-lg body keeps its own display */
.lib-body[hidden] { display: none !important; }

/* ---- results ----------------------------------------------------------------------------------------------------- */
.ls-results:empty { display: none; }
.ls-results { margin-block: 0 24px; }
.lsr { display: grid; gap: 22px; }
html:is([data-motion="1"], [data-motion="2"], [data-motion="3"]) .lsr { animation: lsr-in var(--dur-2, 240ms) var(--ease-out) both; }
html:is([data-motion="2"], [data-motion="3"]) .lsr { animation-name: lsr-rise; }
@keyframes lsr-in { from { opacity: 0; } }
@keyframes lsr-rise { from { opacity: 0; transform: translateY(6px); } }
.lsr-g { display: grid; gap: 10px; min-inline-size: 0; }
.lsr-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-md); font-weight: 750; }
.lsr-h .ic { inline-size: 18px; block-size: 18px; color: var(--indigo); }
.lsr mark { padding: 0 1px; border-radius: 3px; color: inherit; background: color-mix(in srgb, var(--saffron) 38%, transparent); }
.lsr bdi { unicode-bidi: isolate; }

.lsr-shows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.lsr-show { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; min-block-size: 88px; padding: 8px;
  border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink); text-decoration: none; }
.lsr-show .pod-cover, .lsr-show .pod-sq { inline-size: 72px; border-radius: 12px; }
.lsr-show .pod-sq .ic { inline-size: 20px; block-size: 20px; }
.lsr-show.is-book .pod-cover { border-radius: 4px 12px 12px 4px; }

.lsr-rows { list-style: none; margin: 0; padding: 0; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.lsr-rows > li + li { box-shadow: 0 -1px 0 var(--sep); }
.lsr-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-block-size: 64px; padding: 10px 12px;
  color: var(--ink); text-decoration: none; }
.lsr-art { position: relative; display: grid; place-items: center; inline-size: 48px; aspect-ratio: 1; overflow: hidden; border-radius: 10px; color: #fff;
  background: var(--paper-2); }
.lsr-art img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.lsr-art .pod-sq { inline-size: 100%; block-size: 100%; border-radius: 0; }
.lsr-art .ic { inline-size: 18px; block-size: 18px; }
.lsr-art.is-book { border-radius: 3px 10px 10px 3px; }
.lsr-art.is-clip { inline-size: 80px; aspect-ratio: 16 / 9; border-radius: 8px; }
.lsr-tx { display: grid; gap: 2px; min-inline-size: 0; }
.lsr-t { font-weight: 650; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.lsr-m { display: block; color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* an English-only line or title keeps its own direction (its ellipsis cuts the end of the English, punctuation stays
   in place) but sits on the page's side */
html[dir="rtl"] .lsr-en, html[dir="rtl"] .en-r { text-align: right; }
.lsr-m .lvl { font-size: 0.68rem; min-inline-size: 0; padding: 0 5px; }
.lsr-why { display: inline-flex; gap: 4px; align-items: center; justify-self: start; margin-block-start: 2px; padding: 1px 8px; border-radius: 999px;
  font-size: var(--fs-xs); color: var(--indigo); background: color-mix(in srgb, var(--indigo) 10%, var(--card)); }
.lsr-why .ic { inline-size: 13px; block-size: 13px; flex: none; }
.lsr-go { display: grid; place-items: center; inline-size: 32px; block-size: 32px; border-radius: 50%; color: var(--indigo);
  background: color-mix(in srgb, var(--indigo) 10%, var(--card)); }
.lsr-go .ic { inline-size: 14px; block-size: 14px; }
.lsr-plus { display: grid; }
@media (hover: hover) and (pointer: fine) {
  .lsr-row:hover, .lsr-show:hover { background: color-mix(in srgb, var(--indigo) 5%, var(--card)); }
}
.lsr-row:active, .lsr-show:active { background: color-mix(in srgb, var(--indigo) 8%, var(--card)); }
.lsr-row:focus-visible, .lsr-show:focus-visible { outline: 2px solid var(--indigo); outline-offset: -2px; border-radius: 12px; }
.lsr-all { justify-self: center; display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding-inline: 18px; border-radius: 999px;
  font-weight: 650; text-decoration: none; color: var(--indigo); background: color-mix(in srgb, var(--indigo) 10%, var(--card)); }
.lsr-all .ic { inline-size: 14px; block-size: 14px; }
.lsr-hint { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.lsr-hint .ic { inline-size: 16px; block-size: 16px; flex: none; }
.lsr-empty { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; border-radius: 20px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hair); }
.lsr-empty p { margin: 0; }
.lsr-empty-ic { display: grid; place-items: center; inline-size: 56px; block-size: 56px; margin-block-end: 6px; border-radius: 50%; color: var(--indigo);
  background: color-mix(in srgb, var(--indigo) 10%, var(--card)); }
.lsr-empty-ic .ic { inline-size: 24px; block-size: 24px; }
.lsr-ideas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-block: 10px 0 !important; }
.lsr-idea { display: inline-flex; align-items: center; min-block-size: 36px; padding-inline: 14px; border-radius: 999px; color: var(--ink); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 600; background: var(--paper-2); }
@media (pointer: coarse) { .lsr-idea { min-block-size: 44px; } }
@media (hover: hover) and (pointer: fine) { .lsr-idea:hover { background: color-mix(in srgb, var(--indigo) 12%, var(--card)); } }

/* ---- the list: a «start here» card, then tiles on level shelves --------------------------------------------------- */
.lib-head { margin-block-end: 18px; }
.lib-head p:last-child { max-inline-size: 70ch; color: var(--ink-2); }

/* a blurred cover under a scrim: .ps-bg / .sh-bg */
.ps-bg, .sh-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ps-bg img, .sh-bg img { inline-size: 100%; block-size: 100%; object-fit: cover; transform: scale(1.6); filter: blur(46px) saturate(1.5); opacity: 0.6; }
.ps-bg::after, .sh-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 58%, transparent), color-mix(in srgb, var(--card) 84%, transparent) 70%); }

.pod-start { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px;
  align-items: center; margin-block: 0 26px; padding: 16px; border-radius: 24px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hair), var(--e2); }
.ps-art { display: block; align-self: start; }
.ps-art .pod-sq { inline-size: 100%; border-radius: 14px; }
.ps-body { display: grid; gap: 6px; min-inline-size: 0; }
.ps-body p { margin: 0; }
.ps-kick { display: inline-flex; align-items: center; gap: 6px; color: var(--indigo); font-size: var(--fs-xs); font-weight: 750; }
.ps-kick .ic { inline-size: 15px; block-size: 15px; }
.ps-title { margin: 0; font: 800 clamp(1.2rem, 0.9rem + 1.2vw, 1.6rem)/1.35 var(--f-display); }
.ps-title a { color: inherit; text-decoration: none; }
.ps-title a:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }
.ps-en { color: var(--ink-2); font-size: var(--fs-sm); }
.ps-desc { line-height: 1.85; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.ps-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); }
.ps-meta > span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; color: var(--ink);
  background: color-mix(in srgb, var(--card) 72%, transparent); box-shadow: inset 0 0 0 1px var(--hair); }
.ps-meta > .lvl { box-shadow: none; }
.ps-meta .ic { inline-size: 13px; block-size: 13px; }
.ps-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 6px !important; }
.ps-actions .btn { min-block-size: 44px; }
.ps-play .ic { inline-size: 16px; block-size: 16px; }
@media (min-width: 760px) {
  .pod-start { grid-template-columns: 200px minmax(0, 1fr); gap: 26px; padding: 22px; border-radius: 28px; }
  .ps-art { align-self: center; }
}
@media (max-width: 520px) {
  .pod-start { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .ps-desc, .ps-meta, .ps-actions { grid-column: 1 / -1; }
  .ps-body { display: contents; }
  .ps-art { grid-row: 1 / span 3; }
  .ps-kick, .ps-title, .ps-en { grid-column: 2; }
  .ps-desc { margin-block-start: 4px; }
  .ps-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* covers: a soft shadow and a little lift; a book gets a spine down its left edge (English books bind on the left) */
.lib .pod-cover, .sh-art .pod-cover, .ps-art .pod-cover { border-radius: 14px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 26px -16px rgb(0 0 0 / 0.45); }
.pod-cover.xl .pod-lvl.lvl { bottom: 8px; right: 8px; padding: 1px 8px; font-size: var(--fs-xs); }
html[dir="ltr"] .pod-cover.xl .pod-lvl.lvl { right: auto; left: 8px; }
.is-book .pod-cover, .is-book .sh-art .pod-cover { border-radius: 4px 14px 14px 4px; }
.is-book .pod-cover::before { content: ""; position: absolute; z-index: 1; inset-block: 0; left: 0; inline-size: 9%; border-radius: 4px 0 0 4px; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.30), rgb(255 255 255 / 0.16) 55%, transparent); }

.lib .pod-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 184px), 1fr)); gap: 26px 18px; }
.lib .pod-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 10px; align-content: start; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; transition: none; }
.lib .pod-card:hover { transform: none; box-shadow: none; }
.lib .pod-card:active { transform: none; }
.lib .pod-card:focus-visible { outline: none; }
.lib .pod-card:focus-visible .pc-art { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 16px; }
.pc-art { display: block; }
.pc-art .pod-cover, .pc-art .pod-sq { transition: transform var(--dur-2, 240ms) var(--spring, ease), box-shadow var(--dur-2, 240ms) var(--ease-out); }
.pc-art .pod-sq { inline-size: 100%; border-radius: 14px; }
.pc-art .pod-sq .ic { inline-size: 30%; block-size: 30%; }
.pc-art .pod-sq b { font-size: var(--fs-sm); }
@media (hover: hover) and (pointer: fine) {
  html:is([data-motion="2"], [data-motion="3"]) .lib .pod-card:hover .pc-art > * { transform: translateY(-3px); }
  .lib .pod-card:hover .pc-art .pod-cover { box-shadow: 0 2px 4px rgb(0 0 0 / 0.1), 0 20px 36px -18px rgb(0 0 0 / 0.55); }
}
html:is([data-motion="2"], [data-motion="3"]) .lib .pod-card:active .pc-art > * { transform: scale(0.97); transition-duration: var(--dur-1, 120ms); }
.lib .pod-body { display: grid; gap: 3px; align-content: start; }
.lib .pod-title { font-size: var(--fs-md); line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.lib .pod-en { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); }
.pod-meta { display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--ink-2); font-size: var(--fs-xs); }
.pod-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.pod-meta > span + span::before { content: "·"; margin-inline-end: 6px; }
.pod-meta .ic { inline-size: 13px; block-size: 13px; }
.pm-kind { color: var(--indigo); font-weight: 650; }
.lib .pod-desc { -webkit-line-clamp: 2; line-clamp: 2; font-size: var(--fs-xs); }
.lib .pod-tags { gap: 4px; flex-wrap: wrap; }
.lib .pod-tags .tag { font-size: 0.7rem; line-height: 1.7; padding-inline: 7px; }
.lib .pod-tags .tag .ic { inline-size: 12px; block-size: 12px; }
.lib .pod-len { font-size: 0.72rem; }
.lib .pod-len .ic { display: inline-block; vertical-align: -2px; margin-inline-end: 2px; }
.lib .pod-tags:empty { display: none; }

.pod-shelf-h { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 6px 0 -8px; padding-block-start: 18px;
  border-block-start: 1px solid var(--sep); font: 800 var(--fs-lg)/1.3 var(--f-display); }
.pod-grid > .pod-shelf-h:first-child { margin-block-start: 0; padding-block-start: 4px; border: 0; }
.pod-shelf-h .lvl { font-size: var(--fs-sm); min-inline-size: 36px; }
.lib-empty { grid-column: 1 / -1; }

@media (max-width: 520px) {
  .lib .pod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .lib .pod-desc, .lib .pod-len { display: none; }
  .lib .pod-title { font-size: var(--fs-sm); }
}

/* «ادامه‌ی شنیدن»: the show's cover in front of each card (js/pod-shelf.js) */
.pod-resume.has-art { grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.pod-resume.has-art > :not(.pr-art) { grid-column: 2; }
.pr-art { grid-column: 1; grid-row: 1 / span 4; inline-size: 56px; block-size: 56px; border-radius: 10px; object-fit: cover; align-self: center;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }

/* ---- the show / book page --------------------------------------------------------------------------------------- */
.sh-page { max-inline-size: 980px; }
.sh-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center;
  gap: 16px; margin-block: 0 18px; padding: 22px 16px 20px; border-radius: 28px; text-align: center; color: var(--ink); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hair), var(--e1); }
.sh-art { inline-size: min(62vw, 232px); }
.sh-art .pod-sq { inline-size: 100%; border-radius: 18px; box-shadow: 0 12px 26px -16px rgb(0 0 0 / 0.45); }
.sh-art .pod-sq .ic { inline-size: 30%; block-size: 30%; }
.sh-info { display: grid; gap: 6px; justify-items: center; min-inline-size: 0; }
.sh-info p { margin: 0; }
.sh-kick { display: inline-flex; align-items: center; gap: 6px; color: var(--indigo); font-size: var(--fs-xs); font-weight: 750; }
.sh-kick .ic { inline-size: 15px; block-size: 15px; }
.sh-title { margin: 0; font-size: clamp(1.55rem, 1.1rem + 1.8vw, 2.3rem); line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sh-fa { font-weight: 700; color: var(--ink-2); }
.sh-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 10px; color: var(--ink-2); font-size: var(--fs-sm); }
.sh-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.sh-meta > span:not(.lvl) + span::before { content: "·"; margin-inline-end: 6px; }
.sh-meta .ic { inline-size: 14px; block-size: 14px; }
.sh-narr { color: var(--ink-2); font-size: var(--fs-sm); }
.sh-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block-start: 8px; inline-size: 100%; }
.sh-play { min-block-size: 54px; gap: 10px; padding-inline: 16px 22px; border-radius: 16px; text-align: start; max-inline-size: 100%; }
.sh-play > .ic { inline-size: 18px; block-size: 18px; flex: none; }
.sh-play-tx { display: grid; min-inline-size: 0; line-height: 1.4; }
.sh-play-tx small { max-inline-size: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; opacity: 0.86; font-size: var(--fs-xs); }
.sh-site { min-block-size: 54px; border-radius: 16px; }
.sh-site .ic { inline-size: 15px; block-size: 15px; }
.sh-desc { max-inline-size: 62ch; margin: 0; line-height: 1.95; color: var(--ink); }
@media (max-width: 520px) {
  .sh-actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (min-width: 720px) {
  .sh-hero { grid-template-columns: 232px minmax(0, 1fr); justify-items: start; align-items: center; column-gap: 30px; row-gap: 14px; padding: 28px;
    text-align: start; }
  .sh-art { inline-size: 232px; grid-row: 1 / span 2; align-self: start; }
  .sh-info { justify-items: start; }
  .sh-meta, .sh-actions { justify-content: flex-start; }
  .sh-desc { grid-column: 2; }
}
.sh-tabs { margin-block: 4px 12px; }

/* episode and chapter rows: a grouped list (one card, hairline separators), the number of a chapter or the kind of an
   episode, title, facts, and on this device the progress line / «شنیده شد» (js/pod-shelf.js) */
.sh-eps { gap: 0; padding: 0; overflow: hidden; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
.sh-eps > li + li { box-shadow: 0 -1px 0 var(--sep); }
.sh-eps > li.empty { padding: 18px; }
.sh-eps .ep-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 36px; gap: 12px; align-items: center; min-block-size: 68px;
  padding: 12px 14px; border: 0; border-radius: 0; background: none; color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
@media (hover: hover) and (pointer: fine) { .sh-eps .ep-row:hover { border: 0; background: color-mix(in srgb, var(--indigo) 5%, var(--card)); } }
.sh-eps .ep-row:active { border: 0; background: color-mix(in srgb, var(--indigo) 9%, var(--card)); }
.sh-eps .ep-row:focus-visible { outline: 2px solid var(--indigo); outline-offset: -3px; border-radius: 14px; }
.sh-eps .ep-ic { inline-size: 40px; block-size: 40px; border-radius: 12px; }
.sh-eps .ep-ic .ic { inline-size: 18px; block-size: 18px; }
.ep-n { font: 800 var(--fs-md)/1 var(--f-display); }
/* the chapter number already shows in the circle: «فصل ۳» stays for screen readers (the circle is aria-hidden) */
.ep-row:has(.ep-n) .ep-sec { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sh-eps.is-book .ep-ic { border-radius: 50%; }
.ep-tx { display: grid; gap: 3px; min-inline-size: 0; }
.ep-t { font-weight: 650; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink-2); font-size: var(--fs-xs); }
.ep-meta .tag { font-size: 0.7rem; line-height: 1.7; padding-inline: 7px; }
.ep-meta .tag .ic { inline-size: 12px; block-size: 12px; }
.ep-left { color: var(--indigo); font-weight: 650; }
.ep-left[hidden] { display: none; }
.ep-bar { display: none; position: relative; block-size: 3px; margin-block-start: 4px; border-radius: 3px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 10%, transparent); }
.ep-bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--indigo); transform: scaleX(var(--ep-p, 0)); transform-origin: right center; }
html[dir="ltr"] .ep-bar::after { transform-origin: left center; }
.is-started .ep-bar { display: block; }
.ep-go { display: grid; place-items: center; inline-size: 36px; block-size: 36px; border-radius: 50%; color: var(--indigo);
  background: color-mix(in srgb, var(--indigo) 10%, var(--card)); }
.ep-go .ic { inline-size: 14px; block-size: 14px; }
.ep-go .ic + .ic { display: none; }
.is-done .ep-go { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, var(--card)); }
.is-done .ep-go .ic:first-child { display: none; }
.is-done .ep-go .ic + .ic { display: block; }
.is-done .ep-left { color: var(--ok); }
.is-done .ep-t { color: var(--ink-2); }

/* ---- the episode / chapter page ----------------------------------------------------------------------------------- */
/* the real cover, blurred, tints the Now Playing card from behind (the card is its own stacking context: media-player.css) */
.ep-page.has-cover .mp-card::before { content: ""; position: absolute; inset: -12%; z-index: -1; pointer-events: none;
  background: var(--cover) center / cover no-repeat; filter: blur(52px) saturate(1.6); opacity: 0.32; transform: scale(1.1); }
.ep-page.has-cover .mp-card::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--card) 55%, transparent) 70%); }
.ep-show { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-block-size: 64px; padding: 6px 12px 6px 6px;
  padding-inline: 6px 12px; border-radius: 18px; color: var(--ink); text-decoration: none; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
.ep-show .pod-cover, .ep-show .pod-sq { inline-size: 56px; border-radius: 12px; }
.ep-show .pod-sq .ic { inline-size: 20px; block-size: 20px; }
.ep-show-tx { display: grid; gap: 1px; min-inline-size: 0; }
.ep-show-tx small { display: inline-flex; align-items: center; gap: 5px; color: var(--indigo); font-size: var(--fs-xs); font-weight: 700; }
.ep-show-tx small .ic { inline-size: 13px; block-size: 13px; }
.ep-show-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-show-go { color: var(--ink-2); display: grid; }
.ep-show-go .ic { inline-size: 16px; block-size: 16px; }
@media (hover: hover) and (pointer: fine) { .ep-show:hover { background: color-mix(in srgb, var(--indigo) 5%, var(--card)); } }
.ep-show:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.ep-head { display: grid; }
.ep-head .ep-show { max-inline-size: 560px; }
.ep-tags { gap: 6px; }

.ep-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pg-card { display: grid; gap: 4px; align-content: start; min-block-size: 64px; padding: 12px 14px; border-radius: 16px; color: var(--ink); text-decoration: none;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
.pg-card small { display: inline-flex; align-items: center; gap: 2px; color: var(--indigo); font-size: var(--fs-xs); font-weight: 700; }
.pg-card small .ic { inline-size: 13px; block-size: 13px; }
.pg-card b { font-size: var(--fs-sm); font-weight: 650; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pg-next { grid-column: 2; text-align: end; }
.pg-next small { justify-self: end; }
@media (hover: hover) and (pointer: fine) { .pg-card:hover { background: color-mix(in srgb, var(--indigo) 5%, var(--card)); } }
.pg-card:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
html:is([data-motion="2"], [data-motion="3"]) .pg-card:active, html:is([data-motion="2"], [data-motion="3"]) .ep-show:active { transform: scale(0.985); }

.ep-more { display: grid; gap: 10px; }
.ep-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ep-more-head h2 { margin: 0; font-size: var(--fs-lg); }
.ep-more-head a { display: inline-flex; align-items: center; min-block-size: 44px; font-size: var(--fs-sm); font-weight: 650; text-decoration: none; color: var(--indigo); }

@media (prefers-reduced-motion: reduce) {
  .lsr, .ls.htmx-request .ls-spin { animation: none !important; }
  .pc-art .pod-cover, .pc-art .pod-sq { transition: none; }
}

/* ---- clip cards (_clip_card.html): generated artwork when there is no poster ------------------------------------ */
.mc-art.mc-gen { place-items: stretch; container-type: inline-size; inline-size: 100%; min-inline-size: 0; align-self: start; }
/* physical sides: these children are LTR (English, durations), and a logical inset follows the element's own direction */
.mc-gen-t { position: absolute; left: 8cqi; right: 8cqi; bottom: 38px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  line-clamp: 3; overflow: hidden; color: #fff; font: 800 max(13px, 7.4cqi)/1.18 var(--f-body); letter-spacing: -0.01em; text-align: left;
  text-wrap: balance; text-shadow: 0 1px 8px rgb(0 0 0 / 0.25); }
@container (max-width: 260px) { .mc-gen-t { -webkit-line-clamp: 2; line-clamp: 2; } }
.mc-kind { position: absolute; bottom: 8px; left: 8px; display: grid; place-items: center; inline-size: 26px; block-size: 26px;
  border-radius: 50%; color: #fff; background: rgb(0 0 0 / 0.4); }
.mc-kind .ic { inline-size: 13px; block-size: 13px; }
.mc-en { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] .mc-en { text-align: right; }
html:is([data-motion="2"], [data-motion="3"]) .mcard .mc-art img { transition: transform var(--dur-2, 240ms) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { html:is([data-motion="2"], [data-motion="3"]) .mcard:hover .mc-art img { transform: scale(1.03); } }

/* «ادامه‌ی شنیدن / تماشا» cards (resume.js writes English LTR): on the page's side in RTL */
html[dir="rtl"] .pod-resume [dir="ltr"] { text-align: right; }

/* the section's four doors on a phone: one line each, no wrapping (library.css gives them equal widths) */
.lib-tabs { display: flex; inline-size: 100%; }
.lib-tabs a { flex: 1 1 auto; justify-content: center; white-space: nowrap; min-inline-size: 0; }  /* kashi's .seg-tabs a is flex: none */
@media (max-width: 420px) { .lib-tabs a { padding-inline: 6px; font-size: var(--fs-xs); } }

.listening-mast { padding: clamp(18px, 4vw, 36px); border: 1px solid var(--hair); border-radius: 24px; background: radial-gradient(ellipse at top left, var(--accent-soft), transparent 72%), var(--card); }
.listening-mast :is(h1, p) { max-inline-size: 45rem; }
.listening-mast .btn { margin-block-start: 6px; }
.listen-catalog { margin-block: 18px; padding: 16px; border: 1px solid var(--hair); border-radius: 18px; background: var(--card); scroll-margin-block-start: calc(var(--safe-t, 0px) + 84px); }
.listen-catalog h2 { margin-block: 0 10px; font-size: var(--fs-lg); }
.listen-catalog .fb { margin-block-end: 0; }
.listening-library .pod-card { border-radius: 20px; }
.listening-show .sh-hero { border-radius: 26px; }
.listening-show .ep-row { min-block-size: 64px; }
.listen-anchors { display: flex; flex-wrap: wrap; gap: 8px; }
.listen-anchors a { display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding-inline: 12px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card); color: var(--ink); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
.listen-anchors a:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

.listen-facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin-block: 10px; }
.listen-facts li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 9px; background: var(--paper-2); color: var(--ink-2); font-size: var(--fs-xs); }
.listening-show #show-episodes { scroll-margin-block-start: calc(var(--safe-t, 0px) + 84px); }
.sh-publisher { display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; color: var(--ink-2); font-size: var(--fs-sm); }

/* A cover, the listening details and the tap target read as one shelf card. */
.lib .pod-grid .pod-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-inline-size: 0;
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background: var(--card);
  gap: 0;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.lib .pod-grid .pc-art { margin: 6px 6px 0; min-inline-size: 0; }
.lib .pod-grid .pc-art :is(.pod-cover, .pod-sq) { inline-size: 100%; border-radius: var(--r-md); }
.lib .pod-grid .pc-art img { object-fit: contain; background: var(--surface-2); }
.lib .pod-grid .pod-body { flex: 1; min-inline-size: 0; padding: 10px 11px 13px; display: flex; flex-direction: column; gap: 5px; }
.lib .pod-grid .pod-title { overflow-wrap: anywhere; }
.lib .pod-grid .pod-en { text-align: end; }
.lib .pod-grid .pod-len { margin-block-start: auto; }
.lib .pod-grid .pod-tags .tag { line-height: 1.55; }
.lib .pod-grid .pod-tags .tag.warn { color: var(--warn-ink); background: var(--warn-soft); }
@media (hover: hover) and (pointer: fine) {
  .lib .pod-grid .pod-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px -18px var(--accent); }
  html:is([data-motion="2"], [data-motion="3"]) .lib .pod-grid .pod-card:hover .pc-art > * { transform: none; }
}
@media (max-width: 520px) {
  .lib .pod-grid { gap: 10px; }
  .lib .pod-grid .pod-body { padding: 8px; }
  .lib .pod-grid .pod-meta > span + span::before { content: none; }
}
