/* CaseMgr Dark Documentation Theme
   Matches the /cli/ landing page aesthetic */

:root {
  --cmgr-bg: #0f172a;
  --cmgr-surface: #1e293b;
  --cmgr-border: #334155;
  --cmgr-text: #e2e8f0;
  --cmgr-text-dim: #94a3b8;
  --cmgr-accent: #3b82f6;
  --cmgr-accent-hover: #2563eb;
  --cmgr-green: #22c55e;
  --cmgr-code-bg: #0d1117;
  --cmgr-code-border: #21262d;
}

/* Global overrides */
body {
  background-color: var(--cmgr-bg) !important;
  color: var(--cmgr-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Remove WordPress default backgrounds */
.wp-site-blocks,
.wp-block-group,
.has-global-padding,
body .is-layout-constrained {
  background-color: transparent !important;
}

/* Navigation bar */
header,
.wp-block-template-part {
  background-color: var(--cmgr-bg) !important;
  border-bottom: 1px solid var(--cmgr-border) !important;
}

/* Nav links */
header a,
header .wp-block-navigation a,
.wp-block-navigation-item a,
.wp-block-navigation-link a {
  color: var(--cmgr-text-dim) !important;
  text-decoration: none !important;
  font-size: 0.9rem !important;
}

header a:hover,
.wp-block-navigation-item a:hover,
.wp-block-navigation-link a:hover {
  color: var(--cmgr-text) !important;
}

/* Nav submenu dropdowns */
.wp-block-navigation__submenu-container,
.wp-block-navigation-submenu .wp-block-navigation__submenu-container {
  background-color: var(--cmgr-surface) !important;
  border: 1px solid var(--cmgr-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

.wp-block-navigation__submenu-container a {
  color: var(--cmgr-text-dim) !important;
}

.wp-block-navigation__submenu-container a:hover {
  color: var(--cmgr-text) !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Site title */
.wp-block-site-title a {
  color: var(--cmgr-text) !important;
  font-weight: 700 !important;
}

/* Main content area */
main, .entry-content, .wp-block-post-content {
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 2rem 1.5rem !important;
}

/* Page title */
h1, .wp-block-post-title, .entry-title {
  color: var(--cmgr-text) !important;
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 1rem !important;
}

/* Headings */
h2 {
  color: var(--cmgr-text) !important;
  font-size: 1.5rem !important;
  margin: 2.5rem 0 1rem !important;
  padding-bottom: 0.5rem !important;
  border-bottom: 1px solid var(--cmgr-border) !important;
}

h3 {
  color: var(--cmgr-text) !important;
  font-size: 1.1rem !important;
  margin: 1.5rem 0 0.75rem !important;
}

h4 {
  color: var(--cmgr-text-dim) !important;
  font-size: 0.95rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

/* Paragraphs */
p, li {
  color: var(--cmgr-text-dim) !important;
  line-height: 1.6 !important;
}

/* Strong text */
strong, b {
  color: var(--cmgr-text) !important;
}

/* Links */
a {
  color: var(--cmgr-accent) !important;
  text-decoration: none !important;
}

a:hover {
  text-decoration: underline !important;
}

/* Code blocks */
pre, .wp-block-code {
  background-color: var(--cmgr-code-bg) !important;
  border: 1px solid var(--cmgr-code-border) !important;
  border-radius: 8px !important;
  padding: 1rem 1.25rem !important;
  overflow-x: auto !important;
  margin: 0.75rem 0 1.25rem !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

pre code, .wp-block-code code {
  color: var(--cmgr-text) !important;
  background: transparent !important;
  padding: 0 !important;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace !important;
  font-size: 0.9rem !important;
}

/* Inline code */
code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace !important;
  color: var(--cmgr-text) !important;
  background-color: var(--cmgr-code-bg) !important;
  padding: 0.15rem 0.4rem !important;
  border-radius: 4px !important;
  font-size: 0.85rem !important;
}

/* Tables */
table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0.75rem 0 1.25rem !important;
  font-size: 0.9rem !important;
}

th {
  text-align: left !important;
  padding: 0.6rem 0.75rem !important;
  border-bottom: 2px solid var(--cmgr-border) !important;
  color: var(--cmgr-text-dim) !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  background: transparent !important;
}

td {
  padding: 0.5rem 0.75rem !important;
  border-bottom: 1px solid var(--cmgr-border) !important;
  color: var(--cmgr-text-dim) !important;
}

tr:hover {
  background: rgba(59, 130, 246, 0.05) !important;
}

td code {
  background: var(--cmgr-code-bg) !important;
  padding: 0.15rem 0.4rem !important;
  border-radius: 4px !important;
}

/* Horizontal rules */
hr {
  border-color: var(--cmgr-border) !important;
  margin: 2rem 0 !important;
}

/* Lists */
ul, ol {
  color: var(--cmgr-text-dim) !important;
  padding-left: 1.5em !important;
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--cmgr-accent) !important;
  padding-left: 1rem !important;
  color: var(--cmgr-text-dim) !important;
  background: transparent !important;
}

/* Footer */
footer, .wp-block-template-part:last-child {
  background-color: var(--cmgr-bg) !important;
  border-top: 1px solid var(--cmgr-border) !important;
  color: var(--cmgr-text-dim) !important;
}

footer a {
  color: var(--cmgr-accent) !important;
}

/* Mermaid diagram backgrounds (keep light for readability) */
pre.mermaid {
  background-color: #f8fafc !important;
  border: 1px solid var(--cmgr-border) !important;
  border-radius: 8px !important;
  padding: 1rem !important;
}

/* WordPress admin bar (keep as-is) */
#wpadminbar {
  background-color: #1d2327 !important;
}

/* Remove any white background blocks */
.wp-block-group.has-background,
.has-white-background-color,
.has-base-background-color {
  background-color: transparent !important;
}

/* WordPress search, buttons */
input[type="text"], input[type="search"], input[type="email"], textarea {
  background-color: var(--cmgr-surface) !important;
  border: 1px solid var(--cmgr-border) !important;
  color: var(--cmgr-text) !important;
  border-radius: 6px !important;
  padding: 0.5rem 0.75rem !important;
}

.wp-block-button__link, button[type="submit"] {
  background-color: var(--cmgr-accent) !important;
  color: white !important;
  border-radius: 6px !important;
}

.wp-block-button__link:hover, button[type="submit"]:hover {
  background-color: var(--cmgr-accent-hover) !important;
}
