/* =============================
   London Vision Training Clinic
   nav.css — header navigation shared by every page
   (dropdowns, mobile sub-links, desktop/mobile switch)
   ============================= */

/* =========================================================
   NAV DROPDOWNS (Vision Therapy, Our Team) — desktop + mobile
========================================================= */
/* keep nav labels on one line */
.nav a { white-space: nowrap; }

.nav-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dd__toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  padding: .35rem .25rem;
  margin: 0 0 0 .15rem;
  color: var(--ink-800, #1e293b);
  cursor: pointer;
  line-height: 1;
}
.nav-dd__toggle svg { transition: transform .2s ease; }
.nav-dd:hover .nav-dd__toggle,
.nav-dd.is-open .nav-dd__toggle { color: var(--brand, #0f4c81); }
.nav-dd:hover .nav-dd__toggle svg,
.nav-dd.is-open .nav-dd__toggle svg { transform: rotate(180deg); }
.nav-dd__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1.25rem;
  margin-top: .75rem;
  min-width: 260px;
  padding: .4rem 0;
  background: #fff;
  border: 1px solid var(--rule, #e2e8f0);
  border-top: 2px solid var(--brand, #0f4c81);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow, 0 6px 24px rgba(0,0,0,.08));
  z-index: 1050;
  text-align: left;
}
/* invisible bridge so the menu stays open while the mouse crosses the gap */
.nav-dd__menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -.9rem;
  height: .9rem;
}
.nav-dd:hover .nav-dd__menu,
.nav-dd.is-open .nav-dd__menu { display: block; }
.nav .nav-dd__menu a {
  display: block;
  padding: .65rem 1.25rem;
  white-space: nowrap;
  font-weight: 500;
}
.nav .nav-dd__menu a + a { border-top: 1px solid var(--rule, #e2e8f0); }
.nav .nav-dd__menu a:hover,
.nav .nav-dd__menu a:focus-visible { background: var(--bg-soft, #f6f8fb); }

/* Vision Therapy sub-links (mobile menu) */
.menu-inner .menu-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -.75rem 0 0;
}
.menu-inner .menu-sub a {
  min-width: 0;
  margin: 0 auto;
  padding: .45rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
}

/* tighter nav spacing on narrower desktops so the logo keeps its breathing room */
@media (min-width: 1100px) and (max-width: 1260px) {
  .nav { gap: 1.1rem; }
}

/* Switch to the hamburger menu below 1100px.
   The full nav needs about 1100px; some pages switched at 600px before. */
@media (max-width: 1099px) {
  .site-header .nav { display: none !important; }
  .site-header .hamburger {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 32px;
    height: 24px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1100;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-dd__toggle svg { transition: none; }
}

/* Longer mobile menu (with sub-links): start at the top and scroll,
   so "Home" is never cut off on pages that centred the menu */
.menu-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.menu-inner {
  justify-content: flex-start !important;
  height: auto !important;
  min-height: 100%;
  padding-top: 12vh !important;
  padding-bottom: 6vh !important;
}

/* Desktop header, set here so every page shows the same nav
   (some pages hid the desktop nav or had no nav styles of their own) */
.sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15,23,42,.06);
}
.sticky-wrapper .site-header { position: static; }
@media (min-width: 1100px) {
  .site-header .nav {
    display: flex !important;
    align-items: center;
    gap: 1.5rem;
  }
  .site-header .hamburger { display: none !important; }
}
.nav a {
  color: var(--ink-800, #1e293b);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: color .15s ease;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--brand, #0f4c81); }
/* pages whose menu overlay is a centred flex box: pin content to the top so it can scroll */
.menu-overlay.open { align-items: flex-start !important; }

/* Same nav links and header button on every page
   (some pages padded nav links or styled .btn differently) */
.site-header .nav > a:not(.btn),
.site-header .nav-dd > a {
  padding: 0;
  border-radius: 0;
  background: none;
}
.site-header .nav a.btn {
  display: inline-flex;
  align-items: center;
  padding: .7rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.6;
  border-radius: 999px;
  color: var(--ink-800, #1e293b);
  background: var(--cta, #FF6B35);
  border: 2px solid var(--cta, #FF6B35);
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.site-header .nav a.btn:hover {
  background: #E65A24;
  border-color: #E65A24;
}

/* Right-aligned dropdown for the last nav item (Tools), so it never runs off the screen */
.nav-dd--right .nav-dd__menu { left: auto; right: -1.25rem; }

/* ---------- About Us dropdown ---------- */
/* The whole "About Us" label is the toggle (there is no About Us page) */
.site-header .nav-dd__label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-800, #1e293b);
  background: none;
  border: 0;
  cursor: pointer;
}
.site-header .nav-dd__label:hover,
.site-header .nav-dd__label.is-current,
.nav-dd:hover .nav-dd__label { color: var(--brand, #0f4c81); }

/* Our Team row inside About Us, with a secondary menu for each doctor.
   It opens to the left so it always stays on screen. */
.nav-sub { position: relative; }
.nav .nav-dd__menu .nav-sub > a {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.nav .nav-dd__menu .nav-sub > a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .6;
}
.nav .nav-dd__menu .nav-sub + a { border-top: 1px solid var(--rule, #e2e8f0); }
.nav-sub__menu {
  display: none;
  position: absolute;
  top: calc(-.4rem - 1px);
  right: 100%;
  min-width: 220px;
  padding: .4rem 0;
  background: #fff;
  border: 1px solid var(--rule, #e2e8f0);
  border-top: 2px solid var(--brand, #0f4c81);
  border-radius: 12px 0 12px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  z-index: 1060;
}
.nav-sub:hover > .nav-sub__menu,
.nav-sub:focus-within > .nav-sub__menu { display: block; }
.nav-sub:hover > a,
.nav-sub:focus-within > a { background: var(--bg-soft, #f6f8fb); }

/* Mobile menu: "About Us" is a heading, doctors are indented under Our Team */
.menu-inner .menu-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: .9rem 1.2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.menu-inner .menu-sub--nested { margin: -.2rem 0 .1rem; }
.menu-inner .menu-sub--nested a {
  font-size: .9rem;
  color: rgba(255,255,255,.65);
  padding-top: .3rem;
  padding-bottom: .3rem;
}

/* ---------- Top bar: Patient Tools · Directions · phone ---------- */
.top-banner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}
.top-banner a { white-space: nowrap; }
.top-banner a + a { border-left: 1px solid rgba(255,255,255,.3); }
.top-banner__link { font-size: .85rem; color: #fff; }
.top-banner__link:hover,
.top-banner__link[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 420px) {
  .top-banner a { padding-left: .55rem !important; padding-right: .55rem !important; }
  .top-banner__link { font-size: .8rem; }
}
