/* ============================================================
   Brido — Documentation Stylesheet
   ============================================================ */

/* ── Layout ────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 3.5rem);
}

/* ── Sticky Sidebar ────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 3.5rem;
  height: calc(100vh - 3.5rem);
  padding: 3rem 1.5rem 3rem 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  align-self: start;
}

.sidebar-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.sidebar-nav a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--transition);
  line-height: 1.3;
}

.sidebar-nav a:hover {
  color: var(--text-1);
}

.sidebar-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ── Content Area ──────────────────────────────────────────── */
.docs-content {
  max-width: 760px;
  padding: 3rem 2rem 5rem 3.5rem;
}

.docs-content section {
  padding: 0;
  margin-bottom: 5.5rem;
  scroll-margin-top: 5.5rem; /* avoids sticky header collision */
}

.docs-content h2 {
  font-family: var(--font-head);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-1);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
}

.docs-content h2::before {
  content: '●';
  color: var(--accent);
  font-size: 0.6rem;
  vertical-align: middle;
  margin-right: 0.625rem;
  display: inline-block;
}

.docs-content p {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.docs-content p strong {
  color: var(--text-1);
}

/* ── Terminal block layout in docs ─────────────────────────── */
.terminal-block {
  margin-bottom: 1.5rem;
}

/* ── Table Styling ─────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0 2.25rem;
}

th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1rem;
}

td {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-2);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

td.font-mono {
  font-family: var(--mono);
  font-size: 0.825rem;
}

td code {
  font-family: var(--mono);
  font-size: 0.825rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.1rem 0.45em;
  border-radius: 2px;
}

/* ── Bullet Lists (Mono arrow) ─────────────────────────────── */
.bullet-list {
  list-style: none;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bullet-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

.bullet-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  color: var(--accent);
  font-weight: bold;
}

.bullet-list li strong {
  color: var(--text-1);
}

/* ── Error reference section ───────────────────────────────── */
.error-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.error-card:last-child {
  border-bottom: none;
}

.error-card .terminal-block {
  margin-top: 0.5rem;
  margin-bottom: 0.875rem;
  padding: 0.625rem 1rem;
  font-size: 0.8rem;
  color: var(--red);
  background: rgba(239, 83, 80, 0.05);
  border-color: rgba(239, 83, 80, 0.25);
}

.error-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}

.error-label.cause {
  color: var(--yellow);
}

.error-label.fix {
  color: var(--accent);
}

.error-body {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── Troubleshooting Accordion ─────────────────────────────── */
details {
  border: 1px solid var(--border);
  margin-bottom: 0.625rem;
  background: var(--surface);
  transition: border-color var(--transition);
}

details[open] {
  border-color: var(--accent);
}

summary {
  padding: 1.125rem 1.375rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

/* Hide native details arrow on webkit */
summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '›';
  color: var(--text-3);
  font-size: 1.25rem;
  font-weight: bold;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}

details[open] summary::after {
  transform: rotate(90deg);
  color: var(--accent);
}

.details-body {
  padding: 0 1.375rem 1.375rem;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  padding-top: 1.125rem;
}

.details-body ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.details-body li {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
}

.details-body li .terminal-block {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .docs-layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 3.5rem;
    z-index: 90;
    height: auto;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .sidebar-label {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.25rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .sidebar-nav a {
    flex-shrink: 0;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
  }

  .sidebar-nav a.active {
    border-bottom: 2px solid var(--accent);
  }

  .docs-content {
    padding: 2.5rem 0;
  }

  .docs-content section {
    scroll-margin-top: 8rem;
    margin-bottom: 4rem;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  th, td {
    padding: 0.625rem 0.75rem;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding: 0.875rem 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
  }
}


