/* =========================================================================
   HOSTL.eu Docs – öffentliches Layout
   Header · Sidebar · Inhalt · "Auf dieser Seite" · Suche
   ========================================================================= */

:root {
  --docs-header-h: 64px;
  --docs-sidebar-w: 288px;
  --docs-toc-w: 248px;
  --docs-content-w: 768px;
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.docs-announcement {
  display: flex;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  background: var(--hostl-primary-soft);
  border-bottom: 1px solid var(--hostl-primary-soft-strong);
  color: var(--hostl-text-strong);
}
.docs-announcement a { color: inherit; }
.docs-announcement a:hover { text-decoration: underline; }
.docs-announcement-success { background: var(--hostl-success-soft); border-color: var(--hostl-success-soft-strong); }
.docs-announcement-warning { background: var(--hostl-warning-soft); border-color: var(--hostl-warning-soft-strong); }
.docs-announcement-danger { background: var(--hostl-danger-soft); border-color: var(--hostl-danger-soft-strong); }

.docs-preview-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: var(--hostl-warning);
  color: var(--hostl-on-accent);
  font-size: 13px;
  font-weight: 600;
}
.docs-preview-bar + .docs-header { top: 48px; }

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--docs-header-h);
  background: rgba(14, 17, 22, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--hostl-border);
}

.docs-header-inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  width: calc(var(--docs-sidebar-w) - 40px);
}
.docs-brand-logo { height: 30px; width: auto; display: block; }
.docs-brand-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hostl-primary-text);
  background: var(--hostl-primary-soft);
  border: 1px solid var(--hostl-primary-soft-strong);
  padding: 2px 8px;
  border-radius: var(--hostl-radius-pill);
}

.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 380px;
  height: 38px;
  padding: 0 8px 0 12px;
  background: var(--hostl-surface);
  border: 1px solid var(--hostl-border);
  border-radius: var(--hostl-radius-sm);
  color: var(--hostl-text-faint);
  cursor: pointer;
  transition: border-color var(--hostl-transition), background var(--hostl-transition);
}
.docs-search-trigger:hover { border-color: var(--hostl-border-hover); background: var(--hostl-surface-hover); }
.docs-search-label { flex: 1; text-align: left; font-size: 14px; }
.docs-kbd {
  font-size: 11px;
  font-family: var(--hostl-font);
  color: var(--hostl-text-subtle);
  background: var(--hostl-surface-2);
  border: 1px solid var(--hostl-border-strong);
  border-radius: var(--hostl-radius-xs);
  padding: 2px 6px;
}

.docs-header-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.docs-header-link {
  color: var(--hostl-text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--hostl-radius-sm);
}
.docs-header-link:hover { color: var(--hostl-text-strong); background: var(--hostl-surface); }

.docs-header-actions { display: flex; align-items: center; gap: 8px; }

.docs-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: var(--hostl-radius-sm);
  background: transparent;
  color: var(--hostl-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.docs-icon-btn:hover { background: var(--hostl-surface); color: var(--hostl-text-strong); }

.docs-menu-btn, .docs-search-mobile { display: none; }

/* Buttons (öffentlich) */
.docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--hostl-radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--hostl-transition), border-color var(--hostl-transition), color var(--hostl-transition);
}
.docs-btn-primary { background: var(--hostl-primary); color: var(--hostl-on-primary); }
.docs-btn-primary:hover { background: var(--hostl-primary-hover); color: var(--hostl-on-primary); }
.docs-btn-secondary { background: var(--hostl-surface); border-color: var(--hostl-border); color: var(--hostl-text); }
.docs-btn-secondary:hover { background: var(--hostl-surface-hover); border-color: var(--hostl-border-hover); color: var(--hostl-text-strong); }
.docs-btn-discord { background: var(--brand-discord); color: var(--brand-discord-fg); }
.docs-btn-discord:hover { background: var(--brand-discord-hover); color: var(--brand-discord-fg); }
.docs-btn-light { background: rgba(14, 17, 22, 0.15); color: var(--hostl-on-accent); height: 32px; }
.docs-btn-light:hover { background: rgba(14, 17, 22, 0.25); color: var(--hostl-on-accent); }

/* -------------------------------------------------------------------------
   Drei-Spalten-Shell
   ------------------------------------------------------------------------- */
.docs-shell {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr) var(--docs-toc-w);
  align-items: start;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: var(--docs-header-h);
  height: calc(100vh - var(--docs-header-h));
  overflow-y: auto;
  padding: 24px 16px 48px 24px;
  border-right: 1px solid var(--hostl-border);
}
.docs-sidebar-head { display: none; }
.docs-sidebar-overlay { display: none; }

.nav-group + .nav-group { margin-top: 24px; }
.nav-group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hostl-text-subtle);
  padding: 0 10px;
  margin-bottom: 6px;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-sub {
  display: none;
  margin: 2px 0 4px 18px;
  padding-left: 8px;
  border-left: 1px solid var(--hostl-border);
}
.nav-item.is-open > .nav-sub { display: block; }

.nav-row {
  display: flex;
  align-items: center;
  border-radius: var(--hostl-radius-sm);
  transition: background var(--hostl-transition);
}
.nav-row:hover { background: var(--hostl-surface); }
.nav-row.is-active { background: var(--hostl-primary-soft); }

.nav-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--hostl-text-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.nav-link:hover { color: var(--hostl-text-strong); }
.nav-row.is-active .nav-link { color: var(--hostl-primary-text); font-weight: 600; }
.nav-icon { width: 18px; display: inline-flex; justify-content: center; flex-shrink: 0; font-size: 14px; }
.nav-text { overflow: hidden; text-overflow: ellipsis; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  border: 0;
  background: transparent;
  color: var(--hostl-text-faint);
  border-radius: var(--hostl-radius-xs);
  cursor: pointer;
  font-size: 11px;
}
.nav-toggle:hover { color: var(--hostl-text-strong); background: var(--hostl-surface-2); }
.nav-toggle i { transition: transform var(--hostl-transition); }
.nav-item.is-open > .nav-row .nav-toggle i { transform: rotate(90deg); }

/* Hauptspalte */
.docs-main {
  min-width: 0;
  padding: 40px 48px 0;
}
.docs-article { max-width: var(--docs-content-w); margin: 0 auto; }

.doc-cover {
  margin: -8px 0 32px;
  border-radius: var(--hostl-radius-lg);
  overflow: hidden;
  border: 1px solid var(--hostl-border);
  aspect-ratio: 4 / 1;
  background: var(--hostl-surface);
}
.doc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hostl-primary-text);
  margin-bottom: 10px;
}
.doc-breadcrumb i { font-size: 9px; color: var(--hostl-text-faint); }
.doc-breadcrumb a { color: var(--hostl-text-subtle); }
.doc-breadcrumb a:hover { color: var(--hostl-text-strong); }

.doc-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hostl-text-strong);
}
.doc-title-icon { display: inline-flex; font-size: 30px; line-height: 1.2; color: var(--hostl-primary-text); }
.doc-lead { margin: 12px 0 0; font-size: 17px; color: var(--hostl-text-muted); line-height: 1.6; }
.doc-header { margin-bottom: 32px; }

.doc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--hostl-border);
  font-size: 13px;
  color: var(--hostl-text-subtle);
}
.doc-meta i { margin-right: 4px; }
.doc-meta-link { color: var(--hostl-text-subtle); }
.doc-meta-link:hover { color: var(--hostl-text-strong); }

.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.doc-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--hostl-surface);
  border: 1px solid var(--hostl-border);
  border-radius: var(--hostl-radius);
  transition: border-color var(--hostl-transition), background var(--hostl-transition);
}
.doc-pager-link:hover { border-color: var(--hostl-primary); background: var(--hostl-surface-hover); }
.doc-pager-link.is-next { text-align: right; grid-column: 2; }
.doc-pager-label { font-size: 12px; color: var(--hostl-text-subtle); font-weight: 500; }
.doc-pager-title { font-size: 15px; font-weight: 600; color: var(--hostl-text-strong); }

/* Footer */
.docs-footer {
  max-width: var(--docs-content-w);
  margin: 64px auto 0;
  padding: 32px 0 40px;
  border-top: 1px solid var(--hostl-border);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--hostl-text-subtle);
}
.docs-footer-brand { max-width: 340px; }
.docs-footer-brand img { height: 24px; width: auto; opacity: 0.9; }
.docs-footer-brand p { margin: 10px 0 0; line-height: 1.55; }
.docs-footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.docs-footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.docs-footer-links a { color: var(--hostl-text-subtle); }
.docs-footer-links a:hover { color: var(--hostl-text-strong); }

/* TOC */
.docs-toc {
  position: sticky;
  top: var(--docs-header-h);
  height: calc(100vh - var(--docs-header-h));
  overflow-y: auto;
  padding: 40px 24px 40px 8px;
}
.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hostl-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toc-title i { color: var(--hostl-text-faint); font-size: 12px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hostl-border); }
.toc-list a {
  display: block;
  margin-left: -1px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  color: var(--hostl-text-subtle);
}
.toc-list a:hover { color: var(--hostl-text-strong); }
.toc-list a.is-active { color: var(--hostl-primary-text); border-left-color: var(--hostl-primary); }
.toc-l2 a { padding-left: 28px; }
.toc-top {
  margin-top: 16px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: var(--hostl-text-faint);
  font-size: 12px;
  cursor: pointer;
}
.toc-top:hover { color: var(--hostl-text-strong); }

/* Zustände (404, leer) */
.docs-center {
  min-height: calc(100vh - var(--docs-header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.state-card { text-align: center; max-width: 460px; }
.state-card h1 { font-size: 26px; margin: 8px 0 8px; color: var(--hostl-text-strong); letter-spacing: -0.01em; }
.state-card p { color: var(--hostl-text-muted); margin: 0 0 24px; }
.state-code { font-size: 72px; font-weight: 700; line-height: 1; color: var(--hostl-primary-text); letter-spacing: -0.04em; }
.state-icon {
  width: 64px; height: 64px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--hostl-radius-lg);
  background: var(--hostl-primary-soft); color: var(--hostl-primary-text); font-size: 26px;
}
.state-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Suche
   ------------------------------------------------------------------------- */
.search-modal { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; padding: 10vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: var(--hostl-overlay); backdrop-filter: blur(3px); }
.search-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--hostl-surface);
  border: 1px solid var(--hostl-border-strong);
  border-radius: var(--hostl-radius-lg);
  box-shadow: var(--hostl-shadow-xl);
  overflow: hidden;
  animation: pop-in 0.16s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.99); } to { opacity: 1; transform: none; } }

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hostl-border);
  color: var(--hostl-text-faint);
}
.search-input-row input {
  flex: 1;
  height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: var(--hostl-text-strong);
}
.search-input-row input::placeholder { color: var(--hostl-text-faint); }
.search-input-row input::-webkit-search-cancel-button { display: none; }
.search-esc {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: var(--hostl-radius-xs);
  border: 1px solid var(--hostl-border-strong);
  background: var(--hostl-surface-2);
  color: var(--hostl-text-subtle);
  cursor: pointer;
}
.search-results { overflow-y: auto; padding: 8px; flex: 1; }
.search-empty { padding: 32px 16px; text-align: center; color: var(--hostl-text-subtle); font-size: 14px; }
.search-result {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--hostl-radius-sm);
  color: var(--hostl-text);
}
.search-result.is-active, .search-result:hover { background: var(--hostl-primary-soft); color: var(--hostl-text); }
.search-result-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--hostl-radius-sm);
  background: var(--hostl-surface-2);
  color: var(--hostl-text-subtle);
  font-size: 14px;
}
.search-result-main { min-width: 0; }
.search-result-path { font-size: 11px; color: var(--hostl-text-faint); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.search-result-title { font-weight: 600; color: var(--hostl-text-strong); font-size: 14px; }
.search-result-snippet { font-size: 13px; color: var(--hostl-text-subtle); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-result mark { background: transparent; color: var(--hostl-primary-text); font-weight: 600; }
.search-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--hostl-border);
  font-size: 12px;
  color: var(--hostl-text-faint);
}
.search-foot kbd { margin-right: 3px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(5, 7, 10, 0.92);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--hostl-radius); box-shadow: var(--hostl-shadow-xl); }
.lightbox-close { position: absolute; top: 16px; right: 16px; color: var(--hostl-text-strong); }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1279px) {
  .docs-shell { grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 1023px) {
  .docs-header-inner { padding: 0 16px; gap: 10px; }
  .docs-menu-btn, .docs-search-mobile { display: inline-flex; }
  .docs-brand { width: auto; }
  .docs-search-trigger, .docs-header-links { display: none; }
  .docs-header-actions { margin-left: auto; }

  .docs-shell { display: block; }
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 120;
    width: min(320px, 86vw);
    height: 100vh;
    padding: 0 12px 40px;
    background: var(--hostl-bg-alt);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .docs-sidebar.is-open { transform: none; box-shadow: var(--hostl-shadow-xl); }
  .docs-sidebar-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    height: var(--docs-header-h);
    padding: 0 0 0 10px;
    margin-bottom: 8px;
    background: var(--hostl-bg-alt);
    border-bottom: 1px solid var(--hostl-border);
    font-weight: 600;
    color: var(--hostl-text-strong);
  }
  .docs-sidebar-overlay {
    position: fixed; inset: 0; z-index: 110;
    background: var(--hostl-overlay);
  }
  .docs-sidebar.is-open ~ .docs-sidebar-overlay,
  .docs-sidebar-overlay.is-open { display: block; }

  .docs-main { padding: 28px 16px 0; }
  .doc-title { font-size: 28px; }
}

@media (max-width: 560px) {
  .docs-btn-discord span, .docs-header-actions .docs-btn-primary span { display: none; }
  .docs-header-actions .docs-btn { width: 38px; padding: 0; }
  .docs-brand-logo { height: 26px; }
  .doc-pager { grid-template-columns: 1fr; }
  .doc-pager-link.is-next { grid-column: 1; }
  .docs-footer { flex-direction: column; }
  .docs-footer-meta { align-items: flex-start; }
  .docs-footer-links { justify-content: flex-start; }
  .search-modal { padding-top: 16px; }
  .search-foot { display: none; }
}
