/* Docs reader — scoped for birkly.cloud marketing shell */
.docs-main {
  display: grid;
  grid-template-columns: min(280px, 28vw) 1fr;
  gap: clamp(28px, 4vw, 56px);
  min-height: 50vh;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding-right: 20px;
  border-right: 1px solid #DDE1DA;
}

.docs-sidebar-close { display: none; }

.docs-nav-loading,
.docs-nav-section { margin-bottom: 22px; }

.docs-nav-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A2A7B5;
  margin-bottom: 8px;
}

.doc-nav-link {
  display: block;
  padding: 6px 0;
  color: #4A4F5E;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
  border-radius: 6px;
}

.doc-nav-link:hover { color: #2AA69F; }

.doc-nav-link.active {
  font-weight: 650;
  color: #1E1F2A;
}

.docs-sidebar-toggle { display: none; }

.docs-content-area {
  min-width: 0;
  background: #FFFFFF;
  border: 1px solid #E7EAE4;
  border-radius: 20px;
  padding: clamp(28px, 3vw, 48px);
}

.docs-content-area .doc-page-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(28px, 2.8vw, 44px);
  font-weight: 480;
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #E7EAE4;
  letter-spacing: -0.02em;
}

.docs-content-area .doc-body {
  font-size: clamp(15px, 0.9vw, 18px);
  line-height: 1.65;
  color: #33374A;
}

.docs-content-area .doc-summary {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #E7EAE4;
  font-size: clamp(16px, 1vw, 20px);
  color: #4A4F5E;
}

.docs-content-area .doc-toggle {
  margin: 20px 0;
  border: none;
  background: none;
}

.docs-content-area .doc-toggle summary {
  padding: 12px 0;
  cursor: pointer;
  font-weight: 650;
  color: #1E1F2A;
  list-style: none;
}

.docs-content-area .doc-toggle summary::-webkit-details-marker { display: none; }

.docs-content-area .doc-toggle summary::before {
  content: "▶ ";
  font-size: 0.75em;
  color: #2AA69F;
  margin-right: 0.35rem;
}

.docs-content-area .doc-toggle[open] summary::before { content: "▼ "; }

.docs-content-area .doc-toggle-inner {
  padding: 4px 0 0;
  border-top: none;
}

/* Keep doc sections readable even before JS opens details */
.docs-content-area details.doc-toggle[open] .doc-toggle-inner,
.docs-content-area details.doc-toggle.doc-toggle-beginner .doc-toggle-inner,
.docs-content-area details.doc-toggle.doc-toggle-advanced .doc-toggle-inner {
  display: block;
}

.docs-content-area .doc-body h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(22px, 1.8vw, 32px);
  margin: 32px 0 12px;
  color: #1E1F2A;
  scroll-margin-top: 120px;
}

.docs-content-area .doc-body h3 {
  font-size: clamp(18px, 1.2vw, 22px);
  margin: 24px 0 8px;
  color: #1E1F2A;
}

.docs-content-area .doc-body p { margin: 0 0 14px; }

.docs-content-area .doc-body ul,
.docs-content-area .doc-body ol {
  margin: 0 0 14px;
  padding-left: 1.4em;
}

.docs-content-area .doc-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
  background: #F0F2EE;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  color: #2AA69F;
}

.docs-content-area .doc-body pre {
  background: #1E1F2A;
  border-radius: 14px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.7;
}

.docs-content-area .doc-body pre code {
  background: none;
  padding: 0;
  color: #C9CDD6;
}

.docs-content-area .doc-body a {
  color: #2AA69F;
  text-decoration: none;
  border-bottom: 2px solid #7CE3DE;
  padding-bottom: 1px;
  font-weight: 600;
}

.docs-content-area .doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
}

.docs-content-area .doc-body th,
.docs-content-area .doc-body td {
  border: 1px solid #DDE1DA;
  padding: 10px 14px;
  text-align: left;
}

.docs-content-area .doc-body th {
  background: #F0F2EE;
  font-weight: 650;
}

.docs-content-area .doc-related {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #E7EAE4;
  color: #717789;
}

.docs-loading::before {
  content: "Loading documentation…";
  color: #717789;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}

.docs-error {
  padding: 20px 0;
  color: #717789;
  font-size: 15px;
  line-height: 1.6;
}

.docs-error a {
  color: #2AA69F;
  font-weight: 600;
}

@media (max-width: 900px) {
  .docs-main { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9992;
    width: min(300px, 88vw);
    max-height: none;
    background: #F8F9F7;
    padding: 56px 20px 24px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(30, 31, 42, 0.12);
    border-right: none;
  }
  .docs-sidebar.is-open { transform: translateX(0); }
  .docs-sidebar-close {
    display: block;
    position: absolute;
    top: 14px;
    right: 14px;
    background: #1E1F2A;
    color: #F8F9F7;
    border: none;
    border-radius: 99px;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
  }
  .docs-sidebar-toggle {
    display: block;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9991;
    background: #1E1F2A;
    color: #F8F9F7;
    border: none;
    border-radius: 99px;
    padding: 14px 22px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(30, 31, 42, 0.2);
  }
}


/* Docs search */
.docs-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.docs-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid #DDE1DA;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #1E1F2A;
}

.docs-search-input:focus {
  outline: 2px solid #7CE3DE;
  outline-offset: 1px;
  border-color: #2AA69F;
}

.docs-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  background: #fff;
  border: 1px solid #DDE1DA;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(30, 31, 42, 0.12);
  max-height: min(360px, 50vh);
  overflow: auto;
}

.docs-search-results.is-open { display: block; }

.docs-search-result-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  border-bottom: 1px solid #F0F2EE;
}

.docs-search-result-item:last-child { border-bottom: none; }

.docs-search-result-item:hover,
.docs-search-result-item:focus {
  background: #F0F2EE;
  outline: none;
}

.docs-search-result-title {
  display: block;
  font-weight: 650;
  font-size: 14px;
  color: #1E1F2A;
}

.docs-search-result-meta,
.docs-search-empty {
  display: block;
  font-size: 12px;
  color: #717789;
  margin-top: 2px;
}
