/* Typography for rendered help articles (resources/docs/*.md).
   Used by the in-app docs screen (DocsScreen.js) and the public /docs page. */

.fc-docs {
  --fc-docs-text: #1f2937;
  --fc-docs-muted: #4b5563;
  --fc-docs-border: #e5e7eb;
  --fc-docs-subtle-bg: #f3f4f6;
  --fc-docs-link: #1976d2;
  --fc-docs-quote-border: #1976d2;
  --fc-docs-quote-bg: #eff6ff;
  color: var(--fc-docs-text);
  font-size: 15px;
  line-height: 1.7;
  max-width: 820px;
  overflow-wrap: break-word;
}

.body--dark .fc-docs {
  --fc-docs-text: #e5e7eb;
  --fc-docs-muted: #9ca3af;
  --fc-docs-border: #374151;
  --fc-docs-subtle-bg: #1f2937;
  --fc-docs-link: #64b5f6;
  --fc-docs-quote-border: #64b5f6;
  --fc-docs-quote-bg: #0f2740;
}

.fc-docs > :first-child { margin-top: 0; }

.fc-docs h2,
.fc-docs h3,
.fc-docs h4 {
  color: var(--fc-docs-text);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  scroll-margin-top: 72px;
}
.fc-docs h2 { font-size: 1.45rem; margin: 2.2em 0 0.6em; padding-bottom: 0.3em; border-bottom: 1px solid var(--fc-docs-border); }
.fc-docs h3 { font-size: 1.15rem; margin: 1.8em 0 0.5em; }
.fc-docs h4 { font-size: 1rem; margin: 1.5em 0 0.4em; }

.fc-docs p,
.fc-docs ul,
.fc-docs ol,
.fc-docs pre,
.fc-docs table,
.fc-docs blockquote { margin: 0 0 1em; }

.fc-docs ul,
.fc-docs ol { padding-left: 1.6em; }
.fc-docs ul { list-style: disc; }
.fc-docs ol { list-style: decimal; }
.fc-docs li { margin: 0.25em 0; }
.fc-docs li > ul,
.fc-docs li > ol { margin: 0.25em 0 0; }

.fc-docs a,
#q-app .fc-docs a { color: var(--fc-docs-link); text-decoration: underline; text-underline-offset: 2px; }

.fc-docs .heading-permalink {
  margin-left: 0.4em;
  font-weight: 400;
  text-decoration: none !important;
  color: var(--fc-docs-muted) !important;
  opacity: 0;
  transition: opacity 0.15s;
}
.fc-docs h2:hover .heading-permalink,
.fc-docs h3:hover .heading-permalink,
.fc-docs .heading-permalink:focus { opacity: 1; }

.fc-docs code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--fc-docs-subtle-bg);
  border: 1px solid var(--fc-docs-border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.fc-docs pre {
  background: #1e1e1e;
  color: #dcdcdc;
  border-radius: 6px;
  padding: 1em 1.2em;
  overflow-x: auto;
  line-height: 1.5;
}
.fc-docs pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}
/* highlight.js sets its own background on code blocks; keep ours */
.fc-docs pre code.hljs { background: none; padding: 0; }

.fc-docs table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.fc-docs th,
.fc-docs td {
  border: 1px solid var(--fc-docs-border);
  padding: 0.45em 0.8em;
  text-align: left;
  vertical-align: top;
}
.fc-docs th { background: var(--fc-docs-subtle-bg); font-weight: 600; }

.fc-docs blockquote {
  border-left: 4px solid var(--fc-docs-quote-border);
  background: var(--fc-docs-quote-bg);
  border-radius: 0 6px 6px 0;
  padding: 0.75em 1em;
}
.fc-docs blockquote > :last-child { margin-bottom: 0; }

.fc-docs img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1em 0 1.5em;
  border: 1px solid var(--fc-docs-border);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
}

.fc-docs hr { border: 0; border-top: 1px solid var(--fc-docs-border); margin: 2em 0; }

/* In-app screen layout */
/* custom.css colours every #q-app link; keep the contents and search lists in body text colour
   (the active article still gets Quasar's text-primary) */
#q-app .fc-docs-toc a.q-item,
#q-app .fc-docs-toc a.q-item:hover { color: inherit; text-decoration: none; }
/* Sized to fit below the breadcrumbs before it sticks, so the last entries are never off-screen */
.fc-docs-toc { position: sticky; top: 66px; max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 1023px) { .fc-docs-toc { position: static; max-height: none; } }
.fc-docs-screen .fc-docs-card { min-height: 300px; }

/* Search results (in-app and public) */
.fc-docs-results { list-style: none; margin: 0; padding: 0; }
.fc-docs-results li { padding: 0.75em 0; border-bottom: 1px solid #e5e7eb; }
.fc-docs-results li:last-child { border-bottom: 0; }
.fc-docs-results a { font-weight: 600; color: #1976d2; }
.fc-docs-results p { margin: 0.25em 0 0; font-size: 14px; color: #4b5563; }
.fc-docs-results mark,
.fc-docs-hits mark { background: #fff3bf; color: inherit; padding: 0 1px; border-radius: 2px; }
.body--dark .fc-docs-results li { border-color: #374151; }
.body--dark .fc-docs-results a { color: #64b5f6; }
.body--dark .fc-docs-results p { color: #9ca3af; }
.body--dark .fc-docs-hits mark { background: #5c4b00; }

/* Help side panel: use the full window height (Quasar pads dialogs by 24px) */
.fc-help-dialog .q-dialog__inner,
.q-dialog__inner.fc-help-dialog { padding-top: 0 !important; padding-bottom: 0 !important; }

/* Public page layout */
.fc-docs-page { display: flex; gap: 2rem; align-items: flex-start; }
/* Scrolls on its own when the contents are taller than the window */
.fc-docs-page-nav { flex: 0 0 240px; position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; overscroll-behavior: contain; font-size: 14px; }
.fc-docs-page-nav h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 1.2em 0 0.4em;
}
.fc-docs-page-nav h3:first-of-type { margin-top: 0; }
.fc-docs-page-search { margin-bottom: 1.2em; }
.fc-docs-page-search input { width: 100%; padding: 0.45em 0.7em; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #fff; }
.fc-docs-page-search input:focus { outline: 2px solid #93c5fd; border-color: #1976d2; }
.fc-docs-page-nav a { display: block; padding: 0.25em 0.5em; border-radius: 4px; color: #374151; }
.fc-docs-page-nav a:hover { background: #f3f4f6; }
.fc-docs-page-nav a.active { background: #eff6ff; color: #1976d2; font-weight: 600; }
.fc-docs-page-main { flex: 1 1 auto; min-width: 0; background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.fc-docs-page-main .fc-docs img { cursor: default; }
.fc-docs-page-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; font-size: 14px; }
.fc-docs-page-footer a { color: #1976d2; }

@media (max-width: 767px) {
  .fc-docs-page { flex-direction: column; }
  .fc-docs-page-nav { position: static; flex-basis: auto; width: 100%; max-height: none; overflow: visible; }
  .fc-docs-page-main { padding: 1.25rem; }
}
