/* ==========================================================================
   Dr. Hanaa Morjane — Design System & Global Styles
   ========================================================================== */

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

:root {
  /* ── Primary: Rose/Mauve (from logo) ── */
  --clr-primary-50:  #FFF0F5;
  --clr-primary-100: #FFE0EB;
  --clr-primary-200: #FFC2D8;
  --clr-primary-300: #FF94B8;
  --clr-primary-400: #E8608E;
  --clr-primary-500: #B5256E;  /* Main brand — extracted from logo */
  --clr-primary-600: #9E1F5F;
  --clr-primary-700: #8E1B56;
  --clr-primary-800: #6B1341;
  --clr-primary-900: #4A0D2D;

  /* ── Accent: Warm Gold ── */
  --clr-accent-300: #F0D9B5;
  --clr-accent-400: #E8C9A0;
  --clr-accent-500: #D4A574;
  --clr-accent-600: #C08B55;

  /* ── Neutral: Warm Grays ── */
  --clr-neutral-50:  #FDFAF8;  /* Page background */
  --clr-neutral-100: #F8F4F1;
  --clr-neutral-200: #EDE7E3;
  --clr-neutral-300: #D5CCC6;
  --clr-neutral-400: #A89E96;
  --clr-neutral-500: #7A716A;
  --clr-neutral-600: #5C554F;
  --clr-neutral-700: #3D3832;
  --clr-neutral-800: #2C2422;  /* Body text */
  --clr-neutral-900: #1A1210;  /* Headings, dark sections */

  /* ── Dark Section ── */
  --clr-dark-bg:     #1A0F1E;  /* Deep plum */
  --clr-dark-surface:#2D1B2E;  /* Elevated dark */
  --clr-dark-text:   #F0E8E4;  /* Light text on dark */
  --clr-dark-muted:  #A89AAD;  /* Muted text on dark */

  /* ── Semantic ── */
  --clr-success:  #25D366;  /* WhatsApp green */
  --clr-error:    #E53E3E;
  --clr-warning:  #F6AD55;
  --clr-info:     #4299E1;

  /* ── Glass ── */
  --glass-bg:     rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-blur:   20px;

  --glass-dark-bg:     rgba(26, 15, 30, 0.75);
  --glass-dark-border: rgba(255, 255, 255, 0.08);

  /* ── Gradients ── */
  --grad-hero:    linear-gradient(135deg, #1A0F1E 0%, #3D2240 40%, #6B1341 70%, #B5256E 100%);
  --grad-primary: linear-gradient(135deg, #B5256E, #D4739D);
  --grad-accent:  linear-gradient(135deg, #D4A574, #E8C9A0);
  --grad-dark:    linear-gradient(180deg, #1A0F1E, #2D1B2E);
  --grad-shimmer: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);

  /* ── Font Families ── */
  --ff-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Arabic overrides (applied via [lang="ar"]) */
  --ff-heading-ar: 'Noto Serif Arabic', 'Traditional Arabic', serif;
  --ff-body-ar:    'Noto Sans Arabic', 'Segoe UI', sans-serif;

  /* ── Type Scale (mobile-first, rem) ── */
  --fs-display:  clamp(2.5rem, 6vw, 4.5rem);    /* Hero title */
  --fs-h1:       clamp(2rem, 4.5vw, 3.5rem);     /* Page titles */
  --fs-h2:       clamp(1.75rem, 3.5vw, 2.75rem);  /* Section titles */
  --fs-h3:       clamp(1.25rem, 2vw, 1.5rem);     /* Card titles */
  --fs-h4:       clamp(1.1rem, 1.5vw, 1.25rem);   /* Sub-headings */
  --fs-body:     clamp(0.95rem, 1.2vw, 1.0625rem);/* Body text */
  --fs-body-lg:  clamp(1.05rem, 1.4vw, 1.1875rem);/* Large body */
  --fs-small:    clamp(0.8rem, 1vw, 0.875rem);    /* Captions, labels */
  --fs-badge:    0.6875rem;                        /* Badges, tags */

  /* ── Line Heights ── */
  --lh-tight:    1.15;
  --lh-heading:  1.25;
  --lh-body:     1.7;

  /* ── Font Weights ── */
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* ── Letter Spacing ── */
  --ls-tight:    -0.02em;
  --ls-normal:   0;
  --ls-wide:     0.08em;
  --ls-badge:    0.15em;

  /* ── Spacing System ── */
  --space-2xs: 0.25rem;   /* 4px */
  --space-xs:  0.5rem;    /* 8px */
  --space-sm:  0.75rem;   /* 12px */
  --space-md:  1rem;      /* 16px */
  --space-lg:  1.5rem;    /* 24px */
  --space-xl:  2rem;      /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  --space-4xl: 6rem;      /* 96px */
  --space-5xl: 8rem;      /* 128px */

  /* Section padding (mobile → desktop) */
  --section-py: clamp(3rem, 8vw, 7rem);
  --section-px: clamp(1rem, 4vw, 2rem);

  /* Container */
  --container-max: 1200px;
  --container-px:  clamp(1rem, 4vw, 2rem);

  /* ── Elevation & Shadows ── */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.14);
  --shadow-glow: 0 0 40px rgba(181, 37, 110, 0.15);
  --shadow-card-hover: 0 12px 40px rgba(181, 37, 110, 0.12);

  /* ── Border Radii ── */
  --radius-sm:   0.375rem;  /* 6px */
  --radius-md:   0.75rem;   /* 12px */
  --radius-lg:   1rem;      /* 16px */
  --radius-xl:   1.5rem;    /* 24px */
  --radius-2xl:  2rem;      /* 32px */
  --radius-full: 9999px;    /* Pill shape */

  /* ── Transitions ── */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --dur-fast:     150ms;
  --dur-normal:   300ms;
  --dur-slow:     500ms;
  --dur-slower:   800ms;
  --dur-page:     600ms;   /* Page transition duration */
}

/* ==========================================================================
   CSS Reset & Base Rules
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 100%;
  height: 100%;
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--clr-neutral-800);
  background-color: var(--clr-neutral-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

main {
  flex-grow: 1;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-heading);
  line-height: var(--lh-heading);
  color: var(--clr-neutral-900);
  font-weight: var(--fw-bold);
}

/* ==========================================================================
   Arabic RTL Overrides
   ========================================================================== */
[lang="ar"] body {
  font-family: var(--ff-body-ar);
}

[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6 {
  font-family: var(--ff-heading-ar);
}

/* RTL Layout Alignment Rules */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Directional Icon Flipping */
[dir="rtl"] .icon--arrow {
  transform: scaleX(-1);
}

/* ==========================================================================
   Shared Utilities & Layout
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* Section Common Spacing */
.section {
  padding-block: var(--section-py);
}

/* Screen reader only utility */
.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;
}

/* Logical spacing utilities (RTL-safe) */
.m-is-auto { margin-inline-start: auto; }
.m-ie-auto { margin-inline-end: auto; }

/* Grid and Flex Helpers */
.grid {
  display: grid;
  gap: var(--space-xl);
}
.grid-2 {
  grid-template-columns: 1fr;
}
.grid-3 {
  grid-template-columns: 1fr;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
