/* ==========================================================================
   Nava — typography, reset, a11y utilities
   Self-hosted fonts (no remote font loading, no CDN).
   ========================================================================== */

/* ---------- fonts ------------------------------------------------------- */

@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Inter-Bold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-21BB;
}

/* ---------- reset ------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-ui);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.no-scroll {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

html[lang="fa"] h1,
html[lang="fa"] h2,
html[lang="fa"] h3,
html[lang="fa"] h4,
html[lang="fa"] h5,
html[lang="fa"] h6 {
  letter-spacing: 0;
  line-height: 1.5;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

ul, ol {
  padding-inline-start: 1.25em;
}

hr {
  border: 0;
  border-block-start: 1px solid var(--border);
  margin-block: var(--sp-4);
}

small {
  font-size: var(--text-sm);
}

strong, b {
  font-weight: var(--weight-semibold);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease);
}
a:hover { color: var(--brand-hover); }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
}

button:disabled {
  cursor: not-allowed;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

pre {
  margin: 0;
  overflow: auto;
}

::selection {
  background: var(--brand-soft);
  color: var(--brand);
}
html[data-theme="dark"] ::selection {
  color: #C7C7FA;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ---------- scrollbars -------------------------------------------------- */

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-pill);
}
*::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-3);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- direction --------------------------------------------------- */

[dir="ltr"] .flip-rtl,
[dir="rtl"] .flip-ltr {
  transform: scaleX(-1);
}

/* Icons that imply direction (chevrons, arrows) are mirrored in RTL via CSS. */
[dir="rtl"] svg.icon-directional {
  transform: scaleX(-1);
}

/* ---------- prose ------------------------------------------------------- */

.prose {
  font-size: var(--text-base);
  line-height: var(--leading-prose);
  color: var(--text);
  max-width: 72ch;
  white-space: pre-wrap;
}
.prose > * + * {
  margin-block-start: var(--sp-3);
}
.prose h1, .prose h2, .prose h3 {
  margin-block-start: var(--sp-5);
  white-space: normal;
}
.prose ul, .prose ol {
  padding-inline-start: 1.4em;
  white-space: normal;
}
.prose li + li {
  margin-block-start: var(--sp-1);
}
.prose blockquote {
  margin: 0;
  padding-inline-start: var(--sp-3);
  border-inline-start: 2px solid var(--border);
  color: var(--text-2);
  white-space: normal;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose code {
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}
.prose pre {
  padding: var(--sp-3);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  white-space: pre;
}
.prose pre code {
  border: 0;
  background: none;
  padding: 0;
}

/* ---------- utilities --------------------------------------------------- */

/* The `hidden` attribute must win over component display rules. */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  inset-inline-start: var(--sp-4);
  inset-block-start: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-2);
  font-weight: var(--weight-medium);
  transition: inset-block-start var(--motion) var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  inset-block-start: var(--sp-4);
}

.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.tiny { font-size: var(--text-sm); }
.mono { font-family: var(--font-mono); }
.bold { font-weight: var(--weight-semibold); }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; }
.center { text-align: center; }

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
}
.col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.grow { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.start { justify-content: flex-start; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.self-end { align-self: flex-end; }

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.gap-7 { gap: var(--sp-7); }
.gap-8 { gap: var(--sp-8); }

.hidden { display: none !important; }
.no-print { }

/* ---------- motion preferences ----------------------------------------- */

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

/* ---------- print reset hooks ------------------------------------------ */

@media print {
  body {
    background: #FFFFFF;
    color: #000000;
  }
  a {
    color: #000000;
  }
  * {
    box-shadow: none !important;
  }
}
