/* "Scroll with you" section bar for long Journal posts (see post-section-nav.js). */
.post-section-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1150;
  width: min(820px, calc(100vw - 340px));
  padding: 7px;
  border: 1px solid rgba(61, 28, 25, .14);
  border-radius: 999px;
  background: rgba(251, 248, 243, .96);
  box-shadow: 0 16px 40px rgba(34, 19, 17, .16);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.post-section-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.post-section-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.post-section-track::-webkit-scrollbar { display: none; }
.post-section-track a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid rgba(61, 28, 25, .14);
  border-radius: 999px;
  background: var(--paper, #fbf8f3);
  color: rgba(33, 26, 24, .76);
  font: 700 9px/1 var(--sans, Montserrat, Arial, sans-serif);
  letter-spacing: .11em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: center;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.post-section-track a:hover { border-color: var(--wine, #6f1620); color: var(--wine, #6f1620); }
.post-section-track a.active,
.post-section-track a[aria-current="location"] { background: var(--wine, #6f1620); border-color: var(--wine, #6f1620); color: var(--paper, #fbf8f3); }
.post-section-track a:focus-visible { outline: 2px solid var(--wine, #6f1620); outline-offset: 2px; }
body.chat-open .post-section-bar { opacity: 0; pointer-events: none; }

@media (max-width: 820px) {
  body.has-post-section-bar { padding-bottom: 72px; }
  .post-section-bar {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: 0 -14px 34px rgba(34, 19, 17, .12);
    transform: translateY(100%);
  }
  .post-section-bar.show { transform: none; }
  .post-section-track { padding: 0 12px; gap: 7px; }
  .post-section-track a { min-height: 42px; font-size: 8px; }
  body.has-post-section-bar .ask-tab { bottom: 80px !important; }
  body.has-post-section-bar .global-scroll-top { bottom: 136px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .post-section-bar, .post-section-track a { transition: none; }
}
