/* Persistent utility menu and navigation. */
html { scroll-padding-top: var(--site-header-height, 0px); }
.fixed-top-menu, .fixed-site-navbar { position: fixed; left: 0; right: 0; width: 100%; }
.fixed-top-menu { top: 0; z-index: 1031; }
.fixed-site-navbar { top: var(--top-menu-height, 0px); z-index: 1030; }
.site-header-spacer { height: var(--site-header-height, 0px); }
@media (max-width: 991.98px) {
  .fixed-site-navbar .navbar-collapse {
    max-height: calc(100vh - var(--site-header-height, 0px));
    max-height: calc(100dvh - var(--site-header-height, 0px));
    overflow-y: auto;
  }
}

/* A gentle entrance, with added depth once the page scrolls. */
.fixed-top-menu,
.fixed-site-navbar {
    animation: header-enter 450ms cubic-bezier(0.22, 1, 0.36, 1);
}
.fixed-site-navbar {
    transition: box-shadow 250ms ease;
}
.fixed-site-navbar.is-scrolled {
    box-shadow: 0 5px 18px rgba(63, 79, 35, 0.16);
}
@keyframes header-enter {
    from { translate: 0 -12px; }
    to { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .fixed-top-menu,
    .fixed-site-navbar {
        animation: none;
        transition: none;
    }
}

/* Back to top: logical positioning supports both language directions. */
.back-to-top {
    position: fixed;
    inset-inline-end: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 1020;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #4b6410;
    color: #fff;
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover { background: #3d5208; }
.back-to-top:focus-visible { outline: 3px solid #5e4939; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: none; transform: none; }
}
