/* ==========================================================================
   BASE + TYPOGRAPHY SYSTEM + LAYOUT
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--topbar-h) + 16px);
}

body {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: var(--font-fa);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; height: auto; }
img { background: var(--c-surface-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: var(--bw) solid var(--c-border); margin: var(--sp-6) 0; }

::selection { background: var(--gold-line); color: var(--c-text); }

/* ---------- RTL: قرینه‌سازی آیکون‌های جهت‌دار ---------- */
/* همهٔ آیکون‌ها بر مبنای LTR رسم شده‌اند؛ فلش‌ها/chevronها در RTL آینه می‌شوند.
   کلاس flip را به آیکون‌های جهت‌دار اضافه کنید. (با transition تداخل ندارد) */
html[dir="rtl"] .icon.flip { transform: scaleX(-1); }
html[dir="rtl"] .dd__btn .icon.flip,
html[dir="rtl"] .acc__head[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* ---------- FOCUS / ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; right: var(--sp-4); z-index: 200;
  background: var(--c-gold); color: var(--c-on-gold);
  padding: var(--sp-3) var(--sp-5); border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: var(--fw-semibold); transition: top var(--t-base) var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- TYPOGRAPHY ROLES ---------- */
.t-display, .t-h1, .t-h2, .t-h3, .t-h4, .t-body, .t-caption, .t-label, .t-btn {
  margin: 0;
  font-family: var(--font-fa);
  color: var(--c-text);
}

.t-display {
  font-size: var(--fs-display);
  line-height: 1.18;
  font-weight: var(--display-weight, 400);
  letter-spacing: var(--display-tracking, 0);
  text-transform: var(--display-transform, none);
}
.t-h1 { font-size: var(--fs-h1); line-height: 1.3; font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); }
.t-h2 { font-size: var(--fs-h2); line-height: 1.35; font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight); }
.t-h3 { font-size: var(--fs-h3); line-height: 1.45; font-weight: var(--fw-semibold); }
.t-h4 { font-size: var(--fs-h4); line-height: 1.5; font-weight: var(--fw-medium); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body); color: var(--c-text-soft); }
.t-caption { font-size: var(--fs-caption); line-height: 1.7; color: var(--c-muted); }
.t-label {
  font-size: var(--fs-label); line-height: 1.4; color: var(--c-muted);
  letter-spacing: var(--ls-wide); font-weight: var(--fw-medium);
}
.t-en { font-family: var(--font-en); direction: ltr; unicode-bidi: isolate; }
.t-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.t-gold { color: var(--gold-text); }
.t-muted { color: var(--c-muted); }
.t-center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-label); letter-spacing: var(--ls-wider);
  color: var(--gold-text); font-weight: var(--fw-medium); text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: clamp(20px, 4vw, 44px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold));
}
.eyebrow.no-line::before { display: none; }

/* ---------- LAYOUT ---------- */
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 880px; }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--alt { background: var(--c-bg-alt); }
.section--surface { background: var(--c-surface); }
.main { min-height: 60vh; padding-bottom: calc(var(--sp-20) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .main { padding-bottom: var(--sp-16); } }

.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5); margin-bottom: clamp(24px, 3.4vw, 48px);
}
.section-head__text { max-width: 62ch; }
.section-head__text .t-h2 { margin-top: var(--sp-3); }
.section-head__text p { margin: var(--sp-3) 0 0; color: var(--c-muted); max-width: 58ch; }
.section-head__action { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }

.grid { display: grid; gap: var(--grid-gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

.divider-gold {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--gold-line) 20%, var(--gold-line) 80%, transparent);
}

/* Media / image treatment */
.media {
  position: relative; overflow: hidden; border-radius: var(--img-radius);
  background: var(--c-surface-2);
}
.media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(var(--img-sat)) contrast(var(--img-contrast));
  transition: transform var(--t-slow) var(--ease-out), filter var(--t-base) var(--ease);
}
.media--zoom:hover img { transform: scale(var(--img-scale-hover)); }

/* Scroll reveal */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--t-slower) var(--ease-out), transform var(--t-slower) var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* Utility */
.hide-desktop { display: none; }
.hide-mobile { display: block; }
@media (max-width: 899px) {
  .hide-desktop { display: block; }
  .hide-mobile { display: none; }
}
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); }
.full { width: 100%; }
