/* nav-menu.css — floating chapter navigation FAB, shared across all site pages */

/* ── FAB button ─────────────────────────────────────────────── */
#nav-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #003366;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
    transition: background 0.2s;
    /* Ensure touch target is adequate */
    -webkit-tap-highlight-color: transparent;
}
#nav-fab:hover,
#nav-fab:focus {
    background: #004488;
    outline: 2px solid #fff;
    outline-offset: 2px;
}
#nav-fab[aria-expanded="true"] {
    background: #cc0000;
}

/* ── Backdrop ───────────────────────────────────────────────── */
#nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1001;
}
#nav-backdrop.open {
    display: block;
}

/* ── Panel ──────────────────────────────────────────────────── */
#nav-panel {
    display: none;
    position: fixed;
    bottom: 78px;
    right: 16px;
    z-index: 1002;
    width: 310px;
    max-height: 72vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    font-family: Arial, sans-serif;
    font-size: 13px;
}
#nav-panel.open {
    display: block;
}

/* Narrow screens: expand to near full width */
@media (max-width: 360px) {
    #nav-panel {
        width: calc(100vw - 24px);
        right: 12px;
    }
}

/* ── Panel header ───────────────────────────────────────────── */
#nav-panel-header {
    background: #003366;
    color: #fff;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
}
#nav-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
#nav-panel-close:hover { color: #ffcccc; }

/* ── Column headers ─────────────────────────────────────────── */
.nav-col-headers {
    display: grid;
    grid-template-columns: 1fr 60px 68px;
    gap: 0;
    padding: 4px 10px;
    background: #e8f0fb;
    font-size: 11px;
    font-weight: bold;
    color: #003366;
    border-bottom: 1px solid #ccc;
    position: sticky;
    top: 33px;
}

/* ── Nav rows ───────────────────────────────────────────────── */
.nav-row {
    display: grid;
    grid-template-columns: 1fr 60px 68px;
    gap: 0;
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
    line-height: 1.3;
}
.nav-row:last-child { border-bottom: none; }
.nav-row:hover { background: #f0f5ff; }

/* Current page — grayed out */
.nav-row.current-page {
    background: #f0f0f0;
    color: #888;
}

.nav-row-label {
    color: #222;
    font-size: 12px;
    padding-right: 6px;
}
.nav-row.current-page .nav-row-label {
    color: #888;
}

/* Divider row for Addenda and Index */
.nav-divider {
    padding: 3px 10px;
    background: #f5f5f5;
    font-size: 11px;
    font-weight: bold;
    color: #555;
    border-bottom: 1px solid #ddd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Link cells */
.nav-row a {
    display: block;
    text-align: center;
    padding: 3px 4px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    background: #004488;
}
.nav-row a:hover { background: #0066cc; }
.nav-row a.self-test-link { background: #006633; }
.nav-row a.self-test-link:hover { background: #008844; }
.nav-row a.index-link {
    background: #555;
    grid-column: 2 / 4;
}
.nav-row a.index-link:hover { background: #333; }

/* Disabled/current link */
.nav-row a.current-link {
    background: #bbb;
    cursor: default;
}
/* Prevent horizontal overflow from displacing fixed-position elements on mobile */
.html {
    overflow-x: clip;
}
