/* These are links to CSS files not font files. Hence they use @import rather than @font-face */

/* @import url("https://fontlibrary.org/face/sansus-webissimo"); */
/* @import url(https://fontlibrary.org/face/pt-serif); */
/* @import url('https://fontlibrary.org/face/source-code-pro'); */

/* arp.css is the animation for the Arp mascot in stuff/template2.html */
@import url(arp.css);

/* --- This font is on my server --- */

@font-face {
	font-family: 'AkzidenzGroteskRCondensedMedium';
	src: url("../fonts/AkzidenzGroteskRCondensedMedium.woff") format('woff');
	font-weight: normal;
	font-style: normal;
}


/* --- VARIABLES - Won't work in IE 11 --- */

:root {
	--code-bg: PaleTurquoise;
	--text: #556;
	--link-color: #25d;
	--code: darkred;
	--headercolor: tomato;
	--MainBorderColor: #5a7b88;
	--container-bg: honeydew;
	--body-bg: #43768a;
	--headfootaside: 19px;
	--MainDisplay: 'AkzidenzGroteskRCondensedMedium', impact, verdana, sans-serif;
	--bodyFont: rubik, 'segoe ui', tahoma, Geneva, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
		--code-bg: #3e4e5e;
		--text: #9cc8f7;
		--link-color: #ccc;
		--code: #ff9600;
		--headercolor: #ba9500;
		--MainBorderColor: #3e4e5e;
		--container-bg: #2e3641;
		--body-bg: #222831;
	}
}

html {
    scroll-behavior: smooth;
}

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

body {
	margin: 0;
	padding: 0;
	font-family: var(--bodyFont);
	font-size: clamp(0.9rem, 0.7462rem + 0.5792vw, 1.3rem);
	font-weight: 300;
	line-height: 1.4;
	letter-spacing: .5px;
	color: var(--text);
	background-color: var(--body-bg);
}
body::before,
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 50vh;
    background-color: var(--MainBorderColor);
    animation: shrink 0.24s ease-in 0.3s 1 both;
    z-index: 100;

}

body::before {
    /* inset: 0; */
    /* transform: scaleX(1); */
    inset: 0 0 50vh 0;
    transform-origin: right center;
}

body::after {
    inset: 50vh 0 0 0;
    transform-origin: left center;

}

@keyframes shrink {
    to {
        transform: scaleX(0);
        /* opacity: 0; */
    }
}

/* ------ List Page styles --------- */

ul.listpagelist {
	list-style-type: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr) );
	gap: 1em;
	font-size: 0.8em;
}
ul.listpagelist > a {
	padding: 1em;
	background-color: #0001;
	transition: 0.5s;
}
ul.listpagelist > a:hover {
	background-color: #0003;
}

ul.listpagelist h2 {
	margin: 0;
	font-family: var(--bodyfont);
	font-size: 1em;
}
ul.listpagelist p:last-child {
	margin-bottom: 0;
}




ul.listpagetags {
	list-style-type: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1em;
}

ul.listpagetags li a {
	display: block;
	padding: 6px 10px;
	line-height: 1;
	border-radius: 11px;
	color: #fff;
	font-weight: normal;
	background-color: var(--headercolor);
	
}
ul.listpagetags li a:hover {
	/* color: #333; */
	scale: 1.1;
}

/* ----- Main Grid based layout ----- */



header {
	grid-column: 1 / -1;
}



.container>aside {
	grid-column: 3 / 4;
	grid-row: 2 / 3;
}

.htmllogo {
	position: fixed;
	right: calc(50% - 765px - 38px);
	top: 140px;
}

body.page .back-to-top {
    background-color: #8880;
    grid-column: 2 / 3;
    grid-row: 2 / -1;
    position: relative;
    margin-top: 120vh;
    padding: 0 !important;
    pointer-events: none;
}

body.page .back-to-top a {
    position: sticky;
    top: calc(100vh - 9rem);
    text-align: center;
    display: block;
    text-transform: uppercase;
    font-size: 3em;
    transition: 0.4s;
    pointer-events: all;
}

body.page .back-to-top a:hover {
    /* color: #0070ff; */
    transform: scale(1.2);
    }

    :is(body.section, body.home, body.term, body.taxonomy, body.search) .back-to-top {
        display: none;
}

/* ---------- Styling the container ----- */

.container {
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 4ch 280px;
	grid-template-rows: auto 1fr auto;
	grid-column-gap: 5px;
	max-width: 1530px;

	padding: 0 2em 0 2em;
	min-height: 100vh;
	position: relative;
	padding-bottom: 0em;
	border-right: var(--MainBorderColor) 23px solid;
	border-left: var(--MainBorderColor) 23px solid;
	background: var(--container-bg);
}
.container > * {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}
main#main {
	min-height: 100%;
	display: flex;
	flex-direction: column;
}
#content {
	transform: scale(1.03);
	opacity: 0;
	animation: page-load 0.25s 0.4s ease-out both;
	}

	@keyframes page-load {
	    to {
	        transform: scale(1);
	        opacity: 1;
	    }
	}



/* ------- HEADER ------ */

header {
	display: grid;
	grid-template-columns: auto auto;
	padding-bottom: 0.5em;
	background-color: var(--headercolor);
	border-radius: 0 0 var(--headfootaside) var(--headfootaside);
	color: white;

	& ul {
		display: flex;
		align-items: center;
		margin: 0;
		padding: 0;
		list-style-type: none;
	}

	& a {
		color: var(--container-bg);
	}
}

.main-nav {
	grid-column: 1 / 2;
	margin-top: 0;
	display: flex;
	gap: 1em;
	justify-content: space-between;

	& ul {
		gap: 1em;
	}

	& a {
		font-family: var(--MainDisplay);
		font-size: 2em;
	}

	& a:hover {
	border-bottom: solid 5px;
	transition: .3s linear;
	}

	& a.active {
	border-bottom: solid 5px;
	}
}

.page-nav {
	width: max-content;
	justify-self: end;
	& ul {
	font-family: 'segoe ui';
	font-size: 2em;
	gap: 1rem;
	}
	& li {
	font-family: var(--MainDisplay);
	/* margin: 17px 37px 23px 0; */
	}
	& a {
		color: var(--MainDisplay);
	}
}

#sitename {
	grid-column: 1 / 3;
	justify-self: end ;
	width: max-content;
	font-family: 'Segoe UI', Segoe, 'Trebuchet MS', Arial, sans-serif;
	font-weight: bold;
	font-size: 2.9em;
	letter-spacing: -4px;
	line-height: 1;
	color: var(--container-bg);
	padding: 12px 0 3px 0;
}

/* ------- MAIN NAVIGATION ------ */


a {
	text-decoration: none;
	color: var(--link-color);
	transition: all 0.4s;
}
#content a:hover {
	color: #fff;
}


.skip-nav-link {
    background-color: #222;
    padding: .2em 1em;
    position: absolute;
    left: 50%;
    z-index: 100;
    transform: translate(-50%, -120px);
    transition: transform 0.4s;
    text-transform: uppercase;
    border-radius: 12px;
}

.skip-nav-link:focus {
    transform: translate(-50%, 20px);
}










/* -------- R SIDEBAR - RESOURCES & NOTES ---- */

.container>aside {
	grid-row: 2 / 3;
}

.container>aside>ul {
	display: flex;
	flex-direction: column;
	/* width: 100%; */
	background: var(--headercolor);
	color: var(--container-bg);
	padding: 1em;
	margin: 0 0 1em 0;
	border-radius: var(--headfootaside);
	font-size: .8em;
	padding: 1em;
	list-style-type: none;
}

.container>aside>ul:first-of-type {
	margin: 5em 0 1em 0;
}

.container>aside>ul li {
	margin-bottom: .5em;
}

/* .container>aside>ul li:first-child {
	margin-top: .6em;
} */

aside>ul :is(a, a:link) {
	color: white;
	position: relative;
}

aside>ul a::before {
	display: inline-block;
	position: absolute;
	content: '';
	bottom: 0px;
	left: 0;
	height: 2px;
	width: 100%;
	background-color: #fff;
	transform: scaleX(0);
	transform-origin: center;
	transition: 350ms ease-in-out;
}
aside>ul a:hover::before {
	transform: scaleX(1);
	/* transform-origin: left; */
}

aside>ul.extlinks::before {
	content: "External Resources";
	font-family: var(--MainDisplay);
	font-size: 2.2em;
}
.blogposts {
	font-family: var(--MainDisplay);
	font-size: 2.2em;
	text-transform: capitalize;
	margin-bottom: 1em;
	margin-top: 0;
	line-height: 1;

	& + li a {
	outline: solid 1px #ccc;
    outline-offset: 3px;
    border-radius: 5px;
    display: block;
    background: #fff3;
    text-transform: uppercase;
	}
}

.resources ul,
#TableOfContents ul {
	list-style-type: none;
	padding: 0;
}

.resources a[href="#"] {
	pointer-events: none;
	opacity: .5;
}


#TableOfContents ul {
	columns: 3 15em;
	column-gap: 1em;
}
#TableOfContents li {
	column-span: all;
}
/* This makes multi-columns when the list has 5 more items  */
#TableOfContents li:nth-last-child(n+5),
#TableOfContents li:nth-last-child(n+5) ~ li {
	column-span: none;
}



.fullist {
	line-height: 1.3;
	/* display: none; */
}
.fullist ul:not(:first-of-type) {
	margin-top: 1.5em;
}
.fullist .key {
	/* display: none; */
	text-transform: uppercase;
	font-weight: bold;
	margin-top: 1.5em;
	margin-bottom: 0;
	line-height: 1;
}


.notes {
	clear: right;
}

.notes::before {
	content: "Notes";
	font-family: var(--MainDisplay);
	font-size: 2.2em;
	text-transform: capitalize;
	margin-bottom: 1em;
}

details.view-css {

	& summary {
		margin-top: 4em;
		padding: 0.5em;
		border-radius: .5em;
		font-weight: 500;
		background-color: var(--MainBorderColor);
	}

	& .highlight {
		display: flex;
		justify-content: center;
	}
}

.prevnext {
	margin-top: auto;
	display: flex;
	justify-content: center;
	gap: 3em;
	list-style-type: none;
	padding: 5em 0 0 0;
}
.prevnext i {
    font-size: 2em;
    line-height: 0;
    display: inline-block;
    transform: translateY(5px);
}
button {
    border: none;
    padding: 0.25em 1em;
    border-radius: 5px;
    font-size: 1em;
    color: #eee;
    background-color: hsl(213, 69%, 43%);
	outline: solid 1px transparent;
	transition: all 0.2s ease-in-out;
}

button:hover {
	--hover-clr: hsl(213, 69%, 33%);
	background-color: var(--hover-clr);
    cursor: pointer;
	outline-color: var(--hover-clr);
	outline-offset: 3px;
}

.btn-active {
	background-color: darkred;
}


/* ------- FOOTER STYLING ---------- */

/* .footertext {
	display: flex;
	background: var(--headercolor);
	border-radius: var(--headfootaside) var(--headfootaside) 0 0;
	padding-top: 2em;
	margin-top: 0;
}

.footertext>div {
	margin: 15px;
	font-size: 11px;
	color: var(--container-bg);
} */

footer {
	display: flex;
	gap: 1em;
	justify-content: space-between;
	margin-top: 2em;
	grid-column: 1 / -1;
	width: 100%;
	border-radius: var(--headfootaside) var(--headfootaside) 0 0;
	padding: 1em;
	background-color: var(--headercolor);
	color: var(--container-bg);
}

footer > * {
	font-family: rubik, 'segoe ui', sans-serif;
	font-size: 18px;
}
footer > ul {
	margin: 0;
	padding: 0;
}
#rss-icon {
	/* fill: white; */
	width: 1.6em;
	vertical-align: top;
}



/* ------- TEXT STYLING --------- */

::selection {
	background-color: var(--body-bg);
	color: white;
}

.pageHeading {
	margin-bottom: 0;
}

h1 {
	font-size: 5em;
	margin: .9em 0 .3rem 0;
	line-height: 1;
}

.time {
	border-top: 1px solid ;
	display: flex;
	justify-content: space-between;
	margin-bottom: 1em;
	padding-top: 6px;
	font-size: 0.8em;
}

/* .tags {
	font-size: 0.8em;
	margin-bottom: 4em;
} */

/* --- a large font takes up too much space with too many words. Hence .subtitle for longer titles --- */

h1, h2, h3 {
	text-wrap: balance;
}

h1,
h2,
.subtitle {
	font-family: var(--MainDisplay);
	color: var(--headercolor);
}

.subtitle {
	font-size: 45px;
	margin-top: 0;
	margin-left: .5em;
}
body.page h2 {
	font-size: 4.375rem;
	margin-top: 1.4em;
	margin-bottom: 0;
	line-height: 1;
	border-bottom: solid 2px currentColor;
}

h3 {
	font-size: 1.75em;
	margin-top: 1.4em;
	margin-bottom: .25em;
}

blockquote {
	margin: 1.3em 3em 1.3em 2em;
	border-left: solid 13px var(--headercolor);
	padding-left: 1.1em;
	max-width: 50em;
	/* font-size: 1.2em; */
}

ul>li::marker {
	color: var(--headercolor);
}


p em,
p i,
li em,
li i {
	font-family: var(--bodyFont);
}

select {
	font: inherit;
	padding: 0.5em 1em;
	background: light-dark(#adc0ad, #1d2229);
	border-radius: 0.5em;
	border: none;
}

/* ----------- TABLE --------------- */

table {
	font-size: 0.9em;
}
td, th {
	padding: 0.5em;
	vertical-align: top;
}

th {
	border-bottom: 1px solid currentColor;
}
tr:nth-child(even) {
	background-color: #fff2;
}


/* -------- STYLING THE CODING ELEMENTS ------ */

.highlight pre {
	max-width: 986px;
	padding: 0;
	position: relative;
	overflow: auto;
}
.highlight code {  	/* this targets only code using Hugo shortcode highlight */
	padding: 0.5em;
}

@media (prefers-color-scheme: dark) {
	.highlight pre {
	--code-bg: #1f262f;
	background-image: radial-gradient(circle at top right, transparent, #000) !important;
	}

	span[style="color:#111"] {
		color: #ddd !important;
	}
	
	pre[style*="color:#272822"] {
		color: #c3f663 !important;
	}
}
/* .highlight code::before {
	display: block;
	content: attr(data-lang);
	position: absolute;
	top: -21px;
} */


code,
pre {
	display: inline-block;
	background: var(--code-bg);
	font-family: 'dm mono', 'courier new', courier, monospace;
	font-size: .95rem;
	border-radius: 6px;
}

pre {
	clear: both;
	padding: .5em 2em .5em .5em;
	background: var(--code-bg);
}

code {
	padding: 0 1px;
}

p>code,
li>code,
.othercode {
	font-family: 'DM Mono', 'courier new', courier, monospace;
	color: var(--code);
	font-size: 0.9em;
	background: none;
}
h2 code {
	font-size: 0.6em;
}

iframe[title*="CodePen"] {
	resize: both;
	height: 700px;
	margin-block: 1em;
}

iframe.yt {
	width: min(650px, 100%);
	aspect-ratio: 16 / 9;
}


/* ======= Search Page ============= */

#custom-search input {
	font-size: 2em;
	border: none;
	padding: 0.1em;
	background-color: var(--MainBorderColor);
	color: currentColor;
}
body.search time {
	display: none;
}

.search-modal {
	position: fixed;
	/* inset: 0; */
	height: 100vh;
	width: min(100%, 750px);
	margin: auto;
	background-color: #0009;
	border-radius: 1em;
	border: none;
	display: none;
	translate: -150vh 0;
	transition-duration: 0.75s;
	transition-delay: 0s;
	transition-property: overlay display translate;
	transition-behavior: allow-discrete;
}
.search-modal[open] {
	display: block;
	translate: 0 0;
	transition-delay: 0.75s;
	
	@starting-style {
		translate: 150vh 0;
	}
}
.search-modal::backdrop {
	/* background-color: #0009; */
	background-image: linear-gradient(to bottom, rgba(1, 14, 255, 0.6), rgba(253, 3, 3, 0.6));
	backdrop-filter: blur(4px);
	transition-property: overlay display opacity backdrop-filter;
	transition-duration: 0.5s;
	transition-delay: 0.5s; /* delay when closing */
	transition-timing-function: ease-out;
	transition-behavior: allow-discrete;
	opacity: 0;
}

.search-modal[open]::backdrop {
	opacity: 1;
	transition-delay: 0; /* delay when opening */
	transition-duration: 0.5s;
}

/* Cannot nest inside pseudo element so.. */
@starting-style {
	.search-modal[open]::backdrop {
		opacity: 0;
	}
}

.search-close-btn {
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	font-size: 2em;
	aspect-ratio: 1 / 1;
	background: darkred;
	padding: 0 0.25em;
	color: #fff;
	border: none;
	cursor: pointer;
}
#custom-search-field {
	border-radius: 0.25em;
	padding: 0.25em 1em;
}
/* === MEDIA QUERIES === */

@media screen and (max-width: 1200px) {
	aside,
	header ul + ul {
		display: none;
	}
	.container {
		grid-template-columns: 1fr 0;
	}
}

@media screen and (max-width: 636px) {
	header nav {
		position: fixed;
		top: 0;
		left: -99vw;
		width: 100vw;
		height: 100vh;
		background-color: #0009;
		backdrop-filter: blur(4px);
		z-index: 200;
		justify-content: center;
		align-items: center;
		transition: 0.5s;
	}
	header nav:hover {
		left: 0;
	}
	header nav ul {
		font-size: 1.9em;
		flex-direction: column;
		text-align: center;
		gap: 2em;
	}
	header nav ul:first-child a {
		color: #fff !important;
	}
	.hugo-version,
	.copyright {
		display: none;
	}
}
