/* =====================================================================
   base.css — font, reset, typography, focus, scrollbars.
   Every font file is served from /app/fonts/. There is no external
   origin anywhere in this stylesheet: production runs a strict CSP.
   ===================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--c-bg);
  background-image: var(--c-bg-grad);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-md);
  font-weight: var(--w-normal);
  line-height: 1.55;
  /* Persian text: never let the UA synthesise a lighter face. */
  font-synthesis-weight: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { margin: 0; font-weight: var(--w-bold); line-height: 1.3; }
p { margin: 0; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  font-family: var(--f-sans);
}

button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; }

/* Digits are Persian in content, but tabular alignment still matters for
   money columns. */
.num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* Latin/digit runs inside Persian sentences keep their own direction. */
.ltr { direction: ltr; unicode-bidi: isolate; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

::selection { background: var(--c-brand); color: var(--c-brand-ink); }

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

[hidden] { display: none !important; }

/* Scrollbars: visible enough to grab with a finger, quiet enough to ignore. */
.scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line-strong) transparent;
  overscroll-behavior: contain;
}
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb {
  background: var(--c-line-strong);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
.scroll::-webkit-scrollbar-track { background: transparent; }

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