@import url("https://fonts.googleapis.com/css2?family=Vollkorn:ital,wght@0,400..900;1,400..900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Vollkorn+SC:wght@400;600;700;900&display=swap");

:root,
:root[data-theme="light"] {
  --bg: #eeeeee;
  --fg: #111111;
  --muted: #666666;
  --link: #111111;
  --translucent: rgba(238, 238, 238, 0.75);
  --sticky-top: 5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --fg: #eeeeee;
    --muted: #9a9a9a;
    --link: #eeeeee;
    --translucent: rgba(17, 17, 17, 0.75);
  }
}

:root[data-theme="dark"] {
  --bg: #111111;
  --fg: #eeeeee;
  --muted: #9a9a9a;
  --link: #eeeeee;
  --translucent: rgba(17, 17, 17, 0.75);
}

*, *::before, *::after {
  box-sizing: inherit;
}

html {
  height: auto;
  overflow: visible;
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0 auto;
  width: 90%;
  max-width: 75ch;
  padding: 0rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: "Vollkorn", serif;
  font-weight: 400;
  font-style: normal;
}

/* @media (min-width: 1000px) {
  body { 
    max-width: 95ch;
  }
} */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  max-height: var(--sticky-top);
  padding-block: .5rem;
  border-bottom: 0.5px solid var(--muted);
  background: var(--translucent);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
}

footer {
  border-top: 0.5px solid var(--muted);
  padding-top: 0.5rem; 
  margin-top: 2rem;
}

header, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.inline-center {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-left: auto;
}

main {
  margin-top: 1rem;
}

nav {
  display: inline-flex;
  gap: .5rem;
  flex-wrap: wrap;
}

h1 {
  line-height: 1.05;
  font-family: "Vollkorn SC", serif;
}

h1 a {
  text-decoration: none;
}

h2,h4 {
  font-style: italic;
  font-variant: discretionary-ligatures historical-ligatures contextual;
}

hr {
  border: 0;
  width: 50%;
  margin: 2rem auto;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--muted),
    transparent
  );
}

a {
  color: var(--link);
  text-decoration: underline dotted;
  text-underline-offset: .15em;
}

small, small a {
  color: var(--muted);
}

button, .chip {
  font: inherit;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: .25rem .75rem;
  cursor: pointer;
}

.flag,
#themeButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.5em;
  width: 2.25rem;
  /* aspect-ratio: 3 / 2; */
  border-radius: 0.3rem;
  overflow: hidden;
}

.flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#themeButton {
  /* margin-left: .25rem; */
  padding: 0.15em;
  border: 1px solid var(--muted);
  --icon-size: 1.05em;
}

.icon {
  width: var(--icon-size, 1.5em);
  height: var(--icon-size, 1.5em);
  display: inline-block;
  vertical-align: text-bottom;
  color: var(--fg);
  fill: currentColor;
}

.note a {
  font-variant-numeric: tabular-nums;
  padding: 0 .15em;
}

.footnotes {
  margin-top: 2rem;
  padding-top: .5rem;
  font-size: 0.8em;
  line-height: 1.5;
  padding-left: 1.5em;
}

.footnotes li {
  margin: .5rem 0;
}

.footnotes .backref {
  margin-left: .5rem;
  opacity: .7;
}

:target {
  animation: target-highlight 1.5s ease-out 1;
}
@keyframes target-highlight {
  0% { background: rgba(255, 230, 140, .8); }
  100% { background: transparent; }
}

[id^="note-"], [id^="noteref-"] {
  scroll-margin-top: calc(var(--sticky-top) + 0.5rem);
}

#not-found-error {
  text-align: center;
  margin-top: 1rem;
}

.error {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 600;
  margin: 0 0 1rem;
}

#not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}
