// Deprecated: use .navigation-sidebar instead
.sidebar {
  &:not(separator) {
    &:dir(ltr),
    &.left,
    &.left:dir(rtl) {
      border-right: 1px solid $border_color;
      border-left-style: none;
    }

    &:dir(rtl),
    &.right {
      border-left: 1px solid $border_color;
      border-right-style: none;
    }
  }

  listview.view,
  list {
    background-color: transparent;
    color: inherit;
  }

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

stacksidebar row {
  padding: 10px 4px;
  @include focus-ring();

  > label {
    padding-left: 6px;
    padding-right: 6px;
  }

  &.needs-attention > label {
    @extend %needs_attention;
    background-size: 6px 6px, 0 0;
  }
}

separator.sidebar {
  background-color: $border_color;
}

/**********************
 * Navigation Sidebar *
 **********************/

.navigation-sidebar {
  &, &.view {
    background-color: transparent;
    color: inherit;
  }

  &.background {
    background-color: $window_bg_color;
    color: $window_fg_color;
  }

  padding: $menu-margin 0; //only vertical padding. horizontal row size would clip

  > separator {
    margin: $menu-margin;
  }

  > row {
    min-height: 36px;
    padding: 0 8px;
    border-radius: $menu_radius;
    margin: 0 $menu_margin 2px;

    @if $contrast == 'high' {
      &.activatable:hover,
      &.activatable:active,
      &.activatable.has-open-popup,
      &:selected {
        box-shadow: inset 0 0 0 1px $border_color;
      }
    }
  }
}

/********************
 * GtkPlacesSidebar *
 ********************/

$_placesidebar_icons_opacity: 0.7;

row image.sidebar-icon { opacity: $_placesidebar_icons_opacity; } // dim the sidebar icons
                                                                  // see bug #786613 for details
                                                                  // on this oddity

/* this should be more generic, only using .navigation-sidebar
   https://gitlab.gnome.org/GNOME/gtk/-/issues/2929
*/

placessidebar {
  .navigation-sidebar > row {
    // Needs overriding of the `.navigation-sidebar > row` padding
    padding: 0;

    // Using margins/padding directly in the SidebarRow
    // will make the animation of the new bookmark row jump
    > revealer { padding: 0 14px; }

    image.sidebar-icon {
      &:dir(ltr) { padding-right: 8px; }
      &:dir(rtl) { padding-left: 8px; }
    }

    label.sidebar-label {
      &:dir(ltr) { padding-right: 2px; }
      &:dir(rtl) { padding-left: 2px; }
    }

    @at-root button.sidebar-button {
      @extend %button_basic_flat;

      min-height: 26px;
      min-width: 26px;
      margin-top: 3px;
      margin-bottom: 3px;
      padding: 0;
      border-radius: 100%;
    }

    // in the sidebar case it makes no sense to click the selected row
    &:selected:active { box-shadow: none; }

    &.sidebar-placeholder-row {
      padding: 0 8px;
      min-height: 2px;
      background-image: image($drop_target_color);
      background-clip: content-box;
    }

    &.sidebar-new-bookmark-row { color: $accent_color; }

    &:drop(active):not(:disabled) {
      color: $drop_target_color;
      box-shadow: inset 0 0 0 1px $drop_target_color;
    }
  }
}
