/**
 * main.css
 * Author: Riley Mann
 * 
 * Main stylesheet for zeropt.github.io
 * 
 * Created on 19 Apr. 2025
 */

:root {
	--theme-color: lemonchiffon;
	--bg-color: white;
	--focus-bg-color: rgba(255, 255, 255, 0.8);
	--border-color: black;
	--text-color: black;
	--heading-color: black;
	--title-color: black;
	--shadow-color: lemonchiffon;
	--link-color: steelblue;
	--button-color: lemonchiffon;
}

.spring {
	--theme-color: lightpink;
	--heading-color: lightpink;
	--shadow-color: #ffe6e9; /* lighter lightpink */
	--link-color: lightpink;
	--button-color: lightpink;
}

.dark {
	--theme-color: #262626;
	--bg-color: #262626;
	--focus-bg-color: rgba(0, 0, 0, 0.8);
	--border-color: dimgray;
	--text-color: lavenderblush;
	--heading-color: lavenderblush;
	--title-color: lavenderblush;
	--shadow-color: dimgray;
	--link-color: lemonchiffon;
	--button-color: #393939;
}

.spring.dark {
	--theme-color: #262626;
	--heading-color: plum;
	--shadow-color: #9e619e; /* darker thistle */
	--link-color: plum;
	--button-color: #393939;
}

@font-face {
	font-family: Pixellari;
	src: url("font/Pixellari/Pixellari.ttf");
}

@font-face {
	font-family: Silver;
	src: url("font/Silver/Silver.ttf");
	size-adjust: 220%;
}

html {
	height: 100%;
	background-color: var(--theme-color);
}

body {
	height: 100%;
	margin: 0;
	font-family: Silver, sans-serif;
	font-size: 0.75rem;
	line-height: 200%;
	border-color: var(--border-color);
	color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
	margin: 0.25em 0;
	font-family: Pixellari, sans-serif;
	font-weight: normal;
	line-height: normal;
	color: var(--heading-color);
}

h1 {font-size: 2.25rem;}
h2 {font-size: 1.75rem;}
h3 {font-size: 1.5rem;}
h4, h5, h6 {font-size: 1.25rem;}

p {
	margin-top: 1em;
	margin-bottom: 0.5em;
}

a {
	color: var(--link-color);
}

ul, ol {padding-inline-start: 3em;}

.spring ul {
	list-style-image: url("img/bullet_point.webp");
}

.spring.dark ul {
	list-style-image: url("img/bullet_point_dark.webp");
}

li {
	margin-bottom: 0.5em;
}

code {
	font-size: 0.875rem;
}

pre {
	margin-bottom: 2em;
}

pre code {
	display: block;
	padding: 1em;
	overflow-x: auto;
	tab-size: 3;
}

/*-------------------------------Flexbox Layout-------------------------------*/

.layout {
	height: 100%;
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	justify-content: space-between;
	align-items: stretch;
}

.upper {
	height: calc(100% - 0.875rem);
	/* Flex Container */
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: stretch;
}

.header {
	padding-left: 16px;
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	justify-content: flex-start;
	align-items: flex-start;
}

.main {
	min-width: 0;
	width: 100%;
	min-height: 0;
	max-height: 100%;
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	justify-content: center;
	align-items: center;
}

.settings {
	padding-top: 16px;
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	justify-content: flex-start;
	align-items: flex-end;
}

.footer {
	/* Flex Container */
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
	align-items: flex-end;
}

.welcome.nav {
	/* Flex Container */
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
	align-items: center;
}

.subpage.nav {
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	justify-content: flex-start;
	align-items: flex-start;
}

#cactus-dialog {
	min-height: 0;
	max-height: 100%;
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	align-items: center;
}

#cactus-dialog.article {
	width: min(120ch, 100%);
}

#cactus-dialog > div {
	min-height: 0;
	max-height: 100%;
}

#cactus-dialog.article > div {
	width: calc(100% - 96px);
}

.scrollable {
	min-height: 0;
	max-height: 100%;
	padding: 0 1.5rem;
	overflow-x: hidden;
	overflow-y: auto; /* scrollable */
	/* Flex Container */
	display: flex;
	flex-flow: column nowrap;
	justify-content: flex-start;
}

/*---------------------------------Focus Box----------------------------------*/

#focus {
	width: 100%;
	height: 100%;
	position: fixed;
	top: 0;
	left: 0;
	background-color: var(--focus-bg-color);
}

#focus img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/*----------------------------------Borders-----------------------------------*/

.prickly {
	border: 48px solid transparent;
	border-image: url("img/prickly_border.webp") 48 round;
	background-color: var(--bg-color);
	background-clip: padding-box;
}

.dark .prickly {
	border-image-source: url("img/prickly_border_dark.webp");
}

/*----------------------------------Buttons-----------------------------------*/

.button {
	margin: 4px 0;
	border: 12px solid transparent;
	border-image: url("img/button_border.webp") 12 round;
	padding: 12px 4px 0 4px;
	background-color: var(--button-color);
	background-clip: padding-box;
	font-family: inherit;
	color: inherit;
	text-decoration: none;
}

.button:hover {
	padding-top: 8px;
	padding-bottom: 4px;
	border-image-source: url("img/button_border_raised.webp");
}

.button:active {
	padding-top: 12px;
	padding-bottom: 0;
	border-image-source: url("img/button_border.webp");
}

.spring .button {
	border-image-source: url("img/button_border_spring.webp");
}

.spring .button:hover {
	border-image-source: url("img/button_border_spring_raised.webp");
}

.spring .button:active {
	border-image-source: url("img/button_border_spring.webp");
}

.dark .button {
	border-image-source: url("img/button_border_dark.webp");
}

.dark .button:hover {
	border-image-source: url("img/button_border_dark_raised.webp");
}

.dark .button:active {
	border-image-source: url("img/button_border_dark.webp");
}

/*-----------------------------Navigation Buttons-----------------------------*/

.nav .button {
	margin-left: 4px;
	margin-right: 4px;
	padding-left: 2rem;
	padding-right: 2rem;
	font-size: 1rem;
	color: var(--text-color);
}

.dark .nav .button {
	color: lemonchiffon;
	font-weight: bold;
}

.dark.spring .nav .button {
	color: plum;
}

/*----------------------------Close & Back Buttons----------------------------*/

.exit-bar {
	/* Flex Container */
	display: flex;
	flex-flow: row nowrap;
	justify-content: flex-end;
	align-items: flex-start;
}

.exit-bar > a {
	margin: 0 0 0 8px;
	padding: 4px 0 0 0;
	/* Text */
	font-family: inherit;
	font-size: 1rem;
	font-weight: bold;
	color: inherit;
	text-decoration: none;
}

.exit-bar > a:hover {
	padding-top: 0;
	padding-bottom: 4px;
}

.exit-bar > a:active {
	padding-top: 4px;
	padding-bottom: 0;
}

.exit-bar.hidden {
	display: none;
}

.exit-bar + div {
	max-height: calc(100% - 1.5rem);
}

.exit-bar.hidden + div {
	max-height: 100%
}

/*------------------------------Settings Buttons------------------------------*/

#theme-btn {
	width: 64px;
	height: 64px;
	margin: 4px 16px 4px 4px;
	background-image: url("img/theme_sprites.webp"); /* sprite sheet */
}

#theme-btn:hover {
	background-position-x: -64px;
}

#theme-btn:active {
	background-position-x: 0;
}

.dark #theme-btn {
	background-position-y: -64px;
}

#mute-btn {
	width: 64px;
	height: 64px;
	margin: 4px 8px;
	background-image: url("img/mute_sprites.webp"); /* sprite sheet */
}

#mute-btn:hover {
	background-position-x: -64px;
}

#mute-btn:active {
	background-position-x: 0;
}

#mute-btn.muted {
	background-position-y: -64px;
}

.dark #mute-btn {
	background-position-y: -128px;
}

.dark #mute-btn.muted {
	background-position-y: -192px;
}

/*--------------------------Cactus Dialog Animation---------------------------*/

@keyframes dialogin {
	from {transform: scale(0.0)}
	to {transform: scale(1.0)}
}

#cactus-dialog > .prickly {
	animation-name: dialogin;
	animation-duration: 100ms;
}

/*--------------------------------ID Elements---------------------------------*/

#title-heading {
	margin: 0.875rem 16px 0 4px;
	text-wrap: nowrap;
	color: var(--title-color);
	text-shadow: 0 0.05em var(--shadow-color);
}

#content {
	max-width: 100%;
}

#cactus-dialog.article #content {
	width: 90ch;
}

#content img {
	max-width: 100%;
	max-height: 50vh;
	border: 4px solid var(--border-color);
	box-sizing: border-box;
	object-fit: cover;
}

#copyright {
	margin: 0;
	font-family: Verdana, sans-serif;
	font-size: 0.75rem;
	color: dimgray;
}

#cactus {
	width: 256px;
	height: 256px;
	position: fixed;
	padding: 0;
	border: none;
	background-color: transparent;
	background-image: url("img/cactus.webp");
	background-size: 100%;
}

.dark #cactus {
	background-position-y: -256px;
}

#cactus:active {
	transform: translateY(4px);
}

/*-------------------------------Mobile Styling-------------------------------*/

@media screen and (max-width: 800px) {

	img {max-height: 90vh;}

	ul, ol {padding-inline-start: 1.5em;}

	/*----------Flexbox Layout----------*/

	.layout {
		height: auto;
		min-height: 100%;
	}

	.upper {
		/* Flex Container */
		flex-flow: row wrap;
		justify-content: start;
		align-items: flex-start;
	}

	.header {
		/* Flex Item */
		order: 1;
	}

	.main {
		width: 100%;
		/* Flex Item */
		order: 3;
	}

	.settings {
		margin-left: auto;
		padding-top: 0;
		/* Flex Item */
		order: 2;
		/* Flex Container */
		flex-flow: row wrap;
		justify-content: flex-end;
		align-items: flex-start;
	}

	.footer {margin-top: 210px;}

	.scrollable {padding: 0;}

	/*----------Hide Desktop Elements----------*/

	.desktop, .desktop * {display: none;}

	/*----------Prickly Border----------*/

	.prickly {
		border-image-source: url("img/prickly_border_mobile.webp");
	}

	.dark .prickly {
		border-image-source: url("img/prickly_border_mobile_dark.webp");
	}

	/*----------Close & Back Buttons----------*/

	.exit-bar {
		/* Flex Container */
		flex-direction: row-reverse;
		justify-content: space-between;
	}

	.exit-bar > a {
		margin-left: 0;
		font-size: 1.5rem;
	}

	/*----------Settings Buttons----------*/

	#theme-btn {margin-right: 4px;}

	/*----------ID Elements----------*/

	#cactus {
		width: 192px;
		height: 192px;
	}

	.dark #cactus {background-position-y: -192px;}

	#cactus:active {transform: translateY(3px);}
}

/*-------------------------------Print Styling--------------------------------*/

@media print {
	/*----------Flexbox Layout----------*/

	.layout {
		height: auto;
		min-height: 100%;
	}

	.upper {
		/* Flex Container */
		flex-flow: row wrap;
		justify-content: start;
		align-items: flex-start;
	}

	.main {width: 100%;}

	.settings {display: none;}

	.scrollable {padding: 0;}

	/*----------Borders----------*/

	.prickly {border: none;}

	/*----------Close & Back Buttons----------*/

	.exit-bar {display: none;}

	/*----------Hide Desktop Elements----------*/

	.desktop, .desktop * {display: none;}

	/*----------ID Elements----------*/

	#cactus {display: none;}
}
