/* genxmichael bar: the shared sticky top bar on sw.genxmichael.com and
   swd.genxmichael.com. Collection links below are specific to this site.
   The wordmark font is a 4.5 KB subset of Newsreader 500 (SIL Open Font
   License) holding only the letters of "genxmichael". */
@font-face {
  font-family: "GXM Wordmark";
  src: url("/fonts/genxmichael-wordmark.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --gxm-bar-h: 65px;
}

html {
  scroll-padding-top: calc(var(--gxm-bar-h) + 12px);
}

.gxm-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 26, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color-scheme: dark;
}

.gxm-bar__inner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1336px;
  min-height: 64px;
  margin: 0 auto;
  padding-left: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 4vw, 48px), env(safe-area-inset-right, 0px));
}

.gxm-bar__wordmark {
  flex-shrink: 0;
  font: 500 1.5rem/1 "GXM Wordmark", "Newsreader", Georgia, serif;
  letter-spacing: -0.02em;
  color: #f7f0e4;
  text-decoration: none;
}

.gxm-bar__wordmark span {
  color: #8fd5ff;
}

/* Match the section links in the genxmichael redesign prototype. */
.gxm-bar__links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* The collection link is a back link: a gray left arrow before the name.
   On hover the arrow and name turn the index's yellow and the pill widens. */
.gxm-bar__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 0.9rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: rgba(247, 240, 228, 0.7);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, padding 0.25s ease, gap 0.25s ease;
}

.gxm-bar__back {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: rgba(247, 240, 228, 0.45);
  transition: color 0.2s, transform 0.25s ease;
}

.gxm-bar__links a:hover,
.gxm-bar__links a:focus-visible {
  gap: 12px;
  padding-left: 16px;
  padding-right: 18px;
  color: #ffe81f;
  background-color: rgba(255, 232, 31, 0.1);
  border-color: rgba(255, 232, 31, 0.35);
}

.gxm-bar__links a:hover .gxm-bar__back,
.gxm-bar__links a:focus-visible .gxm-bar__back {
  color: #ffe81f;
  transform: translateX(-3px);
}

.gxm-bar__social {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: -10px;
  border-radius: 50%;
  color: rgba(247, 240, 228, 0.7);
  transition: color 0.2s, background-color 0.2s;
}

.gxm-bar__social:hover {
  color: #f7f0e4;
  background-color: rgba(255, 255, 255, 0.07);
}

.gxm-bar__social svg {
  display: block;
  width: 20px;
  height: 20px;
}

.gxm-bar a:focus-visible {
  outline: 2px solid #8fd5ff;
  outline-offset: 4px;
}

@media (max-width: 640px) {
  :root {
    --gxm-bar-h: 57px;
  }

  .gxm-bar__inner {
    min-height: 56px;
  }

  .gxm-bar__wordmark {
    font-size: 1.3rem;
  }

  /* Keep the full collection name visible in a second row on small screens. */
  .gxm-bar__inner:has(.gxm-bar__links) {
    flex-wrap: wrap;
    gap: 0 16px;
    padding-top: 8px;
  }

  .gxm-bar__links {
    order: 3;
    flex-basis: 100%;
    margin: 4px 0 0 -12px;
    padding-bottom: 8px;
  }

  .gxm-bar__links + .gxm-bar__social {
    margin-left: auto;
  }

  html:has(.gxm-bar__links) {
    --gxm-bar-h: 98px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gxm-bar__social,
  .gxm-bar__links a,
  .gxm-bar__back {
    transition: none;
  }
}

/* Closing line at the foot of every page: "(c) <year> genxmichael | Privacy and Copyright", set
   against the same right edge as the bar at the top. The link goes to the one privacy and
   copyright page, which lives on genxmichael.com. On the Star Wars site tools/site-bar.py stamps
   the line; on the MOTU site it is in templates/entry-page.html and site/index.html. It is a div
   with its own classes so no page stylesheet's footer or link rules reach it. The year in the
   markup is a fallback: the one-line script beside it shows the current year. */
.gxm-foot {
  clear: both;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  /* Right edge: the bar's inner box is 1336px wide at most, with 16 to 48px of padding. */
  padding: 14px max(clamp(16px, 4vw, 48px), calc(50% - 620px), env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #070c1a;
  color: rgba(247, 240, 228, 0.62);
  color-scheme: dark;
  text-align: right;
  font: 600 0.8rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  text-transform: none;
}

.gxm-foot .gxm-foot__year {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
}

.gxm-foot .gxm-foot__link {
  display: inline-block;
  margin: 0;
  padding: 6px 0;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  color: rgba(247, 240, 228, 0.86);
  background: none;
  text-decoration: none;
}

.gxm-foot .gxm-foot__link:hover,
.gxm-foot .gxm-foot__link:focus-visible {
  color: #f7f0e4;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gxm-foot .gxm-foot__link:focus-visible {
  outline: 2px solid #8fd5ff;
  outline-offset: 3px;
  border-radius: 2px;
}

@media print {
  .gxm-foot {
    display: none;
  }
}
