/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
  height: 88px;
}

body.page-home .site-header:not(.is-solid) {
  background: transparent;
  border-bottom: none;
}

/* Navigation */
.site-nav {
  display: flex;
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s;
}

.site-nav a:hover {
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* Language Toggle */
.lang-toggle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lang-toggle a {
  text-decoration: none;
  color: var(--text-muted);
}

.lang-toggle a[aria-current="true"] {
  color: var(--text);
  font-weight: 600;
}

.lang-toggle span {
  margin: 0 8px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  flex: none;
  height: 44px;
  text-decoration: none;
}

.site-logo img {
  width: auto;
  height: 100%;
}

/* Hamburger Menu Toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: all 0.3s ease;
}

.nav-toggle span::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  position: absolute;
  top: -8px;
  left: 0;
  transition: all 0.3s ease;
}

.nav-toggle span::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  position: absolute;
  top: 8px;
  left: 0;
  transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

/* Main content padding for non-home pages */
body:not(.page-home) main {
  padding-top: 88px;
}

/* Responsive: Tablet and below */
@media (max-width: 899px) {
  .site-header__inner {
    height: 72px;
  }

  /* The wordmark is 4:1, so scale it by height to leave room for the
     language toggle and the hamburger at 375px. */
  .site-logo {
    height: 34px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    z-index: 40;
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
  }

  /* The drawer is a child of .site-header, whose z-index creates a stacking
     context, so it would paint over its own siblings. Lift the logo, language
     toggle and close button above it. */
  .site-logo,
  .lang-toggle,
  .nav-toggle {
    position: relative;
    z-index: 45;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    text-align: center;
  }

  .site-nav a {
    display: block;
    font-size: 1.1rem;
    padding: 16px 0;
    border-bottom: none;
  }

  .site-nav a:hover {
    border-bottom: none;
  }

  .site-nav a[aria-current="page"] {
    border-bottom: none;
  }

  body:not(.page-home) main {
    padding-top: 72px;
  }
}
