/* MAIN MENU */
.menu {
  background-color: var(--menu-button-background);
  position: relative;
}

.menu a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 0.35em 0.5em;
  white-space: nowrap;
  transition: background 0.3s;
}

.menu a:hover {
  background-color: var(--hover-bg);
}

/* Hamburger icon for mobile */
.menu-icon {
  display: none;
  padding: 0.5em;
  color: white;
  cursor: pointer;
  font-size: 1.5em;
  user-select: none;
}

/* Menu layout */
.menu-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list>li {
  border-right: 1px solid white;
  position: relative;
  /* for submenu positioning */
}

/* Submenus */
.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--menu-button-background);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
  min-width: 180px;
}

.submenu li {
  position: relative;
  /* for the arrow */
  border-bottom: 1px solid white;
}

.submenu li a {
  display: block;
  padding-left: 2em;
  /* just enough room for the arrow */
  color: white;
  text-decoration: none;
}

/* Arrow before submenu items */
.submenu li::before {
  content: "▶";
  position: absolute;
  left: 0.5em;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-weight: bold;
  font-size: 0.75em;
  z-index: 1;
}


/* Show submenu on hover (desktop) */
.menu-list li:hover>.submenu {
  display: block;
}

/* Parent indicator ▼ */
.has-sub>a::after {
  content: " ▼";
  font-size: 0.8em;
}

/* Checkbox toggle for mobile */
#menu-toggle {
  display: none;
}

/* -------------------------------
   Responsive mobile menu
---------------------------------*/
@media (max-width: 768px) {

  /* Show hamburger icon */
  .menu-icon {
    display: block;
  }

  /* Stack menu vertically */
  .menu-list {
    display: none;
    flex-direction: column;
    background-color: var(--menu-button-background);
    position: absolute;
    width: 100%;
    top: 100%;
    left: 0;
  }

  /* Show menu when checkbox is checked */
  #menu-toggle:checked+.menu-icon+.menu-list {
    display: flex;
  }

  /* Mobile submenu always relative */
  .submenu {
    position: relative;
    box-shadow: none;
  }

  /* Show submenu on parent focus or click */
  .has-sub:focus-within>.submenu,
  .has-sub:active>.submenu {
    display: flex;
    flex-direction: column;
  }

  /* Borders for mobile menu items */
  .menu-list li {
    border-top: 1px solid white;
  }

  /* Submenu arrows stay visible */
  .submenu li::before {
    color: white;
  }

}

/* BUTTON-BAR CSS (Navigation Button Bar) */
.button-bar {
  display: flex;
  justify-content: space-between;
  background-color: transparent);
}

.button-bar button {
  background: transparent;
  /* see-through */
  border: none;
  /* remove border */
  color: inherit;
  /* text colour same as parent */
  font: inherit;
  /* inherit font style */
  cursor: pointer;
  /* still looks clickable */
  padding: 0;
  /* optional spacing */
}

.button-bar button:hover {
  border: 1px solid transparent;
}

.spacer {
  visibility: hidden;
  pointer-events: none;
}