/* The one site menu (scripts/site-menu.mjs). Every rule is scoped to it so the
   page's own styles for links, lists and buttons never reach it. */
.site-menu {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  border-bottom: 1px solid #2c405c;
  background: rgba(5, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  /* Pixel sizes: the menu is the same height on every page, whatever the
     page's own root font size. */
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 20px;
}
/* Over a full-window picture the menu floats and stays out of its way, then
   turns solid once the picture scrolls away. */
.site-menu[data-over-art] {
  position: fixed;
  inset: 0 0 auto 0;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(5, 13, 26, 0.7), transparent);
  backdrop-filter: none;
  transition: background-color 0.3s ease-out;
}
.site-menu[data-over-art][data-solid],
.site-menu[data-over-art][data-open] {
  background-color: rgba(5, 13, 26, 0.94);
  backdrop-filter: blur(12px);
}
.site-menu nav {
  display: flex;
  align-items: center;
  gap: 0.6rem 1.8rem;
  margin: 0;
  padding: 14px clamp(20px, 4vw, 56px);
}
/* Resets the page's own `nav a` rules (the library styles its chapter list
   that way); this file loads last, so it wins ties. */
.site-menu nav a {
  display: inline-block;
  grid-template-columns: none;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #e7eef8;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
  font-weight: 600;
}
.site-menu a:focus-visible,
.site-menu button:focus-visible {
  outline: 2px solid #f4bd69;
  outline-offset: 5px;
}
.site-menu .site-menu-home {
  margin-right: auto;
  font-weight: 700;
  white-space: nowrap;
}
.site-menu .site-menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-menu .site-menu-links li {
  margin: 0;
  padding: 0;
  border: 0;
}
.site-menu .site-menu-links a {
  opacity: 0.86;
}
.site-menu .site-menu-links a:hover {
  color: #f4bd69;
  opacity: 1;
}
/* The page you are on. */
.site-menu .site-menu-links a[aria-current="page"] {
  color: #f4bd69;
  opacity: 1;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}
/* Play free: the site's cut-corner amber plate, small. */
.site-menu .site-menu-play {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(
    180deg,
    #ffe4ad,
    #f7c46f 47%,
    #e9993a 53%,
    #f3b45a
  );
  clip-path: polygon(
    8px 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0 calc(100% - 8px),
    0 8px
  );
  color: #1b1305;
  font-family: "Sunward Display", Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-menu .site-menu-play:hover {
  color: #1b1305;
  filter: brightness(1.1);
}
.site-menu .site-menu-toggle {
  display: none;
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #5d7190;
  border-radius: 4px;
  background: transparent;
  color: #e7eef8;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Phones: the name, Play free and a Menu button; the links open below. */
@media (max-width: 760px) {
  .site-menu {
    font-size: 14px;
  }
  .site-menu nav {
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
    padding: 12px 16px;
  }
  .site-menu .site-menu-play {
    padding: 8px 14px;
    font-size: 13px;
  }
  .site-menu[data-ready] .site-menu-play {
    order: 1;
  }
  .site-menu[data-ready] .site-menu-toggle {
    display: inline-block;
    order: 2;
  }
  .site-menu[data-ready] .site-menu-links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-top: 0.4rem;
  }
  .site-menu[data-ready][data-open] .site-menu-links {
    display: flex;
  }
  .site-menu[data-ready] .site-menu-links a {
    display: block;
    padding: 0.85rem 0;
    border-top: 1px solid #2c405c;
    font-size: 16px;
  }
}
