/**
 * Copyright 2020-2026 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
 * https://github.com/luigifab/human-theme
 *
 * Forked from
 *  Copyright 2020 | Mike Kazantsev (mk-fg) <mk~fraggod~gmail~com>
 *  https://github.com/mk-fg/clearlooks-phenix-humanity
 *
 * Forked from
 *  Copyright 2011-2014 | Jean-Philippe Fleury
 *  Copyright 2013-2014 | Andrew Shadura
 *  https://github.com/jpfleury/clearlooks-phenix
 *
 * This program is free software, you can redistribute it or modify
 * it under the terms of the GNU General Public License (GPL) as published
 * by the free software foundation, either version 3 of the license, or
 * (at your option) any later version.
 *
 * This program 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 (GPL) for more details.
 */

/* --- notebook --- */

notebook {
	margin: 1px 0;
	background-color: @nb_bg;
}

notebook stack {
	border: 1px solid @nb_border;
}

notebook stack notebook {
	margin: -1px;
}

notebook stack notebook header {
	background-color: @nb_bg;
}

notebook header {
	padding: 1px;
	background-color: @theme_bg;
}

notebook header tabs {
	min-height: 23px;
}

notebook header tab {
	padding: 2px;
	border: 1px solid @nb_tab_border;
	transition: background 0.3s;
}

notebook header tab label {
	padding: 0 1px;
	border: 1px solid transparent;
	border-radius: 1px;
}

notebook header tab button {
	margin-left: 3px; /* @todo not working */
	padding: 0;
}

notebook header tabs arrow {
	min-width: 18px;
	min-height: 18px;
}

notebook header.top tab {
	margin: 0 -1px -2px;
	border-bottom-color: @nb_border;
	border-radius: 2.4px 2.4px 0 0;
	background: linear-gradient(to bottom,
		@nb_tab_glaze_top,
		@nb_tab_glaze_mida 51%,
		@nb_tab_glaze_midb 51%,
		@nb_tab_glaze_bot);
}

notebook header.top tab:checked {
	margin: -1px -1px -2px;
	border-color: @nb_border;
	border-bottom: 0;
	background: linear-gradient(to bottom,
		@nb_tab_checked_glaze_top,
		@nb_tab_checked_glaze_mida 51%,
		@nb_tab_checked_glaze_midb 51%,
		@nb_tab_checked_glaze_bot);
	box-shadow:
		inset -1px 0 alpha(@nb_border, 0.07),
		inset 1px 1px alpha(@nb_border, 0.07);
}

notebook header.bottom tab {
	margin: -2px -1px 0;
	border-top-color: @nb_border;
	border-radius: 0 0 2.4px 2.4px;
	background: linear-gradient(to top,
		@nb_tab_glaze_top,
		@nb_tab_glaze_mida 51%,
		@nb_tab_glaze_midb 51%,
		@nb_tab_glaze_bot);
}

notebook header.bottom tab:checked {
	margin: -2px -1px -1px;
	border-color: @nb_border;
	border-top: 0;
	background: linear-gradient(to top,
		@nb_tab_checked_glaze_top,
		@nb_tab_checked_glaze_mida 51%,
		@nb_tab_checked_glaze_midb 51%,
		@nb_tab_checked_glaze_bot);
	box-shadow:
		inset -1px -1px alpha(@nb_border, 0.07),
		inset 1px 0 alpha(@nb_border, 0.07);
}

notebook header.left tab {
	margin: -1px -2px -1px 0;
	padding: 3px 1px;
	border-right-color: @nb_border;
	border-radius: 2.4px 0 0 2.4px;
	background: linear-gradient(to right,
		@nb_tab_glaze_top,
		@nb_tab_glaze_mida 50%,
		@nb_tab_glaze_midb 50%,
		@nb_tab_glaze_bot);
}

notebook header.left tab:checked {
	margin: -1px -2px -1px -1px;
	padding: 3px 2px;
	border-color: @nb_border;
	border-right: 0;
	background: linear-gradient(to right,
		@nb_tab_checked_glaze_top,
		@nb_tab_checked_glaze_mida 50%,
		@nb_tab_checked_glaze_midb 50%,
		@nb_tab_checked_glaze_bot);
	box-shadow:
		inset 0 -1px alpha(@nb_border, 0.07),
		inset 1px 1px alpha(@nb_border, 0.07);
}

notebook header.right tab {
	margin: -1px 0 -1px -2px;
	padding: 3px 1px;
	border-left-color: @nb_border;
	border-radius: 0 2.4px 2.4px 0;
	background: linear-gradient(to left,
		@nb_tab_glaze_top,
		@nb_tab_glaze_mida 50%,
		@nb_tab_glaze_midb 50%,
		@nb_tab_glaze_bot);
}

notebook header.right tab:checked {
	margin: -1px -1px -1px -2px;
	padding: 3px 2px;
	border-color: @nb_border;
	border-left: 0;
	background: linear-gradient(to left,
		@nb_tab_checked_glaze_top,
		@nb_tab_checked_glaze_mida 50%,
		@nb_tab_checked_glaze_midb 50%,
		@nb_tab_checked_glaze_bot);
	box-shadow:
		inset -1px -1px alpha(@nb_border, 0.07),
		inset 0 1px alpha(@nb_border, 0.07);
}

notebook header.top tab button:dir(ltr),
notebook header.bottom tab button:dir(ltr) {
	margin-left: -1px;
	margin-right: 1px;
}

notebook header.top tab button:dir(rtl),
notebook header.bottom tab button:dir(rtl) {
	margin-left: 1px;
	margin-right: -1px;
}

notebook header.top tab:checked button,
notebook header.bottom tab:checked button {
	margin-top: 2px;
	margin-bottom: 2px;
}

notebook header.left tab button:dir(ltr),
notebook header.right tab button:dir(ltr) {
	margin-left: -2px;
	margin-right: 2px;
}

notebook header.left tab button:dir(rtl),
notebook header.right tab button:dir(rtl) {
	margin-left: 2px;
	margin-right: -2px;
}

notebook:focus header tab:checked label {
	border-color: @theme_outline;
	background: @nb_tab_focus_bg;
}

/* --- notebook stack - with gtk3-classic (appearance_notebook_stack_class.patch) --- */

notebook stack.top {
	border-radius: 0 0 2.4px 2.4px;
	box-shadow:
		inset -1px -1px alpha(@nb_border, 0.125),
		inset 1px 0 alpha(@entry_bg, 0.42);
}

notebook stack.bottom {
	border-radius: 2.4px 2.4px 0 0;
	box-shadow:
		inset -1px 0 alpha(@nb_border, 0.125),
		inset 1px 1px alpha(@entry_bg, 0.42);
}

notebook stack.left {
	border-radius: 0 2.4px 2.4px 0;
	box-shadow:
		inset -1px -1px alpha(@nb_border, 0.125),
		inset 0 1px alpha(@entry_bg, 0.42);
}

notebook stack.right {
	border-radius: 2.4px 0 0 2.4px;
	box-shadow:
		inset 0 -1px alpha(@nb_border, 0.125),
		inset 1px 1px alpha(@entry_bg, 0.42);
}

/* --- notebook arrow --- */

notebook header.top tabs arrow.down {
	margin: 1px 2px 0 0;
	-gtk-icon-transform: scale(0.8);
}

notebook header.top tabs arrow.up {
	margin: 1px 0 0 2px;
	-gtk-icon-transform: scale(0.8);
}

notebook header.bottom tabs arrow.down {
	margin: 0 2px 1px 0;
	-gtk-icon-transform: scale(0.8);
}

notebook header.bottom tabs arrow.up {
	margin: 0 0 1px 2px;
	-gtk-icon-transform: scale(0.8);
}

notebook header.left tabs arrow.down {
	margin: 0 0 2px 1px;
	-gtk-icon-transform: rotate(180deg) scale(0.8);
}

notebook header.left tabs arrow.up {
	margin: 2px 0 0 1px;
	-gtk-icon-transform: rotate(180deg) scale(0.8);
}

notebook header.right tabs arrow.down {
	margin: 0 1px 2px 0;
	-gtk-icon-transform: rotate(180deg) scale(0.8);
}

notebook header.right tabs arrow.up {
	margin: 2px 1px 0 0;
	-gtk-icon-transform: rotate(180deg) scale(0.8);
}
