/*
 * Copyright (c) 2019 Jerome Kasper <neon.king.fr@gmail.com>
 * Copyright (c) 2019, 2020 Tracey Emery <tracey@traceyemery.net>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

*, *::after, *::before {
	box-sizing: border-box;
}

a {
	color: #444444;
	text-decoration: none;
}
a:hover {
	color: Gold;
	text-decoration: none;
}
body {
	background-color: #ffffff;
	color: #000000;
	margin: 0;
	padding: 0;
	font-family: sans-serif;
	font-size: 16px;
}

pre {
	font-family: monospace;
	margin: 0;
}

.diff_minus, .diff_submodule {
	color: magenta;
}
.diff_plus, .diff_symlink, .diff_author {
	color: darkcyan;
}
.diff_chunk_header, .diff_date {
	background-color: LightSlateGray;
	color: yellow;
}
.diff_meta, .diff_executable, .diff_commit {
	color: green;
}
.diff_directory {
	color: blue;
}

.refs_str {
	background-color: #243647;
	color: #ffffff;
	font-style: italic;
	white-space: pre;
}
hr {
	margin: 0;
	height: 0;
	border: 0px;
	border-top: 1px dotted #444444;
}
#header {
	background-image: linear-gradient(to right, White, LightSlateGray);
}
#header a {
	color: #ffffff;
	text-decoration: none;
}
#header a:hover {
	color: Gold;
	text-decoration: none;
}
#site_path {
	overflow: auto;
	width: 100%;
	background-color: #243647;
}
#site_link {
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	color: #ffffff;
	overflow: hidden;
}
#site_link a {
	color: #ffffff;
	text-decoration: none;
}
#got_link {
	padding-bottom: 10px;
	padding-top: 10px;
}
#login_status {
	color: lightgrey;
	text-align: right;
	padding-right: 10px;
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	font-weight: monospace;
}
#np_wrapper {
	width: 100%;
	border-bottom: 1px dotted #444444;
	background-color: #f5fcfb;
	overflow: hidden;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
}
#nav_more, #nav_prev, #nav_next {
	padding: 5px 10px;
}
#nav_more {
	text-align: center;
	flex-grow: 2;
}
.navs_wrapper {
	width: 100%;
	background-color: #ced7e0;
}
.navs {
	padding-left: 10px;
	padding-top: 2px;
	padding-bottom: 2px;
}
@media (min-width: 680px) {
	.navs {
		font-size: .8em;
	}
}
#site_owner_wrapper {
	width: 100%;
	background-color: LightSlateGray;
	color: #ffffff;
}
#site_owner {
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	margin: 0;
}

#err_content {
	padding-left: 20px;
	padding-top: 20px;
	padding-bottom: 20px;
}

header.subtitle {
	background-color: LightSlateGray;
}
header.subtitle h2 {
	margin: 0;
	padding: 5px 10px;
	font-size: 1rem;
	font-weight: normal;
	color: #ffffff;
}

.brief {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
}
.brief p {
	margin: 0;
}
.brief_meta {
	flex-grow: 0;
	flex-shrink: 0;
}
.briefs_age, .briefs_author, .briefs_id {
	display: inline-block;
	vertical-align: middle;
}
.briefs_age {
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	width: 140px;
}
.briefs_author {
	padding-top: 5px;
	padding-bottom: 5px;
	width: 8.5em;
	font-style: italic;
}
.briefs_id {
	padding-top: 5px;
	padding-bottom: 5px;
	width: 8.5em;
	font-family: monospace;
	font-size: 14px;
}
.briefs_log {
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	width: 100%;
}

@media (min-width: 680px) {
	.brief {
		flex-wrap: nowrap;
	}
	.briefs_log {
		width: auto;
	}
}

.briefs_log summary {
	cursor: pointer;
}

.briefs_toggle {
	display: inline-block;
	padding: 3px 4px;
	padding: 0px 4px;
	border: 1px solid #222;
	border-radius: 3px;
	user-select: none;
}

/* work around .commits being unusable here */
.briefs_log > p {
	white-space: pre-wrap;
}

.tag_age, .tag_name, .tag_log {
	display: inline-block;
	vertical-align: middle;
}
.tag_age {
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	width: 140px;
}
.tag_name {
	width: 8.5em;
	font-style: italic;
	padding-top: 5px;
	padding-bottom: 5px;
}
.tag_log {
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	width: 65%;
}

#tag_commit {
	padding-top: 20px;
	padding-left: 20px;
	padding-bottom: 20px;
	overflow: auto;
}

#index_header {
	background-color: Khaki;
}
.index_project, .index_project_description, .index_project_owner,
.index_project_age {
	display: inline-block;
	padding: 10px;
	overflow: hidden;
	vertical-align: middle;
}
.index_wrapper .index_project {
	font-weight: bold;
	text-decoration: underline;
}
.index_project {
	width: 20%;
}
.index_project_description {
	width: 30%;
}
.index_project_owner {
	width: 25%;
}
.index_project_age {
	width: 25%;
	opacity: 0.7;
}
.index_project a {
	color: #444444;
	text-decoration: none;
}
.index_project a:hover {
	color: SteelBlue;
	text-decoration: none;
}
#index_next a {
	color: #444444;
	text-decoration: none;
}
#index_next a:hover {
	color: SteelBlue;
	text-decoration: none;
}
#index_prev a {
	color: #444444;
	text-decoration: none;
}
#index_prev a:hover {
	color: SteelBlue;
	text-decoration: none;
}

.page_header_wrapper {
	background-color: #f5fcfb;
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 2px;
}

.commits_content {
	width: 100%;
}
.commit {
	padding-left: 20px;
	padding-bottom: 20px;
	white-space: pre-wrap;
}

#blame, #blob {
	margin-top: 20px;
	margin-left: 20px;
	margin-bottom: 20px;
	overflow: auto;
}
.blob_line > a {
	display: inline-block;
	text-align: right;
	width: 60px;
	padding-right: 20px;
	user-select: none;
}
.blame_code, .blob_code {
	/* fixes the width of the first tab */
	display: inline-block;
}
.blame_line:target, .blob_line:target {
	background-color: Khaki;
}
.blame_number, .blob_number {
	width: 6em;
	overflow: hidden;
}
.blame_hash {
	width: 6em;
	overflow: auto;
}
.blame_date {
	width: 7em;
	overflow: auto;
}
.blame_author {
	width: 6em;
	overflow: hidden;
}

#tree {
	margin-left: 20px;
	margin-top: 20px;
	margin-bottom: 20px;
	border-collapse: collapse;
}
.tree_wrapper:nth-child(odd) {
	background-color: #d8f3ef;
}
.tree_line {
	font-family: monospace;
	width: 20em;
	padding: 5px;
}
.tree_line_blank {
	padding: 1px;
	width: 9.5em;
}
#tree_content h2 {
	margin-top: 40px;
	padding: 0 20px 0;
}
#tree_content pre {
	padding: 0 20px 20px;
	white-space: pre-wrap;
}

#diff {
	margin-top: 20px;
	margin-left: 20px;
	margin-bottom: 20px;
	overflow: auto;
}

#summary_wrapper {
	background-color: Khaki;
}

dl {
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
}
dt {
	padding: 3px 7px;
	width: 120px;
}
dd {
	padding: 3px 7px;
	margin-left: auto;
	width: calc(100% - 130px);
	flex-grow: 2;
}

.clone-url {
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

.commit-msg {
	white-space: pre-wrap;
}

.commit-id {
	width: 100%;
	display: inline-block;
	overflow: hidden;
	text-overflow: ellipsis;
}

.branches_age, .branches_space, .branch {
	display: inline-block;
	vertical-align: middle;
}
.branches_age {
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	width: calc(140px + 8.5em);
}
.branch {
	padding-right: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	padding-left: 10px;
}

/* mobile (<=680px) */
@media(max-width:680px) {
	#index_header {
		display: none;
	}
	.index_wrapper {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
	}
	.index_wrapper .index_project,
	.index_wrapper .index_project_description {
		padding-bottom: 0;
		width: 100%;
	}
	.index_wrapper .index_project_owner,
	.index_wrapper .index_project_age {
		width: 50%;
	}
	.index_wrapper .index_project_age {
		text-align: right;
	}

	#summary_wrapper {
		padding: 4px 0;
	}
	#summary_wrapper dt,
	#summary_wrapper dd {
		width: 100%;
	}
	#summary_wrapper dt {
		font-weight: bold;
		padding-bottom: 0;
	}
	#summary_wrapper dd {
		padding-bottom: 8px;
	}
}

/* dark theme */
@media (prefers-color-scheme: dark) {
	body {
		color: #eee;
		background-color: #282A36;
	}

	hr {
		border-style: solid;
	}

	#index_header, #summary_wrapper {
		background-color: #BD93F9;
		color: #222;
	}

	#got_link {
		filter: brightness(0) saturate(100%)
			invert(68%) sepia(73%) saturate(2771%)
			hue-rotate(213deg) brightness(104%)
			contrast(95%);
	}

	#header {
		background-image: unset;
	}

	.index_project a {
		color: #8BE9FD;
		text-decoration: none;
	}
	.index_project a:hover {
		color: #FFFFA5;
		text-decoration: none;
	}

	.index_wrapper {
		border-bottom-style: solid;
		border-bottom-width: 1px;
		border-image: linear-gradient(90deg, #FF79C6, #BD93F9 50%) 1;
	}

	a {
		color: #FF79C6;
	}

	.diff_minus, .diff_submodule {
		color: #FF79C6;
	}
	.diff_plus, .diff_symlink, .diff_author {
		color: #8BE9FD;
	}
	.diff_chunk_header, .diff_date {
		background-color: unset;
		color: #FFB86C;
	}
	.diff_meta, .diff_executable, .diff_commit {
		color: #6272A4;
	}

	.blame_code {
		color: #eee;
	}

	.blame_wrapper {
		color: #6272A4;
	}

	.blame_author {
		color: #8BE9FD;
		text-decoration: none;
	}

	.blame_line:target, .blob_line:target {
		background-color: #44475a;
	}

	#site_owner_wrapper, #np_wrapper {
		background-color: unset;
	}

	#site_owner_wrapper {
		border-top: 1px solid #444444;
	}

	.page_header_wrapper {
		background-color: unset;
	}

	.navs_wrapper {
		background-color: #282A36;
	}

	.tree_wrapper:nth-child(even) {
		background-color: #282A36;
	}

	.tree_wrapper:nth-child(odd) {
		background-color: #3e3e3e;
	}
}
