/* ---------------------------------------------------------------
   میهن اد — پایه: فونت، ریست، تایپوگرافی، گرید
   --------------------------------------------------------------- */

/* ---------- فونت وزیرمتن (self-host) ---------- */
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 300;
  src: url("../fonts/Vazirmatn-300.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 400;
  src: url("../fonts/Vazirmatn-400.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 500;
  src: url("../fonts/Vazirmatn-500.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 600;
  src: url("../fonts/Vazirmatn-600.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 700;
  src: url("../fonts/Vazirmatn-700.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 800;
  src: url("../fonts/Vazirmatn-800.woff2") format("woff2"); font-display: swap;
}

/* ---------- ریست ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  font-size: 90%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--ink-soft);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.351rem, 2.688vw, 2.133rem); }
h2 { font-size: clamp(1.067rem, 2.048vw, 1.6rem); }
h3 { font-size: clamp(.853rem, 1.408vw, 1.244rem); }
h4 { font-size: .978rem; font-weight: 600; }
h5, h6 { font-size: .8rem; font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--brand-600); }

ul, ol { margin: 0 0 1em; padding-inline-start: 1.4em; }
li { margin-bottom: .4em; }

strong, b { font-weight: 600; color: var(--ink); }
small { font-size: var(--fs-sm); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-8) 0; }

blockquote {
  border-inline-start: 4px solid var(--brand);
  background: var(--brand-50);
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-sm);
  margin: var(--sp-6) 0;
  color: var(--ink-soft);
}

code, kbd, pre, samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr;
  unicode-bidi: embed;
}
code {
  background: var(--surface-2); padding: .15em .45em;
  border-radius: 6px; font-size: .9em; color: var(--accent-600);
}
pre {
  background: var(--ink); color: #E2E8F0; padding: var(--sp-5);
  border-radius: var(--r); overflow-x: auto; text-align: left;
}
pre code { background: none; color: inherit; padding: 0; }

table { width: 100%; border-collapse: collapse; }

::selection { background: var(--brand-200); color: var(--brand-700); }

:focus-visible {
  outline: 3px solid var(--brand-300);
  outline-offset: 2px;
  border-radius: 6px;
}

/* اعداد لاتین در متن فارسی خواناتر بمانند */
.ltr { direction: ltr; unicode-bidi: embed; text-align: left; display: inline-block; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "ss01"; }

/* ---------- چیدمان ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 820px; }

.section { padding-block: clamp(var(--sp-12), 7vw, var(--sp-24)); }
.section--tight { padding-block: clamp(var(--sp-10), 5vw, var(--sp-16)); }
.section--surface { background: var(--surface); }
.section--soft { background: var(--grad-soft); }

.grid { display: grid; gap: var(--sp-6); }
.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)); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--center { justify-content: center; }
.row--nowrap { flex-wrap: nowrap; }
.spacer { flex: 1; }

/* ---------- کمکی ---------- */
.text-center { text-align: center; }
.text-start  { text-align: start; }
.text-muted  { color: var(--muted); }
.text-ink    { color: var(--ink); }
.text-brand  { color: var(--brand); }
.text-accent { color: var(--accent); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-lg { font-size: var(--fs-lg); }
.fw-500 { font-weight: 500; } .fw-700 { font-weight: 600; } .fw-800 { font-weight: 700; }
.mt-0{margin-top:0}.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}
.mt-4{margin-top:var(--sp-4)}.mt-6{margin-top:var(--sp-6)}.mt-8{margin-top:var(--sp-8)}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:var(--sp-2)}.mb-4{margin-bottom:var(--sp-4)}
.mb-6{margin-bottom:var(--sp-6)}.mb-8{margin-bottom:var(--sp-8)}
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ویژگی hidden باید بر قوانین display غالب باشد؛ در غیر این صورت عناصری
   که display: flex/grid دارند با وجود hidden همچنان دیده می‌شوند. */
[hidden] { display: none !important; }
.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; inset-block-start: 12px; inset-inline-start: 12px;
  z-index: 9999; background: var(--brand); color: #fff;
  padding: 10px 18px; border-radius: var(--r-sm); width: auto; height: auto;
  clip: auto; white-space: normal;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  body { font-size: .9375rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding-block: var(--sp-12); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------- چاپ ---------- */
@media print {
  .site-header, .site-footer, .no-print, .panel-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel-card { box-shadow: none !important; border: 1px solid #ccc; }
}
