/* ============================================
   ROACH PI — Documentation Page Styles
   Extends ../style.css design tokens
   ============================================ */

/* --- Doc Layout --- */
.doc-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.doc-prose {
  max-width: 780px;
  line-height: 1.8;
  font-size: 1rem;
}

.doc-prose p {
  margin-bottom: 1.25rem;
}

/* --- Sidebar Nav --- */
.doc-sidebar {
  position: sticky;
  top: 5rem;
  float: left;
  width: 220px;
  margin-right: 2rem;
  padding: 1rem 0;
}

.doc-sidebar ul {
  list-style: none;
  padding: 0;
}

.doc-sidebar li {
  margin-bottom: 0.5rem;
}

.doc-sidebar a {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: none;
  display: block;
  padding: 0.25rem 0.5rem;
  border-left: 3px solid transparent;
  transition: border-color 0.1s, background 0.1s;
}

.doc-sidebar a:hover,
.doc-sidebar a.active {
  border-left-color: var(--blue);
  background: var(--gray-light);
}

/* --- Doc Content with Sidebar --- */
.doc-with-sidebar {
  margin-left: 240px;
}

/* --- Section Headers in Docs --- */
.doc-section {
  padding: 2.5rem 0;
  border-bottom: 2px solid var(--black);
}

.doc-section:last-of-type {
  border-bottom: none;
}

.doc-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  border-bottom: none;
}

.doc-section h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 900;
}

.doc-section h4 {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-transform: none;
}

/* --- Configuration Table --- */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.doc-table th,
.doc-table td {
  border: 3px solid var(--black);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.doc-table td code {
  background: var(--gray-light);
  border: 2px solid var(--black);
  padding: 0.1rem 0.3rem;
  font-size: 0.85em;
}

/* --- Code Example Blocks in Docs --- */
.doc-code {
  background: var(--black);
  color: var(--white);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
}

.doc-code .comment {
  color: #888;
}

.doc-code .highlight {
  color: var(--blue);
}

/* --- Callout Boxes --- */
.doc-callout {
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.doc-callout-info {
  border-color: var(--blue);
  box-shadow: 4px 4px 0 var(--blue);
}

.doc-callout-warn {
  border-color: #CC8800;
  box-shadow: 4px 4px 0 #CC8800;
}

.doc-callout-title {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* --- Sub-feature Grid (for power-tools page) --- */
.doc-subsection {
  padding: 2rem 0;
  border-bottom: 2px dashed var(--black);
}

.doc-subsection:last-of-type {
  border-bottom: none;
}

.doc-subsection h3 {
  font-size: 1.3rem;
}

/* --- Responsive Doc Overrides --- */
@media (max-width: 768px) {
  .doc-sidebar {
    position: static;
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--black);
    padding-bottom: 1rem;
  }

  .doc-with-sidebar {
    margin-left: 0;
  }

  .doc-table {
    font-size: 0.8rem;
  }

  .doc-table th,
  .doc-table td {
    padding: 0.35rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .doc-container {
    padding: 1rem;
  }
}

/* --- Print --- */
@media print {
  .doc-sidebar {
    display: none;
  }

  .doc-with-sidebar {
    margin-left: 0;
  }

  .doc-callout,
  .doc-table th,
  .doc-table td {
    box-shadow: none;
  }
}
