/* Varnak Media - public site styles (v3).
   Shape lock: one subtle radius (--r) on every image, card, button, input and box.
   Only avatars and icon-only buttons are full circles. Full-width bands stay square.
   Colour lock: indigo is the brand surface (cover, footer, marks); red is the single accent
   (kickers, progress bar, active states). RTL-first with logical properties. */

@font-face { font-family: "IRANSansX"; font-weight: 400; font-display: swap; src: url("../../fonts/iranSanX/fonts/woff2/IRANSansX-Regular.woff2") format("woff2"); }
@font-face { font-family: "IRANSansX"; font-weight: 500; font-display: swap; src: url("../../fonts/iranSanX/fonts/woff2/IRANSansX-Medium.woff2") format("woff2"); }
@font-face { font-family: "IRANSansX"; font-weight: 700; font-display: swap; src: url("../../fonts/iranSanX/fonts/woff2/IRANSansX-Bold.woff2") format("woff2"); }
@font-face { font-family: "IRANSansX"; font-weight: 900; font-display: swap; src: url("../../fonts/iranSanX/fonts/woff2/IRANSansX-Black.woff2") format("woff2"); }
@font-face { font-family: "Varnak Naskh"; font-weight: 400; font-display: swap; src: url("../../fonts/B-Zar/B_Zar_0.ttf") format("truetype"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Varnak Naskh"; font-weight: 700; font-display: swap; src: url("../../fonts/B-Zar/B_Zar_Bold_0.ttf") format("truetype"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  --paper: #fbfbfd;
  --paper-2: #f0f1f8;
  --card: #ffffff;
  --ink: #14152b;
  --ink-2: #3a3c58;
  --muted: #5f6280;
  --rule: #dfe0ec;
  --brand: #2e3192;
  --brand-ink: #2e3192;
  --brand-soft: #e7e8f7;
  --cover: #23266f;
  --cover-2: #1a1c56;
  --on-cover: #ffffff;
  --on-cover-2: #c9cbf2;
  --accent: #d5352b;
  --accent-fill: #ef4136;
  --accent-on-cover: #ffa39b;
  --r: 10px;
  --wrap: 1280px;
  --gutter: clamp(16px, 3vw, 32px);
  --head-h: 68px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: "IRANSansX", Tahoma, "Segoe UI", system-ui, sans-serif;
  --read: "Varnak Naskh", "IRANSansX", Tahoma, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1020; --paper-2: #161832; --card: #15172e; --ink: #eef0ff; --ink-2: #c8caea; --muted: #9a9dc4;
    --rule: #2a2d52; --brand-ink: #b3b6ff; --brand-soft: #222553; --cover: #1c1f5c; --cover-2: #151745;
    --accent: #ff7b70; --accent-on-cover: #ffa39b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1020; --paper-2: #161832; --card: #15172e; --ink: #eef0ff; --ink-2: #c8caea; --muted: #9a9dc4;
  --rule: #2a2d52; --brand-ink: #b3b6ff; --brand-soft: #222553; --cover: #1c1f5c; --cover-2: #151745;
  --accent: #ff7b70; --accent-on-cover: #ffa39b; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.85; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.45; font-weight: 900; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; vertical-align: -.22em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .i-prev { transform: scaleX(-1); }
[dir="ltr"] .i-next, [dir="ltr"] .i-fwd { transform: scaleX(-1); }

/* Small red square before section titles */
.leaf { display: inline-block; width: .5em; height: .5em; background: var(--accent-fill); border-radius: 2px; flex: none; }

/* Headline link underline that grows on hover */
.hl a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-repeat: no-repeat; background-position: 100% 100%; transition: background-size .45s var(--ease); padding-bottom: 2px; }
[dir="ltr"] .hl a { background-position: 0 100%; }
.hl a:hover, .story:hover .hl a { background-size: 100% 2px; }

/* ---------- Utility bar ---------- */
.utility { background: var(--cover-2); color: var(--on-cover-2); font-size: 12.5px; }
.utility .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.utility__date { margin: 0; display: flex; gap: 14px; white-space: nowrap; overflow: hidden; }
.utility__clock { color: #fff; font-weight: 700; }
.utility__end { display: flex; align-items: center; gap: 18px; margin-inline-start: auto; }
.utility a { color: #fff; opacity: .8; transition: opacity .2s; }
.utility a:hover { opacity: 1; }
.langs { display: flex; gap: 14px; }
.langs a { font-weight: 500; padding-block: 6px; }
.langs a[aria-current="true"] { opacity: 1; box-shadow: inset 0 -2px 0 var(--accent-fill); }
.social-mini { display: none; gap: 12px; }
@media (min-width: 760px) { .social-mini { display: flex; } }
@media (max-width: 520px) { .utility__date time { display: none; } }

/* ---------- Masthead (one sticky bar) ---------- */
.masthead { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--rule); }
@supports (background: color-mix(in srgb, red 50%, blue)) and (backdrop-filter: blur(8px)) {
  .masthead { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
}
.masthead__bar { display: flex; align-items: center; gap: 14px; min-height: var(--head-h); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; }
.brand__mark { width: 44px; height: 44px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand__name { font-size: clamp(16px, 2vw, 21px); font-weight: 900; color: var(--brand-ink); white-space: nowrap; }
.brand__tag { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.brand__short { display: none; font-size: 22px; font-weight: 900; color: var(--brand-ink); }
@media (max-width: 479px) { .brand__name { display: none; } .brand__short { display: block; } }
.brand { flex: 0 1 auto; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); transition: background .2s; flex: none; }
.icon-btn:hover { background: var(--brand-soft); }
.icon-btn--line { border: 1px solid var(--rule); }
.masthead__actions { display: flex; gap: 2px; margin-inline-start: auto; }
.mainnav { display: none; }
@media (max-width: 1199px) { .brand__tag { display: none; } }
@media (min-width: 1024px) {
  .masthead__menu { display: none; }
  .mainnav { display: block; margin-inline-start: auto; }
  .masthead__actions { margin-inline-start: 0; }
  .mainnav__list { display: flex; list-style: none; margin: 0; padding: 0; }
  .mainnav__list > li { position: relative; }
  .mainnav__list > li > a { display: flex; align-items: center; height: var(--head-h); padding-inline: 12px; font-size: 14.5px; font-weight: 700; white-space: nowrap; position: relative; }
  .mainnav__list > li > a::after { content: ""; position: absolute; inset-inline: 12px; bottom: 15px; height: 3px; background: var(--accent-fill); transform: scaleX(0); transition: transform .3s var(--ease); }
  .mainnav__list > li > a:hover::after, .mainnav__list > li > a[aria-current="page"]::after { transform: scaleX(1); }
  .nav__sub { position: absolute; top: 100%; inset-inline-start: 0; min-width: 230px; list-style: none; margin: 0; padding: 10px 0; background: var(--card); border: 1px solid var(--rule); box-shadow: 0 18px 40px rgba(20, 21, 70, .14); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .2s, transform .25s var(--ease), visibility .2s; border-radius: var(--r); }
  .mainnav__list > li:hover > .nav__sub, .mainnav__list > li:focus-within > .nav__sub { opacity: 1; visibility: visible; transform: none; }
  .nav__sub a { display: block; padding: 8px 18px; font-size: 14px; font-weight: 500; }
  .nav__sub a:hover { color: var(--accent); }
  .nav__sub .nav__sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 14px 0 0; }
}
@media (min-width: 1024px) and (max-width: 1199px) { .mainnav__list > li > a { padding-inline: 9px; font-size: 14px; } }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; overflow: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(10, 11, 35, .55); opacity: 0; transition: opacity .25s; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel { position: absolute; inset-block: 0; inset-inline-start: 0; width: min(88vw, 380px); background: var(--paper); color: var(--ink); overflow-y: auto; transform: translateX(100%); transition: transform .35s var(--ease); padding: 18px 22px; display: flex; flex-direction: column; gap: 20px; }
[dir="ltr"] .drawer__panel { transform: translateX(-100%); }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__menu, .drawer__menu ul { list-style: none; margin: 0; padding: 0; }
.drawer__menu > li { border-bottom: 1px solid var(--rule); }
.drawer__menu a { display: block; padding: 12px 0; font-weight: 700; font-size: 17px; }
.drawer__menu a[aria-current="page"] { color: var(--accent); }
.drawer__menu ul { padding-bottom: 10px; }
.drawer__menu ul a { font-weight: 500; font-size: 15px; padding: 6px 16px 6px 0; color: var(--ink-2); }
[dir="ltr"] .drawer__menu ul a { padding: 6px 0 6px 16px; }
body.no-scroll { overflow: hidden; }
.searchbox { display: flex; align-items: center; width: 100%; border: 1.5px solid var(--ink); background: var(--card); overflow: hidden; border-radius: var(--r); }
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 10px 14px; outline: none; }
.searchbox input::placeholder { color: var(--muted); }
.searchbox button { border: 0; background: var(--ink); color: var(--paper); width: 48px; height: 48px; display: grid; place-items: center; flex: none; }

/* ---------- Breaking news marquee ----------
   Headlines move in the reading direction (to the right in Dari/Pashto, to the left in English).
   Pauses on hover/focus and with its button; still and swipeable under reduced motion. */
.breaking { background: var(--paper); border-bottom: 1px solid var(--rule); }
.breaking__bar { display: flex; align-items: center; gap: 12px; min-height: 50px; }
.breaking__label { flex: none; margin: 0; font-size: 13px; font-weight: 900; line-height: 1.4; color: #fff; background: var(--accent-fill); padding: 6px 12px; border-radius: var(--r); white-space: nowrap; }
.breaking__viewport { position: relative; flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to left, transparent, #000 28px, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to left, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.breaking__track { display: flex; width: max-content; animation: marquee var(--marquee-dur, 70s) linear infinite; }
.breaking__list { display: flex; list-style: none; margin: 0; padding: 0; }
.breaking__list li { display: flex; align-items: center; white-space: nowrap; }
.breaking__list li::after { content: ""; width: 6px; height: 6px; margin-inline: 22px; background: var(--accent-fill); border-radius: 2px; }
.breaking__list a { font-size: 14.5px; font-weight: 700; padding-block: 12px; }
.breaking__list a:hover { color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(var(--marquee-shift, 50%)); } }
[dir="ltr"] .breaking__track { --marquee-shift: -50%; }
.breaking:hover .breaking__track, .breaking:focus-within .breaking__track, .breaking.is-paused .breaking__track { animation-play-state: paused; }
.breaking__toggle .icon-play { display: none; }
.breaking.is-paused .breaking__toggle .icon-play { display: block; }
.breaking.is-paused .breaking__toggle .icon-pause { display: none; }
@media (max-width: 479px) { .breaking__label { font-size: 12px; padding: 5px 9px; } .breaking__list a { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) {
  .breaking__viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; scrollbar-width: none; }
  .breaking__list[aria-hidden="true"], .breaking__toggle { display: none; }
}

/* ---------- Story building blocks ---------- */
main { display: block; }
/* Photo frames: one shape (5:3, the size the dashboard saves uploads at). Photos fill the frame
   (object-fit: cover): kept in proportion, never stretched; only a sliver is trimmed if a photo
   has a different shape. */
.media { position: relative; display: block; overflow: hidden; background: var(--paper-2); aspect-ratio: 5 / 3; border-radius: var(--r); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .8s var(--ease); }
.story:hover .media img, .media-btn:hover .media img { transform: scale(1.035); }
.kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--accent); line-height: 1.5; }
.kicker::before { content: ""; width: 7px; height: 7px; background: currentColor; border-radius: 2px; }
.kicker:hover { text-decoration: underline; text-underline-offset: 4px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.story { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.story__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.story__title { font-size: 17.5px; font-weight: 700; line-height: 1.7; }
.story__excerpt { font-size: 14.5px; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story--row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: start; }
.story--row .story__title { font-size: 15.5px; }
.story--text .story__title { font-size: 16.5px; }
.story--big .story__title { font-size: clamp(21px, 2.3vw, 28px); line-height: 1.55; font-weight: 900; }

/* Reveal on scroll (CSS scroll-driven, no JS). Browsers without support just show the content. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal > * { animation: rise linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Section frame ---------- */
.section { padding-block: clamp(36px, 5vw, 64px); }
.section--tint { background: var(--paper-2); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.sec-head h2 { display: inline-flex; align-items: center; gap: 12px; font-size: clamp(24px, 3vw, 34px); line-height: 1.3; }
.sec-head h2 a:hover { color: var(--brand-ink); }
.more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand-ink); white-space: nowrap; padding: 10px 0; }
.more .icon { transition: transform .3s var(--ease); }
[dir="rtl"] .more:hover .icon { transform: translateX(-4px); }
[dir="ltr"] .more:hover .icon { transform: scaleX(-1) translateX(-4px); }

.cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.cols > * { min-width: 0; }
@media (min-width: 640px) { .cols--4, .cols--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cols--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Cover: indigo block at the top of the home page ---------- */
.cover { background: var(--cover); color: var(--on-cover); padding-block: clamp(24px, 4vw, 48px) clamp(36px, 5vw, 64px); }
.cover__grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
.cover__grid > * { min-width: 0; }
@media (min-width: 1024px) { .cover__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; } }
.lead { display: grid; gap: 16px; }
.lead .media { background: var(--cover-2); }
.lead:hover .media img { transform: scale(1.03); }
.cover .kicker { color: var(--accent-on-cover); }
.lead__title { font-size: clamp(26px, 3.4vw, 42px); line-height: 1.45; font-weight: 900; color: #fff; }
.lead__title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-repeat: no-repeat; background-position: 100% 100%; transition: background-size .5s var(--ease); }
.lead:hover .lead__title a { background-size: 100% 2px; }
.lead__excerpt { color: var(--on-cover-2); font-size: 16.5px; margin: 0; max-width: 62ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover .meta { color: var(--on-cover-2); }
.glance { display: flex; flex-direction: column; }
.glance__title { display: flex; align-items: center; gap: 10px; font-size: 20px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 2px solid rgba(255, 255, 255, .22); }
.glance ol { list-style: none; margin: 0; padding: 0; counter-reset: g; }
.glance li { counter-increment: g; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding-block: 15px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.glance li:last-child { border-bottom: 0; }
.glance li::before { content: counter(g); font-size: 26px; font-weight: 900; line-height: 1.1; color: var(--accent-on-cover); }
:lang(fa-AF) .glance li::before, :lang(ps-AF) .glance li::before { content: counter(g, persian); }
.glance a { font-size: 16px; font-weight: 700; line-height: 1.7; color: #fff; }
.glance a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.glance time { display: block; font-size: 12px; color: var(--on-cover-2); margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .lead, .glance li { animation: rise .7s var(--ease) both; }
  .glance li:nth-child(1) { animation-delay: .1s; } .glance li:nth-child(2) { animation-delay: .16s; }
  .glance li:nth-child(3) { animation-delay: .22s; } .glance li:nth-child(4) { animation-delay: .28s; }
  .glance li:nth-child(5) { animation-delay: .34s; }
}

/* Latest strip right under the cover */
.latest-strip { padding-block: 36px 8px; }
.latest-strip .story__title { font-size: 16px; }

/* Feature */
.feature { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.feature > * { min-width: 0; }
@media (min-width: 900px) { .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 44px; align-items: start; } }
.feature__stack { display: flex; flex-direction: column; gap: 22px; }
.feature__stack .story { padding-top: 22px; border-top: 1px solid var(--rule); }
.feature__stack .story:first-child { padding-top: 0; border-top: 0; }

/* Mosaic */
.mosaic { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.mosaic > * { min-width: 0; }
@media (min-width: 900px) { .mosaic { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; } .mosaic__main { order: 2; } }
.mosaic__rows { display: grid; gap: 20px; align-content: start; }

/* Duo */
.duo { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); }
.duo > * { min-width: 0; }
@media (min-width: 900px) { .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; } .duo > * + * { padding-inline-start: 56px; border-inline-start: 1px solid var(--rule); } }
.duo__body { display: grid; gap: 20px; }
.duo__list { display: flex; flex-direction: column; gap: 16px; }
.duo__list .story { padding-top: 16px; border-top: 1px solid var(--rule); }

/* ---------- Audio & video ---------- */
.play { position: absolute; z-index: 1; inset-inline-end: 14px; bottom: 14px; width: 54px; height: 54px; border-radius: 50%; background: var(--accent-fill); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(239, 65, 54, .35); transition: transform .3s var(--ease); }
.play .icon { width: 22px; height: 22px; }
.media-btn { display: flex; flex-direction: column; gap: 12px; text-align: start; background: none; border: 0; padding: 0; min-width: 0; width: 100%; }
.media-btn:hover .play { transform: scale(1.08); }
.media-btn .story__title { transition: color .2s; }
.media-btn:hover .story__title { color: var(--accent); }
.listen { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); }
.listen > * { min-width: 0; }
@media (min-width: 900px) { .listen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; } }
.listen__rows { display: grid; gap: 14px; margin-top: 20px; }
.listen__rows .media-btn { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; }
.listen__rows .play { width: 30px; height: 30px; inset-inline-end: 6px; bottom: 6px; box-shadow: none; }
.listen__rows .play .icon { width: 14px; height: 14px; }
.listen__rows .story__title { font-size: 15px; }

.reel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.reel > * { scroll-snap-align: start; }
.reel .media { background: #0d0e22; }
@media (max-width: 639px) { .reel { grid-auto-columns: 72%; } }

dialog.player { width: min(960px, 94vw); padding: 0; border: 0; background: #0d0e22; color: #fff; overflow: hidden; border-radius: var(--r); }
dialog.player::backdrop { background: rgba(8, 9, 30, .82); }
@media (prefers-reduced-motion: no-preference) { dialog.player[open] { animation: pop .3s var(--ease); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.player__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; }
.player__head h3 { font-size: 16px; font-weight: 700; }
.player__close { border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.player__body video, .player__body iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.player__body img { width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.player__body audio { width: calc(100% - 36px); margin: 18px; }

/* ---------- Most read: outlined numerals ---------- */
.mostread { list-style: none; margin: 0; padding: 0; counter-reset: m; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .mostread { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mostread { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.mostread li { counter-increment: m; display: flex; flex-direction: column; gap: 8px; }
.mostread li::before { content: counter(m); font-size: 84px; font-weight: 900; line-height: .9; color: transparent; -webkit-text-stroke: 1.5px var(--brand-ink); transition: color .3s; }
:lang(fa-AF) .mostread li::before, :lang(ps-AF) .mostread li::before { content: counter(m, persian); }
.mostread a { font-size: 16px; font-weight: 700; line-height: 1.7; }
.mostread a:hover { color: var(--accent); }
.mostread li:hover::before { color: var(--brand-ink); }

/* Compact ranked list (sidebar) */
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; display: grid; gap: 14px; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.ranked li::before { content: counter(rank); font-size: 30px; font-weight: 900; line-height: 1; color: transparent; -webkit-text-stroke: 1.2px var(--brand-ink); }
:lang(fa-AF) .ranked li::before, :lang(ps-AF) .ranked li::before { content: counter(rank, persian); }
.ranked a { font-size: 15px; font-weight: 700; line-height: 1.7; }
.ranked a:hover { color: var(--accent); }

/* ---------- Ads ---------- */
.ad { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-inline: auto; }
.ad__label { font-size: 11px; color: var(--muted); }
.ad--leaderboard { padding-block: 24px; min-height: 130px; }
.ad--leaderboard ins { width: 100%; max-width: 970px; min-height: 90px; }
.ad--sidebar ins { width: 100%; min-height: 250px; }
.ad--in-article { margin-block: 32px; min-height: 280px; }
.house-ad img { width: 100%; border-radius: var(--r); }

/* ---------- Sidebar ---------- */
.with-sidebar { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); }
.with-sidebar > * { min-width: 0; }
@media (min-width: 1024px) { .with-sidebar { grid-template-columns: minmax(0, 1fr) 310px; gap: 56px; } }
.sidebar__inner { display: flex; flex-direction: column; gap: 36px; }
@media (min-width: 1024px) { .sidebar__inner { position: sticky; top: calc(var(--head-h) + 24px); } }
.list-head { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 18px 16px 0; }
[dir="ltr"] .timeline li { padding: 0 0 16px 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 8px; width: 12px; height: 12px; background: var(--paper); border: 2px solid var(--brand-ink); border-radius: 50%; }
.timeline time { display: block; font-size: 12px; color: var(--muted); }
.timeline a { font-size: 15px; font-weight: 500; line-height: 1.75; }
.timeline a:hover { color: var(--accent); }
.cta { position: relative; display: block; overflow: hidden; color: #fff; background: var(--cover); border-radius: var(--r); }
.cta img { width: 100%; opacity: .55; transition: transform .8s var(--ease); }
.cta:hover img { transform: scale(1.04); }
.cta span { position: absolute; inset: auto 0 0; padding: 18px; font-weight: 900; font-size: 18px; line-height: 1.5; }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 50; background: var(--accent-fill); transform-origin: 100% 50%; transform: scaleX(0); pointer-events: none; }
[dir="ltr"] .progress { transform-origin: 0 50%; }
@supports (animation-timeline: scroll()) { .progress { animation: grow linear both; animation-timeline: scroll(root); } }
@supports not (animation-timeline: scroll()) { .progress { display: none; } }
@keyframes grow { to { transform: scaleX(1); } }
.crumbs { font-size: 13px; color: var(--muted); padding-top: 26px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .5; }
.crumbs a:hover { color: var(--accent); }
.article__head { display: flex; flex-direction: column; gap: 16px; padding-block: 18px 26px; max-width: 860px; }
.article__title { font-size: clamp(28px, 4.2vw, 48px); line-height: 1.42; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: 13.5px; color: var(--muted); }
.byline__author { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.byline__author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--paper-2); }
.byline span { display: inline-flex; align-items: center; gap: 6px; }
.article__figure { margin: 0 0 34px; }
.article__figure img { width: 100%; height: auto; max-height: 80vh; object-fit: cover; background: var(--paper-2); border-radius: var(--r); }
.article__body { max-width: 720px; }
.prose { font-family: var(--read); font-size: clamp(19px, 1.9vw, 22px); line-height: 2.05; color: var(--ink); overflow-wrap: anywhere; }
:lang(en) .prose { font-family: var(--sans); font-size: 18px; line-height: 1.85; }
.prose > * + * { margin-top: 1.05em; }
.prose p { margin: 0; text-align: justify; text-justify: inter-word; }
.prose h2, .prose h3 { font-family: var(--sans); font-weight: 900; margin-top: 1.6em; }
.prose h2 { font-size: .98em; }
.prose h3 { font-size: .88em; }
.prose a { color: var(--brand-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.prose img { margin-inline: auto; border-radius: var(--r); }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 8px; }
.prose blockquote { position: relative; margin: 1.8em 0; padding: 24px 26px 20px; background: var(--brand-soft); color: var(--ink); font-size: 1.12em; border-radius: var(--r); }
.prose blockquote::before { content: "«"; position: absolute; top: -20px; inset-inline-start: 20px; font-family: var(--sans); font-weight: 900; font-size: 56px; line-height: 1; color: var(--accent-fill); }
[dir="ltr"] .prose blockquote::before { content: "“"; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 8px 10px; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--r); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 36px; padding: 14px 18px; background: var(--paper-2); border-radius: var(--r); }
.share__label { font-weight: 900; font-size: 14px; margin-inline-end: 8px; }
.share a, .share button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink-2); transition: background .2s, color .2s; }
.share a:hover, .share button:hover { background: var(--brand); color: #fff; }
.share button.is-done { background: #1d7a46; color: #fff; }
.pager { display: grid; gap: 16px; margin-block: 8px 28px; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--card); border: 1px solid var(--rule); transition: border-color .2s; border-radius: var(--r); }
.pager a:hover { border-color: var(--brand-ink); }
.pager a.is-next { text-align: end; align-items: flex-end; }
.pager small { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.pager strong { font-size: 15px; line-height: 1.7; }

/* ---------- Listing pages ---------- */
.page-head { position: relative; padding-block: 36px 28px; margin-bottom: 36px; }
.page-head h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(32px, 5vw, 56px); line-height: 1.25; }
.page-head p { color: var(--muted); margin: 10px 0 0; }
.page-head::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--rule); }
.page-head::before { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 96px; height: 3px; background: var(--brand); z-index: 1; }
.list { display: flex; flex-direction: column; gap: 32px; }
.list .story { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .list .story { grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; } }
.list .story__title { font-size: 20px; }
.empty { color: var(--muted); padding: 44px 28px; background: var(--paper-2); border-radius: var(--r); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 40px; list-style: none; padding: 0; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 44px; height: 44px; padding-inline: 10px; border-radius: 50%; font-weight: 700; font-size: 14px; }
.pagination a:hover { background: var(--brand-soft); }
.pagination [aria-current="page"] { background: var(--brand); color: #fff; }
.pagination .is-disabled { opacity: .35; }

/* ---------- Content pages, forms ---------- */
.page { max-width: 820px; margin-inline: auto; padding-bottom: 40px; }
.info-list { display: grid; gap: 12px; padding: 0; margin: 28px 0; list-style: none; }
.info-list li { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.info-list .icon { color: var(--accent); width: 22px; height: 22px; }
.info-list strong { min-width: 100px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; padding: 13px 28px; min-height: 48px; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; transition: background .2s, transform .15s; border-radius: var(--r); }
.btn:hover { background: var(--cover-2); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent-fill); }
.btn--accent:hover { background: #c92a20; }
.panel { background: var(--card); border: 1px solid var(--rule); padding: clamp(20px, 3vw, 32px); border-radius: var(--r); }
.panel__title { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 16px; }
.form { display: grid; gap: 18px; }
@media (min-width: 640px) { .form--2 { grid-template-columns: 1fr 1fr; } .form--2 .span-2 { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1.5px solid var(--muted); padding: 10px 12px; min-height: 48px; width: 100%; border-radius: var(--r); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-ink); outline-offset: 0; border-color: var(--brand-ink); }
.field small { color: var(--muted); font-size: 13px; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 16px; margin-bottom: 18px; font-weight: 500; border-inline-start: 4px solid; border-radius: var(--r); }
.alert--ok { background: #e6f4ec; color: #12603a; border-color: #1d7a46; }
.alert--err { background: #fdeceb; color: #93190f; border-color: var(--accent-fill); }

/* ---------- Footer ---------- */
.footer { margin-top: 72px; background: var(--cover-2); color: var(--on-cover-2); font-size: 14.5px; }
.footer a { color: #fff; opacity: .82; transition: opacity .2s; }
.footer a:hover { opacity: 1; }
.footer__top { display: grid; gap: 40px; padding-block: 56px 36px; }
@media (min-width: 820px) { .footer__top { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer__brand img { width: 64px; height: 64px; margin-bottom: 14px; }
.footer__name { display: block; font-size: 22px; font-weight: 900; color: #fff; }
.footer__tag { display: block; color: var(--accent-on-cover); font-weight: 700; margin-bottom: 12px; }
.footer__brand p { max-width: 380px; }
.footer h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #fff; margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.socials a:hover { background: var(--accent-fill); }
.socials--ink a { background: var(--brand-soft); color: var(--brand-ink); }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding-block: 18px; font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.to-top { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 30; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(30, 32, 110, .3); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .3s var(--ease), visibility .25s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .progress { display: none; }
}
@media print {
  .utility, .masthead, .sidebar, .share, .pager, .footer, .ad, .to-top, .related, .progress { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
