/* ===============================
   HAMBURGER + DRAWER MENU
   =============================== */

/* Header is positioning context */
header {
  position: relative;
}

/* Anchor container in top-right of header */
.menu-container {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1200; /* highest layer in header */
}

/* Hidden checkbox sits on top for click/tap (or you can rely on label only) */
input.hamburger-checkbox {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  opacity: 0;
  cursor: pointer;
  z-index: 1201;
}

/* The visible button */
.hamburger-icon label {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;   /* ✅ add this */
  gap: 6px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  cursor: pointer;
}


/* The 4 bars */
.hamburger-icon span {
  height: 3px;
  width: 28px;
  background: var(--drawer-bg);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease, background 0.2s ease;
  margin: 0;               /* IMPORTANT: no margin if using gap */
}

/* Drawer */
.menu-pane {
  position: fixed;
  inset: 0 auto 0 0;
  width: clamp(300px, 40vw, 480px);
  background: var(--drawer-bg);
  transform: translateX(-110%);
  transition: transform 0.3s ease;
  z-index: 1100;
}

/* Overlay (click outside to close) */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1050;
}

/* Open state */
#openmenu:checked ~ .menu-pane {
  transform: translateX(0);
}
#openmenu:checked ~ .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Transform 3 bars into X */
#openmenu:checked ~ .hamburger-icon span:nth-of-type(1) {
  transform: translateY(9px) rotate(45deg);
  background: var(--brand-primary);
}

#openmenu:checked ~ .hamburger-icon span:nth-of-type(2) {
  opacity: 0;
}

#openmenu:checked ~ .hamburger-icon span:nth-of-type(3) {
  transform: translateY(-9px) rotate(-45deg);
  background: var(--brand-primary);
}
.hamburger-icon span {
  transform-origin: center;
}

/* Styles for the menu content */
.menu-pane nav {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}
.menu-pane nav a {
  color: white;
  text-decoration: none;
  padding: 1rem 0.75rem;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  display: block;
  border-radius: 0.75rem;
}
.menu-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}


.menu-links a:hover,
.menu-links a:focus-visible {
  color: var(--brand-primary);
  background: rgba(255,255,255,0.08);
  outline: 3px solid var(--brand-primary);
  outline-offset: 3px;
}
.menu-links a {
  border-radius: 0.75rem;
}

.menu-links a:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 4px;
}
.menu-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

#back-to-map {
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  font-weight: 700;
  margin: 0 0 1.25rem;
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}