/* Radio Crime · رادیو کرایم */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("fonts/Lalezar-Arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("fonts/Lalezar-Latin.woff2") format("woff2");
  unicode-range: U+0000-00FF;
  font-display: swap;
}

:root {
  --bg: #121110;
  --bg-2: #1a1816;
  --bg-3: #23201d;
  --line: #34302b;
  --text: #efe8db;
  --muted: #aea595;
  --paper: #e6d6b6;
  --red: #c4161c;
  --red-hover: #dc1f26;
  --red-text: #f0565a;
  --radius: 6px;
  --wrap: 1180px;
  --display: "Lalezar", "Vazirmatn", system-ui, sans-serif;
  --body: "Vazirmatn", Tahoma, system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.9 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}
/* Fine film grain, kept behind all content so text stays clean */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 .8  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--red-text); text-underline-offset: .3em; }
a:hover { color: #ff7a7d; }
:focus-visible { outline: 2px solid var(--red-text); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--red); color: #fff; padding: .5rem 1rem; z-index: 50; border-radius: var(--radius); }
.skip:focus { top: .75rem; }

/* ── Preview banner ── */
.preview-bar {
  background: repeating-linear-gradient(-45deg, #2a1111 0 12px, #321313 12px 24px);
  border-bottom: 1px solid #5a1a1c;
  color: var(--paper);
  font-size: .85rem;
  text-align: center;
  padding: .45rem 1rem;
  line-height: 1.6;
}
.preview-bar strong { color: #fff; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 17, 16, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--paper); }
.brand img { width: 40px; height: 40px; border-radius: 4px; }
.wordmark { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.wordmark b { font: 400 1.6rem/1.1 var(--display); color: var(--paper); letter-spacing: 0; }
.wordmark small {
  display: flex; align-items: center; gap: .35rem;
  font: 600 .5rem/1 var(--body); letter-spacing: .32em; color: var(--paper); opacity: .85; margin-top: .2rem;
  direction: ltr;
}
.wordmark small::before, .wordmark small::after { content: ""; width: 12px; height: 1px; background: var(--red); }
.nav { display: flex; align-items: center; gap: .15rem; }
.nav a {
  color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: .45rem .6rem; border-radius: var(--radius); white-space: nowrap;
}
.nav a:hover { background: var(--bg-3); color: #fff; }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.nav .yt { display: inline-flex; align-items: center; gap: .35rem; }
.nav .yt svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 420px) {
  .brand img { display: none; }
  .nav a { padding: .4rem .45rem; font-size: .85rem; }
  .nav .yt span { display: none; }
}

/* ── Section rule (echoes the red lines around the cover wordmark) ── */
.rule {
  display: flex; align-items: center; gap: .8rem;
  font: 700 .78rem/1 var(--body); letter-spacing: .02em; color: var(--paper);
  margin: 0 0 1rem;
}
.rule::before, .rule::after { content: ""; height: 1px; background: var(--red); flex: 0 0 28px; }
.rule::after { flex: 1; background: linear-gradient(to left, var(--red), transparent); }

/* ── Titles ── */
.ep-title { font: 400 clamp(2rem, 7.5vw, 3.6rem)/1.35 var(--display); color: var(--text); margin: 0; }
.ep-case {
  display: flex; align-items: center; gap: .6rem;
  margin: .35rem 0 0; font: 700 clamp(1.05rem, 3.6vw, 1.35rem)/1.6 var(--body); color: var(--paper);
}
.ep-case::before { content: ""; width: 22px; height: 2px; background: var(--red); flex: none; }
.ep-case .en { font-weight: 400; color: var(--muted); font-size: .8em; direction: ltr; unicode-bidi: isolate; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); font-size: .9rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.meta li { display: inline-flex; align-items: center; gap: .4rem; }
.meta svg { width: 16px; height: 16px; opacity: .8; }
.placeholder { color: var(--muted); font-style: normal; border: 1px dashed #5a524a; border-radius: var(--radius); padding: .1rem .6rem; font-family: var(--body); font-size: .8em; display: inline-block; line-height: 1.8; }

/* ── Cover frame ── */
.cover {
  position: relative; aspect-ratio: 1 / 1; background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(230, 214, 182, .12), 0 18px 40px -18px rgba(0, 0, 0, .9);
}
.cover img { width: 100%; height: 100%; object-fit: contain; }
.cover-note {
  position: absolute; inset-inline: 0; bottom: 0; background: rgba(0,0,0,.75); color: var(--paper);
  font-size: .75rem; text-align: center; padding: .3rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  background: var(--red); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  font: 700 1rem/1 var(--body); padding: .95rem 1.5rem; border-radius: 999px; min-height: 48px;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--red-hover); color: #fff; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }

/* ── Homepage: featured ── */
.featured { padding: 1.5rem 0 2.5rem; border-bottom: 1px solid var(--line);
  background: radial-gradient(120% 70% at 70% 0%, rgba(196, 22, 28, .12), transparent 60%); }
.featured-grid { display: grid; gap: 1.4rem; }
.featured .cover { max-width: 520px; width: 100%; }
.featured .summary { color: var(--text); opacity: .92; margin: 1rem 0 1.4rem; max-width: 60ch; }
.schedule { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.schedule::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(196,22,28,.2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
@media (min-width: 820px) {
  .featured { padding: 3rem 0 3.5rem; }
  .featured-grid { grid-template-columns: minmax(0, 440px) 1fr; align-items: center; gap: 3rem; }
}

/* ── Archive ── */
.archive { padding: 2.25rem 0 3.5rem; }
.archive-head { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.archive-head h1, .archive-head h2 { font: 400 clamp(1.7rem, 5vw, 2.3rem)/1.3 var(--display); margin: 0; color: var(--text); }
.archive-head .count { color: var(--muted); font-size: .9rem; margin: 0; }
.search { position: relative; }
.search input {
  width: 100%; font: 500 1rem/1.5 var(--body); color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .8rem 2.9rem .8rem 2.8rem; min-height: 50px;
}
.search input::placeholder { color: #8a8174; }
.search input:focus { outline: none; border-color: var(--red-text); box-shadow: 0 0 0 3px rgba(240, 86, 90, .2); }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon { position: absolute; inset-inline-start: 1rem; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search .clear { position: absolute; inset-inline-end: .5rem; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.search .clear:hover { background: var(--bg-3); color: var(--text); }
.search input:placeholder-shown ~ .clear { display: none; }
@media (min-width: 820px) {
  .archive-head { grid-template-columns: 1fr minmax(280px, 400px); align-items: end; }
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem .9rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem 1.25rem; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card a { display: block; text-decoration: none; color: inherit; }
.card .cover { transition: transform .2s, box-shadow .2s; }
.card a:hover .cover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(240, 86, 90, .55), 0 22px 40px -18px rgba(0,0,0,.9); }
.card h3 { font: 400 clamp(1.15rem, 4.2vw, 1.4rem)/1.45 var(--display); margin: .75rem 0 0; color: var(--text); }
.card .case { margin: .1rem 0 0; font-size: .88rem; font-weight: 600; color: var(--paper); line-height: 1.6; }
.card .meta { font-size: .78rem; margin-top: .35rem; gap: .2rem .8rem; }
.badge { position: absolute; top: .5rem; inset-inline-start: .5rem; z-index: 1; background: #000c; color: var(--paper); border: 1px solid #6a5f52; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: .05rem .55rem; line-height: 1.7; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty b { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: .3rem; }

/* ── Episode page ── */
.episode { padding: 1.25rem 0 3.5rem; }
.back { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; font-weight: 600; text-decoration: none; }
.back svg { width: 18px; height: 18px; }
.ep-hero { display: grid; gap: 1.4rem; margin-top: 1rem; }
.ep-hero .cover { width: 100%; max-width: 560px; }
@media (min-width: 900px) {
  .ep-hero { grid-template-columns: minmax(0, 460px) 1fr; gap: 3rem; align-items: start; }
  .ep-hero .cover { position: sticky; top: 88px; }
}
.ep-body { display: grid; gap: 2.2rem; margin-top: 2rem; max-width: 68ch; }
.ep-body h2 { font: 800 1.2rem/1.5 var(--body); color: var(--paper); margin: 0 0 .6rem; display: flex; align-items: center; gap: .6rem; }
.ep-body h2::before { content: ""; width: 4px; height: 1.1em; background: var(--red); border-radius: 2px; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin: 0; }

.warning { display: flex; gap: .8rem; background: #1e1312; border: 1px solid #4d2224; border-inline-start: 4px solid var(--red); border-radius: var(--radius); padding: .9rem 1rem; margin-top: 1.2rem; }
.warning svg { width: 22px; height: 22px; flex: none; color: var(--red-text); margin-top: .25rem; }
.warning strong { display: block; color: #fff; font-size: .95rem; }
.warning p { margin: 0; font-size: .92rem; color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 1.2rem 1.1rem 0; padding-inline: 1.2rem 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: .65rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--red); }
.timeline time { display: block; font-weight: 800; color: var(--paper); font-size: .9rem; }
.sources { margin: 0; padding-inline-start: 1.2rem; }
.sources li { margin-bottom: .4rem; }
.sources a { overflow-wrap: anywhere; }
.bottom-back { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ── Audio player ── */
.player {
  margin-top: 1.4rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem; box-shadow: 0 16px 30px -20px #000;
}
.player audio { width: 100%; }
.player .ui { display: grid; gap: .85rem; }
.p-controls { display: flex; align-items: center; justify-content: center; gap: .9rem; direction: ltr; }
.p-btn { border: 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.p-btn:hover { background: var(--bg-3); }
.p-skip { width: 48px; height: 48px; position: relative; }
.p-skip svg { width: 30px; height: 30px; }
.p-skip span { position: absolute; font: 800 .6rem/1 var(--body); top: 54%; left: 50%; translate: -50% -50%; }
.p-play { width: 64px; height: 64px; background: var(--red); color: #fff; box-shadow: 0 8px 22px -8px rgba(196, 22, 28, .8); }
.p-play:hover { background: var(--red-hover); }
.p-play svg { width: 28px; height: 28px; }
.p-play .i-pause, .is-playing .p-play .i-play { display: none; }
.is-playing .p-play .i-pause { display: block; }
.is-loading .p-play { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(196, 22, 28, .25); } }
.p-speed { min-width: 52px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text); font: 700 .85rem/1 var(--body); cursor: pointer; }
.p-speed:hover { border-color: var(--red-text); }
.p-track { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; direction: ltr; font: 600 .8rem/1 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.p-seek {
  --p: 0%; -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
}
.p-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--red) var(--p), #3d3833 var(--p)); }
.p-seek::-moz-range-track { height: 6px; border-radius: 3px; background: #3d3833; }
.p-seek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--red); }
.p-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; margin-top: -6px; box-shadow: 0 0 0 4px rgba(196, 22, 28, .35); }
.p-seek::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(196, 22, 28, .35); }
.p-label { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); }
.p-error { color: var(--red-text); font-size: .88rem; margin: 0; text-align: center; }
.no-audio { margin-top: 1.4rem; display: flex; align-items: center; gap: .7rem; background: var(--bg-2); border: 1px dashed #4a433c; border-radius: 14px; padding: 1rem 1.1rem; color: var(--muted); }
.no-audio svg { width: 22px; height: 22px; flex: none; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: .88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer .brand img { width: 52px; height: 52px; }
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Platform links (YouTube, Spotify, Castbox, Instagram) ── */
.nav-icons { display: inline-flex; align-items: center; gap: .1rem; margin-inline-start: .35rem; padding-inline-start: .5rem; border-inline-start: 1px solid var(--line); }
.nav .ico { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; color: var(--paper); }
.nav .ico svg { width: 19px; height: 19px; }
.nav .ico:hover { color: #fff; background: var(--bg-3); }
@media (max-width: 640px) { .nav-icons { border: 0; margin: 0; padding: 0; } .nav-icons .ico:not(:first-child) { display: none; } }
.platforms { margin-top: 1.6rem; }
.platforms-lead { margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); }
.platforms ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.pf {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .45rem .95rem .45rem .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2);
  color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 600;
  transition: border-color .15s, color .15s;
}
.pf svg { width: 20px; height: 20px; flex: none; color: var(--paper); }
.pf:hover { color: #fff; border-color: var(--red-text); }
.pf:hover svg { color: #fff; }
@media (max-width: 420px) { .platforms ul { display: grid; grid-template-columns: 1fr 1fr; } .pf { justify-content: center; } }
.platforms--episode { margin-top: 1.1rem; }
.platforms--footer { margin: 0; flex-basis: 100%; }
@media (min-width: 820px) { .platforms--footer { flex-basis: auto; } }
