/************************************************************
 * MARKSMAN DIGITAL MEDIA – HEADER STYLING
 * 
 * Custom header styling working with Blocksy Header Builder
 * Features:
 * - Horizontal logo + site title layout (desktop)
 * - Logo only on mobile
 * - Styled dropdown menu
 * - CTA button
 * - Polished mobile menu
 * 
 * Last Updated: 2025-01-09
 ************************************************************/

/* ==========================================
   MAIN HEADER ROW
   ========================================== */

.ct-header {
  background: var(--theme-palette-color-8);
  border-bottom: 1px solid var(--mdm-border, #e2e2e2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-row="middle"] {
  padding-top: 1rem;
  padding-bottom: 1rem;
}


/* ==========================================
   LOGO + SITE TITLE (Desktop)
   ========================================== */

/* Make logo and title sit horizontally */
.site-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo sizing */
.site-logo-container {
  flex-shrink: 0;
}

.site-logo-container img {
  width: auto;
  height: 60px; /* Larger logo on desktop */
  display: block;
}

/* Site title next to logo */
.site-title {
  margin: 0;
  line-height: 1.2;
}

.site-title a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--theme-palette-color-4);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-title a:hover {
  color: var(--theme-palette-color-3);
}

/* Hide site description if present */
.site-description {
  display: none;
}


/* ==========================================
   NAVIGATION MENU (Desktop)
   ========================================== */

/* Main menu items */
.header-menu-1 nav > ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-menu-1 nav > ul > li > a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--theme-palette-color-4);
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

/* Hover effect - underline */
.header-menu-1 nav > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--theme-palette-color-3);
  transition: width 0.3s ease;
}

.header-menu-1 nav > ul > li > a:hover {
  color: var(--theme-palette-color-3);
}

.header-menu-1 nav > ul > li > a:hover::after {
  width: 100%;
}

/* Active/current page */
.header-menu-1 nav > ul > li.current-menu-item > a {
  color: var(--theme-palette-color-2);
}

.header-menu-1 nav > ul > li.current-menu-item > a::after {
  width: 100%;
}


/* ==========================================
   DROPDOWN MENU (Solutions)
   ========================================== */

/* Dropdown container */
.header-menu-1 nav > ul > li.menu-item-has-children {
  position: relative;
}

/* Dropdown arrow styling */
.header-menu-1 nav > ul > li.menu-item-has-children > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Submenu */
.header-menu-1 nav ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--theme-palette-color-8);
  border: 1px solid var(--mdm-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 1000;
}

/* Show dropdown on hover */
.header-menu-1 nav > ul > li.menu-item-has-children:hover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Submenu items */
.header-menu-1 nav ul ul li {
  list-style: none;
  margin: 0;
}

.header-menu-1 nav ul ul li a {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--theme-palette-color-4);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.header-menu-1 nav ul ul li a:hover {
  background: var(--theme-palette-color-6);
  color: var(--theme-palette-color-2);
}


/* ==========================================
   CTA BUTTON (Desktop)
   ========================================== */

/* Style the Contact button in header */
.ct-header .ct-button,
.ct-header .header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--theme-palette-color-2);
  color: var(--theme-palette-color-8);
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.ct-header .ct-button:hover,
.ct-header .header-cta:hover {
  background: var(--theme-palette-color-1);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}


/* ==========================================
   MOBILE STYLES
   ========================================== */

@media (max-width: 999px) {
  
  /* Logo only on mobile - hide site title */
  .site-title {
    display: none;
  }
  
  /* Smaller logo on mobile */
  .site-logo-container img {
    height: 45px;
  }
  
  /* Mobile trigger (hamburger) */
  .ct-header-trigger {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-palette-color-4);
    cursor: pointer;
  }
  
  .ct-header-trigger:hover {
    color: var(--theme-palette-color-2);
  }
  
  
  /* ==========================================
     MOBILE OFFCANVAS MENU
     ========================================== */
  
  /* Offcanvas container */
  #offcanvas {
    background: var(--theme-palette-color-4); /* Navy background */
    color: var(--theme-palette-color-8);
  }
  
  /* Close button */
  .ct-toggle-close {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-palette-color-8);
    background: transparent;
    border: 2px solid var(--theme-palette-color-8);
    border-radius: 8px;
    margin: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .ct-toggle-close:hover {
    background: var(--theme-palette-color-8);
    color: var(--theme-palette-color-4);
  }
  
  /* Mobile menu items */
  #offcanvas nav ul {
    list-style: none;
    margin: 0;
    padding: 2rem 0;
  }
  
  #offcanvas nav ul li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  #offcanvas nav ul li a {
    display: block;
    padding: 1.25rem 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-palette-color-8);
    text-decoration: none;
    transition: background 0.2s ease, padding-left 0.2s ease;
  }
  
  #offcanvas nav ul li a:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 2.5rem;
  }
  
  /* Mobile submenu (if Solutions has dropdown) */
  #offcanvas nav ul ul {
    padding-left: 1rem;
    background: rgba(0, 0, 0, 0.2);
  }
  
  #offcanvas nav ul ul li a {
    font-size: 1.1rem;
    padding: 1rem 2rem;
  }
  
  /* Mobile CTA button in offcanvas */
  #offcanvas .ct-button,
  #offcanvas .header-cta {
    display: inline-flex;
    margin: 2rem;
    padding: 1rem 2rem;
    background: var(--theme-palette-color-2);
    color: var(--theme-palette-color-8);
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
  }
}


/* ==========================================
   TABLET ADJUSTMENTS
   ========================================== */

@media (min-width: 768px) and (max-width: 999px) {
  
  /* Slightly larger logo on tablet */
  .site-logo-container img {
    height: 50px;
  }
  
  /* Offcanvas panel width (already set in Blocksy but enforce here) */
  #offcanvas {
    width: 65vw;
    max-width: 400px;
  }
}


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

/* Focus states */
.ct-header a:focus-visible,
.ct-header button:focus-visible {
  outline: 3px solid var(--theme-palette-color-3);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ct-header *,
  #offcanvas * {
    transition: none !important;
    animation: none !important;
  }
}


/* ==========================================
   NOTES & CHANGELOG
   ========================================== */

/*
USAGE:
This CSS works WITH Blocksy Header Builder settings.
Adjustments needed in Customizer are documented separately.

FEATURES:
- Horizontal logo + title on desktop
- Logo only on mobile
- Styled dropdown (Solutions menu)
- CTA button styling
- Navy mobile offcanvas menu
- Smooth hover effects
- Full accessibility support

CHANGELOG:
- 2025-01-09: Initial header styling
- 2025-01-09: Mobile offcanvas navy background
- 2025-01-09: Logo/title horizontal layout

TODO:
- Add sticky header option if needed later
- Consider adding header announcement bar
*/