/* ==========================================================================
   Equity Legal Group - Typography and Font Loading
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Arabic Font Support */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@300;400;500;600;700&family=Cairo:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   Font Face Declarations
   ========================================================================== */

/* Primary Font - Source Sans Pro */
.font-primary {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Heading Font - Playfair Display */
.font-heading {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
}

/* Arabic Font - Noto Sans Arabic (Primary) */
.font-arabic {
  font-family: 'Noto Sans Arabic', 'Cairo', 'Arial Unicode MS', Tahoma, sans-serif;
}

/* Alternative Arabic Font - Cairo */
.font-arabic-cairo {
  font-family: 'Cairo', 'Noto Sans Arabic', 'Arial Unicode MS', Tahoma, sans-serif;
}

/* ==========================================================================
   Font Weight Classes
   ========================================================================== */

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ==========================================================================
   Typography Utility Classes
   ========================================================================== */

/* Font Size Classes */
.text-xs { font-size: 0.75rem; }    /* 12px */
.text-sm { font-size: 0.875rem; }   /* 14px */
.text-base { font-size: 1rem; }     /* 16px */
.text-lg { font-size: 1.125rem; }   /* 18px */
.text-xl { font-size: 1.25rem; }    /* 20px */
.text-2xl { font-size: 1.5rem; }    /* 24px */
.text-3xl { font-size: 1.875rem; }  /* 30px */
.text-4xl { font-size: 2.25rem; }   /* 36px */
.text-5xl { font-size: 3rem; }      /* 48px */

/* Line Height Classes */
.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 2; }

/* Letter Spacing Classes */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* ==========================================================================
   Language-Specific Typography
   ========================================================================== */

/* English Text Styling */
.lang-en {
  font-family: 'Source Sans Pro', sans-serif;
  direction: ltr;
  text-align: left;
}

.lang-en h1,
.lang-en h2,
.lang-en h3,
.lang-en h4,
.lang-en h5,
.lang-en h6 {
  font-family: 'Playfair Display', serif;
}

/* Arabic Text Styling */
.lang-ar {
  font-family: 'Noto Sans Arabic', 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
  line-height: 1.8; /* Slightly increased for Arabic readability */
  font-feature-settings: "kern" 1, "liga" 1; /* Enable kerning and ligatures for Arabic */
}

.lang-ar h1,
.lang-ar h2,
.lang-ar h3,
.lang-ar h4,
.lang-ar h5,
.lang-ar h6 {
  font-family: 'Noto Sans Arabic', 'Cairo', sans-serif;
  font-weight: 600;
  line-height: 1.4; /* Better line height for Arabic headings */
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Bilingual Content Support */
.bilingual-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-large);
}

.bilingual-content .lang-en,
.bilingual-content .lang-ar {
  flex: 1;
}

/* Language-specific button styling */
.lang-ar .btn {
  font-family: 'Noto Sans Arabic', 'Cairo', sans-serif;
  font-weight: 500;
}

/* Improved Arabic number styling */
.lang-ar .number {
  font-feature-settings: "lnum" 1; /* Use lining numbers for Arabic */
}

/* Arabic-specific typography enhancements */
.lang-ar .legal-heading {
  font-family: 'Noto Sans Arabic', 'Cairo', sans-serif;
  font-weight: 700;
  color: var(--color-primary-navy);
  line-height: 1.3;
  letter-spacing: normal; /* Reset letter-spacing for Arabic */
}

.lang-ar .body-text {
  font-family: 'Noto Sans Arabic', 'Cairo', sans-serif;
  font-weight: 400;
  line-height: 1.8;
  color: var(--color-text-dark);
}

.lang-ar .caption-text {
  font-family: 'Noto Sans Arabic', 'Cairo', sans-serif;
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* Mixed content (English + Arabic) */
.mixed-content {
  font-family: 'Source Sans Pro', 'Noto Sans Arabic', sans-serif;
}

/* Language switcher styling */
.language-switcher {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 600;
  font-size: var(--font-size-small);
}

/* ==========================================================================
   Font Loading Optimization
   ========================================================================== */

/* Font Display Swap for Better Performance */
@font-face {
  font-family: 'Source Sans Pro';
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Arabic';
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  font-display: swap;
}

/* ==========================================================================
   Advanced Typography Classes
   ========================================================================== */

/* Text Transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Text Decoration */
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }

/* Font Style */
.italic { font-style: italic; }
.not-italic { font-style: normal; }

/* Text Color Utilities */
.text-primary { color: var(--color-primary-navy); }
.text-secondary { color: var(--color-secondary-gray); }
.text-light { color: var(--color-text-light); }
.text-dark { color: var(--color-text-dark); }
.text-white { color: var(--color-white); }
.text-gold { color: var(--color-accent-gold); }

/* Professional Typography Combinations */
.legal-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  color: var(--color-primary-navy);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.body-text {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-dark);
}

.caption-text {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* ==========================================================================
   Responsive Typography
   ========================================================================== */

/* Mobile Typography Adjustments */
@media (max-width: 767px) {
  .text-4xl { font-size: 2rem; }     /* 32px */
  .text-5xl { font-size: 2.5rem; }   /* 40px */
  
  /* Improve readability on small screens */
  body {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
  }
}

/* Tablet Typography Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  body {
    font-size: 1rem;
    line-height: 1.65;
  }
}

/* Desktop Typography Enhancements */
@media (min-width: 1024px) {
  body {
    font-size: 1.125rem; /* 18px for better readability on large screens */
    line-height: 1.7;
  }
}