.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  background-color: var(--color-bg-page);
  border-bottom: 1px solid var(--color-border);
}

.shell {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
}

.nav-sidebar {
  width: var(--nav-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background-color: var(--color-bg-surface);
  border-right: 1px solid var(--color-border);
}

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

/* Offset anchor scroll targets so the fixed header doesn't cover them */
html {
  scroll-padding-top: var(--header-height);
}

h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: var(--header-height);
}

.content-body {
  max-width: var(--content-max-width);
  padding: var(--content-padding);
  margin: 0 auto;
}

/* Prose stays readable while code blocks fill the wider container */
.content-body > section > p,
.content-body > section > ul,
.content-body > section > ol,
.content-body > section > h3 {
  max-width: var(--prose-max-width);
}

.nav-overlay {
  display: none;
}

.hamburger {
  display: none;
}

@media (max-width: 1023px) {
  .nav-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    height: auto;
    transform: translateX(-100%);
    z-index: 90;
    transition: transform 0.25s ease;
  }

  .shell.nav-open .nav-sidebar {
    transform: translateX(0);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: var(--color-overlay);
    z-index: 89;
  }

  .shell.nav-open .nav-overlay {
    display: block;
  }

  .hamburger {
    display: flex;
  }
}

@media (max-width: 767px) {
  .content-body {
    padding: 24px 16px;
  }
}
