/* The public pages' one top bar (_includes/site-header.html). It carries its
   own colours and font, so it looks the same on every page whatever that
   page's own style sheet says. Mobile first: a phone's bar and its menu here,
   wider screens add to them below. Touch targets are 44px. */
.st-top {
  --focus: #22d3ee;
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 10px max(8px, env(safe-area-inset-left));
  color: var(--text); font-family: "Heebo", "Inter", system-ui, sans-serif; font-weight: 500; line-height: 1.6;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .st-top { --focus: #0e7490; }
html[lang="en"] .st-top { font-family: "Inter", "Heebo", system-ui, sans-serif; }
.st-top a { text-decoration: none; }
.st-top :is(a, button) { touch-action: manipulation; }
/* a link to a place in a page stops below the bar, and so does focus */
html:has(.st-top) { scroll-padding-top: calc(76px + env(safe-area-inset-top)); }
.st-top :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.st-skip { position: fixed; z-index: 60; inset-block-start: 8px; inset-inline-start: 8px; padding: 12px 16px; border-radius: 12px;
  background: #fff; color: #11152b; font-weight: 700; transform: translateY(-200%); }
.st-skip:focus { transform: none; }

.st-home { display: flex; align-items: center; flex: none; min-height: 44px; }
.st-brand { display: block; height: 18px; width: auto; }
html[data-theme="light"] .st-brand { filter: invert(1) hue-rotate(180deg); }

.st-nav { display: flex; margin-inline-start: auto; }
.st-top-end { display: flex; gap: 8px; align-items: center; }
.st-top .st-icon { flex: none; min-width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-family: inherit; font-weight: 800; font-size: 14px; white-space: nowrap; cursor: pointer; transition: background .2s, transform .15s; }
.st-top .st-icon:hover { background: var(--card-hi); }
.st-top .st-icon:active { transform: scale(.95); }
.st-top .st-icon:disabled { opacity: .3; cursor: default; }
.st-top .st-wide { display: none; }
/* read out, not shown */
.st-top :is(.st-word, .st-sr) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the menu: a panel under the bar (a native popover) */
.st-menu { list-style: none; margin: 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
.st-menu[popover] { position: fixed; inset: calc(65px + env(safe-area-inset-top)) 0 auto; width: 100%; max-width: none; height: auto;
  max-height: calc(100dvh - 65px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text); }
.st-menu:popover-open { display: grid; gap: 4px; align-content: start; }
.st-menu::backdrop { background: rgba(0, 0, 0, .55); }
html:has(.st-menu:popover-open) { overflow: hidden; }
.st-menu :is(a, button) { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 14px;
  background: none; color: var(--text); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.st-menu :is(a, button):hover { background: var(--card-hi); }
.st-menu a[aria-current="page"] { background: var(--card-hi); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.st-menu a.st-call { justify-content: center; margin-top: 6px; color: #fff; background: linear-gradient(120deg, #ff3b5c, #c026d3 60%, #7c3aed); }
@media (prefers-reduced-motion: no-preference) {
  .st-menu:popover-open { transition: opacity .2s, translate .2s; }
  @starting-style { .st-menu:popover-open { opacity: 0; translate: 0 -8px; } }
}

@media (min-width: 390px) {
  .st-top { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .st-brand { height: 22px; }
}
/* room for words beside the icons */
@media (min-width: 600px) {
  .st-top { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .st-brand { height: 24px; }
  .st-top .st-login { padding: 0 16px; }
  .st-top .st-word { position: static; width: auto; height: auto; clip-path: none; }
}
/* wide: the menu is a row in the bar (js/site-header.js takes the popover off) */
@media (min-width: 1280px) {
  .st-nav { margin-inline: 6px auto; }
  .st-top .st-menu-btn, .st-menu .st-narrow { display: none; }
  .st-top .st-wide { display: inline-flex; }
  .st-menu { display: flex; gap: 2px; padding: 0; }
  .st-menu :is(a, button) { min-height: 40px; padding: 0 5px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
    transition: color .2s, background .2s; }
  .st-menu a:hover, .st-menu a[aria-current="page"] { color: var(--text); background: var(--card); }
}
@media (min-width: 1440px) {
  .st-nav { margin-inline-start: 18px; }
  .st-menu { gap: 4px; }
  .st-menu a { padding-inline: 10px; font-size: 14.5px; }
}
/* a browser without popovers: the links in a row of their own, scrolled sideways */
@supports not selector(:popover-open) {
  .st-top { flex-wrap: wrap; }
  .st-nav { order: 1; width: 100%; overflow-x: auto; }
  .st-top .st-menu-btn { display: none; }
  .st-top-end { margin-inline-start: auto; }
  .st-menu { display: flex; padding: 0; }
  .st-menu a { white-space: nowrap; }
}
