/**
 * Rosenblatt Law - Header Styles
 * 
 * Centralized stylesheet for site header
 * Enqueue via functions.php
 * 
 * @package RosenblattLaw
 * @version 1.0.0
 */

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

:root {
  /* Brand Colors */
  --rl-navy: #1a3a6b;
  --rl-orange: #ff6600;
  --rl-orange-hover: #cc5200;
  --rl-white: #ffffff;
  
  /* Header Specific */
  --rl-header-sticky-bg: rgba(26, 58, 107, 0.95);
  --rl-header-border-orange: rgba(255, 102, 0, 0.6);
  --rl-header-transparent: rgba(0, 0, 0, 0);
  
  /* Transitions */
  --rl-transition-smooth: 0.3s all ease-in-out;
  --rl-transition-fast: 0.2s all ease-in-out;
  
  /* Spacing */
  --rl-header-padding-x: 30px;
  --rl-header-margin-top-sticky: 20px;
  --rl-header-border-radius: 100px;
}

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

#header-bar .header-internal {
  border: 1px solid var(--rl-header-transparent);
  transition: var(--rl-transition-smooth);
}

/* ============================================
   STICKY HEADER EFFECTS
   ============================================ */

#header-bar.elementor-sticky--effects .header-internal {
  background: var(--rl-header-sticky-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); /* Safari support */
  margin-top: var(--rl-header-margin-top-sticky);
  border-radius: var(--rl-header-border-radius);
  border: 1px solid var(--rl-header-border-orange);
  padding-right: var(--rl-header-padding-x);
  padding-left: var(--rl-header-padding-x);
  transition: var(--rl-transition-smooth);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   MENU ITEM STYLES (STICKY STATE)
   ============================================ */

#header-bar.elementor-sticky--effects .header-internal .elementor-nav-menu .elementor-item {
  color: var(--rl-white);
  transition: var(--rl-transition-fast);
}

#header-bar.elementor-sticky--effects .header-internal .elementor-nav-menu .elementor-item:hover {
  color: var(--rl-orange);
}

/* Active/Current menu item in sticky state */
#header-bar.elementor-sticky--effects .header-internal .elementor-nav-menu .current-menu-item .elementor-item {
  color: var(--rl-orange);
}

/* ============================================
   BUTTON STYLES (STICKY STATE)
   ============================================ */

#header-bar.elementor-sticky--effects .elementor-button {
  transition: var(--rl-transition-fast);
}

/* ============================================
   RESPONSIVE: TABLET & MOBILE
   ============================================ */

@media (max-width: 1024px) {
  #header-bar.elementor-sticky--effects .header-internal {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 767px) {
  #header-bar.elementor-sticky--effects .header-internal {
    background: var(--rl-header-sticky-bg);
    margin-top: 10px;
    border-radius: 50px;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  /* Mobile menu dropdown */
  .elementor-nav-menu--dropdown {
    margin-left: 10px;
    margin-right: 10px;
  }
  
  /* Ensure mobile menu toggle is visible in sticky state */
  #header-bar.elementor-sticky--effects .elementor-menu-toggle {
    color: var(--rl-white);
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Use will-change for smoother animations */
#header-bar.elementor-sticky--effects .header-internal {
  will-change: background, border-radius, margin-top;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  #header-bar .header-internal,
  #header-bar.elementor-sticky--effects .header-internal,
  #header-bar.elementor-sticky--effects .header-internal .elementor-nav-menu .elementor-item {
    transition: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  #header-bar.elementor-sticky--effects .header-internal {
    background: var(--rl-white);
    border: 1px solid var(--rl-navy);
    border-radius: 0;
    margin-top: 0;
    backdrop-filter: none;
  }
}
