/* Extra styles for the timeweb-rs documentation. */

:root {
    --sidebar-background: #f7f8fa;
    /* mdBook ships a 750px column, which is too narrow for wide tables and
       code blocks on a desktop screen. Pixels, not rem: mdBook sets the root
       font size to 10px, so a rem value here would be misread. */
    --content-max-width: min(960px, 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --sidebar-background: #16191d;
    }
}

code {
    font-size: 0.92em;
}

table {
    font-size: 0.92em;
}

/* A wide table scrolls inside its own box instead of pushing the page wider. */
main table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

/* The link to the same page in the other language, added by
   `js/language-switch.js` next to the title of the menu bar. */
.language-switch {
    align-self: center;
    margin-inline-start: 0.75rem;
    padding: 0.1rem 0.7rem;
    border: 1px solid var(--icons);
    border-radius: 1rem;
    color: var(--icons);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.7;
    text-decoration: none;
    white-space: nowrap;
}

.language-switch:hover,
.language-switch:focus-visible {
    border-color: var(--icons-hover);
    color: var(--icons-hover);
}

/* Diagrams of the architecture chapter. */
.diagram {
    margin-block: 1.5rem;
    text-align: center;
}

.diagram img {
    max-width: 100%;
    height: auto;
}

.diagram figcaption {
    margin-block-start: 0.5rem;
    color: var(--fg);
    font-size: 0.85em;
    opacity: 0.8;
}
