/* Shell */
.docs-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Hero – ensure not sticky and below menu */
.docs-hero {
  position: static !important;
  z-index: auto !important;
  background: #e9f3ef;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin: .5rem 0 1rem;
  text-align: center;
}

.docs-hero h1 {
  margin: 0 0 .25rem;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-accent-dark);
}

.docs-hero p {
  margin: 0;
  opacity: .85;
  color: var(--color-accent-dark);
}

/* Two-column layout */
.docs-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}

/* Sidebar */
.docs-nav {
  background: #f7f9fb;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  padding: .75rem;
  position: sticky;
  top: 12px;
}

.docs-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  background: #fff;
  border: 2px solid var(--color-accent-dark);
  color: var(--color-accent-dark);
  border-radius: 10px;
  padding: .55rem .7rem;
  font-weight: 800;
}

.docs-nav-toggle .caret {
  margin-left: .4rem;
}

.docs-menu {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-top: .4rem;
}

.docs-menu a {
  display: block;
  padding: .5rem .6rem;
  border-radius: 10px;
  text-decoration: none;
  color: #0d1b1e;
  border: 1px solid transparent;
}

.docs-menu a:hover {
  background: rgba(0, 0, 0, .03);
}

.docs-menu a.active {
  background: #fff;
  border-color: rgba(0, 0, 0, .08);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
  font-weight: 700;
}

/* Collapsible groups in sidebar */
.docs-group {
  border-radius: 10px;
  padding: .15rem 0;
}

.docs-group[open] {
  background: rgba(0, 0, 0, .012);
}

.docs-group-title {
  cursor: pointer;
  padding: .4rem .5rem;
  border-radius: 8px;
  list-style: none;
  color: var(--color-accent-dark);
  font-weight: 700;
}

.docs-group-title::-webkit-details-marker {
  display: none;
}

.docs-group-title::before {
  content: "▸";
  display: inline-block;
  margin-right: .4rem;
  transform: translateY(-1px);
  opacity: .7;
}

.docs-group[open] .docs-group-title::before {
  content: "▾";
}

.docs-group-list {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .15rem .1rem .35rem .1rem;
}

/* Content area */
.docs-content {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
  border-radius: 12px;
  padding: 1rem;
  overflow: hidden;
}

.docs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .25rem 0 .75rem;
}

.btn {
  display: inline-block;
  padding: .45rem .7rem;
  border: 1px solid #185240;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: #dff3ec;
  color: #143c31;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn-ghost {
  background: transparent;
  border-color: #2a6b57;
  color: #2a6b57;
}

/* Typography */
.doc-article {
  line-height: 1.65;
  color: var(--color-accent-dark);
}

.doc-article h1,
.doc-article h2,
.doc-article h3 {
  scroll-margin-top: 80px;
  color: var(--color-accent-dark);
}

.doc-article h1 {
  font-size: 2rem;
  margin: 1rem 0 .25rem;
}

.doc-article h2 {
  font-size: 1.4rem;
  margin: 1.25rem 0 .25rem;
}

.doc-article h3 {
  font-size: 1.15rem;
  margin: 1rem 0 .25rem;
}

.doc-article p {
  margin: .5rem 0 .75rem;
  color: var(--color-accent-dark);
}

.doc-article strong {
  font-weight: 800;
}

.doc-article a {
  color: var(--color-accent-dark);
  text-decoration-color: rgba(11, 58, 46, .4);
}

.doc-article a:hover {
  text-decoration-color: rgba(11, 58, 46, .8);
}

/* Inline code */
.doc-article code {
  background: #f5f7f9;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 6px;
  padding: .05rem .35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
  color: var(--color-accent-dark);
}

/* =========================
   CODE BLOCKS & HIGHLIGHTING
   ========================= */

/* Box selbst: GANZ dunkles Grün */
.doc-article pre,
.docs-content pre {
  background: var(--color-primary-bg); /* #02120e */
  color: #ffffff;
  border-radius: 10px;
  padding: .9rem 1rem;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, .7);
}

/* Basis für Code im Block */
.doc-article pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
  font-weight: 500;
}

/* Default: nackte Tokens (Klammern, Kommas, etc.) */
.doc-article pre code.hljs {
  color: #ffffff;
}

/* Default-Farbe für alle Token-Spans (z.B. JSON-Werte, die keine spezielle Klasse bekommen) */
.doc-article pre span {
  color: #b6fff0;
}

/* Kommentare */
.doc-article pre .hljs-comment,
.doc-article pre .hljs-quote {
  color: #c1e4d6;
  font-style: italic;
}

/* Keywords, Literale, Tags */
.doc-article pre .hljs-keyword,
.doc-article pre .hljs-selector-tag,
.doc-article pre .hljs-literal,
.doc-article pre .hljs-name,
.doc-article pre .hljs-built_in,
.doc-article pre .hljs-builtin-name,
.doc-article pre .hljs-doctag {
  color: #ffe08a;
}

/* JSON-Keys / Attribute */
.doc-article pre .hljs-attr,
.doc-article pre .hljs-attribute,
.doc-article pre .hljs-property {
  color: #ffe08a;
}

/* Strings, Zahlen, Regex explizit auch Türkis (für „normale“ JSON-Werte) */
.doc-article pre .hljs-string,
.doc-article pre .hljs-number,
.doc-article pre .hljs-regexp,
.doc-article pre .hljs-selector-attr,
.doc-article pre .hljs-selector-pseudo,
.doc-article pre .hljs-meta .hljs-string {
  color: #b6fff0;
}

/* Titel / Typen / Klassen in Violett */
.doc-article pre .hljs-title,
.doc-article pre .hljs-section,
.doc-article pre .hljs-type,
.doc-article pre .hljs-class .hljs-title {
  color: #f5c6ff;
}

/* Variablen, Bullets, Links in Orange */
.doc-article pre .hljs-variable,
.doc-article pre .hljs-template-variable,
.doc-article pre .hljs-symbol,
.doc-article pre .hljs-bullet,
.doc-article pre .hljs-link,
.doc-article pre .hljs-subst {
  color: #ffb4a2;
}

/* Meta & Diffs */
.doc-article pre .hljs-meta {
  color: #cfd8ff;
}

.doc-article pre .hljs-addition {
  color: #c5ffb8;
}

.doc-article pre .hljs-deletion {
  color: #ffd4d4;
}

/* Betonung */
.doc-article pre .hljs-emphasis {
  font-style: italic;
}

.doc-article pre .hljs-strong {
  font-weight: 700;
}

/* Tables */
.doc-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow: auto;
  display: block;
}

.doc-article th,
.doc-article td {
  border: 1px solid rgba(0, 0, 0, .1);
  padding: .5rem .6rem;
  text-align: left;
}

.doc-article th {
  background: #f3f6f7;
  font-weight: 800;
}

/* Blockquotes */
.doc-article blockquote {
  border-left: 4px solid #2a6b57;
  background: #f0f7f4;
  padding: .5rem .8rem;
  border-radius: 6px;
  margin: .75rem 0;
}

/* Loading / error */
.loading {
  opacity: .7;
}

.doc-error {
  background: #fff4f4;
  border: 1px solid #f0d1d1;
  border-radius: 10px;
  padding: .75rem 1rem;
}

/* Responsive */
@media (max-width: 980px) {
  .docs-container {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: static;
  }

  .docs-menu {
    display: none;
  }

  .docs-menu.open {
    display: flex;
  }
}

/* Very small */
@media (max-width: 420px) {
  .docs-shell {
    padding: .75rem;
  }

  .docs-content {
    padding: .75rem;
  }
}

/* Images responsiv */
.doc-article img {
  max-width: 100%;
  height: auto;
  display: block;
}

.doc-article table img,
.doc-article li > img {
  max-width: 100%;
  height: auto;
}

/* Lightbox */
#img-zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  display: none;
  z-index: 10000;
}

#img-zoom-overlay .viewport {
  position: absolute;
  inset: 2vh 2vw;
  background: transparent;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#img-zoom-overlay img {
  display: block;
}

#img-zoom-overlay .close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: #000a;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  font: 600 14px/1.2 system-ui;
  cursor: pointer;
}

/* Overlay-Image: nie begrenzen – JS setzt die Größe in px */
#img-zoom-overlay img {
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
}
