/* Typography System - UAE Federal Design Standards */

/* Font Loading Strategy */
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-regular.woff2') format('woff2'),
       url('../fonts/roboto-regular.woff') format('woff');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-medium.woff2') format('woff2'),
       url('../fonts/roboto-medium.woff') format('woff');
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-semibold.woff2') format('woff2'),
       url('../fonts/roboto-semibold.woff') format('woff');
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-regular.woff2') format('woff2'),
       url('../fonts/inter-regular.woff') format('woff');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-semibold.woff2') format('woff2'),
       url('../fonts/inter-semibold.woff') format('woff');
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}

/* Arabic Fonts */
@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('../fonts/notokufiarabic-regular.woff2') format('woff2'),
       url('../fonts/notokufiarabic-regular.woff') format('woff');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('../fonts/notokufiarabic-medium.woff2') format('woff2'),
       url('../fonts/notokufiarabic-medium.woff') format('woff');
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('../fonts/notokufiarabic-semibold.woff2') format('woff2'),
       url('../fonts/notokufiarabic-semibold.woff') format('woff');
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}

/* Typography Scale - Minor Third Ratio (1.2×) */
:root {
  --font-family-primary: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-family-secondary: 'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
  --font-family-arabic: 'Noto Kufi Arabic', 'Tahoma', system-ui, sans-serif;
  
  /* Font Sizes */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;      /* 16px - Base */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0.016em;  /* 0.16× font size */
  --letter-spacing-wide: 0.025em;
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

/* Base Typography Classes */
.text-body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
  color: var(--text-primary);
}

.text-heading {
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

.text-arabic {
  font-family: var(--font-family-arabic);
  line-height: var(--line-height-relaxed);
  letter-spacing: 0.01em;
}

/* RTL Support for Typography */
[dir="rtl"] .text-body {
  font-family: var(--font-family-arabic);
}

[dir="rtl"] .text-heading {
  font-family: var(--font-family-arabic);
  font-weight: var(--font-weight-medium);
}

/* Heading Sizes */
.text-h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-6);
}

.text-h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

.text-h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

.text-h4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-2);
}

.text-h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-2);
}

.text-h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-1);
}

/* Text Sizes */
.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-xl {
  font-size: var(--font-size-xl);
}

.text-2xl {
  font-size: var(--font-size-2xl);
}

.text-3xl {
  font-size: var(--font-size-3xl);
}

.text-4xl {
  font-size: var(--font-size-4xl);
}

/* Font Weights */
.font-normal {
  font-weight: var(--font-weight-normal);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

/* Line Heights */
.leading-tight {
  line-height: var(--line-height-tight);
}

.leading-normal {
  line-height: var(--line-height-normal);
}

.leading-relaxed {
  line-height: var(--line-height-relaxed);
}

/* Letter Spacing */
.tracking-tight {
  letter-spacing: var(--letter-spacing-tight);
}

.tracking-normal {
  letter-spacing: var(--letter-spacing-normal);
}

.tracking-wide {
  letter-spacing: var(--letter-spacing-wide);
}

/* Text Colors */
.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

.text-inverse {
  color: var(--text-inverse);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-error {
  color: var(--error);
}

.text-info {
  color: var(--info);
}

/* Text Alignment */
.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-justify {
  text-align: justify;
}

.text-start {
  text-align: var(--text-align-start);
}

.text-end {
  text-align: var(--text-align-end);
}

/* Responsive Typography */
@media (max-width: 767px) {
  .text-h1 {
    font-size: var(--font-size-3xl);
  }
  
  .text-h2 {
    font-size: var(--font-size-2xl);
  }
  
  .text-h3 {
    font-size: var(--font-size-xl);
  }
  
  .text-h4 {
    font-size: var(--font-size-lg);
  }
}

/* Print Styles */
@media print {
  .text-heading {
    font-family: 'Georgia', serif;
  }
  
  .text-body {
    font-family: 'Georgia', serif;
    line-height: 1.4;
  }
}