/* Copyright 2026 Geser Dugarov */
/* SPDX-License-Identifier: Apache-2.0 */
.navbar.fixed-top {
    --bs-navbar-color: #fff4eb;
    background-color: #b84a14 !important;
    background-image: none;
}

.navbar.fixed-top .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.15);
}

.navbar.fixed-top nav[aria-label="Site"] .nav-link.active,
.navbar.fixed-top nav[aria-label="Site"] .nav-link:hover,
.navbar.fixed-top nav[aria-label="Site"] .nav-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.3em;
}

.navbar.fixed-top .dropdown-menu {
    --bs-dropdown-link-active-bg: #b84a14;
    --bs-dropdown-link-hover-bg: #b84a14;
}

/* Links take the top bar's hue. The bar's own colour clears 4.5:1 against the light page and its striped table rows,
   but not against the dark page, which gets a lighter tint of it instead. */
:root,
[data-bs-theme="light"] {
    --bs-link-color: #b84a14;
    --bs-link-color-rgb: 184, 74, 20;
    --bs-link-hover-color: #933c10;
    --bs-link-hover-color-rgb: 147, 60, 16;
}

[data-bs-theme="dark"] {
    --bs-link-color: #ec8451;
    --bs-link-color-rgb: 236, 132, 81;
    --bs-link-hover-color: #f1a57e;
    --bs-link-hover-color-rgb: 241, 165, 126;
}

.ai-chat-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
}

.ai-chat-button {
    display: inline-flex;
    border-radius: 6px;
}

.ai-chat-button:hover {
    filter: brightness(1.3);
}

.navbar.fixed-top .navbar-brand:focus-visible,
.navbar.fixed-top .nav-link:focus-visible,
.ai-chat-button:focus-visible {
    box-shadow: none;
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.ai-chat-button img {
    display: block;
}

/* Keep focus outlines inside the collapsed menu's scrolling box. */
@media (max-width: 1199.98px) {
    .navbar.fixed-top .nav-link {
        padding-inline: 0.5rem;
    }

    .navbar.fixed-top .nav-link:focus-visible {
        outline-offset: -2px;
    }
}

/* Keep the full navigation in the collapsed menu until both AI buttons fit. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar.fixed-top.navbar-expand-lg > .container {
        flex-wrap: wrap;
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-toggler {
        display: block;
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-collapse {
        display: block !important;
        flex-basis: 100%;
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-collapse.collapse:not(.show) {
        display: none !important;
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-collapse.show {
        overflow-y: auto;
        max-height: calc(100vh - 3.5rem);
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-nav {
        flex-direction: column;
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-nav .dropdown-menu {
        position: static;
    }

    .navbar.fixed-top.navbar-expand-lg .navbar-collapse .d-lg-none {
        display: inline !important;
    }
}
