/* Offset body content for fixed header height */
body {
  padding-top: var(--header-offset, 72px);
}

/* =============================
 * Whitestone Health – Header & Navigation
 * Two-tier nav: utility (top-right) + primary (centered)
 * Light top state (white header), JS will handle dark-on-scroll later
 * Uses tokens from variables.css
 * ============================= */

/* Sticky header container */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  width: 100%;
  backdrop-filter: blur(10px);
  transition: background-color 480ms ease, color 480ms ease, box-shadow 480ms ease, border-color 480ms ease;
}

/* ---------------- Utility Bar (light) ---------------- */
.utility-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 28px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.2;
  background: #f7f7f7; /* slight shade darker than white */
  color: var(--text-primary);
  border-bottom: 1px solid var(--neutral-200);
  transition: background-color 480ms ease, color 480ms ease, border-color 480ms ease;
}

.utility-left { margin-right: auto; display: flex; align-items: center; gap: 8px; }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.utility-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
}
.utility-menu li {
    margin: 0;
}
.utility-menu a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 480ms ease, text-decoration-color 480ms ease;
}
.utility-menu a:hover, .utility-menu a:focus { color: var(--brand-primary, var(--action-link)); text-decoration: underline; text-underline-offset: 2px; }

.utility-menu a.utility-link {
  font-size: 10px;
    display: flex;
    align-items: center;
}

.menu-separator {
  font-size: 10px;
  transition: color 480ms ease, opacity 480ms ease;
}

/* Native select styled for "Go to…" quick nav */
.goto-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background: #fff;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  font: inherit;
  padding: 6px 28px 6px 10px;
  line-height: 1.2;
  box-shadow: var(--shadow-sm) inset;
  background-image: linear-gradient(45deg, transparent 50%, var(--neutral-500) 50%), linear-gradient(135deg, var(--neutral-500) 50%, transparent 50%);
  background-position: right 10px top 50%, right 5px top 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.goto-select:focus { outline: none; box-shadow: var(--focus-ring); border-color: var(--brand-primary, var(--action-link)); }

/* ---------------- Primary Nav (light) ---------------- */
.primary-nav {
  background: #ffffff; /* white top state */
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--neutral-200);
  transition: background-color 480ms ease, color 480ms ease, border-color 480ms ease, box-shadow 480ms ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 28px;
  max-width: 1280px;
  margin: 0 auto;
}

/* Brand */
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  width: 140px; /* fixed width to prevent layout shift */
}
.brand-logo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  width: auto;
  transition: opacity 480ms ease;
  opacity: 0;
}
.brand-logo--dark {
  opacity: 1;
}
.site-header.is-scrolled .brand-logo--dark {
  opacity: 0;
}
.site-header.is-scrolled .brand-logo--light {
  opacity: 1;
  margin-left: 30px;
}

/* Menu */
.nav-main { flex: 1; display: flex; justify-content: center; }
.menu { list-style: none; display: flex; gap: 36px; margin: 0; padding: 0; }
.menu-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 2px;
  letter-spacing: 0.02em;
  transition: color 480ms ease, text-decoration-color 480ms ease;
}
.menu-link:hover, .menu-link:focus { color: var(--brand-primary, var(--action-link)); text-decoration: none; }

/* Right-side actions (phone CTA) */
.nav-actions { display: flex; align-items: center; margin-left: auto; }
.btn-phone {
  background: var(--brand-primary, var(--action-link));
  color: #fff;
  box-shadow: var(--shadow-sm);
  border-radius: 9999px;
  padding: 6px 14px;
  line-height: 1;
}
.btn-phone:hover, .btn-phone:focus { background: var(--brand-primary-hover, var(--action-link-hover)); box-shadow: var(--shadow-md); }
.icon {
  display: inline-block;
}

.icon-phone {
    margin-right: 8px;
}

/* Dropdown */
.menu-item { position: relative; }
.has-dropdown .dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  min-width: 240px;
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none; /* revealed on hover/focus */
  transition: background-color 480ms ease, color 480ms ease, border-color 480ms ease, opacity 480ms ease, transform 480ms ease;
  opacity: 0;
  transform: translateY(6px);
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.utility-menu .has-dropdown {
  position: relative;
}
.utility-menu .has-dropdown .dropdown {
  right: 0;
  left: auto;
  top: calc(100% + 4px);
}

.dropdown-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--fs-md);
}
.dropdown-item:hover,
.dropdown-item:focus { background: var(--neutral-100); color: var(--brand-primary, var(--action-link)); }

/* Hidden placeholders until filled */
.hide-until-filled { display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .menu { gap: 24px; }
  .brand-logo { height: 34px; }
}

@media (max-width: 768px) {
  .utility-bar { padding: 6px 16px; }
  .nav-inner { padding: 10px 16px; }
  .menu { gap: 18px; }
  .menu-link { font-size: 16px; }
  .has-dropdown .dropdown { left: -8px; min-width: 220px; }
}

@media (max-width: 560px) {
  .nav-inner { flex-wrap: wrap; row-gap: 8px; }
  .nav-main { order: 2; flex-basis: 100%; justify-content: center; }
  .brand { order: 1; }
  .menu { flex-wrap: wrap; justify-content: center; gap: 12px 18px; }
  .menu-link { padding: 8px 2px; }
}
/* =============================
 * Inverted header palette when scrolled
 * (.site-header.is-scrolled toggled by JS)
 * ============================= */
/* Inverted state: glassy blue tint */
.site-header.is-scrolled .utility-bar {
  background: rgba(0,0,0,0.9);
  color: #fff;
  border-bottom: 0px solid rgba(255,255,255,0.10);
  backdrop-filter: saturate(140%) blur(10px);
}
.site-header.is-scrolled .utility-menu a { color: rgba(255,255,255,0.92); }
.site-header.is-scrolled .utility-menu a:hover,
.site-header.is-scrolled .utility-menu a:focus { color: var(--brand-primary, var(--action-link)); }
.site-header.is-scrolled .menu-separator { color: rgba(255,255,255,0.6); }

.site-header.is-scrolled .primary-nav {
  background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(26, 106, 255, 0.08) 100%
  );
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  backdrop-filter: saturate(140%) blur(10px);
}
.site-header.is-scrolled .menu-link { color: #ffffff; }
.site-header.is-scrolled .menu-link:hover,
.site-header.is-scrolled .menu-link:focus { color: var(--brand-primary, var(--action-link)); }

/* Dropdown on dark header */
.site-header.is-scrolled .has-dropdown .dropdown {
  background: rgba(8, 12, 24, 0.96);
  color: #ffffff;
  border: 1px solid rgba(26,106,255,0.25);
}
.site-header.is-scrolled .dropdown-item { color: #ffffff; }
.site-header.is-scrolled .dropdown-item:hover,
.site-header.is-scrolled .dropdown-item:focus { background: rgba(255,255,255,0.08); color: var(--brand-primary, var(--action-link)); }

/* Phone CTA remains themed; no change needed other than contrast on dark bg handled by colors above */