/* Codeblock styles */
.giallo-l {
  display: inline-block;
  min-height: 1lh;
  width: 100%;
}

.giallo-ln {
  display: inline-block;
  user-select: none;
  margin-right: var(--gap);
  min-width: 3ch;
  text-align: right;
}

.giallo-l,
.giallo-ln {
  font-family: var(--ff-code);
  font-size: var(--fs-code);
}

pre {
  outline: solid var(--border-width) var(--clr-border);
  padding: var(--gap);

  > code[data-name]::before {
    content: attr(data-name);
    display: block;
    outline: solid var(--border-width) var(--clr-border);
    margin-inline: calc(var(--gap) * -1);
    margin-top: calc(var(--gap) * -1);
    padding-inline: var(--gap);
    padding-bottom: calc(var(--gap) / 3);
    margin-bottom: var(--gap);
    font-family: var(--ff-text);
    font-size: var(--fs-text);
    background-color: var(--fg0);
    color: var(--bg);
  }

  mark {
    display: block;
    color: currentcolor;
  }

  table td:nth-of-type(1) {
    color: var(--bg);
    font-style: italic;
  }
}

/* Unifraktur Cook/Maguntia are used exclusively for titles/headings */
@font-face {
  font-family: "UnifrakturCook";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/unifraktur-cook-700.ttf") format("truetype");
}

@font-face {
  font-family: "UnifrakturMaguntia";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/unifraktur-maguntia-400.ttf") format("truetype");
}

/* Grenze is for main body text */
@font-face {
  font-family: "Grenze";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/grenze-400.ttf") format("truetype");
}

@font-face {
  font-family: "Grenze";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/grenze-400-italic.ttf") format("truetype");
}

/* Courier Prime is just for code blocks */
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/courier-prime-400.ttf") format("truetype");
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/courier-prime-700.ttf") format("truetype");
}

:root {
  --red: #e67e80;
  --orange: #e69875;
  --yellow: #dbbc7f;
  --green: #a7c080;
  --aqua: #83c092;
  --blue: #7fbbb3;
  --purple: #d699b6;

  --clr-bg: var(--bg0);
  --clr-text: var(--fg0);
  --clr-text-secondary: var(--fg1);
  --clr-text-shadow: var(--bg);
  --clr-accent: var(--orange);
  --clr-border: var(--fg0);

  --ff-text: "Grenze", serif;
  --fs-text: 1.75rem;
  --ff-code: "Courier Prime", monospace;
  --fs-code: 1.5rem;
  --ff-title: "UnifrakturCook", serif;
  --fs-title: 3rem;
  --ff-heading: "UnifrakturCook", serif;
  --fs-heading: 3.5rem;
  --ff-subheading: "Grenze", serif;
  --fs-subheading: 2.25rem;

  --border-width: 0.2rem;
  --gap: 1rem;

  --text-shadow-y: 0.15rem;
  --text-shadow-x: calc(var(--text-shadow-y) * -1);
  --text-shadow-spread: calc(var(--text-shadow-y) * 2);

  --hover-scale: 1.125;
  --hover-letter-spacing: 0.25rem;
  --hover-trans-time: 0.25s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg0: #282828;
    --bg1: #45403d;
    --bg2: #32302f;
    --fg0: #dfbf8e;
    --fg1: #d8b182;
    --fg2: #e5cc97;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg0: #dfbf8e;
    --bg1: #d8b182;
    --bg2: #e5cc97;
    --fg0: #282828;
    --fg1: #45403d;
    --fg2: #32302f;
  }
}

/* Instant transitions if `prefers-reduced-motion` is on */
@media (prefers-reduced-motion: reduce) {
  :root {
    --hover-trans-time: 0s;
  }
}

html {
  font-family: var(--ff-text);
  color: var(--clr-text);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
li {
  font-size: var(--fs-text);
}

h1 {
  font-family: var(--ff-heading);
  font-size: var(--fs-heading);
}

h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ff-subheading);
  font-size: var(--fs-subheading);
}

h2 {
  color: var(--clr-text-secondary);
}

*::selection {
  color: var(--clr-bg);
  background-color: var(--clr-accent);
}

main {
  display: grid;
  grid-template-columns: 1;
}

.divider {
  margin-block: var(--gap);
  border: calc(var(--border-width) / 2) solid var(--clr-border);
}
