/* ==========================================================================
   NUTRIFLOW - MODERN DESIGN SYSTEM TYPOGRAPHY (Montserrat System)
   ========================================================================== */

/* Dual-Engine Typography: Cairo (Arabic RTL) & Montserrat (Latin LTR) 
   Loaded directly via parallel preconnected <link> in HTML <head> for zero-waterfall PageSpeed */

/* --------------------------------------------------------------------------
   1. GLOBAL FONT FAMILY DEFINITIONS & VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Unified Font Family */
  --font-montserrat: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Backward Compatibility Aliases -> Pointing to Montserrat */
  --font-raleway: var(--font-montserrat);
  --font-playfair: var(--font-montserrat);
  --font-ponomar: var(--font-montserrat);

  --rail: var(--font-montserrat);
  --playfair: var(--font-montserrat);
  --ponomar: var(--font-montserrat);

  /* Semantic Mapping */
  --font-primary: var(--font-montserrat);
  --font-serif: var(--font-montserrat);
  --font-heading: var(--font-montserrat);

  /* Font Sizes - Headings (Fluid Scale) */
  --fs-hero-title: clamp(44px, 5vw, 74px);
  --fs-h1: clamp(42px, 4.5vw, 68px);
  --fs-h2: clamp(32px, 3.2vw, 48px);
  --fs-h3: clamp(24px, 2.2vw, 32px);
  --fs-h4: clamp(20px, 1.8vw, 26px);
  --fs-h5: clamp(17px, 1.4vw, 22px);
  --fs-h6: clamp(15px, 1.1vw, 18px);

  /* Font Sizes - Body & Components */
  --fs-body-lead: clamp(18px, 1.3vw, 22px);
  --fs-body: 16px;
  --fs-body-lg: 18px;
  --fs-body-sm: 14px;
  --fs-eyebrow: 14px;
  --fs-button: 16px;

  /* Line Height Variables */
  --lh-tight: 1.08;
  --lh-h1: 1.12;
  --lh-h2: 1.2;
  --lh-h3: 1.25;
  --lh-h4: 1.32;
  --lh-h5: 1.38;
  --lh-h6: 1.4;
  --lh-body-lead: 1.5;
  --lh-body: 1.6;
  --lh-body-lg: 1.55;
  --lh-body-sm: 1.45;
  --lh-eyebrow: 1.2;
  --lh-button: 1.2;
}

/* --------------------------------------------------------------------------
   2. BASE HTML ELEMENT TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1,
.h1,
.text-hero-main {
  font-family: var(--font-heading);
  font-size: var(--fs-hero-title);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: var(--lh-tight);
  color: var(--ink-dark);
  margin-top: 0;
  margin-bottom: 18px;
}

h2,
.h2,
.text-section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: var(--lh-h2);
  color: inherit;
  margin-top: 0;
  margin-bottom: 20px;
}

h3,
.h3,
.text-card-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: var(--lh-h3);
  color: inherit;
  margin-top: 0;
  margin-bottom: 14px;
}

h4,
.h4,
.text-subtitle-header {
  font-family: var(--font-primary);
  font-size: var(--fs-h4);
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: var(--lh-h4);
  color: inherit;
  margin-top: 0;
  margin-bottom: 12px;
}

h5,
.h5,
.text-group-header {
  font-family: var(--font-primary);
  font-size: var(--fs-h5);
  font-weight: 600;
  line-height: var(--lh-h5);
  color: inherit;
  margin-top: 0;
  margin-bottom: 10px;
}

h6,
.h6,
.text-micro-header {
  font-family: var(--font-primary);
  font-size: var(--fs-h6);
  font-weight: 700;
  line-height: var(--lh-h6);
  color: inherit;
  margin-top: 0;
  margin-bottom: 8px;
}

p,
.text-body {
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: inherit;
  margin-top: 0;
  margin-bottom: 1rem;
}

.text-body-lg {
  font-family: var(--font-primary);
  font-size: var(--fs-body-lg);
  font-weight: 400;
  line-height: var(--lh-body-lg);
}

.text-body-sm {
  font-family: var(--font-primary);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  line-height: var(--lh-body-sm);
}

.lead,
.text-lead {
  font-family: var(--font-primary);
  font-size: var(--fs-body-lead);
  font-weight: 400;
  line-height: var(--lh-body-lead);
  letter-spacing: -0.2px;
  opacity: 0.92;
}

/* --------------------------------------------------------------------------
   3. UTILITY TYPOGRAPHY CLASSES
   -------------------------------------------------------------------------- */

.eyebrow,
.text-eyebrow {
  font-family: var(--font-primary);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  line-height: var(--lh-eyebrow);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
  display: inline-block;
  margin-bottom: 14px;
}

.text-hero-eyebrow {
  font-family: var(--font-primary);
  font-size: clamp(15px, 1.35vw, 20px);
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--ink-dark);
  line-height: 1.3;
  margin-bottom: 12px;
  text-transform: uppercase;
  display: inline-block;
  opacity: 0.92;
}

.text-hero-eyebrow em {
  font-style: normal;
  color: var(--green);
}

/* Font Family Helper Classes */
.font-heading {
  font-family: var(--font-heading) !important;
}
.font-serif {
  font-family: var(--font-primary) !important;
}
.font-sans {
  font-family: var(--font-primary) !important;
}

/* Font Weight Helper Classes */
.fw-light {
  font-weight: 300 !important;
}
.fw-normal {
  font-weight: 400 !important;
}
.fw-medium {
  font-weight: 500 !important;
}
.fw-semibold {
  font-weight: 600 !important;
}
.fw-bold {
  font-weight: 700 !important;
}
.fw-extrabold {
  font-weight: 800 !important;
}

/* Text Style & Alignment Helper Classes */
.text-italic {
  font-style: italic !important;
}
.text-uppercase {
  text-transform: uppercase !important;
}
.text-lowercase {
  text-transform: lowercase !important;
}
.text-capitalize {
  text-transform: capitalize !important;
}

/* Links & Interactive Action Text */
a {
  color: var(--green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--green-dark);
}


/* ==========================================================================
   Arabic Typography System (Cairo Modern Geometric Sans)
   ========================================================================== */
:root {
  --font-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[dir="rtl"],
html[lang="ar"],
body.rtl-active {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
}

[dir="rtl"] body,
html[lang="ar"] body,
body.rtl-active {
  font-family: var(--font-arabic);
}

[dir="rtl"] .font-heading,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .h1, [dir="rtl"] .h2, [dir="rtl"] .h3, [dir="rtl"] .h4, [dir="rtl"] .h5, [dir="rtl"] .h6 {
  font-family: var(--font-arabic);
  letter-spacing: normal !important;
}

[dir="rtl"] .badge-tag,
[dir="rtl"] .eyebrow-row,
[dir="rtl"] .btn-brand {
  letter-spacing: normal !important;
}
