%sidebar-row {
    &:hover {
        background-color: rgba(white, 0.75);

        @if $color-scheme == "dark" {
            background-color: rgba(white, 0.05);
        }
    }

    &:selected,
    // GtkAssistant
    &.highlight {
        background-color: bg_color(4);
        color: $fg-color;
    }
}

.sidebar-pane,
.sidebar,
.sidebar.view,
.source-list {
    popover & {
        background: transparent;
    }

    &,
    list,
    .view {
        background-color: bg_color(3);
    }
}

.sidebar-pane,
.sidebar {
    &:dir(ltr) {
        border-right: 1px solid #{'@menu_separator'};
    }

    &:dir(rtl) {
        border-left: 1px solid #{'@menu_separator'};
    }

    paned.horizontal & {
        &:dir(ltr) {
            border-right: none;
        }
        &:dir(rtl) {
            border-left: none;
        }
    }

    row,
    // GtkAssistant
    > label {
        padding: rem(6px) rem(12px);

        @extend %sidebar-row;
    }
}

// Nested Adw.NavigationSplitView
.sidebar-pane .content-pane {
    background: bg_color(1);
}

placessidebar.frame,
placessidebar viewport.frame {
    border: none;

    .sidebar-icon {
        -gtk-icon-style: regular;
    }

    .sidebar-icon + .sidebar-label:dir(ltr),
    .sidebar-label + .sidebar-icon:dir(rtl) {
        margin-left: rem(6px);
    }
}

treeview.sidebar {
    .view {
        @extend %sidebar-row;
    }

    entry.flat {
        // to match row selection
        background-color: bg_color(4);
    }
}
