/* created using https://gwfh.mranftl.com/fonts */
@font-face {
  font-display: swap;
  font-family: 'Inconsolata';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/inconsolata-v32-latin-500.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Noto Emoji';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/noto-emoji-v53-emoji-500.woff2') format('woff2');
}

[data-theme="light"] {
  --bg: white;
  --bg-rgb: 255, 255, 255;
  --font: black;
  --font-rgb: 0, 0, 0;
  --accent: blue;
  --accent-rgb: 0, 0, 255;
  --alpha: 0.04;
}
[data-theme="dark"] {
  --bg: black;
  --bg-rgb: 0, 0, 0;
  --font: white;
  --font-rgb: 255, 255, 255;
  --accent: #03dac6;
  --accent-rgb: 3, 218, 198;
  --alpha: 0.15;
}
[data-theme="dark"] .invert_dark {
  -webkit-filter: invert(100%);
  filter: invert(100%);
}

html {
  overflow-x: hidden;
}
body {
  font-family: "Inconsolata", apple-system, system-ui, "Helvetica", "Arial", sans-serif, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  text-transform: lowercase;
  font-optical-sizing: auto;
  font-weight: 400;
  font-variation-settings: "wdth" 100;
  background-color: var(--bg);
  color: var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 70ch;
  margin: 0 auto;
  padding: 0 20px;
  font-size: large;
  align-items: center;
  overflow-x: hidden;
  -webkit-text-size-adjust: none;
}

p {
  line-height: 1.15;
}
@media only screen and (max-width: 70ch) {
  p {
    line-height: 1.3;
  }
}

main {
  flex: 1;
  width: 100%;
}

header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin-top: 30px;
}
header nav {
  display: flex;
  gap: 2ch;
  margin: 0 0 0 auto;
  padding: 0;
}

a {
  text-decoration: underline;
  text-decoration-thickness: .5px;
  color: var(--accent);
}
a:hover {
  text-decoration-thickness: 1px;
}

hr {
  color: var(--accent);
  width: 100%;
  border: 0;
  border-top: .5px dashed var(--accent);
}

strong {
  font-weight: 900;
  color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.25rem;
}

h3 + p, h4 + p, h5 + p, h6 + p {
  margin-top: 0.25rem;
}

li::marker {
  color: var(--accent);
}

.hl {
  color: var(--accent);
}

.section-header {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.section-element {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 2ch;
}
.section-element * {
  margin: 0;
}

.element-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.single-header h1 {
  margin: .67em 0 0 0;
}
.single-header h4 {
  margin: 0;
  color: var(--accent);
}

#blog-rss {
  margin-left: 0px;
  position: relative;
  top: -0.5em;
}

#large404 {
  display: flex;
}
#large404 h2 {
  font-size: 10ch;
  margin: 20vh auto 0 auto;
}
#text404 {
  margin: 3ch auto;
  max-width: max-content;
}
#text404 p {
  margin: .5ch 0;
}

footer {
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  text-align: center;
  position: relative;
  bottom: 0;
  min-width: 100%;
  font-weight: 100;
}
footer p {
  margin: 0;
  padding-bottom: 15px;
  color: var(--font);
}

#themer-button {
  align-self: baseline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
#themer-button:focus {
  outline: none;
}

/* Code blocks */
pre, code {
  text-transform: none;
}
pre:not(.key-box pre) {
  padding: 0.5rem;
  background-color: rgba(var(--font-rgb), 0.07) !important;
  color: var(--font-rgb) !important;
}
pre {
  overflow-x: scroll;
  font-size: .9rem;
  line-height: 1.15;
  font-family: "Inconsolata", monospace;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  pre {
    font-family: "Inconsolata", apple-system, system-ui, "Helvetica", "Arial", sans-serif, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: .9rem !important;
  }
}
code:not(pre code) {
  padding: 1px;
  background-color: rgba(var(--font-rgb), 0.07) !important;
}
.single-page pre:has(code) {
  overflow: scroll;
}
td:has(pre):has(code) {
  overflow: scroll;
  border-top: dashed 1px var(--accent);
  border-bottom: dashed 1px var(--accent);
  padding: .5ch 0 .5ch 0;
}

/* Media */
img, video {
  display: block;
  margin: 0 auto;
  max-height: 40ch;
  max-width: min(60ch, 95%);
  width: auto;
  height: auto;
  object-fit: contain;
}
img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}
@media only screen and (max-width: 70ch) {
  img, video {
    max-width: 90vw;
  }
}

figure {
  max-height: 40ch;
  max-width: 60ch;
  margin: 0 auto;
}
figcaption {
  font-size: small;
}
figure:has(video) + p {
  margin-top: 3rem !important;
}

/* Caption shortcode + figcaptions in imgcap/vidcap */
.cap {
  text-align: var(--cap-align, center);
  margin-top: var(--cap-mt, .2rem);
  font-size: small;
}
.cap__label {
  color: var(--accent);
}

.highlight:has(+ .cap .cap__label) > pre {
  margin-bottom: 0;
}

.portrait-img {
  width: 50%;
}
@media only screen and (max-width: 70ch) {
  .portrait-img {
    width: 70%;
  }
}

/* Blockquote */
blockquote {
  width: 100%;
  margin: 1ch 0 0 0;
  padding: .5ch 0 .5ch 1.5ch;
  border-left: .25ch solid var(--accent);
  background-color: rgba(var(--font-rgb), var(--alpha));
  font-style: oblique 5deg;
  line-height: 1.2;
}
blockquote p {
  margin: 0;
}
blockquote p + p {
  margin-top: 0.75ch;
}
@media only screen and (max-width: 70ch) {
  blockquote {
    padding: 1ch 1.5ch;
    line-height: 1.3;
  }
}

/* Key-box */
.key-box {
  outline: dashed .5px;
  margin: 3ch;
  margin-bottom: 8ch;
}
.key-box h3 {
  color: var(--accent);
  position: relative;
  top: -1.5ch;
  left: 1ch;
  background-color: var(--bg);
  width: max-content;
  padding: 0 1ch;
  margin: 0;
}
.key-box a {
  color: var(--accent);
  position: relative;
  bottom: -1ch;
  left: 1ch;
  background-color: var(--bg);
  width: max-content;
  padding: 0 1ch;
  margin: 0;
}
.key-box pre {
  padding: 0ch;
  margin: 0ch 5ch;
  overflow: hidden;
  font-size: 1.7ch;
  text-transform: none;
}

#TableOfContents ul {
  margin-top: 0px;
}

/* Review banner (in single.html) */
.review-banner {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  font-weight: 600;
  border-radius: 4px;
}

/* Badge wall (home) */
#badge-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0;
  padding: 0;
  margin: 0;
  width: 100%;
}
#badge-wall a {
  position: relative;
  display: block;
  padding: 0;
  margin: 0;
  line-height: 0;
  overflow: hidden;
}
#badge-wall a::before {
  content: "";
  display: block;
  padding-top: 35%;
}
#badge-wall img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
  display: block;
  image-rendering: pixelated;
  aspect-ratio: auto !important;
  max-width: 100% !important;
  max-height: none !important;
}
#badge-wall a::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}
#badge-wall a:hover::after {
  opacity: .3;
}
#badge-wall .badge__img--dark { opacity: 0; }
[data-theme="dark"] #badge-wall .badge__img--light { opacity: 0; }
[data-theme="dark"] #badge-wall .badge__img--dark  { opacity: 1; }

p:has(#badge_text) {
  margin-top: 0;
  margin-bottom: 1ch;
}
