/* Borg Docs — brutalist, filesystem-native */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #000000;
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: #0000ee; text-decoration: underline; }
a:visited { color: #551a8b; }
a:hover { background: #ffffcc; }

hr { border: 0; border-top: 1px solid #999; margin: 0; }

#topbar {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 6px 12px;
  background: #eeeeee;
  border-bottom: 1px solid #999;
  position: sticky;
  top: 0;
  z-index: 100;
}
#topbar #title a {
  font-weight: bold;
  text-decoration: none;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 17px;
}
#topbar #title a:hover { background: transparent; text-decoration: underline; }
#breadcrumbs {
  flex: 1;
  font-size: 15px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#breadcrumbs .sep { color: #999; margin: 0 4px; }
#breadcrumbs a { text-transform: capitalize; }
#actions { font-size: 15px; }
#actions a { margin-left: 12px; }

#layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 40px);
}

#tree-pane {
  background: #f5f5f5;
  border-right: 1px solid #999;
  padding: 8px 6px;
  overflow-y: auto;
  max-height: calc(100vh - 40px);
  position: sticky;
  top: 40px;
}
.pane-header {
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  padding: 4px 6px;
  border-bottom: 1px solid #ccc;
  margin-bottom: 6px;
}

#tree, #tree ul {
  list-style: none;
  margin: 0;
  padding-left: 14px;
}
#tree { padding-left: 4px; }
#tree li { margin: 0; padding: 0; font-size: 16px; }
#tree .dir > .label,
#tree .file {
  display: flex;
  align-items: baseline;
}
#tree .dir > .label { user-select: none; font-weight: bold; }
#tree .chevron {
  cursor: pointer;
  display: inline-block;
  width: 14px;
  flex: 0 0 14px;
  color: #666;
  text-align: center;
  user-select: none;
}
#tree .chevron::before { content: "\25B8"; }
#tree .dir.open > .label .chevron::before { content: "\25BE"; }
#tree .dir:not(.open) > ul { display: none; }
#tree a {
  display: inline-block;
  flex: 1;
  padding: 1px 4px;
  text-decoration: none;
  color: #0000ee;
}
#tree a:hover { background: #ffffcc; text-decoration: underline; }
#tree a.current { background: #d0d8ff; color: #000; font-weight: bold; }
#tree .file::before {
  content: "\2022";
  display: inline-block;
  width: 14px;
  flex: 0 0 14px;
  color: #999;
  text-align: center;
}

#doc-pane { padding: 16px 28px 32px 28px; min-width: 0; }
#doc { max-width: 820px; }

#doc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  max-width: 820px;
  margin-bottom: 8px;
}
#doc-actions button {
  font-family: inherit;
  font-size: 15px;
  padding: 4px 12px;
  background: #f0f0f0;
  border: 1px solid #666;
  cursor: pointer;
}
#doc-actions button:hover { background: #ffffcc; }
#doc-actions button.copied { background: #d0ffd0; }

/* Markdown content */
#doc h1, #doc h2, #doc h3, #doc h4 {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#doc h1 {
  font-size: 30px;
  border-bottom: 1px solid #999;
  padding-bottom: 4px;
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: bold;
}
#doc h2 {
  font-size: 22px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 2px;
  margin-top: 28px;
  font-weight: bold;
}
#doc h3 { font-size: 18px; margin-top: 22px; font-weight: bold; }
#doc h4 { font-size: 16px; margin-top: 18px; font-weight: bold; }
#doc p { margin: 10px 0; }
#doc ul, #doc ol { padding-left: 24px; }
#doc li { margin: 3px 0; }
#doc code {
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  background: #f0f0f0;
  padding: 1px 4px;
  border: 1px solid #ddd;
}
#doc pre {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.4;
  font-family: "Courier New", Courier, monospace;
}
#doc pre code { background: transparent; border: 0; padding: 0; font-size: 13px; }
#doc blockquote {
  margin: 10px 0;
  padding: 4px 12px;
  border-left: 4px solid #999;
  background: #f9f9f9;
  color: #333;
}
#doc table {
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 16px;
  width: 100%;
  max-width: 780px;
}
#doc th, #doc td {
  border: 1px solid #666;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
#doc th { background: #eee; font-weight: bold; }
#doc img { max-width: 100%; }

#docfoot { margin-top: 40px; color: #666; }
#docfoot small { font-size: 14px; line-height: 1.5; }

@media (max-width: 720px) {
  #layout { grid-template-columns: 1fr; }
  #tree-pane { position: static; max-height: 240px; }
}
