﻿
.json-document {
    width: 720px;
}
.json-document.landscape {
    width: 960px;
}

.json-document .checklist .mud-icon-button {
    align-self: start;
}

.json-list-item .mud-typography {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

.json-list .json-list-item .mud-list-item-text {
    min-width: 0 !important; /* critical */
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important; /* avoid clipping */
}

.json-list-item .mud-list-item-text > .mud-typography {
    display: grid;
    grid-template-columns: 2.5ch minmax(0, 1fr) !important; /* marker | content */
    column-gap: 0.5rem;
    align-items: start; /* bullet aligns to first line */
    padding-top: 2px !important;
    max-width: 100% !important;
    width: 100% !important;
}

.json-list-marker {
    width: 2.25ch; /* fits "10." nicely; tweak to taste */
    text-align: right;
    line-height: 1.4;
    flex: none;
    min-width: 1.5rem;
    display: inline-block;
    padding-right: 0.5rem;
    font-weight: 600;
    vertical-align: top;
}

.json-list-content {
    min-width: 0; /* critical in grid/flex to allow wrapping */
    max-width: 100% !important;
    white-space: normal;
    overflow-wrap: anywhere; /* breaks long words/IDs */
    word-break: break-word; /* Safari fallback */
    line-height: 1.4;
}

.json-list {
    padding-left: 1.25rem;
    max-width: 100%;
}

.json-document h1 {
    font-size: 30px;
}

.json-document h2 {
    font-size: 24px;
}

.json-document h3 {
    font-size: 21px;
}

.json-document h4 {
    font-size: 18px;
}

.json-document h5 {
    font-size: 17px;
}

.json-document h6 {
    font-size: 16px;
}

.json-document .checkbox-group-title {
    padding-bottom: 1px;
}

.json-document .mud-list-item-text {
    margin: 0;
}

.json-document .mud-input-control-input-container {
    margin: -8px 0;
}

.json-document .mud-table-bordered th,
.json-document .mud-table-bordered td {
    border: 1px solid var(--mud-palette-table-lines) !important;
}

.json-document .mud-table {
    margin-bottom: 8px;
    margin-top: 8px;
}

.json-document th {
    font-weight: 700 !important;
    border-bottom: 2px solid #000 !important;
}

@media print {
    /* -----------------------------------------------------------
       TABLE BORDER + LAYOUT FIXES
       ----------------------------------------------------------- */
    @page {
        size: auto; /* let printer choose paper */
        margin: auto;
    }

    .json-document {
        width: 720px !important;
    }

    .json-document.landscape {
        width: 960px !important;
    }

    .json-document .mud-table {
        border: 1px solid rgba(0, 0, 0, 0.4) !important;
        width: 100% !important;
    }

    .json-document .mud-table thead {
        display: table-header-group !important; /* repeat on new pages */
        border-bottom: 1px solid rgba(0, 0, 0, 0.4) !important;
    }

    .json-document .mud-table tfoot {
        display: table-footer-group !important;
    }

    .json-document th {
        background-color: #e0e0e0 !important; /* Light gray */
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .json-document .mud-table-bordered,
    .json-document .mud-simple-table table * tr > td,
    .json-document .mud-simple-table table * tr th {
        border-collapse: collapse;
    }

    .json-document .mud-table-bordered th,
    .json-document .mud-table-bordered td {
        border: 1px solid rgba(0, 0, 0, 0.4) !important;
    }

    /* Hover highlight (irrelevant for print) */
    .json-document .mud-table-hover .mud-table-row:hover {
        background-color: white !important;
    }

    /* Striped rows (MudBlazor uses odd/even classes) */
    .json-document .mud-table-striped .mud-table-row:nth-child(even) {
        background-color: white !important;
    }

    /* Remove MudBlazor dense mode row height limits */
    .json-document .mud-table-cell {
        min-height: auto !important;
        height: auto !important;
    }
}

@media print and (orientation: portrait) {
    .json-document {
        width: 720px !important;
    }
}

@media print and (orientation: landscape) {
    .json-document {
        width: 960px !important;
    }
}