/* --- /styles/hea_menu.css (dark-mode ready) --- */
/* =========================
   1) Design tokens
   ========================= */
/* --- /styles/hea_tokens.css — single source of truth --- */
/* Header */
.hea-header {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  transition: border-top 0.3s ease, background 0.2s ease, color 0.2s ease;
  border-top: 4px solid var(--brand-color-primary);
}

/* Constrain & center the header’s inner shell to the page width */
.hea-header .hea-header-inner{
  max-width: var(--page-w);
  margin-inline: auto;
  padding-inline: var(--app-pad);
  box-sizing: border-box;
}

/* Center the L1 links within the available row space */
.hea-header .hea-menu{
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

/* keeps logo vertically centered in the header row */
.hea-logo-link { display:flex; align-items:center; }

/* On small screens, align left so it wraps naturally */
@media (max-width: 900px){
  .hea-header .hea-menu{ justify-content: flex-start; }
}

.hea-header-inner {
  padding: 0.5rem 1rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between; /* logo + menu */
  gap: 0.5rem;
}

/* Logo */
.hea-logo {
  height: 60px;
  flex-shrink: 0;
  margin-right: 0.5rem;
}
@media (max-width: 600px) {
  .hea-logo { height: 40px; }
}

/* Top-level menu and L2 menu*/
.sub-menu-placeholder,
.hea-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  flex: 1 1 0; /* allow wrapping next to logo */
}

.sub-menu-placeholder a,
.hea-menu a {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink);
  padding-left: 0.2rem;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 2px solid transparent;
}

.ico{ filter:grayscale(100%) brightness(.8); opacity:.8; }

.sub-menu-placeholder a:hover,
.hea-menu a:hover {
  color: var(--brand-color-primary);
}

.sub-menu-placeholder a.active,
.hea-menu a.active {
  color: var(--brand-color-primary);
  font-weight: 700;
  border-bottom-color: var(--brand-color-primary);
}

/* Level-2 nav (bar + tabs) */
.hea-menu-l2,
.hea-menu-l2-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.hea-menu-l2-tab {
  background: var(--surface);
  padding: 0.4rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.hea-menu-l2-tab:hover {
  background-color: var(--surface-2);
}

.hea-menu-l2-tab.active {
  background-color: var(--brand-color-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

/* Submenu (compact pill links) */
.hea-submenu {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.hea-submenu a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* “Active” looks like a subtle chip in both themes */
.hea-submenu a.active {
  background: var(--surface);
  border: 1px solid var(--line);
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .hea-menu a { font-size: 0.85rem; }
}