/* Site header, primary nav, footer. Mobile-first. */

.site-header {
  border-bottom: var(--border-width) solid var(--theme-accent-color);
}

.site-header__inner,
.site-footer__inner {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding: var(--gap-medium) var(--content-padding);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-small) var(--gap-large);
}

/* Brand + theme switcher, grouped at the left of the bar. */
.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-medium);
}

.site-brand {
  font-size: var(--font-size-lg);
  font-weight: bold;
  text-decoration: none;
  color: var(--theme-fg-color);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--gap-small) var(--gap-medium);
}

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

.site-nav a:hover {
  text-decoration: underline;
}

/* Theme switcher: an icon-only button beside the brand. Cycles
   system → light → dark; the glyph reflects the current choice. */
.theme-toggle {
  font: inherit;
  font-size: var(--font-size-lg);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  color: var(--theme-accent-color);
  display: inline-flex;
  align-items: center;
}

.theme-toggle:hover {
  opacity: 0.7;
}

/* Account dropdown: a native <details> menu so personal links don't crowd the
   bar. The username is the trigger; items drop into a bordered panel. */
.nav-menu {
  position: relative;
}

.nav-menu > summary {
  cursor: pointer;
  list-style: none;
  /* Match the nav links exactly (guards against summary UA-font quirks). */
  font: inherit;
  color: var(--theme-accent-color);
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu > summary::after {
  content: "\25BE"; /* ▾ */
  margin-left: 0.5ch;
}

.nav-menu[open] > summary::after {
  content: "\25B4"; /* ▴ */
}

.nav-menu__items {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  margin-top: var(--gap-small);
  display: flex;
  flex-direction: column;
  gap: var(--gap-small);
  padding: var(--gap-medium);
  border: var(--border-width) solid var(--theme-accent-color);
  background-color: var(--theme-bg-color);
  white-space: nowrap;
}

.site-footer {
  flex-shrink: 0;
  border-top: var(--border-width) solid var(--theme-accent-color);
}

.site-footer__inner {
  color: var(--theme-fg-muted);
  font-size: var(--font-size-small);
}

/* Small count pill, e.g. unread notifications */
.badge {
  display: inline-block;
  padding: 0 var(--gap-xsmall);
  background-color: var(--theme-accent-color);
  color: var(--theme-bg-color);
  font-size: var(--font-size-small);
  line-height: 1.4;
}

/* Unread-notifications dot on the account-menu trigger. */
.unread-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background-color: var(--theme-accent-color);
  vertical-align: middle;
}
