/* PyQuantLib documentation custom styles */

/* Lower Furo's right sidebar breakpoint from 82em (1312px) to 72em (1152px) */
@media (min-width: 72em) and (max-width: 82em) {
    .toc-drawer {
        position: static !important;
        right: auto !important;
        height: auto !important;
        border-left: none;
    }
    .toc-content-icon {
        display: none !important;
    }
}

/* Headline sizes and spacing */
h1 { 
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-brand-primary);
}

h2 { 
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-background-border);
}

h3 { 
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-foreground-secondary);
}

h4 { 
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

h5 { 
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

h6 { 
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-foreground-secondary);
}

/* Reduce top margin when heading follows another heading */
h1 + h2 { margin-top: 1.5rem; }
h2 + h3 { margin-top: 1.5rem; }
h3 + h4 { margin-top: 1rem; }

/* Code block styling */
.highlight pre {
    padding: 1em;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: var(--color-background-secondary);
}

/* Dark mode adjustment */
body[data-theme="dark"] .highlight pre {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Inline code styling */
code.literal {
    background: var(--color-inline-code-background);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Subtle bordered table with hover and stripes */
table.docutils {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--color-background-border);
    border-radius: 6px;
    overflow: hidden;
}

table.docutils th {
    padding: 5px 12px;
    text-align: left;
    font-weight: 600;
    background: var(--color-background-secondary);
    border-bottom: 1px solid var(--color-background-border);
}

table.docutils td {
    padding: 4px 12px;
    border-bottom: 1px solid var(--color-background-border);
}

table.docutils tr:last-child td {
    border-bottom: none;
}

table.docutils tbody tr:nth-child(even) {
    background: var(--color-background-secondary);
}

table.docutils tr:hover {
    background: var(--color-background-hover);
}

/* API documentation improvements */
dl.py {
    margin-left: 0;
    padding-left: 0;
}

/* Align class/function signatures with the indented content below */
dl.py.class > dt.sig,
dl.py.function > dt.sig,
dl.py.method > dt.sig {
    margin-left: 1.5em;
    padding: 0.5em 0.75em;
    background: var(--color-api-background);
    border-radius: 4px;
    font-family: var(--font-stack--monospace);
}

/* Better spacing for parameter lists */
.field-list dt {
    font-weight: 600;
}

.field-list dd {
    margin-bottom: 0.5em;
}

/* Admonition styling */
.admonition {
    border-radius: 4px;
}

/* Version badge styling */
.version-badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.875em;
    background: var(--color-brand-primary);
    color: white;
    border-radius: 4px;
}
