/* fonts */
@font-face {
	font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../_assets/webfonts/pfd_b.woff2') format('woff2');
}

@font-face {
	font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../_assets/webfonts/pfd_bi.woff2') format('woff2');
}

/* deathshadow reset */

html,body,div,p,h1,h2,h3,h4,h5,h6,
ul,ol,li,dl,dt,dd,form,fieldset,caption,
table,tr,td,th,address,blockquote,img {
	margin:0;
	padding:0;
}

img, fieldset, object {
	border:none;
}

*, *:after, *:before {
	flex:1 0 auto; /* safari bugfix */
	box-sizing:border-box;
}

button, label {
	cursor:pointer;
	flex: 0;
}

html, body {
	height:100%;
}

hr {
	display:none;
}

body {
	line-height: 1.5;
}

button, input, table, textarea, select {
	font: inherit;
}

code, raw {
	font-size: 1em;
}

select, img {
	max-width: 100%;
}

/* we do a little trolling */

[id$="google-cache-hdr"]{
	position: fixed !important;
	width: 100% !important;
	z-index: 999 !important;
	bottom: 0 !important;
}

[id$="google-cache-hdr"] + * {
	padding-bottom:15em !important;
}


body {
	line-height: 1.6em;
	font-family: Helvetica, Arial, Arimo, sans-serif;
	background: #888;
	color: #111;
	background-image: url('../_assets/images/bg-light.jpg');
	background-size: cover;
	background-attachment: fixed;
}

a {
	color: inherit;
	opacity: 0.65;
}

a:hover {
	opacity: 1;
}

article a:visited {
	color: #3c3cd2;
}

hr {
	display: none;
}

p {
	padding-bottom: .75em;
}

img {
	max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	padding: 0.6rem 0;
	font-family: 'Playfair Display', Times, 'Times New Roman', serif;
	line-height: 1.6em;
	clear: both;
}

pre {
	max-width: 100%;
	overflow: auto;
}

code {
	font-size: 1rem;
}

h1 {
	font-size: 2em;
}

h2 {
	font-size: 1.45em;
}

h3 {
	font-size: 1.2em;
}

h4,
h5,
h6 {
	font-size: 1.2em;
}

#contents,
footer {
	padding: 0 2em;
}

.container {
	width: 80%;
	margin: auto;
	margin-bottom: 5em;
	border-radius: 0em 0em 1em 1em;
	box-shadow: 0 1px 16px rgba(0, 0, 0, 0.5);
}

header {
	display: flex;
	flex-direction: column-reverse;
}

header > * {
	flex-grow: 1;
}

header h1 {
	background: #cc8400;
	background-image: url('../_assets/images/scanline.png'), linear-gradient(to right, rgba(0, 0, 0, 0) 0%, #000000 100%);
	background-position: 0 0, 0 0, 80%;
	background-repeat: repeat, repeat;
	background-size: auto, auto;
	text-shadow: 0 0 10px black;
	color: white;
	padding-left: 1em;
	padding-right: 1em;
	padding-top: 2.5em;
	padding-bottom: 1em;
	line-height: 1em;
	user-select: none;
}

#main-menu,
footer {
	background: #212b44;
	color: white;
}

#main-menu {
	position: fixed;
	z-index: 999;
	width: 80%;
	top: 0;
	padding: .8em 2em;
	font-size: .9em;
	display: flex;
	flex-direction: row-reverse;
	background-image: url('../_assets/images/icon.svg'), linear-gradient(to bottom, #a7adb9 0%, #a7adb9 1px, #6c7282 1px, #354356 50%, #212b44 50%, #000000 100%);
	background-position: 2em 50%, 0 0;
	background-repeat: no-repeat, repeat;
	background-size: auto 70%, auto;
}

#main-menu ul {
	list-style: none;
	display: flex;
	flex-grow: 1;
}

#main-menu ul li {
	display: inline-block;
	flex-grow: 1;
}

#main-menu ul li a {
	opacity: 1;
}

.selected a {
	text-shadow: 0 0 8px;
}

#main-menu ul:before {
	content: '';
	width: 2em;
	margin-right: 2em;
}

#main-menu ul:after {
	content: '';
	padding-left: 14em;
}

#contents {
	background: rgba(255, 255, 255, 0.7);
	padding-bottom: 2em;
}

#contents ul,
#contents ol {
	margin-left: 3em;
}

article ul li,
article ol li {
	margin-bottom: .5em;
}

#blog-index ul {
	margin-left: 0;
	list-style-type: none;
}

#blog-index-categorical ul {
    margin-left: 1em;
    list-style-type: '\02192\00020';
}

footer {
	display: flex;
	flex-direction: column;
	padding-top: .5em;
	padding-bottom: .5em;
	line-height: 1.5em;
	border-radius: 0em 0em 1em 1em;
	background-image: linear-gradient(to bottom, #354356 0%, #010b24 100%);
}

footer .row {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
}

footer .row > * {
	padding: .5em;
}

footer .lhs,
footer .rhs,
footer .chs {
	flex-grow: 1;
}

footer .lhs {
	text-align: left;
}

footer .rhs {
	text-align: right;
}

footer .chs {
	text-align: center;
}

footer .rhs ul {
	list-style-type: none;
}
/*.separator{
    width:100%;
    content:'';
    height: 1px;
    background: rgba(255,255,255,.2);
    margin: 10px 0;
}*/
.footer-buttons {
  /*&:after{
        content: "(Don't hotlink!)";
        display: block;
        text-align: center;
    }*/;
}

.footer-buttons > * {
	opacity: 1;
	margin-right: .5em;
}

.article-date,
.last-edited {
	color: rgba(0, 0, 0, 0.7);
	user-select: none;
	font-style: oblique;
}

.readtime {
	position: relative;
	display: inline-block;
	top: 1em;
	margin-bottom: .5em;
}

a.image-link {
	opacity: 1;
}

#mobile-toggle {
	display: none;
}

#blog-index li {
	margin-bottom: 0;
}

article figure img {
	border: 1px solid rgba(0, 0, 0, 0.7);
}

article figure figcaption {
	font-style: oblique;
}

.fig-left,
.figure-left {
	float: left;
	clear: left;
}

.fig-right,
.figure-right {
	float: right;
	clear: right;
}

article figure {
	margin: 1em 0;
	padding: .5em;
}


blockquote {
	padding: .1em 1.5em;
	font-style: italic;
}

footer .row > * {
	max-width: 100%;
}

pre {
	overflow-x: auto;
}

@media only screen and (max-width: 56em) {
	.container {
		width: 100%;
		margin-bottom: 0;
		border-radius: 0;
	}

	footer {
		border-radius: 0;
	}

	#main-menu {
		width: 100%;
		background-position: 1em 50%, 0 0;
	}

	#main-menu ul:after {
		padding-left: 0;
	}

	#contents, footer {
		padding: .5em 1em;
	}

	#contents {
		padding-bottom: 2em;
		padding-top: 0;
	}

	header h1 {
		padding-left: .5em;
		padding-right: .5em;
	}
}

/* mobile toggles */
@media only screen and (max-width: 35em) {
	#main-menu ul {
		display: none;
	}

	#mobile-toggle + label {
		-webkit-tap-highlight-color: transparent;
	}

	#mobile-toggle + label:before {
		width: 7em;
		text-align: center;
		background: #0e1217;
		background-image: linear-gradient(to bottom, #6f788b 0%, #222a36 50%, #101522 50%, #111 100%);
		box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.2);
		border-radius: 5px;
		display: block;
		content: 'Show menu';
		font-weight: bold;
		text-shadow: 0 2px rgba(0, 0, 0, 0.7);
		padding: .25em 0;
		margin: -.25em;
		position: relative;
		left: 1em;
	}

	#mobile-toggle:checked + label:before {
		content: 'Hide menu';
		box-shadow: inset 0 2px 5px #000000, inset 0 -1px 0 rgba(255, 255, 255, 0.2);
	}

	#mobile-toggle:checked + label + ul {
		display: block;
		position: absolute;
		background: white;
		background-image: linear-gradient(to bottom, white 0%, #ddd 100%);
		text-shadow: 0 1px rgba(0, 0, 0, 0.2);
		color: #222;
		border-radius: 5px;
		box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
		top: 3.5em;
		right: 0.8em;
	}

	#mobile-toggle:checked + label + ul:before {
		display: none;
	}

	#mobile-toggle:checked + label + ul li {
		display: block;
		padding: .5em 1.5em;
		border-radius: 5px;
	}
	
	#mobile-toggle:checked + label + ul li a {
		text-decoration: none;
		text-shadow: none;
	}

	#mobile-toggle:checked + label + ul li:hover {
		background: #0380dd;
		background-image: linear-gradient(to bottom, #0380dd 0%, #65b7ef 100%);
		color: white;
	}

	#mobile-toggle:checked + label + ul li:hover a {
		opacity: 1;
	}
}

@media only screen and (max-width: 24em) {
	header h1 {
		background-size: auto, auto, 80% auto;
	}
}

@media only screen and (min-width: 80em) {
	.container {
		width: 64em;
	}

	#main-menu {
		width: 64rem;
	}
}

article figure {
	text-align: center;
	display: block;
}

article figure img {
	max-width: 80%;
}

.fig-left,
.figure-left,
.fig-right,
.figure-right {
	width: 40%;
}

.fig-left,
.figure-left {
	float: left;
	clear: left;
	margin: 1em 2em 1em 0;
}

.fig-right,
.figure-right {
	float: right;
	clear: right;
	margin: 1em 0 1em 2em;
}

@media only screen and (max-width: 56em) {
  .fig-left,
  .figure-left,
  .fig-right,
  .figure-right {
		width: 50%;
	}
}

@media only screen and (max-width: 35em) {
  .fig-left,
  .figure-left,
  .fig-right,
  .figure-right {
		float: right;
		width: 100%;
		margin: 1em;
	}
}

/* dark theme */
@media (prefers-color-scheme: dark) {
    body{
        background-image: url('../_assets/images/bg-dark.jpg');
    }
    #contents{
        background: rgba(12,12,12,0.7);
        color: #fff;
    }
    #mailtxt{
        filter: invert(1);
    }
    .article-date, .last-edited {
        color: rgba(255,255,255,.7);
    }

    @media only screen and (max-width: 35em){
        #mobile-toggle:checked + label + ul{
            background-image: linear-gradient(to bottom, #444 0%,#000 100%);
            color: white;
        }
        #mobile-toggle:checked + label + ul li:hover{
            background-image: linear-gradient(to bottom, #0360bd 0%,#4597cf 100%);
            color: white;
        }
    }
    
    article figure img {
        border: 1px solid rgba(255,255,255,.7);
    }

    article a:visited {
      color: #acacf2;
    }
}

footer {
	clear: both;
}

#blog-index-categorical {
	columns: 20em;
}

#blog-index-categorical > * {
	box-shadow: 0 0 0 1px inset rgba(0,0,0,.1);
	padding: 1em;
	break-inside: avoid;
	margin-bottom: 1em;
}

@media screen and (prefers-color-scheme: dark) {
	#blog-index-categorical > * {
		box-shadow: 0 0 0 1px inset rgba(255,255,255,.1);
	}
}

.blog-category {
	margin-bottom: 1em;
}

