/* ============================================================
   Joomla Fediverse — Documentation Layout
   Sits alongside main.css (shared brand variables)
   ============================================================ */

/* ── Layout shell ── */
.docs-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-body);
}

/* ── Body area: sidebar + content ── */
.docs-body {
  display: flex;
  flex: 1;
}

/* ── Sidebar ── */
.docs-sidebar {
  width: 360px;
  flex-shrink: 0;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}
.docs-sidebar .sidebar-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: .25rem 1.25rem .5rem;
}
.docs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-sidebar-group {
  margin-bottom: .35rem;
}
.docs-sidebar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .15rem 1.25rem;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.docs-sidebar-toggle:hover {
  background: rgba(167,139,250,.06);
}
.docs-sidebar-toggle-label {
  color: var(--text-muted);
}
.docs-sidebar-toggle-icon {
  width: .7rem;
  height: .7rem;
  border-right: 2px solid var(--purple);
  border-bottom: 2px solid var(--purple);
  transform: rotate(45deg);
  transition: transform .15s ease;
  flex-shrink: 0;
  margin-right: .2rem;
}
.docs-sidebar-group.is-open .docs-sidebar-toggle-label {
  color: var(--text);
}
.docs-sidebar-group.is-open .docs-sidebar-toggle-icon {
  transform: rotate(225deg);
}
.docs-sidebar-panel {
  padding-bottom: .35rem;
}
.docs-sidebar-panel ul {
  padding-left: 1em;
}
.docs-sidebar li a {
  display: block;
  padding: .45rem 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.docs-sidebar li a:hover {
  color: var(--purple);
  background: rgba(167,139,250,.07);
  border-left-color: var(--purple-bright);
}
.docs-sidebar li.active a {
  color: var(--purple);
  background: rgba(167,139,250,.12);
  border-left-color: var(--purple);
  font-weight: 600;
}
.docs-sidebar .sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: .75rem 1.25rem;
}
.docs-sidebar .sidebar-label:first-child {
  padding-top: 0;
}

/* ── Main content area ── */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem clamp(1rem, 4vw, 3rem);
  max-width: 860px;
}

/* ── Typography ── */
.docs-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--purple);
  margin: 0 0 1.5rem;
  line-height: 1.2;
}
.docs-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--purple);
  margin: 1.75rem 0 .5rem;
}
.docs-content h4 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.25rem 0 .4rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.docs-content p { margin: 0 0 1rem; line-height: 1.75; }
.docs-content ul, .docs-content ol {
  margin: 0 0 1rem 1.5rem;
  line-height: 1.75;
}
.docs-content li { margin-bottom: .25rem; }

/* ── Inline code ── */
.docs-content code {
  font-family: var(--font-mono, 'Fira Code', 'Cascadia Code', monospace);
  font-size: .875em;
  background: rgba(167,139,250,.12);
  color: var(--purple);
  padding: .15em .4em;
  border-radius: 4px;
}

/* ── Code blocks ── */
.docs-content pre {
  background: #0a071f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: .875rem;
  line-height: 1.6;
}
.docs-content pre code {
  background: none;
  color: #e2d9f3;
  padding: 0;
  font-size: inherit;
}

/* ── Blockquotes / callouts ── */
.docs-content blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: rgba(167,139,250,.07);
  border-left: 4px solid var(--purple);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.docs-content blockquote p { margin: 0; }

/* ── Horizontal rules (used as section dividers in source) ── */
.docs-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Nav breadcrumb lines (🏠 … | ← … | … →) become styled pill rows ── */
.docs-content .nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.5rem 0;
  padding: .6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
}
.docs-content .nav-bar a {
  color: var(--purple);
  text-decoration: none;
}
.docs-content .nav-bar a:hover { text-decoration: underline; }

/* ── Page navigation ── */
.docs-page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.docs-page-nav a,
.docs-page-nav .docs-page-nav-spacer {
  min-width: 0;
  flex: 1 1 180px;
}
.docs-page-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--purple);
  text-decoration: none;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.docs-page-nav a:hover {
  background: rgba(167,139,250,.08);
  border-color: var(--border-strong);
  text-decoration: none;
}
.docs-page-nav .docs-page-nav-home {
  color: var(--text);
  font-weight: 700;
}

/* ── Tables ── */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .9rem;
}
.docs-content th {
  background: var(--bg-card);
  color: var(--purple);
  font-weight: 700;
  padding: .6rem .9rem;
  border: 1px solid var(--border);
  text-align: left;
}
.docs-content td {
  padding: .55rem .9rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
.docs-content tr:nth-child(even) td { background: rgba(167,139,250,.04); }

/* ── Images ── */
.docs-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1rem 0;
  display: block;
}

/* ── Links ── */
.docs-content a {
  color: var(--purple);
  text-decoration: none;
}
.docs-content a:hover { text-decoration: underline; }

/* ── Strong / em ── */
.docs-content strong { color: var(--text); font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .docs-body { flex-direction: column; }
  .docs-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: .75rem 0;
  }
  .docs-sidebar-toggle {
    padding-left: .9rem;
    padding-right: .9rem;
  }
  .docs-sidebar-panel ul { padding-left: 1em; }
  .docs-sidebar li a {
    padding: .4rem .9rem .4rem 1.25rem;
    border-left: none;
    font-size: .85rem;
  }
  .docs-content { padding: 1.5rem 1rem; }
  .docs-page-nav { flex-direction: column; }
}
