/*
 * DocumentResults page responsive styles.
 * Mirrors the CommitteeResults.css pattern: desktop columns hidden on mobile,
 * replaced by a single combined column with labelled fields.
 */

/* Responsive: hide desktop columns on mobile, show single combined column */
@media (max-width: 950px) {
    .k-grid td.desktop-col,
    .k-grid th.desktop-col {
        display: none !important;
    }

    .k-grid td.mobile-combined-col,
    .k-grid th.mobile-combined-col {
        display: table-cell !important;
        width: 100% !important;
    }

    .k-grid table {
        table-layout: auto !important;
    }

    /* Hide column header row on mobile — the combined column has its own labels */
    #gridDocumentResults .k-grid-header,
    #gridDocumentResults thead,
    #gridDocumentResults .k-table-thead {
        display: none !important;
    }

    /* Allow grid content to expand vertically to fit stacked rows */
    #gridDocumentResults .k-grid-content,
    #gridDocumentResults .k-table-wrap {
        height: auto !important;
        max-height: none !important;
    }
}

/* Responsive: hide mobile combined column on desktop, show desktop columns */
@media (min-width: 951px) {
    .k-grid td.mobile-combined-col,
    .k-grid th.mobile-combined-col {
        display: none !important;
    }

    .k-grid td.desktop-col,
    .k-grid th.desktop-col {
        display: table-cell !important;
        width: auto !important;
    }
}

/* Column header: allow text wrapping and vertically center */
#gridDocumentResults .k-grid-header th,
#gridDocumentResults .k-table-thead th {
    white-space: normal !important;
    overflow: hidden !important;
    vertical-align: middle !important;
}

#gridDocumentResults .k-grid-header th .k-cell-inner,
#gridDocumentResults .k-table-thead th .k-cell-inner {
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

#gridDocumentResults .k-grid-header th .k-cell-inner .k-link,
#gridDocumentResults .k-table-thead th .k-cell-inner .k-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    box-sizing: border-box !important;
    width: 100%;
}

#gridDocumentResults .k-grid-header th .k-column-title,
#gridDocumentResults .k-table-thead th .k-column-title {
    display: block !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: center !important;
}

/* Keep overflow scoped to the results region instead of expanding page width. */
#divResults {
    max-width: 100%;
}

#divResults,
#divResults .k-grid,
#divResults .k-grid-header,
#divResults .k-grid-header-wrap,
#divResults .k-grid-content,
#divResults .k-grid-content table {
    max-width: 100%;
    min-width: 0;
}

/* Allow horizontal scroll within the grid content area when columns cannot reflow. */
#gridDocumentResults .k-grid-content {
    overflow-x: auto !important;
}

/* Ensure long values do not force cell min-content width growth at high text zoom. */
#gridDocumentResults .k-grid-table td,
#gridDocumentResults .k-grid-table th,
#gridDocumentResults .k-grid-table a {
    overflow-wrap: anywhere;
    word-break: break-word;
}
