/* XActions Docs Styles — shared across all documentation pages */
/* by nichxbt */
/* Base styles & sidebar are provided by common.css + sidebar.js */

/* Override: docs pages use wider line-height */
body { line-height: 1.6; }

/* Override: docs main content is wider than default */
.main-content { max-width: 800px; }

/* Breadcrumb */
.breadcrumb { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 4px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Article */
.article { padding: 24px 20px; }
.article h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; line-height: 1.2; }
.article h2 { font-size: 1.375rem; font-weight: 700; margin: 32px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.article h3 { font-size: 1.125rem; font-weight: 600; margin: 24px 0 8px; color: var(--accent); }
.article h4 { font-size: 1rem; font-weight: 600; margin: 16px 0 8px; }
.article p { color: var(--text-secondary); font-size: 0.9375rem; margin-bottom: 16px; }
.article ul, .article ol { margin-left: 24px; margin-bottom: 16px; }
.article li { color: var(--text-secondary); font-size: 0.9375rem; margin-bottom: 6px; }
.article a { color: var(--accent); text-decoration: none; }
.article a:hover { text-decoration: underline; }
.article strong { color: var(--text-primary); }
.article blockquote { border-left: 3px solid var(--accent); padding: 12px 16px; margin: 16px 0; background: var(--bg-secondary); border-radius: 0 8px 8px 0; }
.article blockquote p { margin: 0; color: var(--text-secondary); font-style: italic; }
.article code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-family: 'Monaco', 'Menlo', 'Consolas', monospace; font-size: 0.875rem; color: var(--accent); }
.article pre { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 16px; overflow-x: auto; margin: 16px 0; position: relative; }
.article pre code { background: none; padding: 0; color: var(--text-primary); font-size: 0.8125rem; display: block; }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.875rem; }
.article th { background: var(--bg-secondary); padding: 10px 12px; text-align: left; border: 1px solid var(--border); font-weight: 600; }
.article td { padding: 10px 12px; border: 1px solid var(--border); color: var(--text-secondary); }
.article hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.article img { max-width: 100%; border-radius: 12px; }

/* Category badge */
.cat-badge { display: inline-block; background: var(--accent-light); color: var(--accent); padding: 4px 12px; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; margin-bottom: 16px; }

/* CTA box */
.cta-box { background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin: 32px 0; text-align: center; }
.cta-box h3 { font-size: 1.25rem; margin-bottom: 8px; color: var(--text-primary); }
.cta-box p { color: var(--text-secondary); margin-bottom: 16px; }
.cta-box a { display: inline-block; padding: 12px 24px; background: var(--accent); color: #fff; border-radius: 9999px; text-decoration: none; font-weight: 700; transition: background .2s; }
.cta-box a:hover { background: var(--accent-hover); }

/* Sidebar Right (content sidebar for related links) */
.sidebar-right { width: 350px; padding: 16px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-card { background: var(--bg-secondary); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.sidebar-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.sidebar-card a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; padding: 6px 0; border-bottom: 1px solid var(--border); transition: color .2s; }
.sidebar-card a:last-child { border-bottom: none; }
.sidebar-card a:hover { color: var(--accent); }

/* Docs Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 24px; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-section h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 8px; }
.footer-section p, .footer-section a { color: var(--text-secondary); font-size: 0.8125rem; text-decoration: none; display: block; padding: 3px 0; }
.footer-section a:hover { color: var(--accent); }
.footer-bottom { max-width: 1200px; margin: 16px auto 0; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; color: var(--text-secondary); font-size: 0.75rem; }

/* Responsive */
@media (max-width: 1024px) { .sidebar-right { display: none; } }
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar-left { display: none; }
  .main-content { max-width: 100%; border-right: none; }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .article pre { font-size: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* GLOW-UP + FIX: cap tall code blocks so docs pages aren't 20,000px tall       */
/* Some docs embed a full script source (500+ lines). Give long code its own    */
/* scroll region instead of stretching the whole page.                          */
/* ═══════════════════════════════════════════════════════════════════════════ */
.article pre {
  max-height: 520px;
  overflow: auto;
  box-shadow: var(--shadow-1);
  scrollbar-width: thin;
}
.article pre::-webkit-scrollbar { width: 10px; height: 10px; }
.article pre::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 6px; border: 2px solid var(--bg-secondary); }
.article pre::-webkit-scrollbar-thumb:hover { background: #33404b; }

/* Article polish */
.article h2 { letter-spacing: -0.01em; }
.article h3 { color: var(--accent); }
.article code { color: #7fc8ff; }
.cat-badge { box-shadow: inset 0 0 0 1px var(--border-glow); }
.cta-box { position: relative; overflow: hidden; box-shadow: var(--shadow-2); }
.cta-box::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 50% 0%, rgba(29,155,240,0.12), transparent 60%); pointer-events: none; }
.cta-box a { background: var(--grad); box-shadow: 0 8px 22px -8px rgba(29,155,240,0.6); transition: transform 0.16s var(--ease), filter 0.2s; }
.cta-box a:hover { background: var(--grad); filter: brightness(1.06); transform: translateY(-2px); }

/* Related-links sidebar cards: depth + hover */
.sidebar-card { border: 1px solid var(--border); transition: border-color 0.24s, box-shadow 0.24s; }
.sidebar-card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-1); }
.sidebar-card a { transition: color 0.18s, padding-left 0.18s var(--ease); }
.sidebar-card a:hover { color: var(--accent); padding-left: 4px; }

/* Docs footer: force vertical columns (same fix as common.css) */
.site-footer .footer-content > div { display: flex; flex-direction: column; align-items: flex-start; }
