/* Wiki — /wiki component styles. Tokens, body, and the shared top bar/nav
   live in public/shell.css; this file styles only wiki components. */

button, input {
  font: inherit;
  color: inherit;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.search {
  width: min(18rem, 54vw);
}

input[type="search"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}

input[type="search"]:focus-visible, .btn:focus-visible, .tree-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.32rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
}

.wiki-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 25vw) minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.6rem;
}

.tree-pane, .doc-pane {
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tree-pane {
  overflow: auto;
  padding: 0.45rem;
}

.tree, .tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-list .tree-list {
  margin-left: 0.9rem;
  border-left: 1px solid var(--border);
  padding-left: 0.35rem;
}

.tree-item {
  margin: 0.05rem 0;
}

.tree-button {
  width: 100%;
  min-height: 1.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.22rem 0.35rem;
  cursor: pointer;
}

.tree-button:hover {
  background: var(--surface-2);
}

.tree-button.selected {
  background: var(--chip-bg);
  border-color: var(--accent);
}

.tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-meta {
  color: var(--text-dim);
  font-size: 0.76rem;
  white-space: nowrap;
}

.folder-toggle {
  width: 1rem;
  color: var(--text-dim);
}

.hidden {
  display: none;
}

.tree-empty {
  margin: 0.35rem;
  color: var(--text-dim);
}

.doc-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.doc-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.doc-path {
  margin: 0.15rem 0 0;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.doc-meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.15rem 0.55rem;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.doc-meta dt {
  font-weight: 600;
}

.doc-meta dd {
  margin: 0;
}

.doc-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.1rem 2rem;
  overflow-wrap: anywhere;
}

.doc-content.empty {
  color: var(--text-dim);
}

.doc-content h1, .doc-content h2, .doc-content h3,
.doc-content h4, .doc-content h5, .doc-content h6 {
  margin: 1rem 0 0.4rem;
  line-height: 1.2;
}

.doc-content h1:first-child, .doc-content h2:first-child,
.doc-content h3:first-child {
  margin-top: 0;
}

.doc-content p {
  margin: 0.45rem 0;
  max-width: 78rem;
}

.doc-content ul, .doc-content ol {
  margin: 0.45rem 0;
  padding-left: 1.35rem;
}

.doc-content code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

.doc-content pre {
  max-width: 100%;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem;
}

.doc-content pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.doc-content a {
  color: var(--accent);
}

.doc-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(32rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.65rem 0.8rem;
}

.toast.error {
  color: var(--danger);
  border-color: var(--danger);
}

@media (max-width: 760px) {

  .search {
    width: 100%;
  }

  .wiki-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(12rem, 34vh) minmax(0, 1fr);
  }

  .doc-header {
    display: block;
  }

  .doc-meta {
    margin-top: 0.5rem;
  }
}

/* ── Hologram overlay (task-0132) — glass panels on top of existing layout ── */
.tree-pane, .doc-pane {
  background: rgba(8, 10, 20, 0.72) !important;
  border-color: rgba(245, 158, 11, 0.18) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(245,158,11,0.06);
}

.tree-button:hover {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

.tree-button.selected {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.12);
}

.doc-header {
  border-bottom-color: rgba(245, 158, 11, 0.14) !important;
}

.doc-header h1 {
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.3);
}

input[type="search"] {
  background: rgba(8, 10, 20, 0.65) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}

.btn {
  background: rgba(8, 10, 20, 0.65) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}

.btn:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.tree-list .tree-list {
  border-left-color: rgba(245, 158, 11, 0.15) !important;
}

.toast {
  background: rgba(8, 10, 20, 0.85) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
