/* ============================================================
   Shared site navigation — Albany Avenue Block Association
   Linked from index.html and every /programs page so the nav
   is styled in ONE place. The nav markup itself is repeated in
   each page's HTML (on purpose: real <a> links crawl better
   than JS-injected ones, and discoverability is the whole point).
   ============================================================ */

nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 239, .94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(21, 56, 74, .08);
}
nav .wrap { display: flex; align-items: center; gap: 16px; padding: 10px 0; }

nav .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
nav .brand img { height: 38px; width: auto; }
nav .name {
  font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--navy);
  font-size: .98rem; line-height: 1.15;
}
nav .name span {
  display: block; font-family: "Nunito", sans-serif; font-weight: 600;
  font-size: .72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--orange);
}

nav a.link, nav summary.link {
  font-weight: 700; color: var(--navy); text-decoration: none; font-size: .95rem;
}
nav a.link:hover, nav summary.link:hover { color: var(--teal); }

/* ---------- desktop link row ---------- */
nav .links { display: flex; align-items: center; gap: 18px; }

/* ---------- Programs dropdown ----------
   <details> so it opens on tap without JavaScript and is
   keyboard-accessible for free. nav.js only adds nice-to-haves
   (close on outside click / Escape). */
nav .dd { position: relative; }
nav .dd > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
nav .dd > summary::-webkit-details-marker { display: none; }
nav .dd > summary::after {
  content: ""; width: 0; height: 0; margin-top: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; transition: transform .15s ease;
}
nav .dd[open] > summary::after { transform: rotate(180deg); }
nav .dd[open] > summary { color: var(--teal); }

nav .dd-panel {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  min-width: 260px; background: #fff; border-radius: 16px; padding: 10px;
  box-shadow: 0 18px 44px rgba(21, 56, 74, .18); border: 2px solid rgba(21, 56, 74, .07);
}
nav .dd-panel::before {
  content: ""; position: absolute; top: -9px; left: 50%; margin-left: -8px;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 9px solid #fff;
}
nav .dd-panel a {
  display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none;
  color: var(--navy); font-weight: 700; font-size: .95rem;
}
nav .dd-panel a small {
  display: block; font-weight: 600; font-size: .8rem; color: var(--muted); margin-top: 1px;
}
nav .dd-panel a:hover { background: var(--cream); color: var(--navy); }
nav .dd-panel a:hover small { color: var(--navy); }
nav .dd-panel .all {
  margin-top: 6px; border-top: 2px solid rgba(21, 56, 74, .08);
  border-radius: 0 0 10px 10px; color: var(--teal); font-size: .88rem;
}

/* ---------- mobile menu ----------
   Below 860px the desktop row is replaced by a real menu.
   Before this existed the nav simply vanished on phones. */
nav .mob { display: none; position: relative; }
nav .mob > summary {
  list-style: none; cursor: pointer; display: flex; flex-direction: column;
  justify-content: center; gap: 5px; width: 46px; height: 42px; padding: 0 11px;
  border-radius: 12px; background: var(--navy);
}
nav .mob > summary::-webkit-details-marker { display: none; }
nav .mob > summary i { display: block; height: 3px; border-radius: 2px; background: #fff; transition: opacity .15s ease; }
nav .mob[open] > summary { background: var(--teal); }
nav .mob[open] > summary i:nth-child(2) { opacity: .35; }

nav .mob-panel {
  position: absolute; top: calc(100% + 12px); right: 0; width: min(88vw, 320px);
  background: #fff; border-radius: 18px; padding: 12px;
  box-shadow: 0 22px 50px rgba(21, 56, 74, .22); border: 2px solid rgba(21, 56, 74, .07);
}
nav .mob-panel a {
  display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  color: var(--navy); font-weight: 700; font-size: 1rem;
}
nav .mob-panel a:hover, nav .mob-panel a:focus { background: var(--cream); }
nav .mob-panel .head {
  padding: 14px 14px 6px; font-size: .74rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--orange);
}
nav .mob-panel .sub { padding-left: 26px; font-size: .95rem; }
nav .mob-panel .sub small { display: block; font-weight: 600; font-size: .8rem; color: var(--muted); }
nav .mob-panel .rule { height: 2px; background: rgba(21, 56, 74, .08); margin: 8px 6px; }
nav .mob-panel .cta {
  margin-top: 6px; text-align: center; background: var(--orange); color: #fff;
  font-family: "Fredoka", sans-serif; font-weight: 600;
}
nav .mob-panel .cta:hover { background: #cf7c31; }

@media (max-width: 860px) {
  nav .links { display: none; }
  nav .mob { display: block; }
}
@media (max-width: 420px) {
  nav .name { font-size: .88rem; }
  nav .brand img { height: 32px; }
}
