/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2016 Michael Gratton <mike@vee.net>
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later). See the COPYING file in this distribution.
 */

/*
 * Since GTK+ 3.20 introduced some significant breaking changes to CSS
 * node names for styling GTK+ widgets, we need to duplicate selectors
 * that either either refer to a widget by node name (e.g. "GtkLabel"
 * vs "label"), or that referrs to any child nodes introduced by 3.20
 * (e.g. "frame > border").
 */

.geary-folder-frame, /* GTK < 3.20 */
.geary-folder-frame > border {
  border-left-width: 0;
  border-top-width: 0;
  border-right-width: 0;
}
.geary-conversation-frame, /* GTK < 3.20 */
.geary-conversation-frame > border {
  border-left-width: 0;
  border-top-width: 0;
  border-right-width: 0;
}
/* For 3-pane mode only */
.geary-sidebar-pane-separator.vertical .conversation-frame, /* GTK < 3.20 */
.geary-sidebar-pane-separator.vertical .conversation-frame > border {
  border-bottom-width: 0;
}

.geary-composer-box, /* GTK < 3.20 */
.geary-composer-box > border {
  border-width: 0px;
}
.geary-composer-body, /* GTK < 3.20 */
.geary-composer-body > border {
  border-left-width: 0;
  border-right-width: 0;
  border-bottom-width: 0;
}

.geary-titlebar-left:dir(ltr),
.geary-titlebar-right:dir(rtl) {
  border-top-right-radius: 0px;
}
.geary-titlebar-right:dir(ltr),
.geary-titlebar-left:dir(rtl) {
  border-top-left-radius: 0px;
}

/* FolderPopover */

.list-row.geary-folder-popover-list-row, /* GTK < 3.20 */
row.geary-folder-popover-list-row {
  padding: 6px;
  border-color: @borders;
  border-style: groove;
  border-bottom-width: 1px;
}
.list-row.geary-folder-popover-list-row > GtkLabel, /* GTK < 3.20 */
row.geary-folder-popover-list-row > label {
  color: @theme_text_color;
}

/* ConversationListBox */

.conversation-listbox {
  padding: 18px;
}
.conversation-listbox > .list-row, /* GTK < 3.20 */
.conversation-listbox > row {
  margin: 0;
  border: 1px solid @borders;
  border-bottom-width: 0;
  padding: 0;
  box-shadow: 0 4px 8px 1px rgba(0,0,0,0.4);
  transition: margin 0.1s;
}
.conversation-listbox > .list-row > GtkBox, /* GTK < 3.20 */
.conversation-listbox > row > box {
  background: @theme_base_color;
  transition: background 0.25s;
}
.conversation-listbox > .list-row:hover > GtkBox, /* GTK < 3.20 */
.conversation-listbox > row:hover > box {
  background: shade(@theme_base_color, 0.96);
}
.conversation-listbox > .list-row.geary-expanded, /* GTK < 3.20 */
.conversation-listbox > row.geary-expanded {
  margin-bottom: 6px;
  border-bottom-width: 1px;
}
.conversation-listbox *.geary-matched *.geary-match {
  color: @theme_selected_fg_color;
  background: @theme_selected_bg_color;
}
.conversation-listbox > .list-row.geary-last, /* GTK < 3.20 */
.conversation-listbox > row.geary-last {
  margin-bottom: 0;
}

/* ConversationEmail */

.geary-unread, ConversationMessage, /* GTK < 3.20 */
.geary-unread grid.geary-message-summary {
  border-color: @theme_selected_bg_color;
  transition: border 0.25s;
}

/* ConversationMessage */

ConversationMessage, /* GTK < 3.20 */
grid.geary-message-summary {
  border-top: 4px solid transparent;
  padding: 12px;
  padding-top: 8px;
  transition: border 4s;
}

.geary-headers GtkLabel, /* GTK < 3.20 */
.geary-headers label {
  margin: 0;
  padding: 1px;
}
.geary-headers GtkLabel.geary-header, /* GTK < 3.20 */
.geary-headers label.geary-header {
  padding-right: 6px;
}
.geary-headers GtkFlowBox > *, /* GTK < 3.20 */
.geary-headers flowboxchild {
  margin: 0;
  padding: 1px;
}
.geary-headers GtkFlowBox > * GtkLabel, /* GTK < 3.20 */
.geary-headers flowboxchild label {
  margin: 0;
  padding: 0;
}

.geary-headers GtkLabel.geary-from, /* GTK < 3.20 */
.geary-headers label.geary-from {
  font-weight: bold;
}

.geary-header-value > *:active, /* GTK < 3.20 */
.geary-header-value > flowboxchild:active {
  background: mix(@theme_base_color, @theme_bg_color, 0.5);
}

.geary-header-value > *:hover, /* GTK < 3.20 */
.geary-header-value > flowboxchild:hover {
  background: @theme_base_color;
}

.geary-header-value > * GtkLabel.dim-label, /* GTK < 3.20 */
.geary-header-value > flowboxchild label.dim-label {
  padding-left: 6px; /* Would be margin-left, but GTK 3.14 doesn't like it */
}

.geary-submessages .geary-message {
  background-image: linear-gradient(rgba(0,0,0,0.2), @bg_color 6px);
}

/* Composer */

.geary-composer-embed GtkHeaderBar, /* GTK < 3.20 */
.geary-composer-embed headerbar {
  border-top: 1px solid @borders;
  border-radius: 0px;
}

/* EmptyPlaceholder */

.geary-empty-placeholder > GtkImage, /* GTK < 3.20 */
.geary-empty-placeholder > image {
  margin-bottom: 12px;
}
.geary-empty-placeholder > .title {
  font-weight: bold;
}
