/* Hot Commons — shared site header
   Depends on these CSS variables being defined on the page:
     --bg, --rule, --ink, --accent, --accent-dark, --maxw
*/

/* Sticky lives on the placeholder (#site-header) so it survives the async
   fetch and isn't subject to the inner <nav> being trapped inside a wrapper
   that's the same height as the sticky element. Flow pages opt out by
   setting class="flow" on the placeholder div. */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
#site-header.flow {
  position: static;
  box-shadow: none;
}
.nav {
  background: #ffffff;
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2.5rem;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 1.1rem; text-decoration: none; }
.brand img { height: 80px; width: auto; }
.brand .wordmark {
  font-family: 'Henderson Sans', 'Quicksand', system-ui, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #4d4d4d;
}
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 2.5rem; align-items: center;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}
.nav a:hover { color: var(--accent); }

/* active page highlight (set via header.js) */
.nav ul a[aria-current="page"]:not(.book-btn) {
  color: var(--accent);
  position: relative;
}
.nav ul a[aria-current="page"]:not(.book-btn)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--accent);
}

.book-btn {
  background: var(--accent) !important;
  color: #000 !important;
  padding: 0.65rem 1.3rem;
  font-family: 'Henderson Sans', 'Montserrat', sans-serif !important;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
}
.book-btn:hover { background: var(--accent-dark) !important; color: #fff !important; }

/* hamburger button — hidden on desktop */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  flex-direction: column;
  justify-content: space-between;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* keep the page from jumping while header HTML async-loads */
#site-header:empty { min-height: 112px; }

@media (max-width: 720px) {
  .nav-inner { padding: 1rem 1.25rem; position: relative; }
  .brand { gap: 0.75rem; }
  .brand img { height: 60px; }
  .brand .wordmark { font-size: 1rem; letter-spacing: 0.18em; }

  .hamburger { display: flex; }

  .nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 0;
    z-index: 100;
  }
  .nav ul.open { display: flex; }
  .nav ul li {
    width: 100%;
    border-bottom: 1px solid var(--rule);
  }
  .nav ul li:last-child { border-bottom: none; }
  .nav ul li a, .nav ul li .book-btn {
    display: block;
    padding: 1rem 1.5rem;
    width: 100%;
  }
  .book-btn { text-align: center; }

  /* mobile active page: left bar instead of bottom underline */
  .nav ul a[aria-current="page"]:not(.book-btn)::after { display: none; }
  .nav ul a[aria-current="page"]:not(.book-btn) {
    border-left: 3px solid var(--accent);
    padding-left: calc(1.5rem - 3px);
  }

  #site-header:empty { min-height: 92px; }
}

:root { scroll-padding-top: 128px; }
@media (max-width: 720px) {
  :root { scroll-padding-top: 108px; }
}
