/*
  base.css
  ---------------------------------------------------------------------------
  استایل پایه عناصر خام HTML (Reset سبک، Typography، تنظیمات RTL/Mobile-first).
  هیچ Class کامپوننتی اینجا تعریف نمی‌شود — آن‌ها در components.css هستند.
  ---------------------------------------------------------------------------
*/

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Fallback برای مرورگرهایی که Variable Font را پشتیبانی نمی‌کنند */
@supports not (font-variation-settings: normal) {
  @font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-background);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  color: var(--color-text);
}

h1 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  color: var(--color-white);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-3) 0;
  max-width: 72ch;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

/* ===== Focus State — همیشه قابل مشاهده (بخش Accessibility) ===== */
:focus-visible {
  outline: 2px solid var(--color-burgundy);
  outline-offset: 2px;
}

/* ===== Skip Link — دسترس‌پذیری کیبورد برای رد شدن از منو ===== */
.skip-link {
  position: absolute;
  right: var(--space-3);
  top: -100px;
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  z-index: 2000;
  transition: top var(--duration-base) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ===== Responsive base image ratio helper بدون CLS (نسبت‌های تأییدشده Phase 2.1) ===== */
.ratio-hero-desktop {
  aspect-ratio: 16 / 7;
}

.ratio-hero-mobile {
  aspect-ratio: 4 / 5;
}

.ratio-product-card {
  aspect-ratio: 4 / 5;
}

.ratio-product-main {
  aspect-ratio: 4 / 3;
}

.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

/* Article / Project / Factory / Category */
.ratio-square {
  aspect-ratio: 1 / 1;
}

@media (max-width: 991.98px) {
  html {
    font-size: 15px;
  }
}