/* Confluence-like documentation chrome (inspired by docs.restera.com) */
:root {
  --text: #172b4d;
  --text-subtle: #44546f;
  --text-muted: #626f86;
  --link: #0c66e4;
  --link-hover: #0055cc;
  --border: #dfe1e6;
  --sidebar-bg: #f7f8f9;
  --sidebar-hover: #ebecf0;
  --sidebar-active: #e9f2ff;
  --sidebar-active-text: #0c66e4;
  --page-bg: #ffffff;
  --header-bg: #ffffff;
  --accent-bar: #0c66e4;
  --chip-bg: #f1f2f4;
  --shadow-img: 0 1px 1px rgba(9, 30, 66, 0.08), 0 0 1px rgba(9, 30, 66, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --sidebar-width: 285px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Top header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.docs-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.docs-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(135deg, #0c66e4 0%, #1d7afc 55%, #579dff 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-header-space {
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-header-meta {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Shell */
.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

/* Sidebar */
.docs-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 16px 0 32px;
  overflow: auto;
}

.docs-sidebar-title {
  padding: 4px 20px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.docs-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav a {
  display: block;
  padding: 7px 20px;
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  border-left: 3px solid transparent;
}

.docs-nav a:hover {
  background: var(--sidebar-hover);
  color: var(--text);
  text-decoration: none;
}

.docs-nav a.is-current {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: var(--accent-bar);
}

.docs-nav .nav-home {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-left: 0;
  margin-right: 0;
}

/* Main */
.docs-main {
  overflow: auto;
  padding: 24px 40px 64px;
}

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.docs-breadcrumb a {
  color: var(--link);
}

.docs-breadcrumb .sep {
  color: var(--border);
}

.docs-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.docs-byline {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.docs-intro {
  margin: 0 0 28px;
  max-width: 720px;
  font-size: 15px;
  color: var(--text-subtle);
}

.docs-intro p {
  margin: 0 0 10px;
}

.docs-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.docs-flow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--chip-bg);
  border-radius: 3px;
  font-size: 13px;
  color: var(--text-subtle);
}

.docs-flow .arrow {
  color: var(--text-muted);
  background: transparent;
  padding: 0;
}

/* Children list (hub) */
.childpages {
  list-style: disc;
  margin: 8px 0 0 22px;
  padding: 0;
  font-size: 15px;
}

.childpages li {
  margin: 0 0 8px;
}

/* Section layout: text left, images right */
.section-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.15fr);
  gap: 28px;
  align-items: start;
}

.section-copy h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.section-copy p,
.section-copy li {
  font-size: 15px;
  color: var(--text-subtle);
}

.section-copy p {
  margin: 0 0 12px;
}

.section-copy ul {
  margin: 0 0 16px 18px;
  padding: 0;
}

.section-copy .note {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-bar);
  border-radius: 3px;
  font-size: 14px;
  color: var(--text-subtle);
}

.section-images {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 72px;
}

.section-images figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: var(--shadow-img);
  overflow: hidden;
}

.section-images img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  cursor: zoom-in;
}

.section-images figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.cols-label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(9, 30, 66, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.docs-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
  }

  .section-layout {
    grid-template-columns: 1fr;
  }

  .section-images {
    position: static;
  }

  .docs-main {
    padding: 20px 18px 48px;
  }

  .docs-header-meta {
    display: none;
  }
}
