/* =========================================================
   Page bar — floating quick links to every main page.
   Loaded on every page (redesigned and older ones), so it is
   self-contained: no tokens from mosadad.css, no resets.
   ========================================================= */

.page-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 100;
  box-sizing: border-box;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: rgba(28, 32, 37, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.page-bar a {
  padding: 8px 12px;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.page-bar a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.page-bar a[aria-current] {
  background: #1072FA;
}

.page-bar a:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 0;
}

/* Older pages: empty space at the end of the page so the bar
   never covers the last line of their footer. */
.page-bar-spacer {
  height: 72px;
}

@media (max-width: 768px) {
  .page-bar {
    border-radius: 24px;
  }

  .page-bar-spacer {
    height: 120px;
  }

  /* Older pages show a fixed language toggle bottom-right on phones;
     lift it above the bar. */
  body .lang-toggle-wrapper {
    bottom: 124px;
  }
}

/* ---------- Pages that load site-motion.js ("mo-js" on <html>) ----------
   site-motion.js measures the bar and sets --bar-space (bar height plus
   its 16px offset and a 12px gap) and --toggle-space (the older pages'
   phone language toggle plus a gap), so the spacer and toggle follow the
   bar's real height instead of the fixed guesses above.
   start-settling.html doesn't load site-motion.js, so it keeps the rules
   above unchanged. */
.mo-js .page-bar-spacer {
  /* + 68px clears the back-to-top button that floats above the bar */
  height: calc(var(--bar-space, 72px) + var(--toggle-space, 0px) + 68px);
}

/* Wide screens: the button sits level with the bar (site-motion.css) */
@media (min-width: 1024px) {
  .mo-js .page-bar-spacer {
    height: calc(var(--bar-space, 72px) + var(--toggle-space, 0px) + 8px);
  }
}

@media (max-width: 768px) {
  .mo-js .lang-toggle-wrapper {
    bottom: var(--bar-space, 124px);
  }
}

/* Phones and small tablets: one row that scrolls sideways, instead of
   wrapping to two or three rows that cover a quarter of a small screen.
   site-motion.js scrolls the current page's link into view. */
@media (max-width: 720px) {
  .mo-js .page-bar {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    margin: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    border-radius: 999px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mo-js .page-bar::-webkit-scrollbar {
    display: none;
  }

  .mo-js .page-bar a {
    flex: none;
  }

  /* Scrolled to the end, some browsers drop the bar's end padding and
     clip the last link against the rounded edge; this keeps the gap. */
  .mo-js .page-bar::after {
    content: "";
    flex: 0 0 6px;
  }
}

/* ---------- Pill Nav look (site-motion.js adds .page-bar--pills) ----------
   After reactbits.dev "Pill Nav" (user, 2026-11-03): a round logo button
   beside a dark track of separate pill tiles, with a dot under the
   current page. The hover fill is in site-motion.css. start-settling.html
   doesn't load site-motion.js, so its bar keeps the plain look above. */
.mo-js .page-bar.page-bar--pills {
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.page-bar__logo,
.page-bar__track {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(24, 24, 27, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.page-bar__logo {
  flex: none;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 46px;
  height: 46px;
  padding: 0 !important;
  border-radius: 50%;
}

.page-bar__logo img {
  display: block;
  width: 22px;
  height: auto;
}

.page-bar__track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
}

/* Each link is its own tile */
.mo-js .page-bar--pills .page-bar__track a {
  position: relative;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  font-weight: 600;
}

.mo-js .page-bar--pills .page-bar__track a:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* The current page: a tile like the others, marked with a dot */
.mo-js .page-bar--pills .page-bar__track a[aria-current] {
  background: rgba(255, 255, 255, 0.12);
}

.mo-js .page-bar--pills .page-bar__track a[aria-current]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: currentColor;
  transition: background-color 0.3s ease;
}

/* The dot turns dark with the label while the tile fills white */
.motion .page-bar--pills .page-bar__track a[aria-current]:is(:hover, :focus-visible)::after {
  background: #1C2025;
}

.page-bar .page-bar__logo:hover {
  background: rgba(24, 24, 27, 0.92);
}

.page-bar__logo:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .page-bar__track {
    border-radius: 24px;
  }
}

/* Phones: the logo stays put and only the links scroll sideways */
@media (max-width: 720px) {
  .mo-js .page-bar.page-bar--pills {
    overflow: visible;
  }

  .mo-js .page-bar.page-bar--pills::after {
    content: none;
  }

  .page-bar__track {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    border-radius: 999px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .page-bar__track::-webkit-scrollbar {
    display: none;
  }

  .page-bar__track a {
    flex: none;
  }

  .page-bar__track::after {
    content: "";
    flex: 0 0 4px;
  }
}
