/**
 * Roshd Afarin Kimia Kerman (RAK) — Base styles
 * File: assets/css/base.css
 *
 * Applies the design-system tokens (variables.css) to core HTML elements:
 * body, headings, paragraphs, links, lists, media. Also handles RTL/Persian.
 * Depends on: variables.css (tokens) and fonts.css (font-faces).
 */

/* ============================================================
   1) MODERN RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   2) HEADINGS
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-md);
  color: var(--color-heading);
  font-family: var(--font-base);
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
}

h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
}

/* ============================================================
   3) TEXT ELEMENTS
   ============================================================ */

p {
  margin: 0 0 var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-dark);
}

ul, ol {
  margin: 0 0 var(--space-md);
  padding-inline-start: var(--space-lg);
}

li {
  margin-bottom: var(--space-2xs);
}

strong, b {
  font-weight: var(--fw-semibold);
}

small {
  font-size: var(--fs-caption);
  color: var(--color-text-muted);
}

/* ============================================================
   4) MEDIA
   ============================================================ */

img,
picture,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   5) RTL / PERSIAN
   ============================================================ */

[dir="rtl"] body,
body.rtl {
  font-family: var(--font-fa);
  line-height: var(--lh-relaxed);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
  font-family: var(--font-fa);
}