/*
 * Shared cross-app navigation menu.
 *
 * Consumed identically by Next.js (via @import in a SCSS module) and Django
 * (via WhiteNoise staticfiles). The dropdown relies on the native
 * <details>/<summary> element, so no JavaScript is needed.
 *
 * All selectors are scoped under .bsr-nav to avoid clashing with host styles.
 */

.bsr-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    margin: 8px;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
}

.bsr-nav summary {
    list-style: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background-color: #4a6741;
    color: #f5f7f4;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background-color 120ms ease;
}

.bsr-nav summary::-webkit-details-marker {
    display: none;
}

.bsr-nav summary:hover,
.bsr-nav[open] summary {
    background-color: #5a7a51;
}

.bsr-nav summary:focus-visible {
    outline: 2px solid #9fca38;
    outline-offset: 2px;
}

.bsr-nav__icon {
    width: 20px;
    height: 20px;
}

.bsr-nav__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    padding: 6px;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/*
 * Text colors are marked !important so the widget stays legible inside hosts
 * that style links via an ID selector. The Django admin, for instance, sets
 * `#header a:link { color: var(--header-link-color) }` (specificity 1,1,1),
 * which a plain `.bsr-nav__item` (0,1,0) cannot override — leaving menu links
 * white-on-white. !important is the only single-file way to win without
 * leaking the host's IDs into this shared stylesheet.
 */
.bsr-nav__item {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    color: #2d2d2d !important;
    text-decoration: none;
    transition: background-color 100ms ease;
}

.bsr-nav__item:hover {
    background-color: #f0f4ee;
}

.bsr-nav__item.is-active {
    background-color: #4a6741;
    color: #f5f7f4 !important;
    font-weight: 600;
}

.bsr-nav__item.is-active:hover {
    background-color: #4a6741;
}

.bsr-nav__item.is-disabled {
    color: #a0a0a0 !important;
    cursor: not-allowed;
    pointer-events: none;
}
