p.download { padding-left: 3rem; position: relative; }
ul.downloads { margin-top: 2rem; padding-left: 3rem; }
ul.downloads li { list-style-type: none; position: relative; }
p.download::before { display: inline-block; height: 2.5rem; left: 0; position: absolute; text-align: center; transform: scale(0.6); vertical-align: middle; width: 2.5rem; }
ul.downloads li::before { display: inline-block; height: 2.5rem; left: -3rem; position: absolute; text-align: center; transform: scale(0.6); vertical-align: middle; width: 2.5rem; }
p.download::before { content: url(icons/download.svg#download-dark); }
ul.downloads li.amo::before { content: url(icons/puzzle.svg#puzzle-dark); }
ul.downloads li.dos::before { content: url(icons/dos.svg#dos-dark); }
ul.downloads li.srccpp::before { content: url(icons/source.svg#source-dark); }
ul.downloads li.srcpas::before { content: url(icons/source.svg#source-dark); }
ul.downloads li.srcpy::before { content: url(icons/python.svg#python-dark); }
ul.downloads li.srcscpt::before { content: url(icons/applescript.svg#applescript-dark); }
ul.downloads li.win::before { content: url(icons/windows.svg#win-dark); }

@media (prefers-color-scheme: dark)
{
	p.download::before { content: url(icons/download.svg#download-light); }
	ul.downloads li.amo::before { content: url(icons/puzzle.svg#puzzle-light); }
	ul.downloads li.dos::before { content: url(icons/dos.svg#dos-light); }
	ul.downloads li.srccpp::before { content: url(icons/source.svg#source-light); }
	ul.downloads li.srcpas::before { content: url(icons/source.svg#source-light); }
	ul.downloads li.srcpy::before { content: url(icons/python.svg#python-light); }
	ul.downloads li.srcscpt::before { content: url(icons/applescript.svg#applescript-light); }
	ul.downloads li.win::before { content: url(icons/windows.svg#win-light); }
}

@media (min-width: 768px)
{
	p.download::before { top: 0.25rem; transform: none; }
	ul.downloads li::before { top: 0.25rem; transform: none; }
}

#site-content section
{
	clear: left;
}

#site-content table.news td {
	padding-bottom: 1ex;
	padding-top: 1ex;
	vertical-align: middle;
}

#site-content ul.short,
#site-content ul.short li,
#site-content ul.short li ul
{
	line-height: 100%;
	margin: 1ex 0;
}

#site-content ul.short li ul
{
	padding-left: 2em;
}

/* Page watching service */

.entry {
	font-size: 80%;
	margin-bottom: 1ex;
}

.entry .changed {
	color: red;
	font-weight: bold;
}

div.error {
	background: silver;
	color: red;
	line-height: 1.5;
	margin: 1em 0;
	padding: 1em;
}

div.message {
	background: silver;
	color: black;
	line-height: 1.5;
	margin: 1em 0;
	padding: 1em;
}

label.error {
	color: red;
	font-weight: bold;
}

/* Source code */

code
{
	overflow-x: auto;
}

code.cpp
{
	white-space: pre;
}

code.cpp .kw
{
	color: blue;
}

code.cpp .pp,
code.cpp .pp .kw,
code.cpp .pp .string
{
	color: purple;
}

code.cpp .rem,
code.cpp .rem .kw,
code.cpp .rem .string
{
	color: green;
}

code.cpp .string,
code.cpp .string .kw,
code.cpp .string .rem
{
	color: maroon;
}

code.css,
code.gml,
code.javascript,
code.json,
code.pseudo,
code.sql,
code.xml
{
	white-space: pre;
}

code.xml .prolog,
code.xml .prolog span
{
	color: green;
	font-style: italic;
}

code.xml .element
{
	color: purple;
}

code.xml .entity
{
	color: maroon;
}

code.xml .attr
{
	color: brown;
}

code.xml .value,
code.xml .value span
{
	color: navy;
}

code.xml .cdata
{
	color: teal;
}

/* Keyboard text */

kbd
{
	background-color: #E2E2E2;
	background-image: linear-gradient(to left, white 0%, #E2E2E2 25%);
	border : 1px solid gray;
	border-radius: 3px;
	box-shadow: 1px 0 1px 0 #fff, 0 2px 0 2px silver, 0 2px 0 3px #333;
	color: black;
	font-family: monospace;
	margin: 0 5px;
	padding: 1px 5px;
	text-transform : uppercase;
}

/* Quote */

blockquote {
	background-image: url(quote.png);
	background-repeat: no-repeat;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 110%;
	font-style: italic;
	line-height: 140%;
	margin: 1em;
	padding-left: 30px;
}

/* Twitter feed */

#twitter ul {
	padding: 0 !important;
}

#twitter li {
	color: black;
	display: block;
	font-size: x-small !important;
	margin: 1ex 0;
	overflow: hidden;
}

#twitter li img
{
	border: 1px solid white;
	-moz-box-shadow: 1px 1px 2px black;
	-webkit-box-shadow: 1px 1px 2px black;
	box-shadow: 1px 1px 2px black;
	float: left;
	margin-right: 1ex;
}

#twitter li .date
{
	color: silver;
	display: block;
}

/* Images in title */

h2 img
{
	vertical-align: middle;
}

/* List of cards */

.cards
{
	display: flex;
	margin-right: -1rem;
	flex-wrap: wrap;
}

.card
{
	box-sizing: border-box;
	flex: 0 1 100%;
	margin: 0 1rem 1rem 0;
	text-decoration: none;
}

.card, .card:hover, .card:visited { border: 1px solid var(--light-frg); }

.card .card-thumbnail
{
	background-position: center center;
	background-size: cover;
	height: 0;
	padding-bottom: 75%;
	width: 100%;
}

.card .card-info
{
	line-height: 1.25;
	padding: 0.5rem;
}

.card .card-title
{
	display: block;
	font-weight: bold;
}

.card .card-summary
{
	color: var(--dark-frg);
	display: block;
	margin: 0.25em 0;
}

.card .card-tags
{
	color: var(--light-frg);
	display: block;
	font-size: 80%;
	margin: 0;
	padding: 0;
}

.card .card-tags li
{
	display: inline-block;
	margin: 0 1ex 0 0;
	padding: 0;
}

@media (min-width: 540px) { .card { flex-basis: calc(50% - 1rem); } }
@media (min-width: 1024px) { .card { flex-basis: calc(33.33333% - 1rem); } }

/* Sidebars in blog posts */

section.sidebar
{
	background-color: var(--light-bkg);
	color: var(--dark-frg);
	display: block;
	margin-top: 1rem;
	padding: 1rem;
}

section.sidebar > h2:first-child
{
	margin-top: 0;
}

/* Illustrations in blog posts */

p.illustration
{
	margin: 1em;
	padding-left: 1em;
}

p.illustration img
{
	border: 2px solid white;
	-moz-box-shadow: 2px 2px 5px black;
	-webkit-box-shadow: 2px 2px 5px black;
	box-shadow: 2px 2px 5px black;
	height: auto;
	margin-bottom: 1ex;
	margin-left: -1em;
	max-width: 100%;
}

img.png-shadow
{
	filter: drop-shadow(1ex 1ex 0.5ex rgba(0,0,0,0.5));
	height: auto;
	max-width: 100%;
}

/* Screenshots */

.shot-container
{
	background: black;
	border: none;
	box-shadow: 2px 2px 5px black;
	display: block;
	height: 0;
	position: relative;
	width: 100%;
}

.ar-16x9
{
	padding: 0 0 56.25%;
}

.ar-16x10
{
	padding: 0 0 62.5%;
}

.ar-4x3
{
	padding: 0 0 75%;
}

.shot-container img.shot
{
	bottom: 0;
	box-shadow: none;
	height: 100%;
	left: 0;
	margin: 0;
	max-width: none;
	object-fit: contain;
	position: absolute;
	right: 0;
	top: 0;
	width: 100%;
}

img.rawshot
{
	height: auto;
	margin: 1em;
	max-width: calc(100% - 2em);
}

img.shot
{
	-moz-box-shadow: 2px 2px 5px black;
	-webkit-box-shadow: 2px 2px 5px black;
	box-shadow: 2px 2px 5px black;
	height: auto;
	margin: 1em;
	max-width: calc(100% - 2em);
}

@media (min-width: 768px)
{
	img.shot.left { display: block; float: left; margin-left: 0; }
	#site-content section img.left + div.description { padding-left: 344px; padding-top: 1em; }
}

td > img.shot
{
	max-width: none;
}

table.shots
{
	margin: auto;
}

table.shots img
{
	margin: 1em;
}

figure figcaption
{
	font-size: 80%;
	font-style: italic;
}

/* Gallery */

#gallery_filter select
{
	margin-right: 2em;
}

#gallery_zoomed
{
	background: white;
	border: 1px solid silver;
	cursor: pointer;
	display: none;
	left: 50%;
	padding: 10px;
	position: fixed;
	top: 50%;
}

#gallery_zoomed img#zoomed
{
	margin-bottom: 10px;
}

#gallery .shot
{
	border: 1px solid #EEE;
	cursor: pointer;
	float: left;
	margin: 1em;
	overflow: hidden;
	padding: 1em;
	width: 160px;
}

#gallery .shot:hover {
	background: #EEE;
	border: 1px solid #DDD;
}

#gallery .shot img {
	margin: auto;
}

#gallery .shot span {
	display: none;
}

/* Database result table */

.db_result
{
	border-spacing: 3px;
	color: black;
	empty-cells: show;
	margin: 1em 1px;
	outline: 1px solid silver;
}

.db_result th
{
	background: #D3DCE3;
	font-weight: bold;
	padding: 0.5ex 1em;
	text-align: center;
}

.db_result td
{
	background: #E5E5E5;
	padding: 0.5ex 1em;
	text-align: left;
	vertical-align: top;
}

.db_result tr:nth-child(odd) td
{
	background: #D5D5D5;
}

/* Spoilers, used in blog post about puzzles */

.spoiler
{
	border: 1px dashed #808080;
	border-radius: 4px;
	color: transparent;
	padding-left: 4px;
	padding-right: 4px;
}

.spoiler:hover
{
	color: inherit;
}

/* Support table, used in blog post */

.support
{
	cursor: default;
	empty-cells: show;
	font-size: x-small;
	width: 100%;
}
.support td
{
	background-color: #FEE;
	background-image: url(/images/icons/cross.png);
	background-repeat: no-repeat;
	background-position: center center;
	height: 16px;
	min-width: 16px;
	text-align: center;
}
.support .yes
{
	background-color: #EFE;
	background-image: url(/images/icons/tick.png);
}
.support .maybe
{
	background-color: #FFE;
}
.support .info
{
	background-image: url(/images/icons/information.png);
}
.support .bug
{
	background-color: #FFE;
	background-image: url(/images/icons/bug.png);
}
.support .na
{
	background-color: #DDD;
	background-image: url(/images/icons/bullet_black.png);
}
.support thead th
{
	border-right: 1px solid silver;
	padding: 0 2px;
	vertical-align: top;
}
.support tbody th
{
	border-top: 1px solid silver;
	padding: 8px;
	text-align: right;
}
.support .note
{
	background-color: #FFE;
	border: 1px solid black;
	-moz-box-shadow: grey 2px 2px 10px;
	-webkit-box-shadow: grey 2px 2px 10px;
	box-shadow: grey 2px 2px 10px;
	display: none;
	margin-left: 3em;
	margin-top: 1em;
	padding: 1em;
	position: absolute;
}
.support td:hover .note
{
	display: block;
}

/* Pixel art */

#pixelart { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; margin: 1em 0; padding: 0; }
.pixelart-image { border: none; display: block; position: relative; }
.pixelart-label { background: var(--light-bkg); border: none; border-radius: 3px; bottom: 1em; color: var(--dark-frg); font-size: 0.75rem; font-style: normal; font-weight: bold; line-height: 1; opacity: 0.9; padding: 4px 8px; position: absolute; text-transform: uppercase; }
.pixelart:hover .pixelart-label { opacity: 1; }
.pixelart-alt { left: 1em; }
.pixelart-gif { right: 1em; }
.pixelart-caption { background: var(--light-bkg); bottom: 0; clip: rect(0,0,0,0); color: var(--dark-frg); font-style: normal; left: 0; opacity: 0; padding: 4px 8px; position: absolute; right: 0; transition: opacity 0.5s ease; }
.pixelart-alt:hover + .pixelart-caption, .pixelart-caption:hover { clip: auto; opacity: 0.9; }
.pixelart-image img { display: block; height: auto; width: 100%; }
.pixelart-preview { aspect-ratio: 1; display: block; object-fit: cover; }
.pixelart-meta { border-top: 1px solid var(--light-frg); display: flex; flex-direction: row; justify-content: space-between; }
.pixelart-meta .fa-calendar { margin-right: 0.5rem; }
.pixelart-meta a { margin-left: 0.5rem; }
.pixelart-date { order: 0; }
.pixelart-palette { order: 10; }
.pixelart-social { align-self: flex-end; order: 20; }

#pixelart-popup { display: flex; flex-direction: column; max-height: 95vh; max-width: 95vw; overflow-y: auto; width: 512px; }
#pixelart-popup .popup-header { flex: 0 0 auto; grid-area: header; }
#pixelart-popup .pixelart-image { align-items: center; display: flex; flex: 0 0 auto; grid-area: img; }
#pixelart-popup .pixelart-description { flex: 1 1 4em; font-size: 1rem; grid-area: descr; margin: 0; max-height: 4em; overflow: auto; padding: 0.5rem 1rem; }
#pixelart-popup .pixelart-meta { font-size: 0.75rem; grid-area: footer; }

@media (min-width: 480px)
{
	#pixelart { grid-template-columns: 1fr 1fr; }
	#pixelart .pixelart-image { transition: transform 0.5s ease; }
	#pixelart .pixelart:hover .pixelart-image { transform: scale(1.05); }
	#pixelart .pixelart-caption { font-size: 0.75rem; }
	#pixelart .pixelart-description { font-size: 1rem; }
	#pixelart .pixelart-meta { flex-wrap: wrap; font-size: 1rem; }
	#pixelart .pixelart-meta .pixelart-palette { flex: 1 1 100%; }
	#pixelart .pixelart-meta .pixelart-social { flex: 1 1 auto; order: 5; text-align: right; }
	.js-enabled #pixelart .pixelart { cursor: pointer; }
	.js-enabled #pixelart .pixelart-title { display: none; }
	.js-enabled #pixelart .pixelart-description { display: none; }
	.js-enabled #pixelart .pixelart-meta { display: none; }
}
@media (min-width: 720px)
{
	#pixelart { grid-template-columns: 1fr 1fr 1fr; }
	
	#pixelart-popup { display: grid; grid-template-areas: 'header header' 'img descr' 'footer footer'; width: 1024px; }
	#pixelart-popup .pixelart-full { max-width: 512px; width: 47.5vw; }
	#pixelart-popup .pixelart-meta { font-size: 1rem; }
	#pixelart-popup .pixelart-description { max-height: none; }
}


/* Portfolio */

.portfolio-section
{
	border-color: #CCCCCC;
	border-style: solid none none;
	border-width: 1px 0 0;
	overflow: hidden;
	padding-top: 1em;
	margin: 1em 0;
}

.portfolio-section .portfolio-link
{
	background: none !important;
	float: left;
	padding: 0 !important;
}

.portfolio-section .description
{
	overflow: hidden;
	padding-left: 1em;
}

/* Embedded YouTube */

.youtube-container
{
	height: 0;
	margin: 1.5em 0;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.youtube-container .youtube-embed
{
	bottom: 0;
	height: 100%;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
	width: 100%;
}

/* Embedded Steam */

.steam-iframe
{
	margin: 1em 0;
	width: 100%;
}


/* Search results */

.search-result
{
	display: flex;
}

.search-result .index
{
	color: var(--light-frg);
	flex: 0 0 2em;
	font-size: 200%;
	line-height: 1;
	margin-right: 1ex;
	text-align: right;
}

.search-result .summary
{
	flex: 1 1 auto;
	margin-bottom: 1em;
	overflow: hidden;
}

/* Resume */

#resume p, #resume table {
	margin-bottom: 1em;
	margin-left: 1em;
}

#resume td {
	font-size: 100%;
}

/* ###### Google Ads ##### */
#ads {
	height: 600px;
	margin-bottom: 1em;
	position: absolute;
	right: 1em;
	width: 120px;
}