/*
Theme Name: AlHamd Theme
Description: Custom WordPress theme for شركة الحمد لنقل الأثاث (Al-Hamd Moving Services)
Version: 1.0.0
Author: AlHamd Development Team
Text Domain: alhamd
Domain Path: /languages
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   Self-hosted Cairo Font (Variable Weight)
   ========================================================================== */

/* Arabic */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./assets/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* Latin Extended */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./assets/fonts/cairo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Latin */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./assets/fonts/cairo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

/* Primary Color Scale - hsl(158, 53%, 43%) */
:root {
  --color-primary-50: hsl(158, 53%, 95%);
  --color-primary-100: hsl(158, 53%, 88%);
  --color-primary-200: hsl(158, 53%, 78%);
  --color-primary-300: hsl(158, 53%, 68%);
  --color-primary-400: hsl(158, 53%, 58%);
  --color-primary-500: hsl(158, 53%, 43%);
  --color-primary-600: hsl(158, 53%, 38%);
  --color-primary-700: hsl(158, 53%, 33%);
  --color-primary-800: hsl(158, 53%, 28%);
  --color-primary-900: hsl(158, 53%, 18%);
}

/* Dark Theme Background Scale - hsl(210, 20%, 6%) */
:root {
  --color-dark-50: hsl(210, 20%, 95%);
  --color-dark-100: hsl(210, 20%, 88%);
  --color-dark-200: hsl(210, 20%, 78%);
  --color-dark-300: hsl(210, 20%, 68%);
  --color-dark-400: hsl(210, 20%, 58%);
  --color-dark-500: hsl(210, 20%, 43%);
  --color-dark-600: hsl(210, 20%, 38%);
  --color-dark-700: hsl(210, 20%, 33%);
  --color-dark-800: hsl(210, 20%, 28%);
  --color-dark-900: hsl(210, 20%, 18%);
  --color-dark-950: hsl(210, 20%, 6%);
}

/* Semantic Colors */
:root {
  --color-success: hsl(142, 71%, 45%);
  --color-warning: hsl(38, 92%, 50%);
  --color-error: hsl(0, 84%, 60%);
  --color-info: hsl(199, 89%, 48%);
}

/* Typography */
:root {
  --font-family-primary: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  --font-size-5xl: 3rem;      /* 48px */
  --font-size-6xl: 3.75rem;   /* 60px */

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
}

/* Spacing Scale (4px base grid) */
:root {
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-7: 1.75rem;   /* 28px */
  --space-8: 2rem;      /* 32px */
  --space-9: 2.25rem;   /* 36px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-14: 3.5rem;   /* 56px */
  --space-16: 4rem;     /* 64px */
  --space-18: 4.5rem;   /* 72px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-28: 7rem;     /* 112px */
  --space-32: 8rem;     /* 128px */
}

/* Border Radius */
:root {
  --radius-sm: 0.125rem;  /* 2px */
  --radius-md: 0.25rem;   /* 4px */
  --radius-lg: 0.5rem;    /* 8px */
  --radius-xl: 0.75rem;   /* 12px */
  --radius-2xl: 1rem;     /* 16px */
  --radius-full: 9999px;
}

/* Semantic Background Tokens (Dark Theme) */
:root {
  --bg-body: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #1c2128;
  --bg-sunken: #010409;
  --bg-overlay: rgba(1, 4, 9, 0.7);
}

/* Semantic Text Tokens */
:root {
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --text-inverse: #0d1117;
  --text-link: var(--color-primary-400);
  --text-link-hover: var(--color-primary-300);
}

/* Semantic Border Tokens */
:root {
  --border-subtle: #21262d;
  --border-default: #30363d;
  --border-strong: #484f58;
  --border-active: var(--color-primary-500);
}

/* Primary Interactive State Tokens */
:root {
  --color-primary-hover: hsl(158, 53%, 38%);
  --color-primary-active: hsl(158, 53%, 33%);
  --color-primary-glow: rgba(51, 168, 125, 0.25);
  --color-error-glow: rgba(248, 81, 73, 0.15);
  --color-success-glow: rgba(63, 185, 80, 0.15);
}

/* Gradient Tokens */
:root {
  --gradient-primary: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-400) 100%);
  --gradient-dark: linear-gradient(180deg, var(--bg-body) 0%, var(--bg-sunken) 100%);
  --gradient-hero: linear-gradient(135deg, rgba(13, 17, 23, 0.95) 0%, rgba(13, 17, 23, 0.6) 50%, rgba(13, 17, 23, 0.4) 100%);
  --gradient-surface: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  --gradient-cta: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-500) 100%);
}

/* Shadows (Dark Theme Optimized) */
:root {
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 8px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 20px -3px rgb(0 0 0 / 0.5), 0 4px 8px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 30px -5px rgb(0 0 0 / 0.6), 0 8px 12px -6px rgb(0 0 0 / 0.5);
  --shadow-glow: 0 0 20px var(--color-primary-glow);
  --shadow-glow-lg: 0 0 40px var(--color-primary-glow);
}

/* Motion Tokens */
:root {
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-micro: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;
  --transition-fast: var(--duration-fast) var(--ease-smooth);
  --transition-normal: var(--duration-normal) var(--ease-smooth);
  --transition-slow: var(--duration-slow) var(--ease-smooth);
}

/* RTL Support */
[dir="rtl"] {
  --direction: rtl;
  --text-align-start: right;
  --text-align-end: left;
  --margin-start: margin-right;
  --margin-end: margin-left;
  --padding-start: padding-right;
  --padding-end: padding-left;
}

[dir="ltr"] {
  --direction: ltr;
  --text-align-start: left;
  --text-align-end: right;
  --margin-start: margin-left;
  --margin-end: margin-right;
  --padding-start: padding-left;
  --padding-end: padding-right;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-family-primary);
  line-height: var(--line-height-normal);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-body);
  direction: var(--direction, ltr);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 { font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl)); }
h2 { font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl)); }
h3 { font-size: clamp(var(--font-size-xl), 3vw, var(--font-size-3xl)); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
  margin: 0 0 var(--space-4) 0;
  color: var(--text-secondary);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--text-link-hover);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-6);
  }

  .section {
    padding: var(--space-20) 0;
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.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;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-start { text-align: var(--text-align-start); }
.text-end { text-align: var(--text-align-end); }

.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ==========================================================================
   Accessibility — Focus Styles
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@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;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Safe Area (Notch Devices)
   ========================================================================== */

@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer .footer-bottom {
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   Images
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  body {
    background: white;
    color: #000;
  }

  .site-header,
  .site-footer,
  .menu-toggle,
  .header-actions,
  .cta-section,
  .pagination {
    display: none !important;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}