/* The header of every page, built by api/header.py (header-redesign, design §4-§9), ported from
   the mock's layout A (docs/design/header-mock.html, `.hNew`) with viewport media queries in place
   of its container queries. The bar is forest green in both schemes and spans the page; each tier's
   .inner holds its content in the page's 80rem column, aligned with the planner's .layout.
   The mapbook page has bare `button` and `a` rules, so every header control sets its padding,
   border, background, colour, font and weight here. */
.site-header { display: block; background: var(--hdr-bg); color: var(--hdr-fg); }
.site-header > :last-child { border-bottom: 1px solid var(--hdr-line); }
.site-header .inner {
  box-sizing: border-box; max-width: calc(80rem + 32px); margin: 0 auto; padding: 0 16px;
}
.site-header :focus-visible { outline: 2px solid var(--hdr-fg); outline-offset: 2px; }

/* Tier one: the brand on the left; the Feedback button (or "Planner") and the switch on the right. */
.tier1 .inner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 12px; padding-bottom: 10px;
}
.site-header > .tier1:last-child .inner { padding-bottom: 12px; }
.site-header .brand { display: flex; flex: 0 1 auto; min-width: 0; align-items: center; min-height: 44px; line-height: 0; }
.site-header .brand .wordmark { display: none; width: 160px; height: 26px; }
.site-header .brand .mark { display: block; width: 32px; height: 32px; }
.site-header .tools { display: flex; flex: none; align-items: center; gap: 6px; }
.site-header .hdr-button {
  box-sizing: border-box; display: inline-flex; align-items: center; min-height: 44px; margin: 0;
  padding: 0 12px; border: 1px solid var(--hdr-fg); border-radius: 8px;
  background: transparent; color: var(--hdr-fg);
  font: inherit; font-weight: 600; line-height: 1.5; text-decoration: none; cursor: pointer;
}
/* The outline is an overlay, not a border, so the links can be a full 44 px high and the group
   matches the Feedback button; overflow clips the active code to the rounded corners. */
.site-header .lang { position: relative; display: inline-flex; border-radius: 8px; overflow: hidden; }
.site-header .lang::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--hdr-line); border-radius: 8px;
  pointer-events: none;
}
.site-header .lang > * {
  box-sizing: border-box; display: grid; place-items: center; min-width: 36px; min-height: 44px;
  margin: 0; padding: 0 7px; border: 0; background: transparent; color: var(--hdr-muted);
  font: inherit; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-decoration: none;
}
.site-header .lang > [aria-current] { background: var(--hdr-active-bg); color: var(--hdr-active-fg); }

/* Tier two: the pages as tabs, under a divider that spans the bar; a bar under the current one. */
.tier2 { border-top: 1px solid var(--hdr-line); }
.tier2 .inner { display: flex; }
.tier2 .inner a {
  box-sizing: border-box; flex: 1; display: grid; place-items: center; min-height: 48px; margin: 0;
  padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: transparent;
  color: var(--hdr-muted); font: inherit; font-weight: 600; text-decoration: none;
}
.tier2 .inner a[aria-current="page"] { color: var(--hdr-fg); border-bottom-color: var(--hdr-fg); }

/* Below 480 px the first tier is tight: the mock's spacing needs about 354 px with "Feedback" and
   360 px with "Planeraren", so 340-359 px and 372-389 px would overflow. The gaps and the side
   padding inside the controls shrink; their heights do not. */
@media (max-width: 479.98px) {
  .tier1 .inner, .site-header .tools { gap: 4px; }
  .site-header .hdr-button { padding: 0 8px; }
  .site-header .lang > * { min-width: 32px; padding: 0 5px; }
}
/* The wordmark is 136 px from 340 px and 160 px from 372 px; below 340 px the mark stands in. */
@media (min-width: 340px) {
  .site-header .brand .wordmark { display: block; width: 136px; height: 22px; }
  .site-header .brand .mark { display: none; }
}
@media (min-width: 372px) {
  .site-header .brand .wordmark { width: 160px; height: 26px; }
}
/* From 720 px the tabs stop sharing the width and sit at the left. */
@media (min-width: 720px) {
  .tier2 .inner a { flex: 0 0 auto; padding: 0 22px; }
}
