.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 1px 4px rgb(0 0 0 / 18%);
}

.site-header__brand {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.site-header__nav a {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  color: var(--accent-contrast);
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav a:hover {
  background: var(--accent-fill-hover);
}

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

.site-header__filters {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 10px;
  font-size: 12px;
}

.filter {
  position: relative;
}

.filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.35rem 0.65rem;
  background: var(--accent-fill);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.filter summary:hover {
  background: var(--accent-fill-active);
}

.filter summary::-webkit-details-marker {
  display: none;
}

.filter summary::after {
  content: "▸";
  font-size: 0.9rem;
}

.filter[open] summary,
.filter[open] summary:hover {
  background: var(--surface);
  border-color: transparent;
  color: var(--text-primary);
}

.filter[open] summary::after {
  content: "▾";
}

.filter.has-active-filter summary {
  font-weight: 700;
}

.filter-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1100;
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: min(60vh, 520px);
  padding: 0.45rem 0.75rem 0.65rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  font-size: 1rem;
  line-height: 1.3;
}

.filter:last-of-type .filter-options {
  right: 0;
  left: auto;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 -0.25rem;
  padding: 0.22rem 0.25rem;
  border-radius: 4px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.filter-options label:hover {
  background: var(--hover);
}

.filter-option-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.filter-option-swatch {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .filter-option-icon {
    filter: invert(1);
  }
}

.filter-options label:has(input[data-all]) {
  margin-bottom: 4px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.filter-options label:has(input:not([data-all]):not(:checked)) {
  opacity: 0.45;
  text-decoration: line-through;
}

.filter-options label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-options input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

body.map-page .site-header {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .site-header__filters {
    flex: 1 1 100%;
  }
}

.site-header__nav a:focus-visible,
.site-header__action:focus-visible,
.site-header__search input:focus-visible,
.site-header summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
