/* ==========================================================================
   Base reset + document styles.
   No components here — those live in components.css.
   ========================================================================== */

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

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

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }

::selection { background: var(--primary-container); color: var(--on-primary-container); }

/* Slim, M3-toned scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--on-surface-faint); }

/* Screen-reader-only utility */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Persian digits should not break LTR numbers */
.ltr { direction: ltr; }
.rtl { direction: rtl; }
.mono { font-family: var(--font-mono); }

/* Visibility utilities — prefer these over inline style="display:..." */
.is-hidden { display: none !important; }
