/* The site header, the same on every public page (index.html, terms.html,
   docs/*.html): the wordmark on the left; the section links and the theme
   picker on the right. Colours come from theme.css.

   It is fixed to the top of the viewport. The bar spans the full width;
   the side padding keeps its content within the same 72rem column as the
   page sections. --site-header-h is its height, which pages leave free at
   the top and which in-page links (#pricing) scroll clear of. */

:root {
  --site-header-h: 4.1rem;
}

html {
  scroll-padding-top: calc(var(--site-header-h) + 0.5rem);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  min-height: var(--site-header-h);
  padding: 0.75rem max(1.5rem, calc((100% - 72rem) / 2));
  box-sizing: border-box;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Content pages (terms.html, docs/*.html) start below the fixed header;
   index.html already has more room than that above the sign-in card. */
.page-body {
  padding-top: var(--site-header-h);
}

.site-header .sh-brand {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.35em;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header .sh-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-header a:focus-visible,
.site-header select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-header select {
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.4em;
  padding: 0.3em 0.5em;
  font: inherit;
}

@media (max-width: 40em) {
  :root {
    --site-header-h: 5.6rem;
  }

  .site-header {
    padding: 0.7rem 1rem;
  }

  /* Wordmark and theme picker on the first row, the links below. */
  .site-header .sh-right {
    display: contents;
  }

  .site-header select {
    order: 2;
    margin-left: auto;
  }

  .site-header nav {
    order: 3;
    width: 100%;
    gap: 0.4rem 1.1rem;
  }
}

/* The line at the foot of every page: cookies note left, copyright centred,
   tagline right; stacked and centred on narrow screens. */
.footer-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 0.5em 1.5em;
  font-size: 0.8125rem;
}

.footer-line > :nth-child(1) { justify-self: start; }
.footer-line > :nth-child(2) { justify-self: center; text-align: center; }
.footer-line > :nth-child(3) { justify-self: end; text-align: right; }

@media (max-width: 40em) {
  .footer-line { grid-template-columns: 1fr; }
  .footer-line > :nth-child(n) { justify-self: center; text-align: center; }
}
