/* ==========================================================================
   Slotty House — "On this page" bar
   Loaded only on article views (slot / live / game / free-spins reviews and
   guides) that have at least three sections. See inc/toc.php.
   ========================================================================== */

.sh-tocbar {
  position: sticky;
  top: 64px;                 /* sits directly under the fixed navbar */
  z-index: 500;              /* under the navbar (9999), over the page */
  margin-top: 64px;          /* clears the navbar in normal flow */
  background: hsla(220, 15%, 8%, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

/* Follow the navbar down when the WP admin bar is showing */
.admin-bar .sh-tocbar {
  top: 96px;
}

@media screen and (max-width: 782px) {
  .admin-bar .sh-tocbar {
    top: 110px;
  }
}

.sh-tocbar-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: stretch;
  gap: 14px;
}

@media (min-width: 1024px) {
  .sh-tocbar-inner {
    padding: 0 24px;
  }
}

.sh-tocbar-label {
  flex: none;
  align-self: center;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  white-space: nowrap;
}

/* The chips scroll, the label does not */
.sh-tocbar-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.sh-tocbar-scroll::-webkit-scrollbar {
  display: none;
}

/* Fade whichever edge has more chips behind it, so a clipped label reads as
   "scroll me" rather than as broken text. Classes come from js/toc.js. */
.sh-tocbar-scroll.has-fade-start {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px);
  mask-image: linear-gradient(to right, transparent 0, #000 28px);
}

.sh-tocbar-scroll.has-fade-end {
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px);
  mask-image: linear-gradient(to left, transparent 0, #000 28px);
}

.sh-tocbar-scroll.has-fade-start.has-fade-end {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.sh-tocbar-list {
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: max-content;
}

.sh-tocbar-link {
  display: block;
  padding: 13px 10px 11px;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted-fg);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.sh-tocbar-link:hover,
.sh-tocbar-link:focus-visible {
  color: var(--fg);
}

.sh-tocbar-link.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

@media (max-width: 640px) {
  .sh-tocbar-label {
    display: none;
  }
  .sh-tocbar-link {
    font-size: 0.75rem;
  }
}

/* ---------- Page shells: the bar has already cleared the navbar ---------- */
.sh-tocbar + .sh-slot-page,
.sh-tocbar + .sh-fs-page {
  padding-top: 24px;
}

.sh-tocbar + .sh-guidepage {
  margin-top: 0;
}

/* ---------- Anchor landing offset ---------- */
.sh-slot-article h2[id],
.sh-guide-article h2[id],
.sh-fs-article h2[id],
.sh-slot-faq[id],
.sh-guide-faq[id],
.sh-fs-faq[id] {
  scroll-margin-top: 124px;
}

.admin-bar .sh-slot-article h2[id],
.admin-bar .sh-guide-article h2[id],
.admin-bar .sh-fs-article h2[id],
.admin-bar .sh-slot-faq[id],
.admin-bar .sh-guide-faq[id],
.admin-bar .sh-fs-faq[id] {
  scroll-margin-top: 156px;
}
