/* Header Styles */
.site-header {
  background-color: var(--primary);
  color: var(--primary-foreground);
  position: relative;
  /* The header needs a high z-index so the toggle button is always clickable */
  z-index: 50;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.header-logo-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s;
  font-size: 20px;
}

.header-logo-link:hover {
  opacity: 0.8;
}

.header-logo-link:focus {
  outline: 2px solid var(--primary-foreground);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
}

.nav-list {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--primary-foreground);
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
  transition: opacity 0.3s;
}

.nav-link:hover {
  opacity: 0.8;
}

.nav-link:focus {
  outline: 2px solid var(--primary-foreground);
  outline-offset: 2px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--primary-foreground);
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity 0.3s;
  /* z-index is inherited from .site-header, so it stays on top */
}

.mobile-menu-toggle:hover {
  opacity: 0.8;
}

.mobile-menu-toggle:focus {
  outline: 2px solid var(--primary-foreground);
  outline-offset: 2px;
  border-radius: 2px;
}

.mobile-menu-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile Menu Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  /* Sits above content but below the menu */
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation (The Menu Itself) */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 20rem;
  max-width: 85vw;
  background-color: var(--primary);
  color: var(--primary-foreground);
  /* Sits above the overlay */
  z-index: 45;
  
  /* === ANIMATION START === */
  /* 1. Start position: Pushed completely off the screen to the left */
  transform: translateX(-100%);
  /* 2. Animation effect: Animate the 'transform' property over 0.3 seconds */
  transition: transform 0.3s ease-in-out;
  /* === ANIMATION END === */
}

/* This is the class JavaScript adds when the button is clicked */
.mobile-nav.active {
  /* 3. End position: Bring the menu back to its original position on the screen */
  transform: translateX(0);
}

.mobile-nav-content {
  padding: 1.5rem;
  padding-top: 5rem;
}

.mobile-nav .nav-list {
  flex-direction: column;
  gap: 0;
}

.mobile-nav .nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.mobile-nav .nav-link:last-child {
  border-bottom: none;
}

/* Responsive Design */
@media (min-width: 640px) {
  .header-content {
    padding: 1rem 0;
  }
}

@media (min-width: 768px) {
  .desktop-nav {
    display: block;
  }

  .mobile-menu-toggle {
    display: none;
  }
}

@media (min-width: 1024px) {
  .nav-list {
    gap: 2.5rem;
  }
}