/* ==========================================================================
   عَزْم — AZM ATHLETIC & NUTRITION | Base Styles & Reset (RTL First)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700;800&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* CSS Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  direction: rtl;
  text-align: right;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-graphite);
  background-color: var(--color-misty-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL Logical Properties & Direction Helpers */
bdi, [dir="ltr"] {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* Accessibility Focus Visible Standards */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-brick-red);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-graphite);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw + 1rem, var(--font-size-4xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.6rem, 2.5vw + 0.5rem, var(--font-size-3xl));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, var(--font-size-xl));
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-graphite);
  max-width: 75ch;
}

p.lead {
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--color-slate-green-dark);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style-position: inside;
  margin-bottom: var(--space-4);
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* Number display consistency */
.num, .price, .stat-value {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Screen Reader 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;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100px;
  right: var(--space-4);
  background: var(--color-brick-red);
  color: var(--color-pure-white);
  padding: var(--space-3) var(--space-6);
  z-index: 9999;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
