/**************
 ! GTK settings
***************/

* {
    -GtkWindow-resize-grip-height: 0;
    -GtkWindow-resize-grip-width: 0;
    -WnckTasklist-fade-overlay-rect: 0;

    -GtkWidget-cursor-aspect-ratio: $caret_aspect_ratio;

    outline-color: alpha($selected_bg_color, .5);
    outline-style: dashed;
    outline-width: 1px;
    outline-offset: -1px;
    -gtk-outline-radius: $roundness;
}


/*************
 ! Base states
 *************/

%selected {
    &, &:focus {
        background-color: $selected_bg_color;
        color: $selected_fg_color;
    }
}

* {
    /* hyperlinks */
    -GtkIMHtml-hyperlink-color: $link_color;

    &:selected { @extend %selected; }

    &:disabled,
    &:disabled:disabled { color: mix($fg_color, $bg_color, .5); }

    &:disabled, &:disabled { -gtk-icon-effect: dim; }

    &:hover { -gtk-icon-effect: highlight; }

    &:link, &:visited { color: $link_color; }
}

.background {
    background-color: $bg_color;
    color: $fg_color;

    &:backdrop {
        text-shadow: none;
        -gtk-icon-shadow: none;
    }

    &.csd { background-color: $bg_color; }
}

.gtkstyle-fallback {
    background-color: alpha($bg_color, .5);
    color: $fg_color;

    &:hover {
        background-color: shade($bg_color, 1.1);
        color: $fg_color;
    }

    &:active {
        background-color: shade($bg_color, .9);
        color: $fg_color;
    }

    &:disabled {
        background-color: shade(shade($bg_color, .95), 1.05);
        color: mix($fg_color, $bg_color, .5);
    }

    &:selected { @extend %selected; }
}

image, label, box, grid {
    &, &:disabled { background-color: transparent; }
}

label {
    &.separator {
        @extend .dim-label;

        color: $fg_color;

        &:backdrop { color: $backdrop_fg_color; }
    }

    row:selected &,
    &:selected { @extend %nobg_selected_items; }

    selection {
        background-color: $selected_bg_color;
        color: $selected_fg_color;
    }

    &:disabled {
        color: $insensitive_fg_color;

        selection { @extend %selected_items:disabled; }

        &:backdrop { color: $backdrop_insensitive_color; }
    }

    &:backdrop {
        color: $backdrop_fg_color;

        selection { @extend %selected_items:backdrop; }
    }
}

assistant {
    .sidebar {
        background-color: $base_color;
        border-top: 1px solid $borders_color;

        &:backdrop {
            background-color: $backdrop_base_color;
            border-color: $backdrop_borders_color;
        }
    }

    &.csd .sidebar { border-top-style: none; }

    .sidebar label { padding: $spacing ($spacing * 2); }

    .sidebar label.highlight { background-color: mix($fg_color, $bg_color, .8); }
}
