/*
Theme Name: AlMuataz Theme
Description: Custom WordPress theme for المعتز لنقل وتغليف الأثاث (Al-Muataz Moving & Packing Services)
Version: 1.0.0
Author: AlMuataz 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)
   ========================================================================== */

/* ── Phase 2 Brand Palette — المعتز ─────────────────────────── */
:root {
  /* Navy scale */
  --color-navy-950: #0A0F1E;
  --color-navy-900: #0F172A;
  --color-navy-800: #1E293B;
  --color-navy-700: #334155;
  --color-navy-600: #475569;

  /* Gold scale */
  --color-gold-500: #D4A847;
  --color-gold-400: #E5C06A;
  --color-gold-300: #F0D99A;

  /* Trust green */
  --color-trust-green:      #22C55E;
  --color-trust-green-dark: #15803D;

  /* Warm text */
  --color-warm-white: #F1EDE8;
  --color-soft-gray:  #CBD5E1;
  --color-muted-text: #94A3B8;

  /* Accent aliases */
  --accent:       var(--color-gold-500);
  --accent-hover: var(--color-gold-400);

  /* Gold border helpers */
  --border-subtle: rgba(212, 168, 71, 0.08);
  --border-medium: rgba(212, 168, 71, 0.2);
  --border-strong: rgba(212, 168, 71, 0.5);

  /* Premium shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 168, 71, 0.12);
  --shadow-gold:  0 8px 24px rgba(212, 168, 71, 0.3);

  /* Layout tokens */
  --section-padding-y: clamp(60px, 8vw, 100px);
  --container-max:     1200px;
  --container-padding: clamp(16px, 4vw, 48px);
}

/* Primary gold scale — المعتز brand */
:root {
  --color-primary-50:  hsl(42, 80%, 96%);  /* lightest gold tint */
  --color-primary-100: hsl(42, 75%, 88%);
  --color-primary-200: hsl(42, 72%, 78%);
  --color-primary-300: #F0D99A;            /* = --color-gold-300 */
  --color-primary-400: #E5C06A;            /* = --color-gold-400 */
  --color-primary-500: #D4A847;            /* = --color-gold-500 */
  --color-primary-600: #C49530;
  --color-primary-700: #A67C20;
  --color-primary-800: #8A6310;
  --color-primary-900: hsl(42, 53%, 18%);  /* deepest gold-brown */
}

/* 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 — premium rounded */
:root {
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-2xl:  36px;
  --radius-full: 9999px;
}

/* Semantic Background Tokens (Dark Premium — المعتز) */
:root {
  --bg-body:    var(--color-navy-950);  /* #0A0F1E */
  --bg-surface: var(--color-navy-900);  /* #0F172A */
  --bg-elevated: var(--color-navy-800); /* #1E293B */
  --bg-sunken:  #06090F;
  --bg-overlay: rgba(10, 15, 30, 0.8);
}

/* Semantic Text Tokens */
:root {
  --text-primary:   var(--color-warm-white);  /* #F1EDE8 */
  --text-secondary: var(--color-soft-gray);   /* #CBD5E1 */
  --text-muted:     var(--color-muted-text);  /* #94A3B8 */
  --text-inverse:   var(--color-navy-950);
  --text-link:      var(--color-gold-400);
  --text-link-hover: var(--color-gold-300);
}

/* Semantic Border Tokens — gold-tinted */
:root {
  --border-default: rgba(212, 168, 71, 0.15);
  --border-active:  var(--color-gold-500);
}

/* Interactive State Tokens */
:root {
  --color-primary-hover:  #C49530;
  --color-primary-active: #A67C20;
  --color-primary-glow:   rgba(212, 168, 71, 0.25);
  --color-error-glow:   rgba(248, 81, 73, 0.15);
  --color-success-glow: rgba(34, 197, 94, 0.15);
}

/* Gradient Tokens */
:root {
  --gradient-gold:    linear-gradient(135deg, var(--color-gold-500) 0%, var(--color-gold-400) 100%);
  --gradient-gold-btn: linear-gradient(135deg, #D4A847 0%, #C49530 100%);
  --gradient-dark:    linear-gradient(180deg, var(--bg-body) 0%, var(--bg-sunken) 100%);
  --gradient-hero:    linear-gradient(135deg, rgba(10,15,30,0.97) 0%, rgba(10,15,30,0.75) 50%, rgba(10,15,30,0.45) 100%);
  --gradient-surface: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  --gradient-card:    linear-gradient(180deg, var(--color-navy-800) 0%, var(--color-navy-900) 100%);
  --gradient-cta:     linear-gradient(135deg, var(--color-gold-500) 0%, #C49530 100%);
  /* Legacy alias */
  --gradient-primary: var(--gradient-gold);
}

/* Shadows */
: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);
  /* Premium aliases */
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-hover:   0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 168, 71, 0.12);
  --shadow-gold:    0 8px 24px rgba(212, 168, 71, 0.3);
}

/* 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: var(--container-max, 1200px);
  margin: 0 auto;
  padding: 0 var(--container-padding, 1rem);
}

.section {
  padding: var(--section-padding-y) 0;
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-6);
  }
}

/* ==========================================================================
   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-gold-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;
  }
}