/* Hamidiz Arts — public site. One stylesheet for every page. Light theme only.
   Typography: Newsreader (headlines, reading text) + the system UI font; Vazirmatn for Persian. */

:root {
  --paper: #ffffff;
  --paper-2: #f7f6f3;
  --paper-3: #efede8;
  --ink: #141414;
  --ink-2: #3a3a3c;
  --muted: #6e6e73;
  --rule: #e4e1db;
  --rule-strong: #141414;
  --accent: #b3261e;
  --accent-ink: #8c1d17;
  --accent-soft: #fbeceb;
  --focus: #0a66ff;
  --mark: #fff1a8;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --reading: var(--serif);

  --radius: 6px;
  --radius-lg: 14px;
  --shadow-pop: 0 1px 2px rgba(0,0,0,.06), 0 12px 32px -8px rgba(0,0,0,.18);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --gutter: 16px;
  --wrap: 1240px;
  color-scheme: light;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

.lang-farsi {
  --serif: "Vazirmatn", Tahoma, sans-serif;
  --sans: "Vazirmatn", Tahoma, system-ui, sans-serif;
  --reading: "Vazirmatn", Tahoma, sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.lang-farsi body, body.lang-farsi { line-height: 1.8; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.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; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
mark { background: var(--mark); color: inherit; padding: 0 .1em; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.main { display: block; min-height: 50vh; outline: none; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); transition: top 160ms var(--ease-out); }
.skip:focus { top: 12px; color: #fff; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 600 .9375rem/1 var(--sans);
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #000; color: #fff; }
.btn:active { transform: scale(.97); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: .875rem; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .i { width: 22px; height: 22px; }

/* ── Masthead ───────────────────────────────────────────────────────────── */
.topbar { border-bottom: 1px solid var(--rule); font-size: .8125rem; color: var(--muted); }
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 38px; }
.today { white-space: nowrap; }
.breaking { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.breaking a { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breaking a:hover { color: var(--accent); }
.breaking-tag { flex: none; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .6875rem; }
.langs { display: flex; gap: 2px; margin-inline-start: auto; }
.langs a { padding: 4px 9px; border-radius: 999px; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.langs a:hover { color: var(--ink); background: var(--paper-2); }
.langs a[aria-current] { color: var(--ink); font-weight: 600; background: var(--paper-3); }
@media (max-width: 899px) { .breaking { display: none; } }
@media (max-width: 599px) { .today { display: none; } .langs { margin-inline: auto; } }

.brand-row { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding-block: 22px 18px; }
.brand { grid-column: 2; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-name {
  font: 700 clamp(2.1rem, 6vw, 3.6rem)/1 var(--serif);
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
}
.lang-farsi .brand-name { letter-spacing: 0; font-weight: 800; }
.brand-tag { margin-top: 8px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .22em; }
.lang-farsi .brand-tag { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.menu-btn { grid-column: 1; justify-self: start; }
.search-btn { grid-column: 3; justify-self: end; }
@media (min-width: 900px) { .menu-btn { visibility: hidden; } }

/* Section bar: sticky, translucent, the content scrolls under it */
.nav {
  position: sticky; top: 0; z-index: 40;
  border-block: 1px solid var(--rule-strong);
  border-bottom-color: var(--rule);
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}
.nav-in { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 48px; }
.nav-link {
  position: relative; display: inline-flex; align-items: center;
  padding: 0 12px; height: 46px;
  font: 500 .9375rem/1 var(--sans); color: var(--ink-2); white-space: nowrap;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current]::after {
  content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; background: var(--accent);
}
.nav-link[aria-current] { color: var(--ink); font-weight: 600; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item .nav-link { padding-inline-end: 2px; }
.nav-item .nav-link[aria-current]::after { inset-inline-end: 2px; }
.nav-caret { display: grid; place-items: center; width: 26px; height: 32px; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 6px; }
.nav-caret .i { width: 15px; height: 15px; transition: transform 200ms var(--ease-out); }
.nav-caret:hover { color: var(--ink); }
.nav-menu {
  position: absolute; top: calc(100% + 1px); inset-inline-start: 0; z-index: 50;
  min-width: 240px; max-height: min(70vh, 520px); overflow: auto;
  display: grid; padding: 8px;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  transform-origin: top left;
  opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), visibility 0s linear 160ms;
}
[dir="rtl"] .nav-menu { transform-origin: top right; }
.nav-menu a { padding: 9px 12px; border-radius: 8px; font-size: .9375rem; color: var(--ink-2); }
.nav-menu a:hover { background: var(--paper-2); color: var(--ink); }
.nav-menu strong { font-weight: 600; color: var(--ink); }
.nav-item.is-open .nav-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-item.is-open .nav-caret .i { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover .nav-menu, .nav-item:focus-within .nav-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
@media (max-width: 899px) {
  .nav-in { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  [dir="rtl"] .nav-in { -webkit-mask-image: linear-gradient(270deg, #000 85%, transparent); mask-image: linear-gradient(270deg, #000 85%, transparent); }
  .nav-in::-webkit-scrollbar { display: none; }
  .nav-caret, .nav-menu { display: none; }
  .nav-item .nav-link { padding-inline-end: 12px; }
  .brand-row { padding-block: 14px 12px; }
}

/* ── Sheets (menu, search) ──────────────────────────────────────────────── */
dialog.sheet { padding: 0; border: 0; background: #fff; color: var(--ink); max-width: none; max-height: none; }
dialog.sheet::backdrop { background: rgba(20,20,20,.32); opacity: 0; transition: opacity 240ms ease; }
dialog.sheet[open]::backdrop { opacity: 1; }
dialog.sheet.is-closing::backdrop { opacity: 0; }
@starting-style { dialog.sheet[open]::backdrop { opacity: 0; } }

.sheet-menu {
  position: fixed; inset-block: 0; inset-inline-start: 0; margin: 0;
  width: min(86vw, 360px); height: 100dvh;
  display: none; flex-direction: column;
  box-shadow: var(--shadow-pop);
  transform: translateX(0);
  transition: transform 320ms var(--ease-drawer);
}
.sheet-menu[open] { display: flex; }
@starting-style { .sheet-menu[open] { transform: translateX(-100%); } }
.sheet-menu.is-closing { transform: translateX(-100%); transition-duration: 220ms; }
[dir="rtl"] .sheet-menu.is-closing { transform: translateX(100%); }
@starting-style { [dir="rtl"] .sheet-menu[open] { transform: translateX(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--rule); }
[dir="rtl"] .sheet-head { padding: 12px 20px 12px 12px; }
.sheet-title { font: 700 1.35rem/1 var(--serif); }
.sheet-nav { flex: 1; overflow: auto; padding: 8px 12px; display: grid; align-content: start; }
.sheet-nav > a, .sheet-nav summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 10px; font-size: 1.0625rem; font-weight: 500; border-bottom: 1px solid var(--rule); list-style: none; cursor: pointer; }
.sheet-nav summary::-webkit-details-marker { display: none; }
.sheet-nav summary .i { width: 18px; height: 18px; color: var(--muted); transition: transform 200ms var(--ease-out); }
.sheet-nav details[open] summary .i { transform: rotate(180deg); }
.sheet-nav details a { display: block; padding: 10px 10px 10px 22px; color: var(--ink-2); font-size: .9688rem; }
[dir="rtl"] .sheet-nav details a { padding: 10px 22px 10px 10px; }
.sheet-nav a[aria-current] { color: var(--accent); }
.sheet-langs { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); }
.sheet-langs a { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: .875rem; }
.sheet-langs a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }

.sheet-search {
  position: fixed; inset-inline: 0; top: 0; margin: 0; width: 100%;
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow-pop);
  opacity: 1; transform: translateY(0);
  transition: transform 260ms var(--ease-out), opacity 200ms ease;
}
@starting-style { .sheet-search[open] { opacity: 0; transform: translateY(-16px); } }
.sheet-search.is-closing { opacity: 0; transform: translateY(-16px); transition-duration: 180ms; }
.search-panel { max-width: 860px; margin: 0 auto; padding: 20px var(--gutter); display: grid; grid-template-columns: 1fr auto; gap: 12px 8px; align-items: center; }
.search-field { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.search-field .i { width: 24px; height: 24px; color: var(--muted); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 500 clamp(1.25rem, 3.4vw, 1.75rem)/1.2 var(--serif); padding: 6px 0; }
.search-scope { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.search-scope label { position: relative; }
.search-scope input { position: absolute; opacity: 0; }
.search-scope span { display: inline-block; padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; font-size: .875rem; color: var(--ink-2); cursor: pointer; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
.search-scope input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.search-scope input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.search-panel > .icon-btn { grid-column: 2; grid-row: 1; }

/* Auto-suggest list (search sheet + search page) */
.has-suggest { position: relative; }
.suggest { grid-column: 1 / -1; max-height: min(60vh, 460px); overflow: auto; overscroll-behavior: contain; padding: 4px 0 8px; }
.dict-search .suggest { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 30; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 6px; }
.suggest[hidden] { display: none; }
.suggest-head { margin: 10px 10px 4px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lang-farsi .suggest-head { letter-spacing: 0; text-transform: none; }
.suggest-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius); background: none; color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.35; text-align: start; cursor: pointer; transition: background-color 120ms ease; }
.suggest-item:hover, .suggest-item[aria-selected="true"] { background: var(--paper-2); }
.suggest-item:active { transform: scale(.99); }
.suggest-title { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.suggest-title mark { background: var(--mark); color: inherit; border-radius: 2px; }
.suggest-hint { flex: none; max-width: 45%; color: var(--muted); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-all { margin-top: 4px; border-top: 1px solid var(--rule); border-radius: 0 0 var(--radius) var(--radius); color: var(--accent); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .suggest-item { transition: none; } .suggest-item:active { transform: none; } }

/* ── Shared story pieces ───────────────────────────────────────────────── */
.media { position: relative; display: block; overflow: hidden; background: var(--paper-3); border-radius: var(--radius); }
.media img { position: relative; width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.media .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 clamp(1.5rem, 5vw, 3rem)/1 var(--serif); color: rgba(20,20,20,.18);
  background: linear-gradient(135deg, #f1efe9, #e7e3da);
}
.media img { z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  a:hover > .media img, .card:hover .media img, .lead:hover .media img { transform: scale(1.03); }
}
.kicker { display: inline-block; margin-bottom: 6px; color: var(--accent); font: 700 .6875rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.lang-farsi .kicker { letter-spacing: 0; font-size: .8125rem; text-transform: none; }
a.kicker:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .i { width: 14px; height: 14px; }
.meta .dot { color: #b8b5ae; }
.dek { color: var(--ink-2); font-size: .9688rem; line-height: 1.55; margin-top: 8px; }

.lead-title a, .card-title a, .row-title a, .ranked a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 300ms var(--ease-out), color 160ms ease; }
[dir="rtl"] .lead-title a, [dir="rtl"] .card-title a, [dir="rtl"] .row-title a, [dir="rtl"] .ranked a { background-position: 100% 100%; }
.lead-title a:hover, .card-title a:hover, .row-title a:hover, .ranked a:hover, .card:hover .card-title a { background-size: 100% 1px; color: var(--ink); }

/* Lead */
.lead { display: grid; gap: 16px; }
.lead-media .media { aspect-ratio: 16 / 10; }
.lead-title { font: 600 clamp(1.75rem, 3.6vw, 2.75rem)/1.08 var(--serif); letter-spacing: -0.018em; text-wrap: balance; }
.lang-farsi .lead-title { letter-spacing: 0; line-height: 1.45; font-weight: 800; }
.lead .dek { font-size: 1.0625rem; max-width: 62ch; }

/* Card */
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-media .media { aspect-ratio: 3 / 2; }
.card-title { font: 600 1.1875rem/1.25 var(--serif); letter-spacing: -0.01em; text-wrap: pretty; }
.lang-farsi .card-title { letter-spacing: 0; line-height: 1.6; font-weight: 700; font-size: 1.0625rem; }
.card.card-lg .card-title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.15; }

/* Row card */
.row-card, .result { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: start; min-width: 0; }
.row-media .media { aspect-ratio: 1; border-radius: 4px; }
.row-media .ph { font-size: 1.6rem; }
.row-body { min-width: 0; }
.row-title { font: 600 1.0313rem/1.3 var(--serif); text-wrap: pretty; }
.lang-farsi .row-title { line-height: 1.65; font-weight: 700; font-size: .9688rem; }
.row-card .meta { margin-top: 4px; }
.row-list { display: grid; }
.row-list > * { padding-block: 14px; border-top: 1px solid var(--rule); }
.row-list > *:first-child { border-top: 0; padding-top: 0; }

.result { grid-template-columns: 120px 1fr; padding-block: 22px; border-top: 1px solid var(--rule); }
.result .row-title { font-size: 1.25rem; }
@media (max-width: 599px) { .result { grid-template-columns: 84px 1fr; } .result .row-title { font-size: 1.0625rem; } }

/* Ranked list (Most read) */
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; display: grid; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; padding-block: 13px; border-top: 1px solid var(--rule); }
.ranked li:first-child { border-top: 0; padding-top: 0; }
.ranked li::before { content: counter(rank); grid-row: span 2; font: 600 1.75rem/1 var(--serif); color: var(--accent); font-variant-numeric: lining-nums; }
.ranked a { font: 600 1rem/1.3 var(--serif); }
.lang-farsi .ranked a { line-height: 1.65; font-weight: 700; font-size: .9375rem; }
.ranked .meta { grid-column: 2; margin-top: 4px; }

/* Section heads: a strong rule, a serif title */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); padding-top: 10px; margin-bottom: 20px; }
.section-title { font: 700 1.375rem/1.2 var(--serif); letter-spacing: -0.01em; }
.lang-farsi .section-title { letter-spacing: 0; font-weight: 800; font-size: 1.25rem; }
.section-head .more { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.section-head .more .i { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
.section-head .more:hover { color: var(--accent); }
.section-head .more:hover .i { transform: translateX(3px); }
[dir="rtl"] .section-head .more:hover .i { transform: scaleX(-1) translateX(3px); }

/* Page head (list pages) */
.page-head { padding-block: 36px 24px; border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.eyebrow { color: var(--accent); font: 700 .75rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px; }
.lang-farsi .eyebrow { letter-spacing: 0; font-size: .875rem; }
.page-title { font: 700 clamp(2rem, 5vw, 3.25rem)/1.05 var(--serif); letter-spacing: -0.022em; text-wrap: balance; }
.lang-farsi .page-title { letter-spacing: 0; line-height: 1.4; font-weight: 800; }
.page-sub { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }

/* Chips (sorting, filters, tags) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; font-size: .875rem; color: var(--ink-2); background: #fff; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip:active { transform: scale(.97); }
.chip[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { color: var(--muted); font-size: .8125rem; }
.chip[aria-current] .count { color: rgba(255,255,255,.7); }

/* ── Layout grids ───────────────────────────────────────────────────────── */
.grid { display: grid; gap: 32px 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .grid.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; } .keep-2 .card-title { font-size: 1rem; } }

.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.side { display: grid; gap: 40px; position: sticky; top: 72px; }
@media (max-width: 1023px) { .with-side { grid-template-columns: 1fr; } .side { position: static; } }

.band { background: var(--paper-2); border-block: 1px solid var(--rule); padding-block: 40px; margin-block: 48px; }
.block { margin-block: 48px; }
.block:first-child { margin-top: 32px; }

/* ── Front page ─────────────────────────────────────────────────────────── */
.front-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding-top: 32px; }
.front-top .lead { padding-inline-end: 40px; border-inline-end: 1px solid var(--rule); }
.front-latest .section-head { margin-bottom: 14px; }
@media (max-width: 1023px) {
  .front-top { grid-template-columns: 1fr; }
  .front-top .lead { padding-inline-end: 0; border-inline-end: 0; }
}
.cat-block { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
.cat-block .row-list > * { padding-block: 16px; }
@media (max-width: 767px) { .cat-block { grid-template-columns: 1fr; } }

/* Side blocks */
.side-block .section-head { margin-bottom: 16px; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats li > * { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: #fff; transition: border-color 160ms ease, transform 140ms var(--ease-out); }
.stats li > a:hover { border-color: var(--ink); color: var(--ink); }
.stats li > a:active { transform: scale(.98); }
.stats .i { grid-row: span 2; width: 20px; height: 20px; color: var(--accent); margin-top: 3px; }
.stat-num { font: 700 1.25rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .8125rem; }
.side-search { display: block; }
.field-icon { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; transition: border-color 160ms ease, box-shadow 160ms ease; }
.field-icon:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,20,20,.06); }
.field-icon .i { color: var(--muted); }
.field-icon input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; }

/* Ads */
.ad { margin-block: 40px; padding-block: 12px; border-block: 1px solid var(--rule); text-align: center; min-height: 120px; }
.ad-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .6875rem; text-transform: uppercase; letter-spacing: .14em; }
.side .ad { margin: 0; }

/* ── Article / news story ───────────────────────────────────────────────── */
.story { padding-top: 36px; }
.story-head { max-width: 820px; margin: 0 auto; text-align: center; }
.story-head .kicker { font-size: .75rem; margin-bottom: 14px; }
.story-title { font: 700 clamp(2rem, 5vw, 3.4rem)/1.06 var(--serif); letter-spacing: -0.024em; text-wrap: balance; }
.lang-farsi .story-title { letter-spacing: 0; line-height: 1.45; font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.5rem); }
.story-dek { margin: 18px auto 0; max-width: 680px; color: var(--ink-2); font: 400 clamp(1.0625rem, 1.8vw, 1.25rem)/1.5 var(--serif); }
.lang-farsi .story-dek { line-height: 1.9; }
.story-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; margin-top: 22px; color: var(--muted); font-size: .875rem; }
.story-meta span { display: inline-flex; align-items: center; gap: 6px; }
.story-meta .i { width: 16px; height: 16px; }
.story-hero { max-width: 1040px; margin: 32px auto 0; }
.story-hero .media { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.story-hero figcaption { margin-top: 10px; color: var(--muted); font-size: .8125rem; }
.notice { max-width: 680px; margin: 24px auto 0; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); font-size: .9375rem; }
.notice.is-ok { background: #eef6ee; color: #23602a; }

.prose { max-width: 680px; margin: 36px auto 0; font: 400 1.1875rem/1.72 var(--reading); color: #1d1d1f; overflow-wrap: break-word; }
.lang-farsi .prose { font-size: 1.0625rem; line-height: 2.05; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); line-height: 1.25; margin-top: 1.8em; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.6rem; } .prose h3 { font-size: 1.35rem; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-ink); }
.prose img { border-radius: var(--radius); margin-inline: auto; height: auto; }
.prose blockquote { margin-inline: 0; padding-inline-start: 20px; border-inline-start: 3px solid var(--accent); font-style: italic; color: var(--ink-2); }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font: .9375rem/1.5 var(--sans); }
.prose td, .prose th { border-bottom: 1px solid var(--rule); padding: 8px; text-align: start; }
.prose .is-dropcap::first-letter { float: left; font: 700 3.6em/.8 var(--serif); margin: .08em .08em 0 0; color: var(--ink); }

.story-foot { max-width: 680px; margin: 36px auto 0; display: grid; gap: 24px; }
.source-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper-2); }
.source-card p { color: var(--muted); font-size: .8125rem; }
.source-card strong { display: block; color: var(--ink); font-size: 1rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { color: var(--muted); font-size: .8125rem; margin-inline-end: 4px; }
.share .icon-btn { border: 1px solid var(--rule); width: 40px; height: 40px; }
.share .icon-btn .i { width: 18px; height: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags .chip { min-height: 30px; font-size: .8125rem; }

.story-more { margin-top: 64px; }

/* Comments */
.comments { max-width: 680px; margin: 56px auto 0; }
.comment-list { display: grid; gap: 0; margin-bottom: 28px; }
.comment { padding-block: 16px; border-top: 1px solid var(--rule); }
.comment:first-child { border-top: 0; }
.comment-who { display: flex; align-items: baseline; gap: 10px; }
.comment-who strong { font-size: .9688rem; }
.comment-who time { color: var(--muted); font-size: .8125rem; }
.comment p { margin-top: 6px; color: var(--ink-2); white-space: pre-line; }
.empty-note { color: var(--muted); padding-block: 8px 20px; }

/* Forms */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 599px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; font-size: .875rem; color: var(--ink-2); font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; font-weight: 400; font-size: 1rem; color: var(--ink); transition: border-color 160ms ease, box-shadow 160ms ease; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,20,20,.06); }
.form-msg { font-size: .9375rem; min-height: 1.4em; }
.form-msg.is-error { color: var(--accent); }
.form-msg.is-ok { color: #23602a; }

/* ── Index pages (all categories, all sources) ─────────────────────────── */
.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 32px; }
.index-col .section-head { margin-bottom: 12px; }
.index-col .section-title a:hover { color: var(--accent); }
.index-col ul { list-style: none; margin: 0; padding: 0; }
.index-col li { padding-block: 9px; border-top: 1px solid var(--rule); }
.index-col li:first-child { border-top: 0; padding-top: 0; }
.index-col li a { font: 500 1rem/1.4 var(--serif); }
.lang-farsi .index-col li a { line-height: 1.7; }
.index-col .media { aspect-ratio: 16 / 9; margin-bottom: 14px; }
.count-badge { color: var(--muted); font: 500 .8125rem/1 var(--sans); }

/* ── Pager ──────────────────────────────────────────────────────────────── */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin-block: 48px 16px; }
.pager-step { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 999px; font-size: .9375rem; font-weight: 500; transition: border-color 160ms ease, transform 140ms var(--ease-out); }
.pager-step:hover { border-color: var(--ink); color: var(--ink); }
.pager-step:active { transform: scale(.97); }
.pager-step.is-off { color: #c2bfb8; }
.pager-step .i { width: 16px; height: 16px; }
.pager-nums { display: flex; align-items: center; gap: 4px; }
.pager-nums a, .pager-nums span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 999px; font-variant-numeric: tabular-nums; font-size: .9375rem; }
.pager-nums a:hover { background: var(--paper-2); color: var(--ink); }
.pager-nums .is-current { background: var(--ink); color: #fff; font-weight: 600; }
.pager-nums .gap { min-width: 20px; color: var(--muted); }
.pager-count { display: none; color: var(--muted); font-size: .875rem; }
@media (max-width: 599px) { .pager-nums { display: none; } .pager-count { display: inline; } }

/* ── Endless news ──────────────────────────────────────────────────────── */
.feed-stream { display: grid; gap: 40px; max-width: 760px; margin: 0 auto; }
.feed-stream .card-media .media { aspect-ratio: 16 / 9; }
.feed-stream .card-title { font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.18; }
.feed-stream .card { padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.loader { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 28px; color: var(--muted); font-size: .9375rem; }
[data-endless-loader]:not(.is-busy) .spinner, [data-endless-loader]:not(.is-busy) .loading-text { visibility: hidden; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--rule); border-top-color: var(--ink); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Gallery ────────────────────────────────────────────────────────────── */
.masonry { columns: 4 240px; column-gap: 16px; }
.masonry .tile { break-inside: avoid; margin-bottom: 16px; display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper-3); }
.masonry .tile img { width: 100%; height: auto; transition: transform 600ms var(--ease-out); }
.masonry .tile figcaption { position: absolute; inset-inline: 0; bottom: 0; display: flex; justify-content: space-between; gap: 8px; padding: 28px 12px 10px; color: #fff; font-size: .8125rem; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity 200ms ease; }
.masonry .tile figcaption span { display: inline-flex; align-items: center; gap: 4px; }
.masonry .tile .i { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .masonry .tile:hover img { transform: scale(1.03); } .masonry .tile:hover figcaption { opacity: 1; } }
@media (hover: none) { .masonry .tile figcaption { opacity: 1; } }

.photo-stage { background: var(--paper-2); border-block: 1px solid var(--rule); padding-block: 28px; }
.photo-stage img { margin: 0 auto; max-height: 78vh; width: auto; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 24px 48px -24px rgba(0,0,0,.35); }
.photo-info { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding-block: 32px; }
@media (max-width: 899px) { .photo-info { grid-template-columns: 1fr; } }
.photo-title { font: 700 clamp(1.5rem, 3vw, 2.2rem)/1.15 var(--serif); overflow-wrap: anywhere; }
.photo-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo-nav a { display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--paper-3); }
.photo-nav img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.photo-nav a:hover img { transform: scale(1.05); }
.map-frame { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius-lg); background: var(--paper-3); }
.qr-box { display: grid; place-items: center; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: #fff; }
.qr-box[hidden] { display: none; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9375rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ── Link directory ─────────────────────────────────────────────────────── */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.link-card { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; background: #fff; transition: border-color 160ms ease, transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.link-card:hover { border-color: #cfcbc2; color: var(--ink); box-shadow: 0 10px 30px -14px rgba(0,0,0,.25); }
.link-card:active { transform: scale(.99); }
.link-card .media { aspect-ratio: 1.91 / 1; border-radius: 0; }
.link-card .media.is-empty { aspect-ratio: 4 / 1; }
.link-body { padding: 14px 16px 16px; display: grid; gap: 4px; background: var(--paper-2); flex: 1; }
.link-domain { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.link-title { font: 600 1.0625rem/1.3 var(--serif); }
.link-text { color: var(--ink-2); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-visits { margin-top: 6px; color: var(--muted); font-size: .8125rem; display: inline-flex; align-items: center; gap: 4px; }
.link-visits .i { width: 14px; height: 14px; }

/* ── Dictionary ─────────────────────────────────────────────────────────── */
.dict-hero { padding-block: 44px 32px; text-align: center; border-bottom: 1px solid var(--rule); }
.dict-hero .page-title { margin-bottom: 8px; }
.dict-search { max-width: 640px; margin: 24px auto 0; display: flex; gap: 8px; }
.dict-search .field-icon { flex: 1; min-width: 0; height: 54px; }
.dict-search.is-left { margin: 0; max-width: 720px; }
@media (max-width: 479px) { .dict-search .btn { padding: 0 16px; } }
.dict-search .field-icon input { font: 500 1.125rem/1 var(--serif); }
.dict-search .btn { min-height: 54px; padding: 0 22px; }
.word-cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 16px; padding: 32px 0; }
.word-cloud a { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink-2); transition: color 160ms ease; }
.word-cloud a:nth-child(3n) { color: var(--accent); }
.word-cloud a:nth-child(5n) { color: #6b5b3e; }
.word-cloud a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.word-cloud sup { font: 500 .6rem/1 var(--sans); color: var(--muted); margin-inline-start: 2px; }
.word-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 32px; }
.word-item { padding-block: 20px; border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.word-item h3 { font: 700 1.375rem/1.2 var(--serif); }
.word-item .fa { font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 1.0625rem; line-height: 1.8; color: var(--ink); }
.word-item .def { color: var(--ink-2); font-size: .9375rem; }
.word-item .more { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; font-weight: 600; color: var(--accent); margin-top: 4px; }
.word-item .more .i { width: 16px; height: 16px; }
.ex-list { display: grid; gap: 20px; max-width: 860px; margin: 0 auto; }
.ex { border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 22px; background: #fff; }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ex-num { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; }
.ex-num b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 .8125rem/1 var(--sans); letter-spacing: 0; }
.ex-en { font: 500 1.25rem/1.45 var(--serif); }
.ex-fa { font: 500 1.125rem/1.9 "Vazirmatn", Tahoma, sans-serif; margin-top: 6px; color: var(--ink-2); }
.ex-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .9375rem; color: var(--ink-2); }
.ex-notes h4 { font: 700 .75rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.ex-notes [dir="rtl"] h4 { letter-spacing: 0; }
.ex-notes p + h4 { margin-top: 12px; }
@media (max-width: 699px) { .ex-notes { grid-template-columns: 1fr; } }
.def-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 860px; margin: 28px auto 36px; }
.def-pair > div { padding: 20px; border-radius: var(--radius-lg); background: var(--paper-2); }
.def-pair h2 { font: 700 .75rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.def-pair p { font: 400 1.125rem/1.6 var(--serif); }
.def-pair .fa { font-family: "Vazirmatn", Tahoma, sans-serif; line-height: 1.9; }
@media (max-width: 699px) { .def-pair { grid-template-columns: 1fr; } }

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
@media (max-width: 899px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; }
.contact-list li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; padding-block: 18px; border-top: 1px solid var(--rule); }
.contact-list li:first-child { border-top: 0; }
.contact-list .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--paper-2); color: var(--accent); }
.contact-list .ic .i { width: 20px; height: 20px; }
.contact-list small { display: block; color: var(--muted); font-size: .8125rem; }
.contact-list a, .contact-list span { font-size: 1.0625rem; font-weight: 500; overflow-wrap: anywhere; }
.contact-map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius-lg); background: var(--paper-3); }

/* ── Empty / 404 ────────────────────────────────────────────────────────── */
.empty { max-width: 560px; margin: 0 auto; padding-block: 72px; text-align: center; }
.empty-code { font: 700 clamp(4rem, 14vw, 8rem)/1 var(--serif); letter-spacing: -0.04em; color: var(--paper-3); -webkit-text-stroke: 1px #d6d2c8; }
.empty h1, .empty h2 { font: 700 clamp(1.6rem, 4vw, 2.2rem)/1.15 var(--serif); margin-top: 8px; }
.empty p { color: var(--muted); margin: 12px auto 24px; }
.empty .side-search { max-width: 420px; margin: 0 auto 20px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-foot { margin-top: 80px; border-top: 2px solid var(--ink); background: var(--paper-2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding-block: 44px 32px; }
@media (max-width: 899px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 499px) { .foot-grid { grid-template-columns: 1fr; } }
.brand-sm { align-items: flex-start; text-align: start; }
.brand-sm .brand-name { font-size: 2rem; }
.brand-sm .brand-tag { margin-top: 6px; }
.foot-note { margin-top: 16px; color: var(--ink-2); font-size: .9375rem; max-width: 40ch; }
.social { display: flex; gap: 4px; margin-top: 16px; margin-inline-start: -10px; }
.foot-col { display: grid; align-content: start; gap: 2px; }
.foot-col h2 { font: 700 .75rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.lang-farsi .foot-col h2 { letter-spacing: 0; font-size: .875rem; }
.foot-col a { padding-block: 5px; color: var(--ink-2); font-size: .9375rem; }
.foot-col a:hover { color: var(--accent); }
.foot-stats { display: flex; flex-wrap: wrap; gap: 12px 32px; padding-block: 18px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .875rem; }
.foot-stats p { display: inline-flex; align-items: center; gap: 6px; }
.foot-stats .stat-num { color: var(--ink); font-size: 1.0625rem; }
.foot-stats .flags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-inline-start: 6px; }
.flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f9e44; box-shadow: 0 0 0 3px rgba(47,158,68,.18); }
.foot-base { border-top: 1px solid var(--rule); background: #fff; }
.foot-base-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 16px; color: var(--muted); font-size: .8125rem; }
.foot-base .langs { margin: 0; }
.foot-base a:hover { color: var(--ink); }

.to-top {
  position: fixed; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  background: rgba(255,255,255,.9); color: var(--ink); border: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px -8px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top:active { transform: scale(.94); }
.to-top .i { width: 20px; height: 20px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .9375rem;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 200ms ease, transform 240ms var(--ease-out);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── Motion & accessibility preferences ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; }
  .spinner { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .to-top { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #4a4a4f; --rule: #a9a59c; }
}
@media print {
  .masthead, .site-foot, .ad, .to-top, .share, .comments, .story-more, .side { display: none !important; }
  .prose { max-width: none; }
}
.dl-exif dt { font-size: .8125rem; }
.dl-exif dd { overflow-wrap: anywhere; }
