/**
 * Shared site header — same geometry on every page so nav position does not shift.
 */
:root {
  --header-h: 52px;
  --header-nav-max: 960px;
  /* Main column — same as nav max-width so header and body edges align */
  --site-content-max: var(--header-nav-max);
  --header-nav-pad-x: 1.25rem;
  --header-nav-gap: 1.5rem;
}

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.site-header nav {
  width: 100%;
  max-width: var(--header-nav-max);
  margin: 0 auto;
  padding: 0 var(--header-nav-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.site-header .nav-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--header-nav-gap);
  min-width: 0;
}

.site-header a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.25;
  flex-shrink: 0;
  padding: 0.45rem 0;
  border-radius: 8px;
  position: relative;
  outline: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 125, 125, 0.2);
  flex-shrink: 0;
}

.lang-switch button {
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.1;
  cursor: pointer;
  background: transparent;
}

.lang-switch button[data-active='true'] {
  font-weight: 600;
}

/* Light pages (home, privacy) */
.site-header--light {
  border-bottom: 1px solid rgba(0, 0, 0, 0.09);
  background: rgba(245, 245, 244, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header--light a {
  color: #52525b;
}

.site-header--light a:hover {
  color: #3f3f46;
}

.site-header--light a[aria-current='page'] {
  color: #18181b;
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.45rem;
  text-decoration-color: rgba(59, 130, 246, 0.5);
}

.site-header--light .lang-switch {
  background: rgba(255, 255, 255, 0.65);
}

.site-header--light .lang-switch button {
  color: #475569;
}

.site-header--light .lang-switch button[data-active='true'] {
  color: rgba(255, 255, 255, 1);
  background: rgba(15, 23, 42, 1);
  border: 1px solid rgba(15, 23, 42, 1);
}

/* Dark page (nowlyrics support) */
.site-header--dark {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header--dark a {
  color: rgba(255, 255, 255, 0.58);
}

.site-header--dark a:hover {
  color: rgba(255, 255, 255, 0.78);
}

.site-header--dark a[aria-current='page'] {
  color: rgba(255, 255, 255, 0.92);
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.45rem;
  text-decoration-color: rgba(125, 211, 252, 0.55);
}

.site-header--dark .lang-switch {
  border-color: rgba(125, 211, 252, 0.25);
  background: rgba(10, 16, 27, 0.75);
}

.site-header--dark .lang-switch button {
  color: rgba(226, 240, 255, 0.75);
}

.site-header--dark .lang-switch button[data-active='true'] {
  color: rgba(248, 252, 255, 0.96);
  background: rgba(56, 189, 248, 0.14);
}

.site-header a:focus-visible {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}

.lang-switch button:focus-visible {
  outline: 2px solid rgba(59, 168, 246, 0.26);
  outline-offset: 1px;
}

@media (max-width: 520px) {
  :root {
    --header-h: 58px;
    --header-nav-pad-x: 1rem;
    --header-nav-gap: 1rem;
  }

  .site-header nav {
    gap: 0.65rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
  }

  .site-header a {
    font-size: 0.9rem;
    padding: 0.5rem 0;
  }

  .lang-switch button {
    padding: 0.28rem 0.5rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  :root {
    --header-h: 62px;
    --header-nav-pad-x: 0.8rem;
    --header-nav-gap: 0.75rem;
  }

  .site-header nav {
    align-items: flex-start;
    padding-top: 0.35rem;
  }

  .site-header .nav-links {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-header .nav-links::-webkit-scrollbar {
    display: none;
  }
}
