/* Copyright 2014 Sam Hewitt.
*
* This file is part of the Orchis GTK theme.
*
* The Orchis GTK theme is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* The Orchis GTK theme is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the Orchis GTK theme. If not, see http://www.gnu.org/licenses/.
*/


/*********
 * Frame *
 *********/

.frame {
    background-color: transparent;
    border: 1px solid @border;
    color: @foreground;
}

.frame:backdrop {
    border-color: @backdrop_border;
    background-color: @backdrop_background;
    color: @backdrop_text;
}

.frame:insensitive {
    border-color: @insensitive_border;
    background-color: transparent;
    color: @insensitive_text;
}

/*************************
 * Basic Window Elements *
 *************************/

/* Some of these are deprecated but still cause theme errors. */
GtkVBox,
GtkDialog,
GtkStatusbar,
GtkEventBox,
GtkPaned,
GtkViewport,
GtkScrolledWindow,
GtkWindow {
    color: @foreground;
    background-color: @background;
}

GtkDialog:backdrop,
GtkVBox:backdrop,
GtkStatusbar:backdrop,
GtkEventBox:backdrop,
GtkPaned:backdrop,
GtkViewport:backdrop,
GtkScrolledWindow:backdrop,
GtkWindow:backdrop {
    color: @backdrop_text;
    background-color: @backdrop_background;
}

GtkVBox:insensitive,
GtkStatusbar:insensitive,
GtkEventBox:insensitive,
GtkPaned:insensitive,
GtkViewport:insensitive,
GtkScrolledWindow:insensitive,
GtkWindow:insensitive {
    color: @insensitive_text;
    background-color: @insensitive_background;
}

/********
 * View *
 ********/

.view {
    background-color: @base;
    color: @foreground;
    text-shadow: none;
}

.view:insensitive,
.view:insensitive:insensitive {
    background-color: @insensitive_background;
    color: @insensitive_text;
    border-color: @insensitive_border;
}

.view:backdrop,
.view:backdrop:backdrop {
    background-color: @backdrop_background;
    border-color:  @backdrop_border;
    color: @backdrop_text;
    text-shadow: none;
}

.view:selected,
.view:selected:focus {
    background-color: @selection;
    color: @selected_foreground;
}

.view:selected:backdrop,
.view:selected:backdrop:focus {
    background-color: @backdrop_background;
    color: @backdrop_text;
    text-shadow:none;
}

.view.separator {
    color: @border;
}

/* Selected */
.view.rubberband,
.rubberband {
    border: 1px solid shade(@selection, 0.9);
    border-radius: 4px;
    background-color: alpha(@selection, 0.3);
}

/************
 * Viewport *
 ************/
GtkViewport {
    color: @foreground;
}


GtkViewport.frame {
    background-color: @background;
}

/*******************
 * Scrolled Window *
 *******************/
GtkScrolledWindow {
    background-color: inherit;
}

GtkScrolledWindow.frame {
    border: 1px solid @border;
    background-color: @base;
}

/* To avoid double border when a viewport is packed into a GtkScrolledWindow */

GtkScrolledWindow GtkViewport.frame,
GtkPaned .frame,
GraniteWidgetsPopOver .frame,
GraniteWidgetsStaticNotebook .frame {
    border: none;
}

/************
 * List Box *
 ************/

GtkListBoxRow:selected,
.view:selected {
    background-color: @selection;
    color: white;
}

GtkListBoxRow:selected:backdrop, {
    background-color: @backdrop_background;
    color: @foreground;
}

GtkListBoxRow:selected:focus,
.view:selected:focus {
    background-color: @selection;
    color: @selected_foreground;
}

/* FIXME: This doesn't work with only-child

GtkListBoxRow:only-child {
    border-bottom: none;
    box-shadow: none;
}

GtkListBoxRow:first-child {
    border-bottom: solid 1px alpha(#fff, 0.04);
    box-shadow: inset 0 -1px shade(@base_color, 0.85);
}
*/

/************
 * Treeview *
 ************/

GtkTreeView.view.separator,
GtkTreeView.separator,
.separator,
.separator:hover {
    color: @border;
    background-color: @border;
}

GtkTreeView {
    -GtkTreeView-vertical-separator: 5px;
    -GtkTreeView-horizontal-separator: 6px;
    -GtkTreeView-expander-size: 8px;
    -GtkTreeView-grid-line-pattern: "\000\000";
}

GtkTreeView row:nth-child(even) {
    background-color: @base;
    color: @foreground;
}

GtkTreeView row:nth-child(odd) {
    background-color: shade(@base,0.96);
    color: @foreground;
}

GtkTreeView .entry {
    border-radius: 0;
}

GtkTreeView.dnd {
    border: 1px solid @selected_border;
    border-radius: 0;
}

GtkTreeView .entry {
    border-radius: 4px;
    background-color: @base;
    background-image: none;
}

/************
 * TextView *
 ************/

GtkTextView {
    background-color: @base;
    color: @foreground;
}

GtkTextView:backdrop {
    background-color: @backdrop_base;
    color: @backdrop_text;
}

GtkTextView:insensitive {
    background-color: @insensitive_base;
    color: @insensitive_text;
}

/************
 * Iconview *
 ************/
GtkIconView.view {
    background-color: @base;
    border: solid @selection;
    border-top-width: 1px;
    color: @foreground;
}
 
GtkIconView.view.cell:selected,
GtkIconView.view.cell:selected:focus {
    border: 1px solid @selection;
    border-radius: 4px;
    background:none;
    background-color: @selection;
    color: @selected_foreground;
}

GdMainIconView.content-view {
    -GdMainIconView-icon-size: 64px;
}

GtkIconView.content-view.check {
    background-color: transparent;
}

GtkIconView.content-view.check:active {
    background-color: transparent;
}

GtkIconView.content-view.check:prelight,
GtkIconView.content-view.check:insensitive,
GtkIconView.content-view.check:selected {
    background-color: transparent;
}


/****************
 * Content View *
 ****************/
.content-view.view {
    background-color: @base;
    color: @foreground;
}

.content-view.view:hover {
    background-color: alpha(@selection, 0.6);
}

.content-view.view:selected,
.content-view.view:active {
    background-color: @selection;
    background-image: none;
}

.content-view.view:insensitive {
    background-color: @insensitive_background;
}

.content-view.view:backdrop {
    background-color: @background_backdrop;
    background-image: none;
}

.content-view.view:selected:backdrop {
    background-color: @backdrop_selected_background;
    background-image: none;
}

.content-view.cell {
    background-color: transparent;
    background-image: none;
}

.content-view.view.check,
.content-view.view.check:active {
    background-color: transparent;
}

.content-view column-header .button {
    border-width: 0 0 1px 1px;

    background-image: linear-gradient(to bottom,
                              @button_gradient_a,
                              @button_gradient_b
                              );

    border-color: @border;
}

.content-view .title,
.content-view .option-title {
    color: @foreground;
    text-shadow: 0 1px alpha(#fff, 0.3);
}

.content-view .subtitle,
.content-view .option-description {
    color: alpha(@foreground, 0.7);
    text-shadow: 0 1px alpha(#fff, 0.4);
} 

/* Drawing area */
GtkDrawingArea {
    background-color: @base;
    color: @foreground;
}

GtkDrawingArea:backdrop {
    background-color: @backdrop_base;
    color: @backdrop_text;
}

GtkDrawingArea:insensitive {
    background-color: @insensitive_background;
}

/***********
 * gtkhtml *
 ***********/
GtkHTML {
    background-color: @base;
    color: @foreground;
}

GtkHTML:active:backdrop,
GtkHTML:backdrop {
    background-color: @backdrop_base;
    color: @backdrop_text;
}

/* needed for webkit/GtkStyle/Evolution compatibility */
GtkHTML:active,
GtkHTML:active:backdrop,
.entry:active,
.entry:active:backdrop {
    color: @backdrop_text;
    background-color: @backdrop_background;
    text-shadow:none;
}

.cursor-handle.top,
.cursor-handle.bottom {
    background-color: transparent;
    box-shadow: none;
    border-style: none;
    border-image: none;
    border-radius: 0px;
    border-width: 0px;

    /* background-image in assets */
}

