@font-face {
  font-family: "Didact Gothic";
  src: url("/fonts/DidactGothic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Didact Gothic";
  src: url("/fonts/DidactGothic-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #475569;
  --code-bg: #f3f4f6;
}

:root[data-theme="dark"] {
  --bg: #1f2937;
  --fg: #f9fafb;
  --muted: #9ca3af;
  --border: #374151;
  --accent: #94a3b8;
  --code-bg: #111827;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Didact Gothic", sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header h1 { margin: 0; }

article a, .home-intro a, .post-summary a {
  text-decoration: underline;
}

article a:hover, .home-intro a:hover, .post-summary a:hover {
  color: var(--bg);
  background: var(--accent);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.site-title { font-weight: 700; font-size: 1.1rem; color: var(--fg); }
.site-header nav { display: flex; gap: 1rem; flex: 1; }

#theme-toggle {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  font: inherit;
  margin-left: auto;
  display: none;
}

#theme-toggle:hover { text-decoration: underline; }

.layout {
  display: flex;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem;
  align-items: flex-start;
}

main { flex: 1; min-width: 0; }

.sidebar-tags {
  width: 140px;
  flex-shrink: 0;
}

.sidebar-tags h2 { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }

.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag-list li { display: inline-flex; align-items: baseline; gap: 0.2rem; }
.tag-count { font-size: 0.7em; color: var(--muted); }

.post-list { list-style: none; padding: 0; margin: 0;}
.post-item { padding: 1.2rem 0; border-bottom: 1px solid var(--border); }
.post-item h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.post-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tag, .tag-list a { text-transform: lowercase; }
.post-meta .tag { color: var(--accent); }
.read-more { font-size: 0.9rem; }

pre { background: var(--code-bg); padding: 1rem; overflow-x: auto; border-radius: 6px; }
code { background: var(--code-bg); padding: 0.1rem 0.3rem; border-radius: 4px; }
pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }

.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.not-found { max-width: 900px; margin: 3rem auto; padding: 0 1rem; }

article img, .home-intro img {
  max-width: 160px;
  border-radius: 50%;
  display: block;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; }

  .site-header nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
  }

  .layout { flex-direction: column; }
  .sidebar-tags { width: auto; }
}
