@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    src: url(/fonts/opensans/OpenSans-Regular.ttf);
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    src: url(/fonts/montserrat/Montserrat-Regular.ttf);
    font-display: swap;
}

:root {
    --total-width: 1024px;
    --hl-color: royalblue;
    --hl1-color: blueviolet;
    --ter-color: dimgray;
    --bg-color: #FEFEFF;
    --snd-bg-color: aliceblue;
}

html {
    background: var(--bg-color);
    font-family: "Open Sans", sans-serif;
    box-sizing: border-box;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-color);
    padding-top: 1em;
}

p, li, dl {
    hyphens: auto;
    overflow-wrap: break-word;
}

hr {
    border: 0 solid var(--ter-color);
    border-bottom-width: 1px;
    clear: both;
    margin: 32px 0;
}

a {
    text-decoration: none;
    color: var(--hl-color);
}

a:hover {
    text-decoration: underline;
}

nav a:hover {
    text-decoration: none;
}

h1.title {
    letter-spacing: 4px;
    margin: 0;
    padding-bottom: 1em;
    text-align: center;
}

aside#head > nav > a > img {
    width: 24px;
    border-width: 0;
    padding: 3px 12px 0 12px;
    filter: saturate(0) invert(0.2);
}

aside#head > nav > a > img:hover {
    filter: unset;
}

header div.highlight {
    padding: 0.75em;
    border-radius: 0.5em;
    border: 1px solid var(--hl-color);
    background: var(--snd-bg-color);
    min-width: 80%;
    display: table;
    margin: 0em auto 0.5em auto;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    margin: 1em 0;
    color: var(--hl-color);
}

main > h2 {
    border-bottom: 1px solid var(--hl-color);
}

main > p:first-of-type {
    margin-top: 0;
}

main > p {
    text-align: justify;
}

section > article > ol {
    display: flex;
    flex-wrap: wrap;
    flex-basis: content;
    margin: 0;
    padding: 0 0 1em 0;
}

section > article > ol > li > figure {
    width: 100%;
    margin: 0;
}

section figure > figcaption {
    text-align: center;
    font-weight: bold;
    padding-top: 16px;
}

section > article > ol > li {
    list-style: none;
}

dl {
    column-count: 2;
}

dt {
    padding-top: 12px;
    font-weight: bold;
}

th {
    text-align: right;
    padding-right: 1em;
    vertical-align:top;
}

/* lightbox (https://github.com/cadars/john-doe/blob/main/style.css) */

.lightbox {
  display: none;
  color: var(--textcolor);
}

.lightbox:target {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--bgcolor);
  border: 0;
  z-index: 3;
}

.lightbox img {
  max-height: 100vh;
  z-index: 4;
}

.lightbox:target:before { /* Loading spinner */
  content:"";
  height: 2em;
  width: 2em;
  animation: spin .8s infinite linear;
  border: 1px solid;
  border-right-color: transparent;
  border-radius: 50%;
  display: block;
  position: absolute;
  transform: translateX(-50%);
  opacity: .25;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.lightbox:target:after { /* × to close */
  content: "\00D7";
  position: fixed;
  font-size: 2em;
  font-weight: 200;
  line-height: 0;
  top: .75em;
  right: .5em;
  z-index: 4;
}

picture, picture > img {
    display: block;
}

picture {
    border: 1px solid var(--ter-color);
    margin: auto;
}

picture > img {
    max-width: 100%;
}

/* desktop/regular */
@media (min-width: 1024px) {
    body {
	width: var(--total-width);
	line-height: 1.33;
	font-size: 1.20em;
	margin: 0 auto 1.5em auto;
	max-width: 56em;
    }

    picture {
	max-width: 100%;
	box-sizing: border-box;
    }

    aside.right {
	float: right;
	margin-left: 32px;
    }

    /* about and links */

    aside#head {
	float: left;
	width: calc(var(--total-width) / 3);
    }

    aside#head > nav {
	margin: 0.5em 0;
	text-align: center;
    }

    aside#head > nav > a {
	text-decoration: none;
    }

    main {
	float: left;
	margin-left: 1em;
	width: calc((var(--total-width) / 3 * 2) - 1.5em);
    }

    main > * {
	max-width: 100%;
    }

    /* portfolio & courses */

    #gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
    }

    section > article > ol > li {
	width: 20%;
	margin: 2.5%;
    }

    section > picture#courses {
	float: right;
	margin: 0 0 1em 1em;
	width: 360px;
    }

    section > figure {
	width: 50%;
	margin: 32px auto 32px auto;
    }

    #portrait {
	max-width: 20%;
    }

    /* footer */

    footer > blockquote {
	font-size: 80%;
	opacity: 0.9;
	font-style: italic;
	margin: 1em 10%;
    }

    footer > blockquote > span:last-child {
	float: right;
	font-style: normal;
    }

    footer > aside#portrait > * {
	display: inline-block;
    }

    footer > aside#portrait > p {
	text-align: bottom;
	padding: 0 0.5em;
	font-size: 80%;
    }

    footer > aside#portrait > picture {
	width: 200px;
    }
}

/* mobile */
@media (max-width: 1024px) {
    html, body {
	width: calc(100%-1em);
	margin: 0 0 1em 0;
	padding-left: 0.5em;
	padding-right: 0.5em;
    }

    picture img {
	width: 100%;
    }

    aside#head > nav {
	padding: 1em;
	text-align: center;
    }

    aside#head > nav > a > picture {
	width: 24px;
	border-width: 0;
    }

    footer > aside#portrait > p#portrait-note {
	display: none;
    }
    
    #gallery figure {
	margin: 0;
	margin-top: 1em;
    }

    section figure > picture > * {
	max-width: 100%;
    }

    section > picture,
    footer > aside > picture {
	max-width: 90%;
	margin: 0 auto;
	display: block;
    }

    dl { column-count: unset; }
}
