/**
 * @file css/typography.css
 * @description نظام الطباعة التحريرية والهندسية لاستوديو إيوان (IWAN Atelier)
 * يعتمد "Noto Kufi Arabic" للعناوين المعمارية و"IBM Plex Sans Arabic" للنصوص،
 * مع "DM Serif Display" للأرقام والأسماء الدولية، و"Space Grotesk" للملاحظات الفنية.
 */

/* --------------------------------------------------------------------------
   1. استيراد الخطوط الرسمية من Google Fonts
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* عائلات الخطوط المعتمدة */
  --font-heading: 'Noto Kufi Arabic', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-editorial: 'DM Serif Display', Georgia, serif;
  --font-tech: 'Space Grotesk', ui-monospace, monospace;
}

/* --------------------------------------------------------------------------
   2. الإعدادات الأساسية لطباعة النصوص العربية
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px للوضوح المعماري */
  font-weight: 400;
  line-height: 1.85;    /* مساحة تنفس واسعة للنص العربي */
  letter-spacing: 0;    /* حظر تباعد الحروف في النص العربي تماماً */
  color: var(--text-primary);
  font-feature-settings: "cv01", "ss01";
}

/* --------------------------------------------------------------------------
   3. سلم العناوين والطباعة المتجاوبة (Fluid Typography Clamp Scales)
   -------------------------------------------------------------------------- */

/* عنوان الهيرو الرئيسي الفخم */
h1,
.type-hero {
  font-family: var(--font-heading);
  font-size: clamp(3.25rem, 7.5vw, 6.75rem);
  font-weight: 800;
  line-height: 1.08; /* ارتفاع ضيق ومحكم للعناوين العربية الكبرى */
  letter-spacing: 0;
  color: var(--text-primary);
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

/* عناوين الأقسام الرئيسية */
h2,
.type-section {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text-primary);
  text-wrap: balance;
  margin-bottom: 1.25rem;
}

/* عناوين المجموعات والمشاريع */
h3,
.type-subheading {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* عناوين الكروت الفرعية */
h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

/* الفقرات الوصفية العامة */
p {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--text-secondary);
  max-width: 68ch; /* تحديد أقصى طول للسطر لمنع إجهاد العين */
  margin-bottom: 1rem;
}

p.lead {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.8;
  color: var(--text-primary);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   4. التسميات الفنية والوسوم الهندسية (Labels & Metadata)
   -------------------------------------------------------------------------- */
.type-label {
  font-family: var(--font-tech);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* الميتاداتا بدون كبسولات (Zero-Pill Discipline) */
.metadata-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.metadata-separator {
  color: var(--border-strong);
  user-select: none;
}

/* --------------------------------------------------------------------------
   5. الأرقام التحريرية والتداول الرقمي (Editorial Numerals)
   -------------------------------------------------------------------------- */
.numeral-hero {
  font-family: var(--font-editorial);
  font-size: clamp(3.5rem, 6vw, 5.5rem);
  line-height: 1;
  font-weight: 400;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.numeral-stat {
  font-family: var(--font-editorial);
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  line-height: 1;
  font-weight: 400;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.numeral-index {
  font-family: var(--font-editorial);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent-warm);
}

/* --------------------------------------------------------------------------
   6. الزخرفة التحريرية للمقالات ودراسات الحالة (Editorial Details)
   -------------------------------------------------------------------------- */
/* حرف استهلالي كبير للمقالات وقصة التأسيس */
.drop-cap::first-letter {
  font-family: var(--font-heading);
  font-size: 3.8rem;
  line-height: 0.85;
  font-weight: 800;
  float: right;
  margin-left: 1rem;
  margin-top: 0.2rem;
  color: var(--accent-primary);
}

/* اقتباس معماري فخم */
.editorial-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
  position: relative;
  padding-right: 2rem;
  border-right: 3px solid var(--accent-warm);
  margin: 2.5rem 0;
}

/* تسطير أوكر رفيع للروابط التفاعلية */
.editorial-link {
  position: relative;
  font-weight: 500;
  color: var(--text-primary);
  padding-bottom: 2px;
}

.editorial-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0%;
  height: 1.5px;
  background-color: var(--accent-warm);
  transition: width var(--duration-hover) var(--ease-cinematic);
}

.editorial-link:hover {
  color: var(--accent-warm);
}

.editorial-link:hover::after {
  width: 100%;
}
