/* ==========================================
   Sidebar Layout — Experimental
   Left nav sidebar + right ToC on posts
   
   To revert: 
   1. Delete this file
   2. Remove <link> from head.njk
   3. Revert base.njk and post.njk
   ========================================== */

/* ── Grid wrapper (replaces .sitewrapper) ── */
.layout-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Stack logo above nav links on all screen sizes */
.sidebar-left .site-header {
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Desktop: left nav sidebar ── */
@media (min-width: 900px) {
  body {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .layout-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
    max-width: 1100px;
    padding: 2.5rem 2rem;
  }

  .sidebar-left {
    position: sticky;
    top: 2rem;
    align-self: start;
  }

  .sidebar-left .site-header {
    margin-bottom: 0;
  }

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

  .content-area {
    min-width: 0;
  }
}

/* ── Large desktop: right ToC sidebar on posts ── */
@media (min-width: 1200px) {
  .layout-post {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 2rem;
  }

  .sidebar-right {
    position: sticky;
    top: 2rem;
    align-self: start;
  }

  /* Push content to the left column */
  .layout-post > :first-child {
    min-width: 0;
  }
}

/* ── Table of Contents ── */
.toc {
  font-size: 0.85em;
}

.toc-heading {
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding: 0;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border);
}

.toc-list li {
  padding-left: 1rem;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.toc-list a {
  color: var(--muted);
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--accent);
}

.toc-h3 {
  padding-left: 1.75rem !important;
}

.toc-h4 {
  padding-left: 2.5rem !important;
}

/* ── Mobile: hide sidebar extras ── */
@media (max-width: 899px) {
  .sidebar-right {
    display: none;
  }

  .layout-grid {
    padding: 0;
  }
}
