:root {
  --off-black: hsl(0, 0%, 10%);
  --dark-grey: hsl(0, 0%, 30%);
  --mid-grey: hsl(0, 0%, 50%);
  --light-grey: hsl(0, 0%, 80%);
  --primary: black;

  --sans-serif: "DejaVu Sans", "Verdana", sans-serif;
  --serif: ETBook, "Georgia", "DejaVu Serif", serif;
  --mono: mono;

  --thin: 2px;
}

/*************
 |  GENERAL  |
 ************/

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  font-family: var(--sans-serif);
  color: var(--off-black);
  text-justify: inter-word;
  counter-reset: i-img i-snippet i-table i-video i-footnote;
  background-color: white;
  padding: 2.5rem;
}

body {
  padding-bottom: 3rem;
}

p {
  margin: 1em 0;
  line-height: 1.5em;
  font-family: var(--serif);
}

h1, h2, h3 {
  color: var(--primary);
  font-weight: bold;
}

h1 a, h2 a, h3 a {
  color: var(--primary);
  text-decoration: none;
}

h1 {
  font-size: 2rem;
  margin: 3rem 0;
}

h2 {
  font-size: 1.25rem;
  margin-top: 1.75em;
  margin-bottom: 1em;
}

h3 {
  font-size: 1rem;
  margin-top: 1.75em;
  margin-bottom: 1em;
}

h1.subtitle {
  font-size: 1rem;
  margin-top: -2rem;
  margin-bottom: 3rem;
  color: var(--mid-grey);
}

ul, ol {
  padding-left: 1.25em;
}

/*****************
 |  PAGE HEADER  |
 ****************/

header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 5rem;
  font-size: 18px;
  white-space: nowrap;
  padding: 2rem;
  margin: -2rem;
  margin-bottom: 0;
  padding-bottom: 0;
}

header a.site-title {
  font-weight: bold;
  font-size: 2.25rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
}

header p.title-quote {
  margin: 0;
  color: hsl(0, 0%, 40%);
}

header div.navrow {
  background-color: white;
  border-top: var(--thin) solid var(--light-grey);
  border-bottom: var(--thin) solid var(--light-grey);
  padding: 0 1rem;
  align-self: center;
  flex: 1 1 0;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

header nav {
  display: flex;
  gap: 0.875em;
}

/**********************
 |  Cat animated SVG  |
 *********************/

header .macek {
  overflow: clip;
  position: relative;
  will-change: width;
  animation: scaleAnimation 5s ease-in-out;
  animation-fill-mode: forwards;
  animation-delay: 3s;
  width: 100%;
}

header .macek-container {
  margin: 0.25rem;
  display: flex;
  flex-grow: 1;
  height: 1.5rem;
  padding: 0.125rem 0;
  min-width: 4.5rem;
  max-width: min(17.5rem, 100%);
  flex-direction: row-reverse;
}

@keyframes scaleAnimation {
  0.0% { width: 100%; }
  70.0% { width: 4.5rem; }
  100.0% { width: 6rem; }
}

header .macek img {
  margin: 0;
  height: 100%;
}

/***********************
 |  TOPLEVEL SECTIONS  |
 **********************/

section.toplevel {
  max-width: 45rem;
  margin: 4rem auto;
}

section.toplevel .info * {
  margin: 0;
}

section.toplevel .info {
  flex-direction: column;
  display: flex;
  gap: 1em;
}

/**************
 |  .aboutme  |
 *************/

section.aboutme {
  display: grid;
  justify-content: start;
  grid-template-columns: auto auto;
  align-items: center;
  font-size: 0.875rem;
  padding: 0 2rem;
  /* outline: 1px solid orange; */
}

section.aboutme h2 {
  font-size: 1rem;
}

section.aboutme .info {
  padding: 1.25rem 0;
  max-width: 16rem;
  /* display: flex; */
  /* outline: 1px solid green; */
}

section.aboutme .contact p {
  font-family: var(--sans-serif);
  margin: 0.125em 0;
  white-space: nowrap;
}

section.aboutme .contact span {
  margin-right: 0.5em;
}

/************************
 |  Decorative crosses  |
 ***********************/

section.aboutme .crosshair:before {
  content: "";
  width: 1.5rem;
  height: 3px;
  position: absolute;
  background-color: SeaGreen;
  left: 2rem;
}
section.aboutme .crosshair:after {
  content: "";
  width: 1.5rem;
  height: 3px;
  position: absolute;
  background-color: Gold;
  right: 2rem;
}

section.aboutme .crosshair.v:before {
  width: 3px;
  height: 1.5rem;
}
section.aboutme .crosshair.v:after {
  width: 3px;
  height: 1.5rem;
}

section.aboutme .crosshair.b:before {
  background-color: Tomato;
  transform: translate(0%, -100%);
}
section.aboutme .crosshair.b:after {
  background-color: RoyalBlue;
  transform: translate(0%, -100%);
}

/***************
 |  .projects  |
 **************/

section.projects ul {
  padding-left: 0;
}

li.project-card {
  font-size: 0.75rem;
  display: flex;
  gap: 2rem;
  flex-direction: row;
  justify-content: space-between;
  /* border-bottom: var(--thin) solid var(--light-grey); */
  /* padding: 2rem 0; */
  margin: 1.5rem 0;
}

li.project-card .info {
  max-width: 30em;
  gap: 1rem;
}

li.project-card .links {
  display: flex;
  flex-direction: row;
  font-family: var(--sans-serif);
  gap: 0.75em;
}

li.project-card figure {
  display: flex;
}

li.project-card img {
  height: 100px;
}

div.separator {
  border-bottom: var(--thin) solid var(--light-grey);
  /* border-bottom: var(--thin) solid red; */
  margin: 0 -1rem;
}

/***************
 |  .postlist  |
 **************/

section.postlist {
  margin: 3.5rem auto;
}

section.postlist ul {
  padding-left: 0;
  margin: 0;
}

section.postlist li {
  display: flex;
  align-items: center;
  margin: 0.5em 0;
  line-height: 1.25em;
  position: relative;
  padding-right: 7em;
}

section.postlist li[lang=en] > span:after {
  content: "(english)";
  left: 0.5em;
  position: relative;
  color: var(--mid-grey);
  font-size: 0.875rem;
  line-height: 1.25em;
  font-weight: bold;
}

section.postlist .tag {
  font-size: 0.625rem;
  padding: 0.175em 0.4em;
  padding-left: 2em;
  text-align: right;
  font-weight: bold;
  clip-path: polygon(1em 0%, 100% 0%, 100% 100%, 1em 100%, 0% 50%);
  position: absolute;
  top: -0.175em;
  right: 0;
  color: white;
}

section.postlist .tag:hover .short {
  display: none;
}

section.postlist .tag:hover .long {
  display: inline;
}

section.postlist .tag .long {
  display: none;
}

/*background-color: #E09740;*/
/*background-color: #577A8B;*/
/*background-color: #61584D;*/

.tag {
  background-color: red;
}

.tag.seminar {
  background-color: #2E3436;
}

.tag.maf2 {
  background-color: #017f57;
}

.tag.fot1 {
  background-color: #b14f47;
}

.tag.mod1 {
  background-color: #e09720;
}

.tag.nrg {
  background-color: #075ca4;
}


/*****************************************
 |  Annotated titles (exclude .aboutme)  |
 ****************************************/

section.toplevel h2:before {
  content: "§";
  color: var(--light-grey);
  font-family: var(--serif);
  position: absolute;
  transform: translate(-1em, 0);
}

section.toplevel h2:hover:before {
  color: var(--primary);
}

section.aboutme h2:before {
  display: none;
}

/***************
 |  .article  |
 **************/

section.article img {
  max-width: 100%;
  min-width: 200px;
}

section.article figure {
  margin: 3em 0;
  text-align: left;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

section.article blockquote {
  margin: 3.5rem;
}

section.article blockquote p {
  font-style: italic;
}

section.article blockquote p:last-of-type {
  text-align: right;
  font-style: normal;
}

section.article blockquote::before {
  content: "”";
  font-size: 5rem;
  color: var(--light-grey);
  position: absolute;
  transform: translate(-3rem, -1.5rem);
}

.snippet pre {
  color: black;
  padding: 0.5em 1em;
  font-size: 0.75rem;
  width: fit-content;
  counter-reset: i-snippet-line;
  background-color: var(--light-grey);
}

.snippet code {
  counter-increment: i-snippet-line;
  position: relative;
}

.snippet code::before {
  content: counter(i-snippet-line);
  color: var(--mid-grey);
  position: absolute;
  left: 0;
  width: 3em;
  text-align: right;
  transform: translateX(-150%);
}

table {
  padding: 0.4rem 0.75rem;
  border: var(--thin) solid var(--light-grey);
}

td, th {
  padding: 0 1em;
}

td:first-child, th:first-child {
  padding-left: 0;
}

td:last-child, th:last-child {
  padding-right: 0;
}

figcaption {
  font-size: 0.875rem;
  line-height: 1.3em;
  margin: 1em 0;
  color: var(--dark-grey);
  width: 100%;
}

figcaption::before {
  counter-increment: i-img;
  content: "Slika " counter(i-img) ": ";
  font-style: italic;
}

pre ~ figcaption::before {
  counter-increment: i-snippet;
  content: "Izrezek " counter(i-snippet) ": ";
  font-style: italic;
}

table ~ figcaption::before {
  counter-increment: i-table;
  content: "Tabela " counter(i-table) ": ";
  font-style: italic;
}

video ~ figcaption::before {
  counter-increment: i-video;
  content: "Video " counter(i-video) ": ";
  font-style: italic;
}

video {
  margin: 0 auto;
  display: block;
  max-width: 100%;
}

.csl-entry {
  margin: 0.875em 0;
  display: flex;
  gap: 1.5em;
}

.footnotes {
  margin: 4em 0;
  color: var(--dark-grey);
  font-size: 0.875rem;
}

.footnotes li {
  list-style: none;
  position: relative;
  counter-increment: i-footnote;
  margin: 0 1.5em;
}
.footnotes li::before {
  content: counter(i-footnote);
  font-size: 0.6875rem;
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-150%, -20%);
}

/*******************
 |  MEDIA QUERIES  |
 ******************/

@media screen and (min-width: 401px) {
  section.aboutme .crosshair {
    display: none;
  }
  section.aboutme img {
    margin-right: 1.75rem;
  }
}

@media screen and (max-width: 600px) {
  html {
    font-size: 14px;
  }
  header {
    font-size: 14px;
  }

  section.aboutme {
    padding: 0;
  }

  li.project-card {
    display: block;
    font-size: inherit;
  }
  li.project-card figure {
    margin-top: 1.25rem;
  }
  li.project-card img {
    height: 90px;
  }
}

@media screen and (max-width: 500px) {
  html {
    font-size: 13px;
  }
  header {
    font-size: 13px;
  }
}

@media screen and (max-width: 400px) {
  html {
    font-size: 11px;
    padding: 2rem;
  }
  header {
    font-size: 12px;
    margin: -2rem;
    margin-bottom: 0;
  }

  section.aboutme {
    padding: 0;
    font-size: inherit;
    grid-template-columns: none;
    grid-template-rows: auto auto;
    justify-content: center;
  }
  section.aboutme img {
    margin-bottom: 1.75rem;
    padding-left: 1rem;
  }
  section.aboutme .info {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media screen and (max-width: 350px) {
  section.aboutme .crosshair:before {
    display: none;
  }
  section.aboutme {
    justify-content: start;
  }
}
