
/* --- INITIAL STATE (Before 50px Scroll) --- */
.sticky-top {
  position: relative;
  top: 0;
  z-index: 1020;
}

/* --- STICKY STATE (After 50px Scroll) --- */

/* 1. Logged Out User: Sticks exactly at the top (top: 0px) */
.sticky-top.is-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
}

/* 2. Logged In User (Desktop): Sticks 30px down below the Admin Bar */
/* (32px Admin Bar + 30px Offset = top: 62px) */
body.admin-bar .sticky-top.is-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 30px;
}

/* 3. Logged In User (Mobile screens 782px and below) */
/* (46px Mobile Admin Bar + 30px Offset = top: 76px) */
@media screen and (max-width: 782px) {
  body.admin-bar .sticky-top.is-sticky {
    top: 0;
  }
}

/* Ensure dropdown-menu.show is visible */
.dropdown-menu { display: none; }
.dropdown-menu.show { display: block; }

/* Position nested submenu to the right */
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: .1rem;
  min-width: 12rem;
}

/* Prevent clipping by parent containers */
.navbar, .navbar-collapse { overflow: visible; z-index: 1000; }

/* Optional: small transition */
.dropdown-menu { transition: opacity .12s ease; }

/* Back-To-Top Node Micro-Interactions */
#nt-back-to-top.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) translateY(0) !important;
}

#nt-back-to-top:hover {
    background-color: var(--bs-primary, #0d6efd) !important;
    transform: scale(1.1) translateY(-3px) !important;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2) !important;
}

#nt-back-to-top:hover svg {
    transform: translateY(-2px);
}

#nt-back-to-top:active {
    transform: scale(0.95) translateY(0) !important;
}

/* Accessible utility rule for focus validation states */
#nt-back-to-top:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 3px;
}