/* -----------------------------------------------------------------------
   Mermaid diagrams — in-page container (click opens modal)
   ----------------------------------------------------------------------- */

.mermaid {
    overflow: hidden;
    border: 1px solid var(--color-background-border);
    border-radius: 4px;
    padding: 8px;
    margin: 1em 0;
    position: relative;
}

.mermaid > svg {
    cursor: zoom-in;
    display: block;
    width: 100%;
    height: auto;
}

/* -----------------------------------------------------------------------
   Mermaid full-screen modal
   ----------------------------------------------------------------------- */

#mermaid-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#mermaid-modal-overlay.visible {
    display: flex;
}

#mermaid-modal-box {
    width: 90vw;
    height: 85vh;
    overflow: hidden;
    cursor: grab;
    background: var(--color-background-primary, #fff);
    border-radius: 6px;
    padding: 12px;
    box-sizing: border-box;
    user-select: none;
}

#mermaid-modal-box:active {
    cursor: grabbing;
}

#mermaid-modal-close,
#mermaid-modal-reset {
    position: fixed;
    top: 16px;
    z-index: 10000;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 4px;
    font-size: 1.1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#mermaid-modal-close:hover,
#mermaid-modal-reset:hover {
    background: rgba(255,255,255,0.35);
}

#mermaid-modal-close { right: 16px; }
#mermaid-modal-reset { right: 58px; }

#mermaid-modal-hint {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.55);
    font-size: 0.75rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10000;
}

/* Remove the old in-page toolbar (no longer used) */
.mermaid-toolbar { display: none; }

/* -----------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------- */

/* Widen the content area (furo default is ~46em) */
:root {
    --font-size--normal: 0.9rem;   /* body text: slightly smaller than furo default (1rem) */
    --content-width: 100%;
}

/* -----------------------------------------------------------------------
   Typography — article body
   ----------------------------------------------------------------------- */

/* Pull down heading margins to reduce vertical sprawl */
article h1 { margin-top: 0.6em; margin-bottom: 0.35em; }
article h2 { margin-top: 1.1em; margin-bottom: 0.3em; }
article h3 { margin-top: 0.9em; margin-bottom: 0.25em; }

/* Tighten paragraph spacing */
article p { margin-top: 0.4em; margin-bottom: 0.5em; }

/* -----------------------------------------------------------------------
   Tables
   ----------------------------------------------------------------------- */

article table {
    font-size: 0.845rem;       /* compact table text */
    border-collapse: collapse;
    width: 100%;
}

article thead tr {
    background-color: var(--color-background-secondary);
}

article th,
article td {
    padding: 0.32em 0.75em;
    border: 1px solid var(--color-background-border);
    vertical-align: top;
}

/* Zebra stripe for readability */
article tbody tr:nth-child(even) {
    background-color: var(--color-background-secondary);
}

/* Inline code inside tables — prevent overflow and keep compact */
article td code,
article th code {
    font-size: 0.82rem;
    padding: 0.05em 0.3em;
    white-space: nowrap;
}

/* -----------------------------------------------------------------------
   Code blocks
   ----------------------------------------------------------------------- */

article .highlight pre,
article pre {
    font-size: 0.82rem;
    padding: 0.75em 1em;
}

/* -----------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */

/* Hide the "Made with Sphinx and Furo" footer credit */
.bottom-of-page .left-details {
    font-size: 0;
}
.bottom-of-page .left-details .copyright {
    font-size: 0.81rem;
}
