/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #fffff0;
  color: #222222;
}

/* Header */
.site-header {
  background-color: #fffff0;
  border-bottom: 1px solid #deddc7;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container a {
  display: inline-block;
}

.site-logo {
  height: 48px;
  width: auto;
  display: block;
}

/* Nav Menu */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-item-header {
  display: inline-flex;
  align-items: center;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.6rem;
  color: #333333;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background-color: #f0efe0;
  color: #000000;
}

/* Chevron Button - visible whenever touch or click toggle is active */
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 0.65rem;
  padding: 0.5rem 0.4rem;
  cursor: pointer;
  color: #555555;
  transition: transform 0.2s ease;
}

.nav-item.submenu-open .dropdown-toggle {
  transform: rotate(180deg);
}

/* Dropdown Menu (Universal styling for horizontal layout) */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: #ffffff;
  border: 1px solid #deddc7;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  list-style: none;
  padding: 0.35rem 0;
  z-index: 1010;
}

.dropdown-link {
  display: block;
  padding: 0.55rem 1rem;
  color: #333333;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.dropdown-link:hover,
.dropdown-link.active {
  background-color: #fffff0;
  color: #000000;
  font-weight: 600;
}

/* 1. Desktop with a real mouse pointer: Hover works automatically */
@media (hover: hover) and (pointer: fine) {
  .dropdown-toggle {
    display: none; /* Hide toggle button on desktop with mouse */
  }

  .nav-item.has-dropdown:hover > .dropdown-menu,
  .nav-item.has-dropdown:focus-within > .dropdown-menu {
    display: block;
  }
}

/* 2. Any device via click/tap toggle (Crucial for Pixel Landscape mode) */
.nav-item.submenu-open > .dropdown-menu {
  display: block;
}

/* 3. Small screen portrait view: collapse menu items into hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: #fffff0;
    border-bottom: 1px solid #deddc7;
    padding: 1rem;
    gap: 0.5rem;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-item-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: #f7f6e6;
    padding-left: 1rem;
  }
}