﻿@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
}

/* ============================================================
   Nav Menu Vars
   ============================================================ */
:root {
  --nav-bg: #081D55;
  --nav-text: #ffffff;
  --nav-focus: #8ec8ff;           /* accent bar color */
  --nav-focus-ring: #ffffff;
  --tab-radius: 10px;
  --gap: -1px;
  --pad-x: 20px;
  --pad-y: 8px;
  --tab-active-bg: #004FB2;       /* active fill - style guide Blue*/
  --tab-inactive-bg: #081D55;     /* base fill - style guide Dark Blue*/
  --focus-accent-h: 2px;          /* main tab top accent bar height */
}

/* ============================================================
   Main Top level tabs
   ============================================================ */
.main-nav .top-level {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  display: flex;
  gap: var(--gap);
  align-items: stretch;
}

.main-nav .top-level > li {
  position: relative;	/* needed for absolute-positioned ring */
  overflow: visible;	/* ensure ring isn't clipped by radius */
  background: var(--tab-inactive-bg);
  transition: background-color 140ms ease, box-shadow 140ms ease;
  padding: var(--pad-y) var(--pad-x);
  border-top-left-radius: var(--tab-radius);
  border-top-right-radius: var(--tab-radius);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

/* Show ring whenever anything inside the top level tab has keyboard focus */
.main-nav .top-level > li:focus-within::after {
  content: "";
  position: absolute;
  /* Inset controls the ring's distance from the tab edges—adjust to taste */
  left: 8px;
  right: 8px;
  top: 6px;
  bottom: 6px;

  border: 2px solid var(--nav-focus-ring);	/* focus ring */
  border-radius: 8px;
  pointer-events: none;	/* don't block clicks */
  z-index: 3;			/* draw above text/chevron */
}
/* Tabs: suppress native outline on the focusable element—we'll draw a container ring */
.main-nav .top-level > li > a:focus-visible,
.main-nav .top-level > li > .nav-toggle:focus-visible {
  outline: none;
}

/* Main tabs: keep hover, keyboard focus, and expanded state in sync */
.main-nav .top-level > li:hover,
.main-nav .top-level > li:focus-within,                               /* keyboard fallback */
.main-nav .top-level > li:has(:focus-visible),                        /* precise keyboard focus on tab link/button */
.main-nav .top-level > li:has(.nav-toggle[aria-expanded="true"]),     /* expanded */
.main-nav .top-level > li:has(.sub-list :focus-visible)               /* submenu item is focused */
{
  background-color: var(--tab-active-bg);
  background-image: linear-gradient(var(--nav-focus), var(--nav-focus));
  background-repeat: no-repeat;
  background-position: left top;
  background-size: 100% var(--focus-accent-h); 						   /* top accent bar */
}

.main-nav .top-level a,
.main-nav .top-level button {
  color: var(--nav-text) !important;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  font-size: 15px;
}

/* ============================================================
   Main Top level tabs - Chevron Button
   ============================================================ */
/* Chevron Button  */
.main-nav .nav-toggle {
  border: none;
  background: transparent;
  color: var(--nav-text);
  cursor: pointer;
  padding: 0 0 0 10px;
  display: inline-flex;
  align-items: center;
}

/* Chevron: make it rotatable and smooth */
.main-nav .nav-toggle .chevron {
  font-size: 20px;
  display: inline-block;
  transition: transform 160ms ease;
  transform-origin: 50% 45%;
  
  /* Ensure the chevron sits below the ring overlay (so the ring stays clean) */
  position: relative;
  z-index: 2;
}

/* When the submenu is expanded, rotate the down chevron (▾) to point up */
.main-nav .nav-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* Reduced motion for tab transitions */
@media (prefers-reduced-motion: reduce) {
  .main-nav .nav-toggle .chevron { transition: none; }
}

/* ============================================================
   Sub list items
   ============================================================ */
.main-nav .sub-list {
  list-style: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 16rem;
  background: var(--tab-inactive-bg);
  padding: .75rem 0;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 1000;
}

/* Make the anchor block-level so it fills the row and can have a rounded focus ring */
.main-nav .sub-list a {
  display: block;
  color: var(--nav-text) !important;
  padding: .5rem 1.5rem;  
  text-decoration: none;
  font-weight: bold;
  font-size: 13px;
}

.main-nav .sub-list li:hover {
  background-color: var(--tab-active-bg);
}

.main-nav .sub-list li { 
  /* no extra padding on the LI; the anchor will provide it */
  padding: 0;
}

.main-nav .sub-list a:hover {
  background-color: var(--tab-active-bg);
}

.main-nav .sub-list a:focus-visible {
  position: relative;                         /* enable the overlay ring */
  background-color: var(--tab-active-bg);     /* blue fill behind text */
  
  /* Kill the default outer ring */
  outline: none !important;
  box-shadow: none !important;
}

/* Draw the rounded ring as an overlay */
.main-nav .sub-list a:focus-visible::after {
  content: "";
  position: absolute;

  /* Tune proximity of the ring to the text: adjust to taste */
  left: 6px;
  right: 6px;
  top: 4px;
  bottom: 4px;

  border: 2px solid var(--nav-focus-ring);
  border-radius: 8px;                        
  pointer-events: none;
  z-index: 2;
}

/* Parent row turns blue when any submenu anchor is focused */
.main-nav .sub-list li:has(a:focus-visible) {
  background-color: var(--tab-active-bg);
  border: none;
}                   