/* رنگ‌ها از لوگو: زمینه غالب سفید است و آبی #072F6C برای متن و تأکیدها. */
:root {
  --brand: #072f6c;
  --white: #fff;
  --bg: #f6f8fb;
  --surface: #fff;
  --surface-2: #eef2f9;
  --line: rgba(7, 47, 108, .13);
  --text: #0e1f3f;
  --muted: #5d6b86;
  --accent: #072f6c;
  --up: #0d7a46;
  --down: #c02b2b;
  --top: 64px;
  --rail: 84px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 12px); }
/* فونت وزیرمتن (مجوز OFL، متن آن در /fonts/OFL.txt) */
@font-face { font-family: Vazirmatn; src: url('/fonts/Vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
body { background: var(--bg); color: var(--text); font: 14px/1.8 Vazirmatn, IRANSansX, "Segoe UI", Tahoma, sans-serif; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand img { height: 50px; width: auto; }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 10px; padding: 7px 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.today { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 7px 14px; border: 1px solid var(--line); }
.btn.primary { background: var(--brand); color: var(--white); font-weight: 700; border-color: var(--brand); }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: wait; }

.rail { position: fixed; top: var(--top); bottom: 0; right: 0; width: var(--rail); z-index: 15; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.rail a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rail a:hover { color: var(--text); background: var(--surface-2); }
.rail a.active { color: var(--white); background: var(--brand); font-weight: 700; }

.page { margin-right: var(--rail); padding: calc(var(--top) + 16px) 16px 24px; min-height: calc(100vh - 250px); }
.page > * { max-width: 1180px; margin-inline: auto; }
.notice { background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 10px; padding: 8px 14px; margin-bottom: 16px; font-size: 13px; }
.layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
main, aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { font-size: 17px; border-inline-start: 4px solid var(--brand); padding-inline-start: 10px; line-height: 1.5; }

.media { position: relative; overflow: hidden; border-radius: 10px; display: grid; place-items: center; flex: none; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media img.mark { inset: 0; margin: auto; width: 55%; height: 75%; object-fit: contain; opacity: .22; }
.tone-0 { background: linear-gradient(135deg, #f4f7fc, #e3eaf6); }
.tone-1 { background: linear-gradient(200deg, #fff, #e8eef8); }
.tone-2 { background: linear-gradient(45deg, #e6ecf7, #f8fafd); }
.tone-3 { background: radial-gradient(circle at 25% 20%, #fff, #e4ebf7 75%); }
.tone-4 { background: linear-gradient(315deg, #eef2f9, #fbfcfe 65%); }

.hero { padding: 0; overflow: hidden; }
.slides { position: relative; }
.slide { display: none; position: relative; }
.slide.active { display: block; animation: fade .4s; }
@keyframes fade { from { opacity: 0; } }
.slide .media { border-radius: 0; aspect-ratio: 16 / 8; }
.slide-text { padding: 12px 18px 4px; border-top: 1px solid var(--line); }
.slide-text h2 { font-size: 20px; line-height: 1.7; }
.slide-text p { color: var(--muted); }
.tag { display: inline-block; background: var(--brand); color: var(--white); font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 0 8px; margin-bottom: 4px; }
.slide-progress { height: 4px; margin: 10px 18px 0; background: var(--line); border-radius: 4px; overflow: hidden; }
.slide-progress span { display: block; height: 100%; background: var(--brand); transform-origin: right; }
.thumbs { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 10px; }
.thumb { flex: 1; max-width: 150px; min-width: 0; padding: 0; border-radius: 10px; opacity: .55; border: 2px solid transparent; }
.thumb.active { opacity: 1; border-color: var(--brand); }
.thumb .media { aspect-ratio: 16 / 9; border-radius: 8px; }
.arrow { font-size: 26px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.arrow:hover { background: var(--surface-2); }

.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
.story { position: relative; flex: 0 0 128px; }
.story .media { aspect-ratio: 9 / 15; }
.story h3 { padding-top: 6px; font-size: 12.5px; text-align: center; }
.story-tag { position: absolute; top: 8px; right: 8px; font-size: 10.5px; background: var(--brand); color: var(--white); border-radius: 20px; padding: 0 8px; font-weight: 700; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding: 2px; }
.chip { white-space: nowrap; padding: 3px 14px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--brand); color: var(--white); border-color: var(--brand); font-weight: 700; }

.prices { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.prices th, .prices td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); }
.prices th { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.prices tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.slide.active, .story, .video { display: block; }
.news { display: flex; gap: 10px; align-items: flex-start; }
.news .media { width: 112px; aspect-ratio: 16 / 10; }
h1, h2 { color: var(--brand); }
h3 { font-size: 13.5px; font-weight: 700; line-height: 1.75; }
small { color: var(--muted); font-size: 11.5px; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.video-frame { position: relative; margin-bottom: 8px; }
.video-frame .media { aspect-ratio: 16 / 10; }
.play { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--white); box-shadow: 0 0 0 3px var(--white); direction: ltr; padding-left: 3px; }
.duration { position: absolute; bottom: 6px; left: 6px; background: rgba(2, 12, 32, .8); color: var(--white); border-radius: 6px; padding: 0 7px; font-size: 11.5px; }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--brand); min-height: 96px; }
.banner img { height: 68px; }
.banner span { color: var(--muted); }
.latest ul { list-style: none; }
.latest li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.latest .row { display: flex; gap: 10px; }
.latest li .media { width: 84px; height: 56px; }
.latest li h3 { font-size: 12.5px; }
.latest:not(.open) li.extra:not(.match) { display: none; }
.more { width: 100%; padding: 10px 0 0; color: var(--accent); font-weight: 700; }

.single { max-width: 820px; padding: 22px; }
.card-head h1 { font-size: 22px; border-inline-start: 4px solid var(--brand); padding-inline-start: 10px; line-height: 1.5; }
.prose p + p { margin-top: 8px; }
.pending { color: var(--muted); }
.contact-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.contact-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--brand); color: var(--brand); text-align: center; transition: transform .15s; }
.contact-card:hover { transform: translateY(-3px); background: var(--surface-2); }
.contact-card svg { width: 34px; height: 34px; }
.contact-card strong { font-size: 16px; }
.contact-card span { font-size: 12.5px; opacity: .8; }

.footer { margin-right: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 16px; border-top: 3px solid var(--brand); background: var(--surface); }
.footer img { height: 90px; }
.footer div { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer a:hover { color: var(--accent); }

dialog { margin: auto; width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; background: var(--surface); color: var(--text); padding: 20px; }
dialog { box-shadow: 0 20px 60px rgba(7, 47, 108, .25); }
dialog::backdrop { background: rgba(7, 47, 108, .35); }
form { display: flex; flex-direction: column; gap: 10px; }
form header { display: flex; justify-content: space-between; align-items: center; }
form header h2 { font-size: 18px; }
.close { font-size: 26px; line-height: 1; padding: 2px 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
input:not([type=search], [type=checkbox]), textarea, select { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 100%; }
select option { background: var(--bg); }
textarea { resize: vertical; }
form input.trap { position: absolute; width: 1px; height: 1px; opacity: 0; clip-path: inset(50%); pointer-events: none; }
.form-status { min-height: 1.5em; font-size: 13px; }
.form-status.error { color: var(--down); }
.form-status.ok { color: var(--up); }

/* صفحه خبر */
.article { max-width: 820px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px; }
.article > * { max-width: 100%; }
.article .notice { margin: 0; }
.article .tag { margin: 0; }
.article h1 { font-size: 24px; line-height: 1.7; overflow-wrap: anywhere; }
.article .lead { font-size: 15px; color: var(--muted); }
.article .cover { width: 100%; max-height: 480px; object-fit: contain; background: var(--bg); border-radius: 12px; }
.article .prose { font-size: 15px; line-height: 2.1; overflow-wrap: anywhere; }
.article .more { width: auto; }

/* محتوای پویا */
.search { flex-direction: row; gap: 8px; }
.head-link { color: var(--accent); font-weight: 700; font-size: 13px; }
.announcement { background: var(--brand); color: var(--white); border-radius: 10px; padding: 9px 16px; margin-bottom: 16px; text-align: center; }
.layout.wide { grid-template-columns: minmax(0, 1fr); }
.banner.picture { padding: 0; overflow: hidden; border-style: solid; }
.banner img.full { width: 100%; height: auto; }
a.tag { align-self: flex-start; }
.related { max-width: 820px; margin-top: 16px; }
.single, .article, .related { margin-inline: auto; }
.listing .card-head h1 { margin: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.prose { width: 100%; overflow-wrap: anywhere; }
.prose h2 { font-size: 19px; margin: 18px 0 6px; }
.prose h3 { font-size: 16px; margin: 14px 0 4px; }
.prose ul { padding-inline-start: 22px; margin: 8px 0; }
.prose blockquote { border-inline-start: 4px solid var(--brand); background: var(--surface-2); border-radius: 8px; padding: 10px 16px; margin: 12px 0; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose figure { margin: 14px 0; }
.prose figure img { border-radius: 12px; margin-inline: auto; }
.prose figcaption { text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.contact-info { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.contact-info div { display: flex; gap: 10px; }
.contact-info dt { color: var(--muted); min-width: 56px; }
.footer p { color: var(--muted); text-align: center; max-width: 560px; }
.footer .social a { border: 1px solid var(--line); border-radius: 20px; padding: 2px 14px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .today { display: none; }
  .search { margin-inline-end: auto; }
}
@media (max-width: 640px) {
  :root { --top: 58px; --rail: 0px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand img { height: 44px; }
  .topbar .btn span { display: none; }
  .rail { scrollbar-width: none; top: auto; left: 0; width: auto; height: 60px; flex-direction: row; overflow-x: auto; border-top: 1px solid var(--line); }
  .rail a { flex: 1 0 64px; padding: 7px 4px; font-size: 10.5px; }
  .page { padding-inline: 10px; }
  .footer { padding-bottom: 88px; }
  .news-grid, .video-grid, .contact-cards { grid-template-columns: minmax(0, 1fr); }
  .slide .media { aspect-ratio: 16 / 10; }
  .slide-text h2 { font-size: 16px; }
  .slide-text p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* نشان روی دکمه انتخاب‌شده، برعکس رنگ دکمه */
.chip.active .badge { background: var(--white); color: var(--brand); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.intro { color: var(--muted); margin: 0 0 12px; }

.prices-time { color: var(--muted); font-size: 12px; margin-top: 8px; }
.player { width: 100%; max-height: 520px; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }
.quality { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.quality select { font: inherit; color: var(--text); background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { display: block; border: 1px solid var(--line); border-radius: 20px; padding: 2px 12px; font-size: 12.5px; }
.tag-list a:hover { background: var(--surface-2); }
.comments { max-width: 820px; width: 100%; margin: 16px auto 0; padding: 22px; }
.comments ol { list-style: none; margin-bottom: 18px; }
.comments li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comments li header { display: flex; justify-content: space-between; gap: 12px; }
.comments li p { white-space: pre-line; overflow-wrap: anywhere; }
.comments .reply { margin-top: 8px; background: var(--surface-2); border-inline-start: 4px solid var(--brand); border-radius: 8px; padding: 8px 14px; }
.comment-form .btn { align-self: flex-start; }
.prices .up, .prices .down { white-space: nowrap; }
.prices-box { max-height: 520px; overflow: auto; overscroll-behavior: auto; }
.prices-box thead th { position: sticky; top: 0; background: #fff; box-shadow: 0 1px 0 var(--line); }
.prices-box .prices { overflow: visible; border-collapse: separate; border-spacing: 0; }
