/* CE | Оформление закреплённых меню | вынесено из o_html_footer 20.09.2026; логика сохранена. */

/* Celestial Eclipse: both navigation menus stay available after the header. */
.punbb #pun-navlinks {
  position: sticky;
  top: 0;
  z-index: 1100;
}

.punbb #pun-navlinks.ce-nav-stuck {
  background-color: var(--pun-bg, #e1d1cb);
}

@media (min-width: 541px) {
  .punbb #pun-navlinks > .container {
    padding-top: 1px;
    padding-bottom: 1px;
  }

  .punbb #pun-ulinks > .container {
    padding-top: 0;
    padding-bottom: 0;
  }

  .punbb #pun-ulinks {
    position: sticky;
    top: var(--ce-nav-height, 42px);
    z-index: 1090;
  }

  .punbb #pun-ulinks.ce-nav-stuck {
    background: var(--pun-bg, #e1d1cb);
    box-shadow: 0 4px 6px -5px rgba(52, 38, 72, .45);
  }
}

@media (max-width: 540px) {
  .punbb #pun-navlinks > .container {
    min-height: 24px;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
  }

  .punbb #pun-navlinks > .container > li {
    padding-left: 4px;
    padding-right: 4px;
  }

  /* Keep the existing icon row and hamburger together, including wrapped rows. */
  .punbb #pun-ulinks {
    position: sticky;
    top: 0;
    z-index: 1110;
    height: 24px;
    margin-top: -24px;
  }

  .punbb #pun-ulinks:focus-within > ul {
    display: block;
  }

  .punbb #pun-ulinks > ul {
    top: 24px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    max-width: calc(100vw - 10px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.punbb .post[id] {
  scroll-margin-top: calc(var(--ce-sticky-height, 70px) + 8px);
}
