*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

html {
  min-height: 100%;
  --bg: #ffe7cdf6;
  --text: #222;
  --link: #0066cc;
  --toggle-track: #e8d4bc;
  --toggle-thumb: #fff;
  background-color: var(--bg);
  color-scheme: light;
}

html:has(#dark:target) {
  --bg: #1a1a1a;
  --text: #e8e4df;
  --link: #7eb8ff;
  --toggle-track: #3a3a3a;
  --toggle-thumb: #e8e4df;
  color-scheme: dark;
}

body {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
}

a:hover {
  text-decoration: underline;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  flex-shrink: 0;
}

header a {
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
}

header a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-link--dark {
  display: none;
}

html:has(#dark:target) .theme-link--light {
  display: none;
}

html:has(#dark:target) .theme-link--dark {
  display: inline;
}

.theme-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  flex-shrink: 0;
}

.theme-toggle__link {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 999px;
  background: var(--toggle-track);
  cursor: pointer;
}

.theme-toggle__link::after {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--toggle-thumb);
  transition: transform 0.2s ease;
}

html:has(#dark:target) .theme-toggle__to-light::after {
  transform: translateX(1.125rem);
}

html:has(#dark:target) .theme-toggle__to-dark {
  display: none;
}

html:not(:has(#dark:target)) .theme-toggle__to-light {
  display: none;
}

.layout {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 25%;
  padding: 0 2rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar nav a {
  text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  text-decoration: underline;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 0 2rem 2rem;
}

.content > * {
  max-width: 65ch;
}

.content h1 {
  font-size: 1.25rem;
  font-weight: normal;
  margin-bottom: 1rem;
}

.content p {
  margin-bottom: 1rem;
}
