
/* Code blocks and highlighting */
code {
    font-family: Fira Code, monospace;
}   

pre.highlight {
    margin: 10px;
    padding: 10px;
    white-space: pre;
    word-wrap: normal;
}

/* for block of numbers */
.hljs-ln-numbers {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    text-align: center;
    color: #ccc;
    border-right: 1px solid #CCC;
    vertical-align: top;
    padding-right: 10px !important;
}

/* for block of code */
.hljs-ln-code {
    padding-left: 10px !important;
    white-space: pre;
}

/* Tables */
.sv-vuln-table-zebra {
    @layer daisyui.l1.l2 {
        tbody {
            tr {
                &:where(:nth-child(even)) {
                    background-color: var(--color-base-300);

                    :where(.table-pin-cols tr th) {
                        background-color: var(--color-base-300);
                    }
                }

                &.row-hover {
                    &,
                    &:where(:nth-child(even)) {
                        &:hover {
                            @media (hover: hover) {
                                background-color: var(--color-base-300);
                            }
                        }
                    }
                }
            }
        }
    }
}

.table-mdsm {
    @layer daisyui.l1.l2 {
        :not(thead, tfoot) tr {
            font-size: 0.85rem;
        }

        :where(th, td) {
            padding-inline: calc(0.2rem * 3);
            padding-block: calc(0.2rem * 2);
        }
    }
}

/* break long word anywhere */
.dont-break-out {  /* from https://stackoverflow.com/a/50777367 */
    /* These are technically the same, but use both */
    overflow-wrap: break-word;
    word-wrap: break-word;

    -ms-word-break: break-all;
    /* This is the dangerous one in WebKit, as it breaks things wherever */
    word-break: break-all;
    /* Instead use this non-standard one: */
    word-break: break-word;
}

/* make tables and MathJax equations scrollable */
div:has(> table), code:has(> table), p:has(> mjx-container) {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    overflow-x: auto !important;
}

table {
    overflow-x: scroll !important;
    width: 100% !important;
}

/* Rounded table */
.table-rounded thead tr th:first-child {
    border-radius: 0.8rem 0 0 0;
}

.table-rounded thead tr th:last-child {
    border-radius: 0 0.8rem 0 0;
}

.table-rounded thead tr th:first-child:last-child {
    border-radius: 0.8rem 0.8rem 0 0;
}

.table-rounded tr:last-child td:first-child {
    border-radius: 0 0 0 0.8rem;
}

.table-rounded tr:last-child td:last-child {
    border-radius: 0 0 0.8rem 0;
}

.table-rounded tr:last-child td:first-child:last-child {
    border-radius: 0 0 0.8rem 0.8rem;
}

/* distance between list point and item */
ul.ul-content > li,
ol.ol-content > li {
    padding-left: 0.3rem;
}

/* center images */
img {
    margin-left: auto;
    margin-right: auto;
}

/* misc */
.text-smxs {
    font-size: 0.825rem;
}

.text-version-badge {
    font-size: 0.825rem;
    line-height: 1.5rem;
}
