/* ================================================================
   base.css — معادل globals.css نسخه TypeScript
   شامل: @font-face وزیرمتن + Preflight معادل Tailwind CSS v4
   (که globals.css از طریق @import "tailwindcss" اعمال می‌کرد)
   + توکن‌های shadcn هم‌راستا با تم زمردی + استایل‌های html/body
   ترتیب cascade: base.css → site.css → self-test.css → engine.css → app.css
   (عیناً همان ترتیب @import در globals.tsx اصلی)
   ================================================================ */

/* ===== فونت وزیرمتن — سلف‌هاست محلی (گوگل‌فونتز در ایران فیلتر است) ===== */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Vazirmatn-Arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Vazirmatn-Latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Preflight — معادل Tailwind CSS v4 (زیرمجموعه مؤثر) ===== */
*,
::after,
::before,
::backdrop,
::file-selector-button {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html,
:host {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Sans");
}

body {
  line-height: inherit;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  -webkit-text-decoration: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

code, kbd, samp, pre {
  font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
  font-size: 1em;
  min-width: 0;
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

button,
input,
optgroup,
select,
textarea {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  opacity: 1;
  border-radius: 0;
  background-color: transparent;
}

::placeholder {
  opacity: 1;
  color: color-mix(in oklab, currentColor 50%, transparent);
}

button,
input:where([type="button"], [type="reset"], [type="submit"]) {
  appearance: button;
}

::file-selector-button {
  appearance: button;
}

input:where([type="checkbox"], [type="radio"]) {
  appearance: none;
  padding: 0;
}

::file-selector-button:disabled {
  cursor: default;
}

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
}

img, video {
  max-width: 100%;
  height: auto;
}

[hidden]:where(:not([hidden="until-found"])) {
  display: none !important;
}

:where(ul, ol) {
  list-style: none;
}

/* ===== توکن‌های shadcn هم‌راستا با تم زمردی قبولی‌یاب (حالت تاریک اجباری) ===== */
:root,
.dark {
  --radius: 0.75rem;
  --background: #050806;
  --foreground: #eafff3;
  --card: #0c1a14;
  --card-foreground: #eafff3;
  --popover: #0f2419;
  --popover-foreground: #eafff3;
  --primary: #14f195;
  --primary-foreground: #031a11;
  --secondary: #0f2419;
  --secondary-foreground: #eafff3;
  --muted: #0a140f;
  --muted-foreground: #9ecdb3;
  --accent: #0f2419;
  --accent-foreground: #eafff3;
  --destructive: #ff6b6b;
  --border: rgba(20, 241, 149, 0.14);
  --input: rgba(20, 241, 149, 0.2);
  --ring: #14f195;
  --chart-1: #14f195;
  --chart-2: #e7c873;
  --chart-3: #ef8fc4;
  --chart-4: #f2b25c;
  --chart-5: #45d6b8;
  --sidebar: #0c1a14;
  --sidebar-foreground: #eafff3;
  --sidebar-primary: #14f195;
  --sidebar-primary-foreground: #031a11;
  --sidebar-accent: #0f2419;
  --sidebar-accent-foreground: #eafff3;
  --sidebar-border: rgba(20, 241, 149, 0.14);
  --sidebar-ring: #14f195;
}

/* معادل قاعدهٔ `* { border-color: var(--border) }` در globals.css اصلی */
* {
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  /* قفل اسکرول افقی: هیچ عنصری نباید قاب صفحه را بشکند (RTL) */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: #050806;
  color: #eafff3;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-wrap: break-word;
}

/* معادل کلاس `antialiased` روی <body> در layout.tsx اصلی */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
