
/*
 * NeoEnvs stylesheet by Slatian
 * copyright: 2024
 * License: MIT or 0BSD
 */

@import "../fonts/jetbrains-mono/font.css";
@import "../fonts/misans/misans.css";

/* Default, dark mode colors */
:root {
	--c-page-bg: #040304;
	--c-page-fg: #fff5ee;
	--c-link-fg: #10a0a0;
	--c-lines: #211921;
	--c-alt-bg: #211921;
}

@media (prefers-color-scheme: light) {
	:root {
		--c-page-bg: #f5f5f5;
		--c-page-fg: #333;
		--c-link-fg: #1C8989;
		--c-lines: #e5e5e5;
		--c-alt-bg: #e5e5e5;
	}
}

/* Manual theme override (set by js/theme.js; overrides the system media query) */
body.theme-light {
	--c-page-bg: #f5f5f5;
	--c-page-fg: #333;
	--c-link-fg: #1C8989;
	--c-lines: #e5e5e5;
	--c-alt-bg: #e5e5e5;
}

body.theme-dark {
	--c-page-bg: #040304;
	--c-page-fg: #fff5ee;
	--c-link-fg: #10a0a0;
	--c-lines: #211921;
	--c-alt-bg: #211921;
}

body {
	background: var(--c-page-bg);
	color: var(--c-page-fg);
	font-family: "JetBrains Mono", "MiSans", monospace, ui-monospace;
	line-height: 1.65;
	margin: 0;
	font-size: max(10pt, 1rem);
}

body {
	display: grid;
	grid-template-rows: auto auto 1fr auto;
	grid-template-areas: /* narrow layout by default*/
		"nav"
		"main"
		"sidebar"
		"footer";
	width: 100%;
	min-height: 100vh;
}

@media (min-width: 70ch) {
	main, #sidebar {
		margin-left: 4em;
	}

	nav.sidenav {
		position: fixed;
		flex-direction: column;
		justify-content: start;
	}
}

@media (min-width: 110ch) {
	body {
		max-width: 960px;
		margin: 0 auto;
	}

	main, #sidebar {
		margin-left: 0;
	}

	#sidebar {
		padding-left: 0;
	}

	.sidenav a {
		display: inline-block;
	}
}

@media (min-height: 30em) {
	footer {
		position: sticky;
		bottom: 0;
		grid-area: footer;
	}

}

main {
	grid-area: main;
	padding: .5em;
}

main.content {
	max-width: 80ch;
}

main > p, main > pre {
	max-width: 80ch;
}

body > #sidebar {
	grid-area: sidebar;
	padding-top: 1em;
	padding: .5em;
}

footer {
	grid-area: footer;
	border-top: 4px solid var(--c-lines);
	background: var(--c-page-bg);
	width: 100%;
}

.footer-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: .25em 1.5em;
	padding: .5em;
}

.footer-left, .footer-right {
	margin: 0;
}

.footer-left .brand {
	text-transform: uppercase;
}

.footer-right {
	display: flex;
	align-items: center;
	gap: .5em;
}

.footer-contact {
	display: inline-flex;
	align-items: center;
	gap: .3em;
	white-space: nowrap;
}

.footer-mail-icon {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
}

.user-icon {
	width: 1em;
	height: 1em;
	vertical-align: -.125em;
	margin-right: .3em;
}

.theme-switch {
	margin-left: 1.5em;
	position: relative;
}

.theme-switch #theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	padding: 0;
	background: transparent;
	color: var(--c-page-fg);
	border: 1px solid var(--c-lines);
	border-radius: .5em;
	cursor: pointer;
}

.theme-switch #theme-toggle:hover {
	border-color: var(--c-page-fg);
}

.theme-icon {
	width: 1em;
	height: 1em;
}

/* some browsers do not apply the UA [hidden] rule to svg elements */
.theme-icon[hidden] {
	display: none;
}

.theme-menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + .5em);
	min-width: 10em;
	margin: 0;
	padding: .25em;
	list-style: none;
	background: var(--c-page-bg);
	color: var(--c-page-fg);
	border: 1px solid var(--c-lines);
	border-radius: .5em;
	box-shadow: 0 .5em 1.5em rgba(0, 0, 0, .35);
	z-index: 10;
}

.theme-menu li {
	display: flex;
	align-items: center;
	gap: .6em;
	padding: .4em .6em;
	border-radius: .35em;
	cursor: pointer;
	white-space: nowrap;
}

.theme-menu li:hover {
	background: var(--c-alt-bg);
}

.theme-menu li[aria-selected="true"] {
	color: var(--c-link-fg);
}


h1, h2, h3. h4, h5, h6 {
	margin-top: 0;
	margin-bottom: 1rem;
}

h1 {
	font-style: italic;
	font-size: 1.6rem;
	font-weight: 600;
}

h2 {
	font-size: 1.3rem;
	font-weight: 600;
}

h2:not(.block h2)::before, h3:not(.block h3)::before {
	content: "# ";
}

.block {
	border-left: 4px solid var(--c-lines);
	padding: .5em 0 .5em 2ch;
	margin-bottom: 1em;
	margin-top: 0;
}

.block h1, .block h2 {
	border: none;
	padding: 0;
	margin-top: .45rem;
	margin-bottom: .45rem;
	font-style: italic;
}

.alert {
	border: none;
	background: var(--c-alt-bg);
	max-width: 80ch;
}

.success {
	border-color: #98971a;
}

summary:hover {
	color: var(--c-link-fg);
}

a {
	color: var(--c-link-fg);
	text-decoration: none;
	position: relative;
}

/* animated underline: grows from the center outwards */
a::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -1px;
	width: 0;
	height: 1px;
	background: currentColor;
	transform: translateX(-50%);
	transition: width .25s ease-out;
}

a:hover::after,
a:focus-visible::after,
a:focus::after {
	width: 100%;
}

main > p, main > pre, ul, ol, table, dl {
	margin-bottom: 2em;
}

#sidebar > .block > ul:last-child {
	margin-bottom: 1em;
}

pre:not(.banner), code {
	background: var(--c-alt-bg);
}

code:not(pre > code), pre {
	padding: .2em .5ch;
}

.banner {
	line-height: 1.2em;
}

#header_sub {
	margin-left: 6em;
}

.tw10 {
	width: 10ch;
}

.tw13_75 {
	width: 13.75ch;
}

.tw16 {
	width: 18ch;
}

.tw18 {
	width: 22ch;
}

/* keep the service table inside narrow viewports */
@media (max-width: 40em) {
	.tw16 {
		width: 16ch;
	}

	.tw18 {
		width: 18ch;
	}
}

.tw36 {
	width: 36ch;
}

.tw85 {
	width: 85ch;
}

.fa-pfx::before, .icon-list > li i[class*="fa-"]::before {
	font: normal normal normal 14px/1 ForkAwesome;
	font-size: 1em;
	text-rendering: auto;
	display: inline-block;
	color: var(--c-page-fg);
	width: 2em;
}

.icon-list {
	padding-left: .5ch;
	list-style: " ";
}

.icon-list > li::marker {
	color: var(--c-page-bg);
}

.table-pkg tr:nth-child(2n) {
	background: #211921;
}

table {
	border-collapse: collapse;
}

tr, th, td {
	text-align: left;
	vertical-align: top;
}

form {
	max-width: 80ch;
	margin-right: 2ch;
}

label {
	display: block;
	margin-bottom: 1em;
}

input, textarea {
	width: 100%;
	box-sizing: border-box;
	color: var(--c-page-fg);
	background: var(--c-alt-bg);
	border: .1em solid var(--c-page-fg);
	font-family: monospace, "MiSans";
	font-size: 1rem;
	padding: .3em .75em;
	border-radius: .75em;
}

input[type="checkbox"] {
	width: unset;
}

input[type="submit"] {
	width: unset;
	margin-bottom: 2em;
}

input[type="submit"]:hover {
	background: var(--c-page-fg);
	color: var(--c-page-bg);
}

@media(min-width: 80ch) {
	.form-half-half-row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 3ch;
	}
}

.sidenav {
	left: 0;
	top: .45rem;
	display: flex;
	justify-content: center;
	grid-area: nav;
}

.sidenav a {
	padding: .2em;
	width: 3rem;
	height: 3rem;
	margin-left: .5em;
	margin-top: .65rem;
	text-decoration: none;
	text-align: center;
}

.sidenav img, .sidenav .fa {
	width: 3rem;
	height: 3rem;
	vertical-align: middle;
	font-size: 2.7rem;
	color: var(--c-page-fg);
}

.user-list {
	max-width: 80ch;
}

.user-list li {
	display: inline-block;
	width: 25ch;
}

.user-list li:before {
	display: inline-block;
	content: '•';
	margin-right: 5px;
}

footer .footer-left {
	margin: .5em 0;
}
