/* astrophage generated component styles */
:root {
  --ap-bg: var(--bg-primary, #f7f8fb);
  --ap-bg-secondary: var(--bg-secondary, #eef1f6);
  --ap-border: var(--border-color, #dde2ea);
  --ap-text: var(--text-main, #1d2433);
  --ap-text-muted: var(--text-muted, #5b6475);
  --ap-accent: var(--text-accent, #0b6bcb);
  --ap-accent-hover: var(--text-accent-hover, #0956a3);
  --ap-highlight: var(--highlight-bg, rgba(11, 107, 203, 0.08));
  --ap-code-bg: var(--code-bg, rgba(127, 127, 127, 0.12));
  --ap-radius: var(--border-radius-md, 10px);
  --ap-font-code: var(--font-code, ui-monospace, SFMono-Regular, Menlo, monospace);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --ap-bg: var(--bg-primary, #11151d);
    --ap-bg-secondary: var(--bg-secondary, #1a2030);
    --ap-border: var(--border-color, #2b3343);
    --ap-text: var(--text-main, #dce3ef);
    --ap-text-muted: var(--text-muted, #9aa4b5);
    --ap-accent: var(--text-accent, #78b7ff);
    --ap-accent-hover: var(--text-accent-hover, #a5ceff);
    --ap-highlight: var(--highlight-bg, rgba(120, 183, 255, 0.12));
    --ap-code-bg: var(--code-bg, rgba(255, 255, 255, 0.08));
  }
}
:root[data-mode="dark"] {
  --ap-bg: var(--bg-primary, #11151d);
  --ap-bg-secondary: var(--bg-secondary, #1a2030);
  --ap-border: var(--border-color, #2b3343);
  --ap-text: var(--text-main, #dce3ef);
  --ap-text-muted: var(--text-muted, #9aa4b5);
  --ap-accent: var(--text-accent, #78b7ff);
  --ap-accent-hover: var(--text-accent-hover, #a5ceff);
  --ap-highlight: var(--highlight-bg, rgba(120, 183, 255, 0.12));
  --ap-code-bg: var(--code-bg, rgba(255, 255, 255, 0.08));
}

.page-shell.has-sidebars {
  width: min(1440px, calc(100% - 32px));
}
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.page-main {
  min-width: 0;
}
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 0.92rem;
}
.sidebar:empty {
  display: none;
}
.sidebar-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ap-text-muted);
  margin: 0 0 8px;
}
@media (min-width: 1100px) {
  .page-layout.has-left.has-right {
    grid-template-columns: 230px minmax(0, 1fr) 270px;
  }
  .page-layout.has-left:not(.has-right) {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .page-layout.has-right:not(.has-left) {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .sidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}
.sidebar .toc {
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 8px 12px;
  background: var(--ap-bg-secondary);
  font-size: 0.85rem;
  line-height: 1.35;
}
.sidebar .toc a {
  text-decoration: none;
}
.site-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--ap-border);
  color: var(--ap-text-muted);
  font-size: 0.9rem;
}

/* --- search --- */
.search-button, .search-close { font: inherit; cursor: pointer; border: 1px solid var(--ap-border); border-radius: 6px; color: var(--ap-text); background: var(--ap-bg-secondary); padding: 0.4rem 0.65rem; }
.search-button { display: inline-flex; align-items: center; gap: 0.8rem; }
.search-button kbd { color: var(--ap-text-muted); font: 0.75em var(--ap-font-code); }
.search-dialog { box-sizing: border-box; width: min(680px, calc(100vw - 2rem)); max-height: 85vh; border: 1px solid var(--ap-border); border-radius: var(--ap-radius); padding: 1.25rem; color: var(--ap-text); background: var(--ap-bg); text-align: start; }
.search-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.search-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.search-heading h2 { color: var(--ap-text); font-size: 1.15rem; margin: 0; }
.search-label { display: block; font-size: 0.85rem; color: var(--ap-text-muted); margin-bottom: 0.3rem; }
.search-input { box-sizing: border-box; width: 100%; font: inherit; border: 1px solid var(--ap-border); border-radius: 6px; padding: 0.7rem; color: var(--ap-text); background: var(--ap-bg-secondary); }
.search-input:focus-visible, .search-result-link:focus-visible { outline: 2px solid var(--ap-accent); outline-offset: 2px; }
.search-status { margin: 0.75rem 0; font-size: 0.85rem; color: var(--ap-text-muted); }
.search-results { list-style: none; padding: 0; margin: 0; max-height: 52vh; overflow-y: auto; scrollbar-width: thin; }
.search-results li + li { border-top: 1px solid var(--ap-border); }
.search-result-link { display: block; padding: 0.8rem 0.5rem; border-radius: 4px; text-decoration: none; color: var(--ap-text); overflow-wrap: anywhere; }
.search-result-link:hover, .search-result-link:focus { background: var(--ap-highlight); }
.search-result-title { display: block; color: var(--ap-accent); }
.search-result-snippet, .search-result-tags { display: block; font-size: 0.85rem; color: var(--ap-text-muted); margin-top: 0.3rem; line-height: 1.5; }
.search-results mark { background: var(--ap-highlight); color: inherit; font-weight: 650; padding: 0; }
@media (max-width: 600px) { .search-button kbd { display: none; } .search-dialog { padding: 1rem; } }


/* --- explorer --- */
.explorer ul { list-style: none; margin: 0; padding: 0; }
.explorer .explorer-folder ul { margin-inline-start: 0.65rem; padding-inline-start: 0.65rem; border-inline-start: 1px solid var(--ap-border); }
.explorer li { margin: 0.2rem 0; }
.explorer a { color: var(--ap-text-muted); text-decoration: none; overflow-wrap: anywhere; }
.explorer a:hover { color: var(--ap-accent); }
.explorer [aria-current="page"] { color: var(--ap-accent); font-weight: 650; background: var(--ap-highlight); border-radius: 4px; }
.explorer-note, .explorer-home { display: block; padding: 0.25rem 0.4rem; }
.explorer-folder > summary { cursor: pointer; padding: 0.25rem 0; }
.explorer-folder > summary a { padding: 0.2rem; }
.explorer-panel > summary { cursor: pointer; }
.explorer-scroll { max-height: 65vh; overflow-y: auto; scrollbar-width: thin; padding-inline-end: 0.3rem; }
.folder-page-list { padding-inline-start: 1.25rem; }
.folder-page-list li { margin-block: 0.65rem; }
@media (max-width: 1099px) { .explorer-scroll { max-height: 18rem; } }


/* --- breadcrumbs --- */
.breadcrumbs { margin-bottom: 1rem; color: var(--ap-text-muted); font-size: 0.85rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: baseline; gap: 0.5rem; min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs li + li::before { content: "/"; color: var(--ap-text-muted); }
.breadcrumbs a { color: var(--ap-accent); }


/* --- backlinks --- */
.backlinks ul { list-style: none; margin: 0; padding: 0; }
.backlinks li + li { margin-top: 0.5rem; }
.backlinks a { color: var(--ap-accent); overflow-wrap: anywhere; }
.backlinks-empty { margin: 0; color: var(--ap-text-muted); }

