/* ══════════════════════════════════════════════════
   Global visual enhancements — applies to all pages
   Excludes .doxygen-content to preserve doxygen-awesome styling
   ══════════════════════════════════════════════════ */

/* ── Links (merged from custom_link.css) ── */
a {
  text-decoration: none;
  color: #2563EB;
  font-weight: 450;
}
a:hover {
  text-decoration: underline;
}

/* ── Sidebar: margin fix + thin scrollbar ── */
.sidebar-primary-items__end {
  margin-top: 0px !important;
}

.bd-sidebar-primary {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.bd-sidebar-primary:hover {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
.bd-sidebar-primary::-webkit-scrollbar {
  width: 4px;
}
.bd-sidebar-primary::-webkit-scrollbar-track {
  background: transparent;
}
.bd-sidebar-primary::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
.bd-sidebar-primary:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

/* ── Table hover (merged from custom_table.css) ── */
table.table tbody td {
  background: #ffffff;
}
table.table tbody tr:hover td {
  background: #f3f9ff;
}

/* ── Section headings: subtle bottom rule on h2 ── */
.bd-article h2 {
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e2e8f0;
  margin-top: 2rem;
}

/* ── Admonitions: modern left-accent style ── */
.bd-article .admonition {
  border: none;
  border-left: 4px solid;
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem 0.8rem 1rem;
  margin: 1.3rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.bd-article .admonition > .admonition-title {
  background: none;
  border: none;
  padding: 0.3rem 0.6rem 0.3rem 2rem;
  margin: 0 0 0.25rem 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bd-article .admonition.note { background: #f0f7ff; border-left-color: #3b82f6; }
.bd-article .admonition.note > .admonition-title { color: #2563eb; }
.bd-article .admonition.warning { background: #fffbeb; border-left-color: #f59e0b; }
.bd-article .admonition.warning > .admonition-title { color: #d97706; }
.bd-article .admonition.important { background: #fef3f2; border-left-color: #ef4444; }
.bd-article .admonition.important > .admonition-title { color: #dc2626; }
.bd-article .admonition.tip { background: #f0fdf4; border-left-color: #22c55e; }
.bd-article .admonition.tip > .admonition-title { color: #16a34a; }
.bd-article .admonition.caution { background: #fff7ed; border-left-color: #f97316; }
.bd-article .admonition.caution > .admonition-title { color: #ea580c; }
.bd-article .admonition.seealso { background: #f5f3ff; border-left-color: #8b5cf6; }
.bd-article .admonition.seealso > .admonition-title { color: #7c3aed; }
.bd-article .admonition.attention { background: #fff7ed; border-left-color: #f97316; }
.bd-article .admonition.attention > .admonition-title { color: #ea580c; }

/* ── Images: subtle frame (skip doxygen content) ── */
.bd-article > section img {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin: 0.5rem 0;
}

/* ── Code blocks (skip doxygen content) ── */
.bd-article > section div[class*="highlight-"] {
  margin: 1.2rem 0;
}

.bd-article > section div.highlight {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.bd-article > section div.highlight pre {
  margin: 0;
  padding: 0.9rem 1rem;
  background: transparent;
  font-size: 0.86rem;
  line-height: 1.6;
}

/* ── Inline code: subtle background (skip doxygen content) ── */
.bd-article > section code.literal {
  background: #f1f5f9;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  border: 1px solid #e2e8f0;
}

/* ── Blockquotes: styled left border ── */
.bd-article > section blockquote {
  border-left: 3px solid #3b82f6;
  background: #f8fafc;
  padding: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  border-radius: 0 6px 6px 0;
}

.bd-article > section blockquote p {
  color: #475569;
  font-size: 0.92rem;
}

/* ── Lists: better spacing ── */
.bd-article > section > ul,
.bd-article > section > section > ul,
.bd-article > section > ol,
.bd-article > section > section > ol {
  margin: 0.8rem 0;
}

.bd-article > section li + li {
  margin-top: 0.3rem;
}

/* ── Tables: clean modern look (skip doxygen content) ── */
.bd-article > section > table,
.bd-article > section > section > table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  width: 100%;
}

.bd-article > section > table thead th,
.bd-article > section > section > table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #475569;
  padding: 0.6rem 0.8rem;
}

.bd-article > section > table td,
.bd-article > section > section > table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #f1f5f9;
}

.bd-article > section > table tbody tr:last-child td,
.bd-article > section > section > table tbody tr:last-child td {
  border-bottom: none;
}

/* ═══════════════════════
   Dark mode
   ═══════════════════════ */
html[data-mode="dark"] .bd-article h2,
html[data-theme="dark"] .bd-article h2 {
  border-bottom-color: #2d3748;
}

/* Sidebar scrollbar dark */
html[data-mode="dark"] .bd-sidebar-primary:hover,
html[data-theme="dark"] .bd-sidebar-primary:hover {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
html[data-mode="dark"] .bd-sidebar-primary:hover::-webkit-scrollbar-thumb,
html[data-theme="dark"] .bd-sidebar-primary:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

/* Admonitions dark */
html[data-mode="dark"] .bd-article .admonition.note,
html[data-theme="dark"] .bd-article .admonition.note { background: #1a2332; }
html[data-mode="dark"] .bd-article .admonition.warning,
html[data-theme="dark"] .bd-article .admonition.warning { background: #2a2010; }
html[data-mode="dark"] .bd-article .admonition.important,
html[data-theme="dark"] .bd-article .admonition.important { background: #2a1515; }
html[data-mode="dark"] .bd-article .admonition.tip,
html[data-theme="dark"] .bd-article .admonition.tip { background: #142218; }
html[data-mode="dark"] .bd-article .admonition.caution,
html[data-theme="dark"] .bd-article .admonition.caution { background: #2a1c10; }
html[data-mode="dark"] .bd-article .admonition.attention,
html[data-theme="dark"] .bd-article .admonition.attention { background: #2a1c10; }
html[data-mode="dark"] .bd-article .admonition.seealso,
html[data-theme="dark"] .bd-article .admonition.seealso { background: #1e1530; }
html[data-mode="dark"] .bd-article .admonition > .admonition-title,
html[data-theme="dark"] .bd-article .admonition > .admonition-title { background: none; }

/* Images dark */
html[data-mode="dark"] .bd-article > section img,
html[data-theme="dark"] .bd-article > section img {
  border-color: #2d3748;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Code blocks dark */
html[data-mode="dark"] .bd-article > section div.highlight,
html[data-theme="dark"] .bd-article > section div.highlight {
  background: #1a2030;
  border-color: #2d3748;
}

/* Inline code dark */
html[data-mode="dark"] .bd-article > section code.literal,
html[data-theme="dark"] .bd-article > section code.literal {
  background: #1e293b;
  border-color: #334155;
}

/* Blockquotes dark */
html[data-mode="dark"] .bd-article > section blockquote,
html[data-theme="dark"] .bd-article > section blockquote {
  background: #1a2030;
  border-left-color: #60a5fa;
}
html[data-mode="dark"] .bd-article > section blockquote p,
html[data-theme="dark"] .bd-article > section blockquote p {
  color: #94a3b8;
}

/* Tables dark */
html[data-mode="dark"] .bd-article > section > table,
html[data-theme="dark"] .bd-article > section > table {
  border-color: #2d3748;
}
html[data-mode="dark"] .bd-article > section > table thead th,
html[data-theme="dark"] .bd-article > section > table thead th {
  background: #1e293b;
  border-bottom-color: #334155;
  color: #94a3b8;
}
html[data-mode="dark"] .bd-article > section > table td,
html[data-theme="dark"] .bd-article > section > table td {
  border-bottom-color: #1e293b;
}

/* ═══════════════════════
   prefers-color-scheme fallback
   ═══════════════════════ */
@media (prefers-color-scheme: dark) {
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article h2 { border-bottom-color: #2d3748; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.note { background: #1a2332; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.warning { background: #2a2010; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.important { background: #2a1515; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.tip { background: #142218; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.caution { background: #2a1c10; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.attention { background: #2a1c10; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition.seealso { background: #1e1530; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article .admonition > .admonition-title { background: none; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section img { border-color: #2d3748; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section div.highlight { background: #1a2030; border-color: #2d3748; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section code.literal { background: #1e293b; border-color: #334155; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section blockquote { background: #1a2030; border-left-color: #60a5fa; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section blockquote p { color: #94a3b8; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section > table { border-color: #2d3748; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section > table thead th { background: #1e293b; border-bottom-color: #334155; color: #94a3b8; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-article > section > table td { border-bottom-color: #1e293b; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-sidebar-primary:hover { scrollbar-color: rgba(255,255,255,0.15) transparent; }
  html:not([data-mode="light"]):not([data-theme="light"]) .bd-sidebar-primary:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
}
