:root {
  --sidebar-width: 260px;
  /* Pico's default scales the root font-size up to 131% on wide viewports
   * and sizes headings accordingly; that reads as oversized for a
   * text/blog layout, so pin it to a fixed, more modest scale. */
  --pico-font-size: 100%;
}

body {
  margin: 0;
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

code, pre, kbd, samp {
  font-family: "Source Code Pro", Consolas, Monaco, "Courier New", monospace;
}

blockquote {
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-style: italic;
}

.layout {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 1rem;
  border-right: 1px solid var(--pico-muted-border-color, #ddd);
  box-sizing: border-box;
}

.sidebar .site-title {
  display: block;
  font-weight: bold;
  font-size: 1.5rem;
  text-decoration: none;
}

/*
 * Pico.css styles a bare <nav> as a horizontal navbar (flex row, inline
 * list items). Our sidebar nav is a vertical tree, so override those
 * assumptions explicitly rather than fight Pico's specificity piecemeal.
 */
nav.sidebar {
  display: block;
}

nav.sidebar ul {
  display: block;
  list-style: none;
  margin: 0;
  padding-left: 1.1rem;
  border-left: 1px solid var(--pico-muted-border-color, #ccc);
}

/* Pico sets `li{list-style:square}` directly on the element, which wins
 * over list-style:none set on the parent <ul> above (it's an explicit
 * re-declaration, not just inheritance) — so it has to be cleared here too. */
nav.sidebar li {
  list-style: none;
}

/* Only the outermost list (a direct child of the sidebar) should be flush
 * left; every nested list — one per level of section nesting — keeps the
 * indent + guide line above so the tree's depth is visible at a glance. */
nav.sidebar > .nav-tree {
  padding-left: 0;
  border-left: none;
}

nav.sidebar li {
  display: list-item;
  margin: 0.5rem 0;
  padding: 0;
}

nav.sidebar details {
  margin: 0;
}

nav.sidebar summary {
  /* <summary> defaults to display:list-item, which reserves a marker
   * "gutter" (~1em) even with the marker glyph hidden — that's what was
   * pushing section labels further right than sibling post links at the
   * same tree depth. Pico draws its own chevron via ::after, so the
   * native marker box isn't needed; dropping list-item display removes
   * the phantom indent and lines summary up with sibling <a> links. */
  display: block;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 0.15rem 0;
}

nav.sidebar summary::marker,
nav.sidebar summary::-webkit-details-marker {
  margin-right: 0.25rem;
}

nav.sidebar a {
  /* Pico's `nav li :where(a,[role=link])` sets a negative left margin
   * (meant to flush links to the edge of a horizontal navbar) that was
   * silently pulling post links further left than sibling <summary>
   * elements, which aren't matched by that rule — the actual cause of
   * the misaligned indentation. */
  display: inline;
  margin: 0;
  padding: 0.15rem 0;
  line-height: 1.3;
}

nav.sidebar a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
}

.content {
  flex: 1;
  padding: 2rem;
  max-width: 70ch;
}

.post-meta {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

.post-tags .tag {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--pico-muted-border-color, #eee);
  font-size: 0.85rem;
}

.content article + article {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pico-muted-border-color, #ddd);
}

.pager {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color, #ddd);
}

@media (max-width: 640px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--pico-muted-border-color, #ddd);
  }
}
