/* The site header: brand, account links, theme picker, and tabs. Django admin
   shows the same one, so every rule is scoped and sets what it relies on. */
.site-header {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  text-align: start;
}
.site-header *, .site-header *::before, .site-header *::after { box-sizing: border-box; }
.site-header form { margin: 0; padding: 0; }
.site-header .container { width: min(1040px, calc(100% - 2rem)); margin-inline: auto; }
.site-header .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.site-header .icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-header a:focus-visible, .site-header button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .container { padding-top: var(--ds-space-3); }
.site-header .mast-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-2) var(--ds-space-4);
  padding-bottom: var(--ds-space-3);
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}
.site-header .brand:hover { color: var(--text); }
.site-header .brand img { width: 38px; height: 38px; flex: none; }
.site-header .mast-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-1) var(--ds-space-4);
}
.site-header .tool-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--ds-text-sm);
  text-decoration: none;
  cursor: pointer;
}
.site-header .tool-link:hover { color: var(--accent); text-decoration: underline; }
.site-header .tool-link[aria-current="page"] { color: var(--accent); text-decoration: underline; }

/* Keeps the account links and theme picker on one row on a phone. */
@media (max-width: 480px) {
  .site-header .mast-tools { column-gap: 0.75rem; }
}

/* Light, dark, or follow the device. The pressed one is the saved choice. */
.site-header .theme-picker {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}
.site-header .theme-picker button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.site-header .theme-picker button:hover { color: var(--text); }
.site-header .theme-picker button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--badge-bg);
  color: var(--accent-strong);
}
.site-header .theme-picker .icon { width: 1.25rem; height: 1.25rem; }

.site-header .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.125rem;
}
.site-header .tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.125rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}
@media (max-width: 480px) {
  .site-header .tabs { column-gap: 0.875rem; }
}
.site-header .tabs a:hover { color: var(--text); }
.site-header .tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
