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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #202122;
  background: #fff;
  line-height: 1.6;
  font-size: 15px;
}

/* Top header — dark bar across the full width */
.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 20px;
  background: #1c1c1e;
}

.site-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.2px;
}

/* Layout */
.site-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 44px);
}

/* Sidebar — white, category headings + article links */
.sidebar {
  width: 210px;
  min-width: 210px;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 18px 14px 32px;
  background: #fff;
  border-right: 1px solid #e2e2e2;
  font-size: 13px;
  color: #202122;
}

.sidebar-nav {
  list-style: none;
  margin-bottom: 20px;
}

.sidebar-nav li {
  margin-bottom: 1px;
}

.sidebar-nav a {
  display: block;
  padding: 4px 6px;
  color: #0645ad;
  text-decoration: none;
  border-radius: 4px;
}

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

.sidebar-category {
  margin-bottom: 18px;
}

.sidebar-heading {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #202122;
  padding: 0 6px;
  margin-bottom: 6px;
}

.sidebar-articles {
  list-style: none;
}

.sidebar-articles li {
  margin-bottom: 2px;
}

.sidebar-articles a {
  display: block;
  padding: 4px 8px;
  color: #0645ad;
  font-weight: 400;
  text-decoration: none;
  border-radius: 10px;
}

.sidebar-articles a:hover {
  background: #eaf0fb;
}

.sidebar-active,
.sidebar-active:hover {
  background: #0645ad !important;
  color: #fff !important;
}

.sidebar-empty {
  padding: 2px 8px;
  color: #8a8a8a;
  font-style: italic;
  font-size: 12.5px;
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  padding: 28px 40px 60px;
  background: #fff;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 12.5px;
  color: #767676;
  margin-bottom: 10px;
}

.breadcrumb a {
  color: #0645ad;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 6px;
  color: #b0b0b0;
}

.breadcrumb-current {
  color: #767676;
}

/* Article title */
.article-title,
.content h1 {
  font-size: 32px;
  font-weight: 300;
  border-bottom: 1px solid #d8d8d8;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* Metadata bar */
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: #f6f6f6;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #55565a;
  margin-bottom: 20px;
}

.meta-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.meta-sep {
  margin: 0 6px;
  color: #c2c2c2;
}

/* Article body — hide the raw title/metadata/hr that are still part of the
   rendered markdown, since the template renders its own title + meta bar. */
.article-body > h1:first-child {
  display: none;
}

.article-body > h1:first-child + p {
  display: none;
}

.article-body > h1:first-child + p + hr {
  display: none;
}

.content h2 {
  font-size: 20px;
  font-weight: 400;
  border-bottom: 1px solid #eaecf0;
  padding-bottom: 2px;
  margin-top: 24px;
  margin-bottom: 12px;
}

.content h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}

.content p {
  margin-bottom: 12px;
}

.content ul, .content ol {
  margin: 0 0 12px 24px;
}

.content li {
  margin-bottom: 4px;
}

.content a {
  color: #0645ad;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content strong {
  font-weight: 600;
}

.content hr {
  border: none;
  border-top: 1px solid #eaecf0;
  margin: 16px 0;
}

.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}

.content th, .content td {
  border: 1px solid #a2a9b1;
  padding: 6px 10px;
  text-align: left;
}

.content th {
  background: #eaecf0;
  font-weight: 600;
}

.content code {
  background: #f8f9fa;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 13px;
}

/* Wiki-link missing (red link) */
.wikilink-missing {
  color: #ba0000;
}

/* Home page portal */
.portal-title {
  font-size: 32px;
  font-weight: 300;
  border-bottom: 1px solid #d8d8d8;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.portal-intro {
  color: #54595d;
  margin-bottom: 28px;
  max-width: 640px;
}

.portal-category {
  margin-bottom: 28px;
  padding-bottom: 4px;
}

.portal-category h2 {
  font-size: 19px;
  font-weight: 400;
  border-bottom: 1px solid #eaecf0;
  padding-bottom: 4px;
  margin-bottom: 10px;
  margin-top: 0;
  scroll-margin-top: 60px;
}

.portal-article-list {
  list-style: disc;
  margin-left: 20px;
  columns: 2;
  column-gap: 32px;
}

.portal-article-list li {
  margin-bottom: 6px;
  break-inside: avoid;
}

.portal-article-list a {
  color: #0645ad;
  text-decoration: none;
}

.portal-article-list a:hover {
  text-decoration: underline;
}

/* Hamburger menu */
.sidebar-toggle-input {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 44px;
    left: -260px;
    width: 240px;
    max-height: calc(100vh - 44px);
    z-index: 100;
    transition: left 0.2s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  }

  .sidebar-toggle-input:checked ~ .site-layout .sidebar {
    left: 0;
  }

  .content {
    padding: 16px 20px 40px;
  }

  .portal-article-list {
    columns: 1;
  }
}
