/* Caliban User Guide — custom theme polish.
 *
 * Layered on top of mdBook's built-in themes. Keeps the default themes intact
 * while adding an accent colour, softer typography, and nicer code/table styling.
 * (Replaces the unmaintained mdbook-catppuccin preprocessor.) */

:root {
    --caliban-accent: #7c5cff;        /* violet — primary accent */
    --caliban-accent-soft: #9b86ff;
    --caliban-radius: 8px;
}

/* Accent links + sidebar active item */
.content a:not(.header):hover {
    color: var(--caliban-accent);
    text-decoration: underline;
}
.chapter li.chapter-item a.active {
    color: var(--caliban-accent);
    font-weight: 600;
}

/* Headings: a little more presence + an accent underline on h2 */
.content h1 {
    letter-spacing: -0.01em;
}
.content h2 {
    padding-bottom: 0.25rem;
    border-bottom: 2px solid color-mix(in srgb, var(--caliban-accent) 35%, transparent);
}

/* Inline code + code blocks: rounded, subtle */
.content code {
    border-radius: 5px;
}
.content pre {
    border-radius: var(--caliban-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Tables: zebra striping + rounded frame for readability of the many
 * reference tables in this guide. */
.content table {
    border-radius: var(--caliban-radius);
    overflow: hidden;
}
.content table thead th {
    background: color-mix(in srgb, var(--caliban-accent) 16%, transparent);
}
.content table tbody tr:nth-child(even) {
    background: color-mix(in srgb, currentColor 4%, transparent);
}

/* Blockquotes pick up the accent rail */
.content blockquote {
    border-inline-start: 4px solid var(--caliban-accent-soft);
}

/* Menu title (book title in the top bar) */
/* Prefix the book title in the top bar with the caliban mark. The mark is the
 * site favicon (mdBook copies theme/favicon.svg to the book root) used as a CSS
 * mask, so it inherits the menu bar's text colour and adapts to every theme. */
.menu-title {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
}
.menu-title::before {
    content: "";
    width: 1.25em;
    height: 1.25em;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask: url("../favicon.svg") center / contain no-repeat;
    mask: url("../favicon.svg") center / contain no-repeat;
}
