/* Animastor docs browser — lightweight styles */

/* ── Layout ── */
.docs-layout {
  display: flex;
  min-height: calc(100vh - 3.25rem);
}

/* ── Sidebar ── */
.docs-sidebar {
  width: 16rem;
  flex-shrink: 0;
  border-right: 1px solid var(--outline-2);
  background: var(--surface);
  overflow-y: auto;
  position: sticky;
  top: 3.25rem;
  height: calc(100vh - 3.25rem);
}
.docs-sidebar__header {
  padding: 1rem 1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.docs-sidebar-toggle {
  display: none;
}

/* ── Tree ── */
.docs-tree {
  padding: 0 0.5rem 1rem;
}
.docs-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-tree li {
  position: relative;
}
.docs-tree a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-tree a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.docs-tree a:target,
.docs-tree a.active {
  background: var(--accent-container);
  color: var(--on-accent-container);
}
.docs-tree-dir {
  font-weight: 500;
  color: var(--text) !important;
}
.docs-tree-file {
  padding-left: 1.5rem;
  font-weight: 400;
}
.docs-tree-icon {
  font-size: 0.6rem;
  width: 0.8rem;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── Main content ── */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem 3rem;
  max-width: 52rem;
}

/* ── Breadcrumb ── */
.docs-breadcrumb {
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-2);
}
.docs-bc-link {
  color: var(--accent);
}
.docs-bc-sep {
  margin: 0 0.25rem;
  opacity: 0.5;
}
.docs-bc-current {
  color: var(--text);
  font-weight: 500;
}

/* ── Directory listing ── */
.docs-dir-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.docs-dir-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s;
}
.docs-dir-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.docs-dir-item--dir {
  font-weight: 500;
  color: var(--accent);
}
.docs-dir-item .docs-tree-icon {
  font-size: 0.55rem;
}

/* ── Markdown rendered content ── */
.docs-md h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--outline-2);
}
.docs-md h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--outline-2);
}
.docs-md h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
.docs-md h4, .docs-md h5, .docs-md h6 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}
.docs-md p {
  margin: 0 0 1rem;
  line-height: 1.65;
}
.docs-md ul, .docs-md ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.docs-md li {
  margin-bottom: 0.3rem;
  line-height: 1.55;
}
.docs-md pre {
  background: var(--surface-2);
  border: 1px solid var(--outline-2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
}
.docs-md code {
  font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
  font-size: 0.8125rem;
}
.docs-md p code, .docs-md li code {
  background: var(--surface-2);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
}
.docs-md pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}
.docs-md a {
  color: var(--accent);
}
.docs-md blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}
.docs-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.875rem;
}
.docs-md th, .docs-md td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--outline-2);
  text-align: left;
}
.docs-md th {
  background: var(--surface-2);
  font-weight: 600;
}
.docs-md hr {
  border: none;
  border-top: 1px solid var(--outline-2);
  margin: 1.5rem 0;
}
.docs-md strong {
  font-weight: 600;
}
.docs-md img {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

/* ── README intro ── */
.docs-readme {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--outline-2);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .docs-layout {
    display: block;
  }
  .docs-sidebar {
    position: fixed;
    top: 3.25rem;
    left: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .docs-sidebar--open {
    transform: translateX(0);
    box-shadow: var(--elev-3);
  }
  .docs-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 45;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 0;
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--elev-2);
    cursor: pointer;
  }
  .docs-sidebar-toggle__icon {
    font-size: 1.25rem;
  }
  .docs-main {
    padding: 1rem 1rem 3rem;
  }
}
