/* Bootstrap data tables, scoped to pages migrated from the legacy templates. */
.incartum-table-region {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-block: 1rem;
    border: 1px solid var(--inc-line);
    border-radius: .375rem;
    overscroll-behavior-x: contain;
}

.incartum-table-region:focus-visible {
    outline: 2px solid var(--inc-gold);
    outline-offset: 3px;
}

/* Allow Bootstrap columns containing a wide table to shrink with the page. */
.RO_CONTENU2 .row > .col,
.RO_CONTENU2 .row > [class*="col-"] {
    min-width: 0;
}

.incartum-table-region > .incartum-data-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.incartum-table-region > .incartum-table-list {
    min-width: 48rem;
}

.incartum-table-region > .incartum-table-details {
    min-width: 36rem;
}

/* Override legacy per-cell backgrounds so Bootstrap hover/striping can show. */
.incartum-data-table > :not(caption) > tr > th,
.incartum-data-table > :not(caption) > tr > td {
    padding: .75rem .875rem;
    font-size: .875rem;
    line-height: 1.5;
    vertical-align: middle;
    color: var(--inc-text);
    background-color: var(--bs-table-bg);
    border-inline-width: 0;
    overflow-wrap: normal;
}

.incartum-data-table > thead > tr > th {
    color: var(--inc-ivory);
    background-color: #211811;
    white-space: nowrap;
}

.incartum-data-table > tbody > tr > th {
    color: var(--inc-ivory);
    font-weight: 600;
    white-space: nowrap;
}

/* Keep identifiers and numbers readable; only long names/prose should wrap. */
.incartum-table-list > tbody > tr > td {
    white-space: nowrap;
}

.incartum-table-list > tbody > tr > td > a {
    display: inline-block;
    max-width: 24rem;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.incartum-data-table > tbody > tr > td[colspan] {
    overflow-wrap: anywhere;
}

.incartum-data-table pre {
    max-width: 40rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .incartum-data-table > :not(caption) > tr > th,
    .incartum-data-table > :not(caption) > tr > td {
        padding: .625rem .75rem;
    }
}
