/**
 * Primary navigation — visual rhythm aligned with homepage hero + section headings
 * (light band, navy accent bar, #0f2f57 typography, sharp panels, calmer hovers).
 * Loads after fixed-navigation.css
 */

@media (min-width: 901px) {
  .tcl-gov-header .tcl-navigation {
    background: #ffffff;
    border-bottom: 1px solid var(--tcl-bc-hairline, rgba(15, 23, 42, 0.08));
    box-shadow: none;
    position: relative;
  }

  .tcl-gov-header .tcl-navigation .tcl-container {
    position: relative;
    z-index: 1;
  }

  .tcl-gov-header .tcl-nav-item {
    border-right-color: rgba(15, 47, 87, 0.12);
  }

  /* Same weight/size for top-level <a> and <button> (theme had 400 !important on plain links) */
  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button,
  .tcl-gov-header .tcl-nav-item:not(.tcl-has-submenu) > .tcl-nav-link {
    font-family: var(--tcl-font-sans, var(--font-primary, 'Roboto', system-ui, sans-serif));
    font-size: clamp(0.9rem, 0.82rem + 0.35vw, 1.05rem) !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    color: #0f2f57 !important;
    padding: 1rem 1.35rem !important;
    min-height: 52px;
    transform: none;
    box-shadow: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  }

  .tcl-gov-header .tcl-nav-link:hover,
  .tcl-gov-header .tcl-nav-button:hover {
    background: rgba(11, 92, 173, 0.08);
    color: #0b213f;
    transform: none;
    box-shadow: none;
  }

  .tcl-gov-header .tcl-nav-item:not(.tcl-has-submenu) > .tcl-nav-link:hover {
    background: rgba(15, 47, 87, 0.1);
    color: #061a33;
    transform: none;
    box-shadow: none;
  }

  .tcl-gov-header .tcl-nav-button[aria-expanded='true'] {
    background: #0f2f57;
    color: #fff;
    box-shadow: inset 0 -3px 0 #0b5cad;
  }

  /* Open submenu: keep label readable when button is focused (keyboard / ArrowUp back) */
  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='true']:hover {
    background: #0c2644 !important;
    color: #fff !important;
  }

  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='true']:focus,
  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='true']:focus-visible {
    background: #0c2644 !important;
    color: #fff !important;
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.45),
      inset 0 -3px 0 #2d8fd9 !important;
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
  }

  .tcl-gov-header .tcl-submenu {
    border-radius: 0;
    border: 1px solid rgba(15, 47, 87, 0.14);
    border-top: 3px solid #0b5cad;
    box-shadow: 0 14px 40px rgba(15, 47, 87, 0.14);
    padding: 0.4rem 0;
    background: #fff !important;
  }

  .tcl-gov-header .tcl-nav-item .tcl-submenu {
    border: 1px solid rgba(15, 47, 87, 0.14);
    border-top: 3px solid #0b5cad;
  }

  .tcl-gov-header .tcl-submenu a {
    color: #1e293b !important;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    letter-spacing: 0.015em;
  }

  .tcl-gov-header .tcl-submenu a:hover,
  .tcl-gov-header .tcl-submenu a:focus {
    background: #e8f1fb !important;
    color: #0b213f !important;
    transform: none;
    padding-left: 1.25rem;
  }

  /* Plain top-level links only — not submenu parent while open (handled above) */
  .tcl-gov-header .tcl-nav-item:not(.tcl-has-submenu) > .tcl-nav-link:focus,
  .tcl-gov-header .tcl-nav-item:not(.tcl-has-submenu) > .tcl-nav-link:focus-visible {
    background: rgba(11, 92, 173, 0.1);
    color: #0b213f;
    box-shadow: inset 0 0 0 1px rgba(11, 92, 173, 0.45);
  }

  .tcl-gov-header .tcl-nav-item:not(.tcl-has-submenu) > .tcl-nav-link:focus-visible {
    outline: 2px solid #0b5cad;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.2);
  }

  /* Closed submenu button: keyboard focus = light surface + dark text */
  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='false']:focus,
  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='false']:focus-visible {
    background: rgba(11, 92, 173, 0.08);
    color: #0b213f;
    box-shadow: inset 0 0 0 1px rgba(11, 92, 173, 0.35);
    outline: 2px solid #0b5cad;
    outline-offset: 2px;
  }

  .tcl-gov-header .tcl-nav-item .tcl-submenu a:focus-visible {
    outline: 2px solid #0b5cad;
    outline-offset: -2px;
    box-shadow: none;
    background: #dbeafe !important;
    color: #0b213f !important;
  }

  /*
   * Main menu disclosure only: fixed-navigation uses .tcl-nav-button:focus { primary-light + white text }
   * which reads as invisible on light blue. Arrow Down keeps focus on the button briefly — override here.
   */
  .tcl-gov-header .tcl-navigation .tcl-nav-button:focus,
  .tcl-gov-header .tcl-navigation .tcl-nav-button:focus-visible {
    background: rgba(237, 244, 252, 0.98) !important;
    color: #0b213f !important;
    outline: 2px solid #0b5cad !important;
    outline-offset: 2px !important;
    box-shadow: inset 0 0 0 1px rgba(11, 92, 173, 0.28);
  }

  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true'],
  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true']:focus,
  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true']:focus-visible {
    background: #0f2f57 !important;
    color: #fff !important;
    outline: 2px solid #7dd3fc !important;
    outline-offset: 2px !important;
    box-shadow: inset 0 -3px 0 #0b5cad;
  }

  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true']:hover {
    background: #0c2644 !important;
    color: #fff !important;
  }
}

@media (max-width: 900px) {
  .tcl-gov-header .tcl-navigation.show {
    background: linear-gradient(180deg, #f1f5f9 0%, #fff 45%);
  }

  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button,
  .tcl-gov-header .tcl-nav-item:not(.tcl-has-submenu) > .tcl-nav-link {
    font-family: var(--tcl-font-sans, var(--font-primary, system-ui, sans-serif));
    font-size: clamp(0.9rem, 0.82rem + 0.35vw, 1.05rem) !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    color: #0f2f57 !important;
  }

  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='true'] {
    background: #0f2f57;
    color: #fff !important;
  }

  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='true']:focus,
  .tcl-gov-header .tcl-nav-item.tcl-has-submenu > .tcl-nav-button[aria-expanded='true']:focus-visible {
    background: #0c2644 !important;
    color: #fff !important;
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
  }

  .tcl-gov-header .tcl-submenu a:focus,
  .tcl-gov-header .tcl-submenu a:focus-visible {
    background: #dbeafe !important;
    color: #0b213f !important;
  }

  .tcl-gov-header .tcl-navigation .tcl-nav-button:focus,
  .tcl-gov-header .tcl-navigation .tcl-nav-button:focus-visible {
    background: rgba(237, 244, 252, 0.98) !important;
    color: #0b213f !important;
    outline: 2px solid #0b5cad !important;
    outline-offset: 2px !important;
  }

  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true'],
  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true']:focus,
  .tcl-gov-header .tcl-navigation .tcl-nav-button[aria-expanded='true']:focus-visible {
    background: #0f2f57 !important;
    color: #fff !important;
    outline: 2px solid #7dd3fc !important;
  }
}
