/**
 * wbl Design System
 * 
 * Base design system with colors, typography, spacing, and component standards
 * Following BEM methodology for consistent styling
 * 
 * @package wbl
 */

/* ================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ================================================================ */

:root {
  /* Font Families */
  --font-family-primary: 'Almarai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Color Palette 
    --color-bg-alt: #e3ded1;    

  */
  --color-bg-alt: #f7f5ee;      /* Alternative Background: lighter beige/cream */
  --color-primary: #733510;     /* Primary: dark brown/terracotta */
  --color-text-primary: #2c2c2c; /* Text Primary: dark gray */
  --color-text-secondary: #666666; /* Text Secondary: medium gray */
  --color-white: #ffffff;       /* White */
  --color-success: #28a745;     /* Success: green */
  --color-warning: #ffc107;     /* Warning: yellow */
  --color-error: #dc3545;       /* Error: red */
  
  /* Typography Scale */
  --font-size-h1: 3rem;         /* 48px - Page titles */
  --font-size-h2: 2.25rem;      /* 36px - Section titles */
  --font-size-h3: 1.75rem;      /* 28px - Subsection titles */
  --font-size-h4: 1.5rem;       /* 24px - Card titles */
  --font-size-h5: 1.25rem;      /* 20px - Small headings */
  --font-size-h6: 1.125rem;     /* 18px - Smallest headings */
  --font-size-body: 1rem;       /* 16px - Regular text */
  --font-size-small: 0.875rem;  /* 14px - Helper text */
  
  /* Line Heights */
  --line-height-heading: 1.2;
  --line-height-body: 1.6;
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  
  /* Spacing System (8px base) */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 1.5rem;   /* 24px */
  --spacing-lg: 2rem;     /* 32px */
  --spacing-xl: 3rem;     /* 48px */
  --spacing-xxl: 4rem;    /* 64px */
  
  /* Border Radius */
  --radius-small: 4px;    /* Buttons */
  --radius-medium: 8px;   /* Cards, inputs */
  --radius-large: 12px;   /* Large components */
  
  /* Box Shadows */
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-interactive: var(--shadow-medium);
  --shadow-interactive-hover: var(--shadow-heavy);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Breakpoints (for reference in media queries) */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
  
  /* Container Widths */
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
  --container-xxl: 1320px;
  
  /* Content Widths */
  --content-width-narrow: 600px;   /* For subtitles and descriptions */
  --content-width-medium: 800px;   /* For content sections */
}

/* ================================================================
   BASE STYLES
   ================================================================ */

/* Box Sizing Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Body Defaults */
body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  background-color: var(--color-white);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-h5); }
h6 { font-size: var(--font-size-h6); }

p {
  margin: 0 0 var(--spacing-sm) 0;
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-medium);
}

a:hover,
a:focus {
  color: var(--color-text-primary);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin: 0 0 var(--spacing-sm) 0;
  padding-inline-start: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================================================================
   LAYOUT UTILITIES
   ================================================================ */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

@media (min-width: 576px) {
  .container { max-width: var(--container-sm); }
}

@media (min-width: 768px) {
  .container { 
    max-width: var(--container-md);
    padding: 0 var(--spacing-md);
  }
}

@media (min-width: 992px) {
  .container { max-width: var(--container-lg); }
}

@media (min-width: 1200px) {
  .container { max-width: var(--container-xl); }
}

@media (min-width: 1400px) {
  .container { max-width: var(--container-xxl); }
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(-1 * var(--spacing-sm));
}

.col {
  flex: 1;
  padding: 0 var(--spacing-sm);
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Spacing Utilities */
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-xxl { margin-top: var(--spacing-xxl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mb-xxl { margin-bottom: var(--spacing-xxl); }

.pt-xs { padding-top: var(--spacing-xs); }
.pt-sm { padding-top: var(--spacing-sm); }
.pt-md { padding-top: var(--spacing-md); }
.pt-lg { padding-top: var(--spacing-lg); }
.pt-xl { padding-top: var(--spacing-xl); }
.pt-xxl { padding-top: var(--spacing-xxl); }

.pb-xs { padding-bottom: var(--spacing-xs); }
.pb-sm { padding-bottom: var(--spacing-sm); }
.pb-md { padding-bottom: var(--spacing-md); }
.pb-lg { padding-bottom: var(--spacing-lg); }
.pb-xl { padding-bottom: var(--spacing-xl); }
.pb-xxl { padding-bottom: var(--spacing-xxl); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-white { color: var(--color-white); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

.text-small { font-size: var(--font-size-small); }
.text-large { font-size: var(--font-size-h4); }

.font-light { font-weight: var(--font-weight-light); }
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-bold { font-weight: var(--font-weight-bold); }

/* Background Utilities */
.bg-primary { background-color: var(--color-primary); }
.bg-white { background-color: var(--color-white); }
.bg-light { background-color: var(--color-bg-alt); }

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

/* Flex Utilities */
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

/* ================================================================
   RESPONSIVE UTILITIES
   ================================================================ */

/* Mobile First Responsive Utilities */
@media (max-width: 767px) {
  .d-none-mobile { display: none !important; }
  .d-block-mobile { display: block !important; }
  .text-center-mobile { text-align: center; }
  
  .col-mobile-12 { flex: 0 0 100%; max-width: 100%; }
  .col-mobile-6 { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 768px) {
  .d-none-tablet { display: none !important; }
  .d-block-tablet { display: block !important; }
}

@media (min-width: 992px) {
  .d-none-desktop { display: none !important; }
  .d-block-desktop { display: block !important; }
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

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

/* Focus Styles */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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