/* CreativeDynamics documentation theme overrides for sphinx-wagtail-theme */

:root {
    --cd-primary: #1D3D59;
    --cd-accent: #3B88C3;
    --cd-dark-bg: #0E1624;
    --cd-dark-surface: #121E30;
    --cd-dark-text: rgba(255, 255, 255, 0.86);
    --cd-dark-muted: rgba(255, 255, 255, 0.70);
}

body {
    background-color: #FFFFFF;
}

/* Wagtail theme uses Bootstrap-like helper classes */
.bg-primary {
    background-color: var(--cd-primary) !important;
}

a,
a:visited {
    color: var(--cd-accent);
}

a:hover {
    color: #2B6FA1;
}

/* Dark mode palette overrides for sphinx-wagtail-theme */
body.theme-dark {
    background-color: var(--cd-dark-bg) !important;
    color: var(--cd-dark-text) !important;
}

body.theme-dark .bg-primary {
    background-color: var(--cd-primary) !important;
}

body.theme-dark .sidebar-container {
    background-color: var(--cd-dark-surface) !important;
    border-right-color: rgba(255, 255, 255, 0.10) !important;
}

body.theme-dark .breadcrumb,
body.theme-dark .breadcrumb a {
    color: var(--cd-dark-muted) !important;
}

body.theme-dark .rst-content a,
body.theme-dark .rst-content a:visited {
    color: #8EC7FF !important;
}

/* Right-hand page contents (TOC) visibility in dark mode */
body.theme-dark .page-toc {
    color: var(--cd-dark-muted) !important;
}

body.theme-dark .page-toc a,
body.theme-dark .page-toc a:visited {
    color: var(--cd-dark-text) !important;
}

body.theme-dark .page-toc a:hover {
    color: #8EC7FF !important;
}

/* Left sidebar injected quick links: ensure readability in dark mode */
body.theme-dark .cd-sidebar-links {
    background: var(--cd-dark-surface) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.theme-dark .cd-sidebar-links__title {
    color: var(--cd-dark-text) !important;
}

body.theme-dark .cd-sidebar-links__link,
body.theme-dark .cd-sidebar-links__link:visited {
    color: #8EC7FF !important;
}

body.theme-dark .cd-sidebar-links__link:hover {
    color: #B9DEFF !important;
}

/* Keep code blocks readable on light background */
code,
pre {
    font-variant-ligatures: none;
}

/* Make the logo feel less cramped in the header */
.navbar-brand img {
    margin-right: 0.5rem;
}

/* Sidebar quick links under the search box */
.cd-sidebar-links {
    margin: 0.75rem 0.25rem 1.25rem 0.25rem;
    padding: 0.75rem;
    border: 1px solid rgba(29, 61, 89, 0.15);
    border-radius: 0.5rem;
    background: #ffffff;
}

.cd-sidebar-links__title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cd-primary);
    margin-bottom: 0.5rem;
}

.cd-sidebar-links__list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.cd-sidebar-links__item {
    margin: 0;
    padding: 0.2rem 0;
}

.cd-sidebar-links__link {
    display: inline-block;
    text-decoration: none;
}

.cd-sidebar-links__link:hover {
    text-decoration: underline;
}
