/* Shared site header — no external fonts or icons */
.site-header {
  --sh-navy: var(--navy, #16324f);
  --sh-navy-soft: var(--navy-soft, #2a4a6b);
  --sh-paper: var(--paper, #fffdf6);
  --sh-gold: var(--gold, #ffd24a);
  --sh-shadow: 0 3px 0 rgba(22, 50, 79, 0.12);
  flex: 0 0 auto;
  margin: 0 0 14px;
  container-type: inline-size;
  container-name: site-header;
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  min-width: 0;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--sh-navy);
  flex: 0 1 auto;
}

.site-header__brand:hover .site-header__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header__brand:focus-visible {
  outline: 3px solid var(--sh-navy);
  outline-offset: 3px;
  border-radius: 12px;
}

.site-header__mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: block;
}

.site-header__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.site-header__name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--sh-navy);
  white-space: nowrap;
}

.site-header__tag {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sh-navy-soft);
  line-height: 1.2;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 10px 8px 2px;
}

.site-header__nav::-webkit-scrollbar {
  display: none;
}

.site-header__link {
  --accent: var(--sh-navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 12px 5px 8px;
  min-height: 40px;
  border: 2px solid var(--sh-navy);
  border-radius: 999px;
  background: var(--sh-paper);
  color: var(--sh-navy);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--sh-shadow);
  white-space: nowrap;
}

.site-header__link[data-accent="states"] { --accent: #ff8a3d; }
.site-header__link[data-accent="world"] { --accent: #1f7aad; }
.site-header__link[data-accent="math"] { --accent: #6c63ff; }
.site-header__link[data-accent="spelling"] { --accent: #c9892e; }
.site-header__link[data-accent="resources"] { --accent: #1faf9a; }
.site-header__link[data-accent="geography"] { --accent: #1f7aad; }

button.site-header__link {
  appearance: none;
  cursor: pointer;
}

.site-header__menu {
  display: inline-flex;
  flex: 0 0 auto;
  position: relative;
}

.site-header__chevron {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: currentColor;
  margin-left: 1px;
}

.site-header__menu-btn[aria-expanded="true"] .site-header__chevron {
  transform: rotate(180deg);
}

.site-header__dropdown {
  box-sizing: border-box;
  min-width: 260px;
  padding: 8px;
  border: 3px solid var(--sh-navy, #16324f);
  border-radius: 20px;
  background: var(--sh-paper, #fffdf6);
  box-shadow: 0 10px 0 rgba(22, 50, 79, 0.12);
  font-family: var(--font, "Trebuchet MS", "Segoe UI", "Avenir Next", "Avenir", system-ui, sans-serif);
}

.site-header__dropdown[hidden] {
  display: none !important;
}

.site-header__choice {
  --accent: var(--sh-navy, #16324f);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--sh-navy, #16324f);
  text-decoration: none;
}

.site-header__choice[data-accent="states"] { --accent: #ff8a3d; }
.site-header__choice[data-accent="world"] { --accent: #1f7aad; }

.site-header__choice-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 10px;
  background: #fff6d0;
  color: var(--accent);
}

.site-header__choice-icon .site-header__icon {
  width: 18px;
  height: 18px;
}

.site-header__choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-header__choice-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.site-header__choice-desc {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sh-navy-soft, #2a4a6b);
}

.site-header__choice:hover,
.site-header__choice:focus-visible {
  background: #fff6d0;
}

.site-header__choice:focus-visible {
  outline: 3px solid var(--sh-navy, #16324f);
  outline-offset: 2px;
}

.site-header__choice[aria-current="page"] {
  background: var(--sh-gold, #ffd24a);
}

@media (prefers-reduced-motion: reduce) {
  .site-header__menu-btn .site-header__chevron {
    transform: none;
  }
}


.site-header__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
}

.site-header__badge {
  display: inline-block;
  margin-left: 1px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8fff6;
  color: #0f6e60;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.site-header__link:hover {
  background: #fff6d0;
  transform: translateY(-1px);
}

.site-header__link:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(22, 50, 79, 0.12);
}

.site-header__link:focus-visible {
  outline: 3px solid var(--sh-navy);
  outline-offset: 2px;
  background: #fff6d0;
}

.site-header__link[aria-current] {
  background: var(--sh-gold);
  box-shadow: 0 3px 0 rgba(22, 50, 79, 0.16);
}

.site-header__link[aria-current] .site-header__badge {
  background: #fffdf6;
}

.site-header__title {
  margin: 6px 0 0;
  min-width: 0;
}

.site-header__title h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--sh-navy);
}

.site-header .toggle {
  flex: 0 0 auto;
  margin-left: 0;
}

/* Compact chrome on game pages so maps keep their height */
.site-header--game {
  margin-bottom: 8px;
}

.site-header--game .site-header__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.site-header--game .site-header__name {
  font-size: 0.92rem;
}

.site-header--game .site-header__link {
  min-height: 36px;
  padding: 3px 10px 3px 7px;
  font-size: 0.85rem;
}

.site-header--game .site-header__icon {
  width: 16px;
  height: 16px;
}

.site-header--game .site-header__title {
  margin-top: 4px;
}

.site-header--game .site-header__title h1 {
  font-size: 1.08rem;
}

.site-header--home .site-header__name {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
}

@container site-header (max-width: 1000px) {
  .site-header__row {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .site-header__brand {
    flex: 1 1 auto;
  }

  .site-header__nav {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
    order: 3;
  }

  .site-header .toggle {
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  .site-header__row {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .site-header__brand {
    flex: 1 1 auto;
  }

  .site-header__nav {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
    order: 3;
  }

  .site-header .toggle {
    margin-left: auto;
  }

  .site-header__name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-header--game .site-header__title h1 {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header__link {
    transform: none;
  }
}
