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

:root {
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --accent: #2563eb;
  --sidebar-w: 240px;
}

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  display: flex;
  min-height: 100vh;
}
body.admin {
  flex-direction: column;
}
img {
  max-width: 100%;
  height: auto;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  border-right: 1px solid var(--border);
  padding: 2rem 1.25rem;
  font-family: system-ui, sans-serif;
  font-size: .85rem;
  flex-shrink: 0;
}

#sidebar ul { list-style: none; margin: 0; padding: 0; }
#sidebar li { margin: .25rem 0; }
#sidebar .section > strong {
  display: block;
  margin-top: 1.25rem;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  color: var(--muted);
}
#sidebar .section > ul { padding-left: .75rem; }
#sidebar a { color: var(--text); text-decoration: none; }
#sidebar a:hover { color: var(--accent); }

/* Main */
main {
  flex: 1;
  max-width: 740px;
  padding: 3rem 2.5rem;
}

main h1 { font-size: 1.9rem; margin-top: 0; }
main h2 { font-size: 1.35rem; margin-top: 2.5rem; }
main h3 { font-size: 1.1rem; }
main a { color: var(--accent); }
main code {
  font-size: .88em;
  background: #f4f4f4;
  padding: .15em .35em;
  border-radius: 3px;
}
main pre code { display: block; padding: 1rem; overflow-x: auto; }
main pre { background: #f4f4f4; border-radius: 4px; overflow: hidden; }

@media (max-width: 640px) {
  body:not(.admin) { flex-direction: column; }
  #sidebar { width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--border); }
}
