body { scroll-behavior: smooth; }

/* Keep the logo tidy in the navbar */
.navbar-brand img { height: 40px; width: auto; }

/* Footer link hover */
footer .nav-link:hover { text-decoration: underline; }

/* Base: both anchors and the logout button-link */
.navbar .navbar-nav a.nav-link,
.navbar .navbar-nav .btn-link.nav-link {
  position: relative;
  text-decoration: none !important;
}

/* The underline line */
.navbar .navbar-nav a.nav-link::after,
.navbar .navbar-nav .btn-link.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .2rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

/* Show underline on hover/focus/active for both */
.navbar .navbar-nav a.nav-link:hover::after,
.navbar .navbar-nav a.nav-link:focus::after,
.navbar .navbar-nav a.nav-link.active::after,
.navbar .navbar-nav .btn-link.nav-link:hover::after,
.navbar .navbar-nav .btn-link.nav-link:focus::after,
.navbar .navbar-nav .btn-link.nav-link:active::after {
  transform: scaleX(1);
}

/* Mobile/collapsed navbar: make underline match text width */
@media (max-width: 991.98px) { /* Bootstrap lg breakpoint */
  .navbar .navbar-nav .nav-link,
  .navbar .navbar-nav .btn-link.nav-link {
    display: inline-block;  /* not full-width */
    padding-left: 0;
    padding-right: 0;
  }

  /* Keep the underline just under the text */
  .navbar .navbar-nav .nav-link::after {
    left: 0;
    right: auto;   /* don't stretch across the full row */
    width: 100%;
  }
}

/* Pretty accordion arrows */
.accordion-button::after { transition: transform .2s ease; }
.accordion-button:not(.collapsed)::after { transform: rotate(-180deg); }