/* Plugin developer documentation styles.
   Shared by the authenticated /dev/docs page (rendered in the dashboard
   chrome) and the public /docs/developers page (rendered in the public
   marketing chrome). Both views include the same per-tab content
   partials, so this CSS is the single styling source of truth. */

.docs { max-width: 920px; }
.docs h2 {
  font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 700;
  margin-top: 2rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border); color: var(--gold-light);
}
.docs h3 {
  font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 600;
  margin-top: 1.5rem; margin-bottom: 0.5rem; color: var(--text);
}
.docs h4 {
  font-size: 1rem; font-weight: 600;
  margin-top: 1rem; margin-bottom: 0.4rem; color: var(--text);
}
.docs p, .docs li { font-size: 1rem; line-height: 1.7; color: var(--muted); margin-bottom: 0.5rem; }
.docs ul, .docs ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.docs strong { color: var(--text); }
.docs code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.88rem;
  background: rgba(201,168,76,0.06); border: 1px solid rgba(180,150,80,0.1);
  padding: 1px 5px; border-radius: 3px; color: var(--gold);
}
.docs pre {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; margin: 0.75rem 0; overflow-x: auto; position: relative;
}
.docs pre code {
  background: none; border: none; padding: 0; color: var(--text);
  font-size: 0.86rem; line-height: 1.65;
}
/* Belt-and-suspenders: highlight.js wraps code in .hljs spans which the
   atom-one-dark stylesheet colours. Force the container to be transparent
   so .docs pre's bg shows through, and stop hljs from setting its own. */
.docs pre code.hljs { background: transparent; padding: 0; }

/* Light-mode syntax-colour overrides — atom-one-dark is dark-only.
   Map each token role to a colour readable on the parchment surface. */
[data-theme="light"] .docs pre code.hljs        { color: #2a261e; }
[data-theme="light"] .hljs-comment,
[data-theme="light"] .hljs-quote                { color: #8a7d68; font-style: italic; }
[data-theme="light"] .hljs-keyword,
[data-theme="light"] .hljs-selector-tag,
[data-theme="light"] .hljs-built_in,
[data-theme="light"] .hljs-name,
[data-theme="light"] .hljs-tag                  { color: #a83a3a; }
[data-theme="light"] .hljs-string,
[data-theme="light"] .hljs-title,
[data-theme="light"] .hljs-section,
[data-theme="light"] .hljs-attribute,
[data-theme="light"] .hljs-literal,
[data-theme="light"] .hljs-template-tag,
[data-theme="light"] .hljs-template-variable,
[data-theme="light"] .hljs-type,
[data-theme="light"] .hljs-addition             { color: #2f7a2c; }
[data-theme="light"] .hljs-deletion,
[data-theme="light"] .hljs-selector-attr,
[data-theme="light"] .hljs-selector-pseudo,
[data-theme="light"] .hljs-meta                 { color: #8a6418; }
[data-theme="light"] .hljs-doctag,
[data-theme="light"] .hljs-attr                 { color: #2a5fa6; }
[data-theme="light"] .hljs-symbol,
[data-theme="light"] .hljs-bullet,
[data-theme="light"] .hljs-link,
[data-theme="light"] .hljs-number,
[data-theme="light"] .hljs-regexp,
[data-theme="light"] .hljs-variable,
[data-theme="light"] .hljs-template-variable    { color: #b86515; }
[data-theme="light"] .hljs-emphasis             { font-style: italic; }
[data-theme="light"] .hljs-strong               { font-weight: 700; }
.docs .badge-new {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; margin-left: 6px;
  background: rgba(107,203,139,0.12); border: 1px solid rgba(107,203,139,0.3);
  color: var(--green); vertical-align: middle;
}
.docs .badge-danger {
  background: rgba(224,90,90,0.12); border: 1px solid rgba(224,90,90,0.3); color: var(--red);
}
.docs .badge-warn {
  background: rgba(201,168,76,0.08); border: 1px solid rgba(201,168,76,0.2); color: var(--gold);
}
.docs .ref-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.92rem; }
.docs .ref-table th {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text); background: rgba(0,0,0,0.15);
}
.docs .ref-table td { padding: 8px 10px; border-bottom: 1px solid rgba(180,150,80,0.07); color: var(--muted); }
.docs .ref-table td:first-child { font-family: 'JetBrains Mono', monospace; font-size: 0.86rem; color: var(--gold); white-space: nowrap; }
.docs .section-card {
  background: var(--depth); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 20px; margin: 0.75rem 0;
}
.docs .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold-bg);
  border: 1px solid var(--gold-dim); color: var(--gold); font-size: 0.95rem;
  font-weight: 700; margin-right: 8px; flex-shrink: 0;
}
.docs .step { display: flex; align-items: flex-start; margin-bottom: 10px; }
.docs .copy-btn {
  position: absolute; top: 8px; right: 8px; font-size: 0.74rem; padding: 4px 10px;
  border-radius: 4px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; font-family: 'JetBrains Mono', monospace;
}
.docs .copy-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
/* Tab bar — sticky, primary navigation for the docs page. */
.docs-tabs {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 0 0 12px; padding: 8px 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.docs-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px;
  font-family: 'Cinzel', serif; font-size: 0.92rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  border: 1px solid transparent;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.docs-tab:hover { color: var(--gold); background: rgba(201,168,76,0.06); }
.docs-tab.is-active {
  color: var(--gold-light); background: rgba(201,168,76,0.10);
  border-color: rgba(201,168,76,0.32);
}
.docs-tab-count {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  padding: 1px 6px; border-radius: 999px; min-width: 18px; text-align: center;
  background: rgba(201,168,76,0.18); color: var(--gold); border: 1px solid rgba(201,168,76,0.32);
}
.docs-tab-count[hidden] { display: none; }

/* Search input — filters sections within the current tab. */
.docs-search { margin: 0 0 1.25rem; display: flex; align-items: center; gap: 10px; }
.docs-search input[type="search"] {
  flex: 1; padding: 8px 12px; border-radius: 6px;
  background: var(--depth); border: 1px solid var(--border); color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 0.88rem;
}
.docs-search input[type="search"]:focus {
  outline: none; border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.12);
}
.docs-search-meta { font-size: 0.82rem; color: var(--muted); }
.docs-search-meta[hidden] { display: none; }
.docs-section-hidden { display: none !important; }
.docs-no-results {
  color: var(--muted); padding: 14px 18px; border: 1px dashed var(--border);
  border-radius: 6px; margin: 1rem 0; font-size: 0.92rem;
}

/* Banner shown on the public /docs/developers page when the viewer is
   anonymous — some inline links go to logged-in surfaces. */
.public-dev-docs-banner {
  background: rgba(201,168,76,0.06); border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px; padding: 12px 16px; margin: 0 0 1.25rem;
  font-size: 0.92rem; color: var(--muted);
}
.public-dev-docs-banner a { color: var(--gold); text-decoration: underline; }
.public-dev-docs-banner a:hover { color: var(--gold-light); }

@media (max-width: 768px) {
  .docs .ref-table { display: block; overflow-x: auto; }
  .docs-tab { font-size: 0.85rem; padding: 5px 10px; }
}
