/* Shared pseudocode presentation. Colors and type inherit the project theme. */
div.sourceCode:has(pre.terminal-pseudocode) {
    position: relative;
    margin: 1rem 0 1.25rem;
    padding-top: 2.35rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    border-radius: 0.4rem;
    background: var(--quarto-scss-export-code-block-bg);
    box-shadow: 0 0.7rem 1.7rem rgb(0 0 0 / 12%);
}

div.sourceCode:has(pre.terminal-pseudocode)::before {
    position: absolute;
    inset: 0 0 auto;
    height: 2.35rem;
    box-sizing: border-box;
    padding: 0.72rem 3.1rem 0.58rem 4.35rem;
    border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    color: inherit;
    background: color-mix(in srgb, var(--quarto-scss-export-code-block-bg) 94%, currentColor);
    content: "Pseudocode";
    font-family: "Jost", "Segoe UI", Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

div.sourceCode:has(pre.terminal-pseudocode)::after {
    position: absolute;
    top: 0.9rem;
    left: 1rem;
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 50%, transparent);
    box-shadow: 0.95rem 0 color-mix(in srgb, currentColor 50%, transparent), 1.9rem 0 color-mix(in srgb, currentColor 70%, transparent);
    content: "";
}

div.sourceCode:has(pre.terminal-pseudocode) pre,
pre.terminal-pseudocode {
    max-width: 100%;
    margin: 0;
    padding: 1rem 0 1.05rem;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: transparent !important;
    font-family: var(--quarto-font-monospace);
    font-size: var(--dact-code-font-size);
    line-height: var(--dact-code-line-height);
    white-space: pre;
}

.terminal-pseudocode code,
.terminal-pseudocode code span {
    color: inherit !important;
    background: transparent !important;
    font-family: inherit;
}

.terminal-pseudocode code > span {
    left: 0 !important;
    padding-right: 1.1rem;
}

.terminal-pseudocode code > span > a:first-child {
    color: inherit;
}

.terminal-pseudocode code > span > a:first-child::before {
    min-width: 3.2rem;
    margin-right: 1rem;
    padding-right: 0.85rem;
    border-right: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    color: inherit !important;
    content: counter(source-line);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.terminal-pseudocode code > span:target {
    background: color-mix(in srgb, currentColor 7%, transparent) !important;
}

.code-copy-outer-scaffold:has(pre.terminal-pseudocode) .code-copy-button {
    top: 0.42rem;
}

@media print {
    div.sourceCode:has(pre.terminal-pseudocode) {
        border-color: #777;
        background: #fff;
        box-shadow: none;
    }

    div.sourceCode:has(pre.terminal-pseudocode)::before {
        border-color: #bbb;
        color: #222;
        background: #eee;
    }

    div.sourceCode:has(pre.terminal-pseudocode) pre,
    pre.terminal-pseudocode,
    .terminal-pseudocode code,
    .terminal-pseudocode code span {
        color: #000 !important;
        background: #fff !important;
    }
}
