pre.spectec {
    position: relative;
    overflow-x: auto;
}

pre.spectec > code {
    display: block;
    padding: 1rem;
}

/* Catppuccin Latte */
.light pre.spectec code,
.rust pre.spectec code { color: #4c4f69; }

/* Catppuccin Mocha */
.coal pre.spectec code,
.navy pre.spectec code,
.ayu pre.spectec code { color: #cdd6f4; }

/* ── AsciiDoc-generated HTML blocks ── */

/* Grammar / listing blocks */
div.listingblock {
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

div.listingblock pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.9em;
}

/* Collapsible source blocks */
details {
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

details summary.title {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    user-select: none;
}

details > div {
    padding: 0 1rem 1rem;
}

details div.listingblock {
    margin: 0.5rem 0 0;
}

/* Prose output sidebar blocks */
div.sidebarblock {
    border-left: 4px solid;
    border-radius: 0 6px 6px 0;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

div.sidebarblock .olist,
div.sidebarblock .ulist {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

/* Catppuccin Latte colours */
.light div.listingblock,
.rust div.listingblock {
    background: #e6e9ef;
    border: 1px solid #bcc0cc;
}

.light details,
.rust details {
    background: #e6e9ef;
    border: 1px solid #bcc0cc;
}

.light details summary.title {
    background: #dce0e8;
    color: #4c4f69;
}

.light div.sidebarblock,
.rust div.sidebarblock {
    background: #eff1f5;
    border-left-color: #1e66f5;
}

/* Catppuccin Mocha colours */
.coal div.listingblock,
.navy div.listingblock,
.ayu div.listingblock {
    background: #1e1e2e;
    border: 1px solid #45475a;
}

.coal details,
.navy details,
.ayu details {
    background: #1e1e2e;
    border: 1px solid #45475a;
}

.coal details summary.title,
.navy details summary.title,
.ayu details summary.title {
    background: #181825;
    color: #cdd6f4;
}

.coal div.sidebarblock,
.navy div.sidebarblock,
.ayu div.sidebarblock {
    background: #181825;
    border-left-color: #89b4fa;
}
