/* FAQ Page Styles
   Index page reuses dg-chapter-group/dg-declaration-table from dep_graph.css.
   This file handles FAQ-specific layout and individual entry page styling. */

/* === Index Page === */

.faq-page .content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.faq-container h1 {
  margin: 0 0 1.5rem 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--bp-text, var(--sbs-heading));
}

/* Preview text in entry table */
.faq-preview {
  color: var(--bp-text-muted, var(--sbs-text-muted));
  font-size: 0.875rem;
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Individual Entry Page === */

.faq-entry-page .content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  max-width: 100ch;
}

.faq-entry-page h1 {
  margin: 0.5rem 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bp-text, var(--sbs-heading));
}

/* === Rendered Markdown Content === */

.faq-content {
  line-height: 1.7;
  color: var(--bp-text, var(--sbs-text));
}

.faq-content h1,
.faq-content h2,
.faq-content h3,
.faq-content h4,
.faq-content h5,
.faq-content h6 {
  color: var(--bp-text, var(--sbs-heading));
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.faq-content h1 { font-size: 1.5rem; }
.faq-content h2 { font-size: 1.3rem; }
.faq-content h3 { font-size: 1.15rem; }

.faq-content p {
  margin: 0.75rem 0;
}

.faq-content ul,
.faq-content ol {
  margin: 0.75rem 0;
  padding-left: 2rem;
}

.faq-content li {
  margin: 0.25rem 0;
}

.faq-content pre {
  background: var(--bp-bg-alt, var(--sbs-graph-bg));
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid var(--bp-border, var(--sbs-border));
}

.faq-content code {
  background: var(--bp-bg-alt, var(--sbs-graph-bg));
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.875em;
}

.faq-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.faq-content blockquote {
  border-left: 3px solid var(--bp-primary, var(--sbs-link));
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  color: var(--bp-text-muted, var(--sbs-text-muted));
}

.faq-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.faq-content th,
.faq-content td {
  border: 1px solid var(--bp-border, var(--sbs-border));
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.faq-content th {
  background: var(--bp-bg-alt, var(--sbs-graph-bg));
  font-weight: 600;
}

.faq-content img {
  max-width: 100%;
  height: auto;
}

.faq-content a {
  color: var(--bp-primary, var(--sbs-link));
}

.faq-content a:hover {
  text-decoration: underline;
}

/* === Prev/Next Navigation === */

.faq-entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bp-border, var(--sbs-border));
}

.faq-nav-prev,
.faq-nav-next {
  color: var(--bp-primary, var(--sbs-link));
  text-decoration: none;
  font-size: 0.9rem;
}

.faq-nav-prev:hover,
.faq-nav-next:hover {
  text-decoration: underline;
}

.faq-nav-disabled {
  visibility: hidden;
}

/* === Dark Mode === */

[data-theme="dark"] .faq-content {
  color: var(--bp-text, var(--sbs-text));
}

[data-theme="dark"] .faq-content h1,
[data-theme="dark"] .faq-content h2,
[data-theme="dark"] .faq-content h3,
[data-theme="dark"] .faq-content h4,
[data-theme="dark"] .faq-content h5,
[data-theme="dark"] .faq-content h6 {
  color: var(--bp-text, var(--sbs-heading));
}

[data-theme="dark"] .faq-preview {
  color: var(--bp-text-muted, var(--sbs-text-muted));
}
