/* ===== Header Component ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--surface-ink);
  color: var(--color-cream);
  height: auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  border-bottom: var(--border-thin);
  border-color: var(--color-tobacco);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-3);
}

/* Brand */
.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-header__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.site-header__brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-cream);
}

/* Navigation toggle (burger) */
.nav-toggle {
  display: none; /* hidden on desktop */
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  z-index: 1100;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-cream);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Navigation container */
.site-header__nav {
  display: flex;
  align-items: center;
}

.site-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.site-header__nav-list li {
  margin: 0;
  padding: 0;
}

.site-header__nav-list a {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-caption-size);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-cream);
  text-decoration: none;
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.site-header__nav-list a:hover,
.site-header__nav-list a:focus-visible {
  color: var(--color-cherry);
}

/* CTA button */
.site-header__cta {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===== Mobile styles ===== */
@media (max-width: 768px) {
  .site-header__brand-text {
    font-size: 1.125rem; /* 18px */
  }

  .site-header__logo {
    width: 32px;
    height: 32px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header__nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    height: 100dvh;
    background-color: var(--surface-ink);
    padding: var(--space-6) var(--space-4);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header__nav.is-open {
    transform: translateX(0);
  }

  .site-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    width: 100%;
  }

  .site-header__nav-list a {
    font-size: var(--text-body-size);
    text-transform: none;
    letter-spacing: normal;
    padding: var(--space-2) 0;
    border-bottom: var(--border-muted);
    width: 100%;
  }

  .site-header__cta {
    display: none; /* hide CTA on mobile, or keep it in the menu if desired */
  }

  /* Overlay behind mobile menu */
  .site-header__nav::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .site-header__nav.is-open::before {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Burger animation for open state */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
