@font-face {
  font-family: Vazirmatn;
  src: url("fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f7f8f5;
  --surface: #ffffff;
  --text: #222b26;
  --muted: #657069;
  --faint: #e2e7e1;
  --accent: #285b45;
  --accent-soft: #eaf0e9;
  --rose: #96405c;
  --rose-soft: #f4e9ee;
  --gold: #95732c;
  --header: #f7f8f5ee;
  --shadow: 0 20px 90px #18251c26;
  --sidebar-width: 254px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171c19;
  --surface: #1d2420;
  --text: #edf0e9;
  --muted: #a6b1a8;
  --faint: #343d36;
  --accent: #a6ceb1;
  --accent-soft: #293b2e;
  --rose: #e1a3b8;
  --rose-soft: #3a2a31;
  --gold: #d8b66b;
  --header: #171c19ee;
  --shadow: 0 20px 90px #0008;
}

* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 15px/1.9 Vazirmatn, Tahoma, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
button, a, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button:disabled { cursor: default; opacity: .4; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.65; }
::selection { background: var(--accent); color: var(--surface); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 30; inset-inline-start: 20px; top: -70px; padding: 10px 20px; background: var(--surface); border: 1px solid var(--accent); }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-width); background: var(--surface); border-inline-end: 1px solid var(--faint); z-index: 10; overflow-y: auto; }
.brand { display: flex; align-items: center; justify-content: center; min-height: 114px; padding: 25px 20px; background: #222b25; }
.brand img { width: 204px; height: auto; display: block; }
.sidebar-body { min-height: calc(100% - 114px); display: flex; flex-direction: column; padding: 27px 18px 20px; }
.nav-caption { font-size: 11px; color: var(--muted); padding-inline: 15px; margin-bottom: 12px; }
.primary-nav, .secondary-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 14px; border-radius: 5px; font-size: 14px; font-weight: 500; }
.nav-link:hover { background: var(--page); }
.nav-link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.nav-link .nav-count { margin-inline-start: auto; font-size: 12px; font-weight: 400; }
.nav-link[aria-current="page"]::before { content: ""; width: 3px; height: 19px; background: var(--accent); border-radius: 1px; position: absolute; inset-inline-start: 0; }
.sidebar-separator { height: 1px; margin: 24px 14px; background: var(--faint); }
.sidebar-foot { margin-top: auto; padding: 42px 14px 4px; color: var(--muted); font-size: 11px; }
.brand-rule { display: block; width: 28px; height: 2px; background: var(--gold); margin-bottom: 12px; }
.workspace { margin-inline-start: var(--sidebar-width); min-height: 100vh; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 48px; border-bottom: 1px solid var(--faint); background: var(--header); }
.breadcrumb { display: flex; align-items: center; gap: 13px; font-size: 12px; color: var(--muted); }
.breadcrumb svg { width: 16px; }
.breadcrumb-separator { opacity: .45; }
.breadcrumb span:last-child { color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 23px; }
.today { color: var(--muted); font-size: 11px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 5px; flex-shrink: 0; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); }
.theme-toggle { border: 1px solid var(--faint); background: var(--surface); }
.mobile-brand, .bottom-nav { display: none; }
main { max-width: 1400px; margin: 0 auto; padding: 45px 48px 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 32px; }
.eyebrow { color: var(--rose); font-size: 12px; margin-bottom: 7px; }
h1 { font-size: 30px; font-weight: 650; line-height: 1.7; }
.heading-mark { display: flex; align-items: center; gap: 12px; color: var(--gold); }
.heading-mark span { width: 24px; height: 1px; background: currentColor; opacity: .65; }
.heading-mark svg { width: 23px; height: 23px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 48px; align-items: start; }
.archive { min-width: 0; }
.archive-controls { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding-bottom: 24px; }
.search { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--faint); border-radius: 6px; min-height: 46px; padding-inline: 15px 4px; width: 100%; max-width: 365px; }
.search:focus-within { border-color: var(--accent); }
.search > svg { width: 17px; color: var(--muted); }
.search input { background: none; border: 0; outline: none; min-width: 0; width: 100%; font-size: 12px; padding: 10px 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); }
.search .icon-button { width: 32px; height: 32px; }
.sort-control { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.sort-control > svg { width: 16px; }
.sort-control select { background: transparent; border: 0; padding: 10px 3px; font-size: 12px; max-width: 135px; }
.sort-control option { color: var(--text); background: var(--surface); }
.list-heading { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-bottom: 1px solid var(--faint); padding-bottom: 15px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 6px; background: var(--faint); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 10px; min-height: 35px; border-radius: 4px; font-size: 11px; color: var(--text); white-space: nowrap; }
.segmented button svg { width: 13px; height: 13px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px #0000000c; font-weight: 600; }
.result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.article-row { position: relative; padding: 29px 0 27px; border-bottom: 1px solid var(--faint); animation: arrive .32s ease both; }
.article-row:nth-child(2) { animation-delay: .04s; }
.article-row:nth-child(3) { animation-delay: .08s; }
.article-row:nth-child(4) { animation-delay: .12s; }
.article-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; margin-bottom: 10px; min-height: 22px; }
.article-category { color: var(--rose); }
.meta-divider { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; opacity: .6; }
.unread-label { display: inline-flex; gap: 5px; align-items: center; color: var(--accent); }
.unread-label::before { content: ""; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.article-title-line { display: flex; align-items: start; gap: 15px; justify-content: space-between; }
.article-title { display: block; text-align: start; font-size: 19px; line-height: 1.9; font-weight: 650; padding: 0; min-width: 0; overflow-wrap: anywhere; }
.article-title:hover { color: var(--accent); }
.article-save { color: var(--muted); width: 34px; height: 36px; margin-top: 1px; }
.article-save[aria-pressed="true"], #reader-save[aria-pressed="true"] { color: var(--rose); }
.article-save[aria-pressed="true"] svg, #reader-save[aria-pressed="true"] svg { fill: var(--rose-soft); }
.article-preview { color: var(--muted); font-size: 13px; line-height: 2.15; margin-top: 9px; max-width: 660px; }
.article-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }
.date-pair { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.date-pair time { white-space: nowrap; }
.date-pair .gregorian { padding-inline-start: 12px; border-inline-start: 1px solid var(--faint); direction: rtl; unicode-bidi: isolate; }
.read-link { display: inline-flex; gap: 8px; align-items: center; color: var(--accent); font-size: 11px; flex-shrink: 0; min-height: 34px; padding: 0; }
.read-link svg { width: 15px; }
.reading-aside { border-inline-start: 1px solid var(--faint); padding-inline-start: 26px; padding-top: 6px; }
.aside-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.aside-heading svg { width: 16px; color: var(--gold); }
.aside-heading h2 { font-size: 12px; font-weight: 600; }
.stat-row { display: flex; width: 100%; justify-content: space-between; padding: 9px 0; font-size: 11px; color: var(--muted); text-align: start; }
.stat-row:hover { color: var(--accent); }
.stat-row strong { font-weight: 500; color: var(--text); }
.aside-separator { height: 1px; background: var(--faint); margin: 25px 0; }
.recent-list { display: grid; gap: 18px; }
.recent-link { display: grid; gap: 4px; text-align: start; padding: 0; font-size: 11px; line-height: 2; }
.recent-link:hover { color: var(--accent); }
.recent-link time { color: var(--muted); font-size: 9px; }
.aside-signature { padding-top: 38px; color: var(--muted); font-size: 10px; }
.signature-rule { display: block; width: 26px; height: 1px; background: var(--gold); margin-bottom: 13px; }
.list-end { display: flex; min-height: 100px; align-items: center; justify-content: center; gap: 15px; font-size: 11px; color: var(--muted); }
.load-more { display: flex; align-items: center; gap: 9px; color: var(--accent); border: 1px solid var(--faint); border-radius: 5px; background: var(--surface); padding: 8px 18px; min-height: 42px; }
.load-more:hover { border-color: var(--accent); }
.load-more svg { width: 16px; }
.empty-state { padding: 70px 20px; text-align: center; border-bottom: 1px solid var(--faint); }
.empty-state > svg { color: var(--muted); width: 30px; height: 30px; margin-bottom: 16px; }
.empty-state h2 { font-size: 17px; margin-bottom: 10px; }
.empty-state p { font-size: 13px; color: var(--muted); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 0; color: var(--accent); font-size: 12px; }
.empty-state .text-button { margin-top: 18px; }
.text-button svg { width: 17px; }
.page-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; padding: 25px 0; border-top: 1px solid var(--faint); color: var(--muted); font-size: 10px; }
.back-top { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; }
.back-top svg { width: 14px; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--faint); border-radius: 8px; box-shadow: var(--shadow); padding: 0; }
dialog::backdrop { background: #101b1680; backdrop-filter: blur(3px); }
.navigation-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 50px); padding: 20px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog-heading h2 { font-size: 20px; }
.reader-dialog { width: min(790px, calc(100% - 48px)); max-height: calc(100dvh - 64px); }
.reader-toolbar { position: sticky; top: 0; display: flex; justify-content: space-between; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--faint); z-index: 2; }
.reader-tools { display: flex; gap: 6px; }
.reader-article { padding: 30px 48px 35px; }
.reader-article h2 { font-size: 25px; line-height: 1.9; font-weight: 650; overflow-wrap: anywhere; }
.reader-dates { margin-top: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--faint); }
.reader-content { --reading-size: 18px; font-size: var(--reading-size); line-height: 2.4; padding-top: 25px; overflow-wrap: anywhere; }
.reader-content p + p { margin-top: 20px; }
.reader-content [lang="ar"] { line-height: 2.7; }
.reader-navigation { display: flex; justify-content: space-between; gap: 15px; padding: 15px 48px; border-top: 1px solid var(--faint); }
.toast { position: fixed; z-index: 50; bottom: 26px; left: 50%; transform: translateX(-50%); padding: 10px 20px; background: var(--text); color: var(--surface); border-radius: 6px; box-shadow: var(--shadow); font-size: 12px; max-width: calc(100% - 32px); text-align: center; }
.skeleton { height: 215px; border-bottom: 1px solid var(--faint); padding: 28px 0; }
.skeleton span { display: block; height: 12px; background: var(--faint); border-radius: 3px; margin-bottom: 20px; animation: pulse 1s ease-in-out infinite alternate; }
.skeleton span:nth-child(1) { width: 20%; height: 9px; }
.skeleton span:nth-child(2) { width: 70%; height: 19px; }
.skeleton span:nth-child(3) { width: 95%; }
.skeleton span:nth-child(4) { width: 80%; }
.noscript-message { padding: 25px; text-align: center; }
body:has(dialog[open]) { overflow: hidden; }
@keyframes arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { to { opacity: .45; } }

@media (min-width: 1550px) {
  :root { --sidebar-width: 280px; }
  main { padding-inline: 65px; }
  .content-layout { gap: 65px; grid-template-columns: minmax(0, 1fr) 225px; }
}
@media (max-width: 1200px) {
  main { padding-inline: 32px; }
  .topbar { padding-inline: 32px; }
  .reading-aside { display: none; }
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .archive-controls .search { max-width: 420px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .workspace { margin-inline-start: 0; }
  .topbar { min-height: 76px; padding: 12px 24px; background: #222b25; border-bottom-color: #344038; }
  .breadcrumb { display: none; }
  .mobile-brand { display: block; }
  .mobile-brand img { width: 183px; height: auto; display: block; }
  .today { display: none; }
  .theme-toggle { background: transparent; border-color: #ffffff26; color: #e6e9df; }
  .icon-button { min-width: 44px; min-height: 44px; }
  .article-save { width: 44px; height: 44px; }
  .search .icon-button { min-width: 40px; min-height: 40px; }
  .read-link { min-height: 44px; }
  main { padding: 30px 28px 90px; max-width: 820px; }
  .page-heading { padding-bottom: 27px; }
  h1 { font-size: 27px; }
  .bottom-nav { position: fixed; z-index: 12; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--faint); padding: 7px 12px max(9px, env(safe-area-inset-bottom)); min-height: 74px; }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 51px; font-size: 10px; color: var(--muted); border-radius: 5px; }
  .bottom-nav [aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .bottom-nav svg { width: 21px; height: 21px; }
  .toast { bottom: 92px; }
  .heading-mark span { width: 17px; }
}
@media (max-width: 480px) {
  .topbar { padding-inline: 20px; }
  main { padding: 26px 20px 85px; }
  .page-heading { padding-bottom: 24px; }
  .eyebrow { font-size: 11px; }
  .archive-controls { gap: 10px; flex-wrap: wrap; padding-bottom: 19px; }
  .search { max-width: none !important; flex: 1 1 100%; min-height: 47px; }
  .search input { font-size: 13px; }
  .sort-control { margin-inline-start: auto; }
  .sort-control select { font-size: 11px; }
  .list-heading { align-items: center; gap: 6px; }
  .segmented button { padding-inline: 8px; font-size: 10px; min-height: 44px; }
  .segmented button svg { display: none; }
  .result-count { font-size: 10px; }
  .article-row { padding: 25px 0 23px; }
  .article-title { font-size: 18px; }
  .article-preview { font-size: 13px; }
  .article-meta { font-size: 10px; gap: 8px; }
  .article-bottom { align-items: flex-end; gap: 10px; margin-top: 16px; }
  .date-pair { gap: 4px; display: grid; font-size: 10px; }
  .date-pair .gregorian { border: 0; padding: 0; direction: rtl; text-align: right; }
  .reader-dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .reader-article { padding: 28px 23px; }
  .reader-article h2 { font-size: 23px; }
  .reader-navigation { padding: 15px 23px max(20px, env(safe-area-inset-bottom)); }
  .reader-content { --reading-size: 17px; }
  .reader-toolbar { padding-inline: 15px; }
  .page-footer { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}