.form-nav-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: sticky;
    top: 40px;
    height: 50px;
    background-color: var(--element_contrast);
    padding: 8px 0;
    box-shadow: 0 2px 5px var(--element_shadow_dark);
    z-index: 149;
    display: none; /* Hide by default on large screens */
}

.form-nav-vertical {
    position: fixed;
    width: 220px;
    height: 100vh;
    padding: 15px;
    overflow-y: auto;
    z-index: 99;
    display: block;
    background-color: var(--element_contrast);
    box-shadow: 0 4px 8px var(--element_shadow_dark);
}

.side-nav {}

.side-nav a {
    border-radius: 10px;
    padding: var(--small-padding);
    text-decoration: none;
    font-size: var(--fs-sm);       /* was .9em */
    font-weight: var(--fw-regular);
    color: var(--Default_Text);
    display: inline-block;
    margin: 0 5px;
    white-space: nowrap;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.side-nav a:hover,
.side-nav a.active {
    background-color: #ddd;
    box-shadow: 0 2px 10px #ddd;
}

/* Floating Vertical Sidebar */
.side-nav-vertical {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 20px;
    width: 220px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Sidebar Title */
.side-nav-vertical h3 {
    font-family: var(--font-main);
    font-size: var(--fs-lg);       /* was 1.2rem */
    font-weight: var(--fw-medium);
    color: var(--navy);
    text-align: left;
    margin-bottom: 0.5em;
}

/* Sidebar Sections */
.nav-section {
    margin-bottom: 10px;
}

/* Sidebar Links */
.side-nav-vertical a {
    font-family: var(--font-main);
    font-size: var(--fs-md);       /* was 1.1rem */
    font-weight: var(--fw-regular);
    color: var(--Default_Text);
    white-space: normal;
}

/* Hover & Active State */
.side-nav-vertical a:hover,
.side-nav-vertical a.active,
.side-nav a.active {
    background-color: #bbb;
    color: #fff;
    font-weight: var(--fw-medium);
}

/* Sub-menu for H2 items */
.sub-menu {
    list-style: none;
    padding-left: 10px;
    margin: 5px 0 10px;
    margin-top: 2px;
}

.sub-menu li {
    margin-bottom: 5px;
}

.sub-menu a {
    font-size: var(--fs-sm);       /* was 0.75em */
    font-weight: var(--fw-regular);
    color: #666;
    padding: 5px 8px;
    display: block;
    border-radius: 3px;
    transition: background 0.3s ease;
    margin-bottom: 2px;
}

/* Hover & Active State for H2 links */
.sub-menu a:hover,
.sub-menu a.active {
    background-color: #e0e0e0;
    color: #000;
}

/* Responsive Behavior */
@media (max-width: 1200px) {
    .form-nav-horizontal {
        display: flex;
    }

    .form-nav-vertical {
        display: none;
    }
    
    .side-nav-vertical {
        position: absolute;
        width: 100%;
        left: 0;
        top: auto;
        bottom: 0;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .side-nav-vertical a {
        flex: 1;
        text-align: center;
    }
}
