/**
 * Xenopz Header Component
 * ========================
 *
 * Styles for the site header and skip-to-content link.
 *
 * The mobile menu is handled entirely by WordPress wp:navigation with
 * overlayMenu:"mobile". We DO NOT override WordPress's responsive behavior.
 * We only style colors, fonts, spacing and hover states.
 *
 * Requirements: 4.1, 4.2, 4.3, 4.4, 25.2, 26.5
 */

/* =========================================================================
   SKIP LINK (Accessibility)
   ========================================================================= */

.x-skip-link {
  position: absolute;
  top: -100%;
  left: var(--x-space-sm);
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--x-teal-900);
  color: var(--x-white);
  font-family: var(--x-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--x-radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}

.x-skip-link:focus {
  top: var(--x-space-xs);
  outline: 3px solid var(--x-orange-500);
  outline-offset: 2px;
}

/* =========================================================================
   HEADER WRAPPER
   ========================================================================= */

.x-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--x-bg-warm);
  border-bottom: 1px solid var(--x-border);
  box-shadow: 0 2px 8px rgba(7, 59, 68, 0.04);
}

.x-header__inner {
  height: 72px;
}

@media (max-width: 767px) {
  .x-header__inner {
    height: 60px;
  }
}

/* =========================================================================
   LOGO (Site Title block)
   ========================================================================= */

.x-header .wp-block-site-title a {
  color: var(--x-teal-900);
  text-decoration: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
}

.x-header .wp-block-site-title a:hover {
  opacity: 0.8;
}

.x-header .wp-block-site-title a:focus-visible {
  outline: 3px solid var(--x-orange-500);
  outline-offset: 4px;
  border-radius: var(--x-radius-sm);
}

/* =========================================================================
   NAVIGATION LINKS — Desktop (horizontal)
   ========================================================================= */

.x-header__nav .wp-block-navigation-item__content {
  padding: 0.5rem 0.875rem;
  font-family: var(--x-font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--x-teal-900);
  text-decoration: none;
  border-radius: var(--x-radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.x-header__nav .wp-block-navigation-item__content:hover {
  color: var(--x-orange-500);
  background: rgba(242, 106, 27, 0.06);
}

.x-header__nav .wp-block-navigation-item__content:focus-visible {
  outline: 3px solid var(--x-orange-500);
  outline-offset: 2px;
}

.x-header__nav .current-menu-item .wp-block-navigation-item__content {
  color: var(--x-orange-500);
  font-weight: 600;
}

/* =========================================================================
   HAMBURGER BUTTON — Style only (display is handled by WP)
   ========================================================================= */

.x-header__nav .wp-block-navigation__responsive-container-open {
  background: transparent;
  border: none;
  border-radius: var(--x-radius-sm);
  cursor: pointer;
}

.x-header__nav .wp-block-navigation__responsive-container-open:hover {
  background: rgba(7, 59, 68, 0.06);
}

.x-header__nav .wp-block-navigation__responsive-container-open:focus-visible {
  outline: 3px solid var(--x-orange-500);
  outline-offset: 2px;
}

.x-header__nav .wp-block-navigation__responsive-container-open svg {
  fill: var(--x-teal-900);
}

/* =========================================================================
   MOBILE OVERLAY — Style only (open/close is handled by WP)
   ========================================================================= */

.x-header__nav .wp-block-navigation__responsive-container.is-menu-open {
  background: var(--x-bg-warm);
  border-left: 1px solid var(--x-border);
  box-shadow: -4px 0 24px rgba(7, 59, 68, 0.12);
}

.x-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  padding: 0.875rem var(--x-space-sm);
  font-size: 1.0625rem;
}

.x-header__nav .wp-block-navigation__responsive-container-close {
  color: var(--x-teal-900);
  border: none;
  background: transparent;
  border-radius: var(--x-radius-sm);
  cursor: pointer;
}

.x-header__nav .wp-block-navigation__responsive-container-close:hover {
  background: rgba(7, 59, 68, 0.06);
}

.x-header__nav .wp-block-navigation__responsive-container-close:focus-visible {
  outline: 3px solid var(--x-orange-500);
  outline-offset: 2px;
}


/* =========================================================================
   FORCE HAMBURGER AT WIDER BREAKPOINT
   =========================================================================
   WordPress's default "mobile" overlay triggers at 600px.
   Our nav needs the hamburger to kick in earlier (~900px) because
   5 nav items + logo don't fit horizontally below that width.
   ========================================================================= */

@media (max-width: 900px) {
  /* Hide the horizontal nav links when NOT in overlay mode */
  .x-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container {
    display: none !important;
  }

  /* Show the hamburger button */
  .x-header__nav .wp-block-navigation__responsive-container-open {
    display: flex !important;
  }
}

/* =========================================================================
   LOGO — SVG Wordmark
   ========================================================================= */

.x-header__logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.x-header__logo-link:hover {
  opacity: 0.8;
}

.x-header__logo-link:focus-visible {
  outline: 3px solid var(--x-orange-500);
  outline-offset: 4px;
  border-radius: var(--x-radius-sm);
}

.x-header__logo-link svg {
  height: 32px;
  width: auto;
}
