/* Shared header layout, including the standalone teaching slide reader. */
.topbar .topbar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 0;
}

.topbar .brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem 0.65rem;
  text-align: center;
}

.topbar .nav,
.topbar .section-nav,
.topbar .nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem 0.4rem;
  width: 100%;
  margin: 0;
}

.topbar .nav a,
.topbar .section-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--ink-700, #593d30);
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.topbar .nav a:hover,
.topbar .nav a[aria-current],
.topbar .section-nav a:hover {
  background: var(--cream-100, #f5e8d9);
  color: var(--umber-800, #7a2f0f);
}

.topbar .section-nav a {
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.topbar a:focus-visible,
.topbar button:focus-visible {
  outline: 3px solid var(--umber-800, #7a2f0f);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  /* A tall wrapped header should scroll with the page on a phone. */
  .topbar {
    position: static;
  }

  .topbar .brand {
    flex-direction: column;
    align-items: center;
  }

  .topbar .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.15rem 0.35rem;
  }

  .topbar .nav a {
    padding: 0.4rem 0.2rem;
    overflow-wrap: anywhere;
  }
}
