/* =========================================================
   Document Repository
   ========================================================= */

.entry-content .njr-documents {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px;

    margin: 0 0 24px 0;
    padding: 0;

    float: none !important;
    clear: both !important;
}

.entry-content .njr-documents::before,
.entry-content .njr-documents::after {
    display: none !important;
    content: none;
}

.entry-content .njr-documents-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 16px;

    margin: 0 0 20px 0;
    padding: 0;
}

.entry-content .njr-documents-search label {
    display: block;
    flex: 0 0 100%;

    margin: 0;

    font-size: 16px;
    line-height: 1.35;
    font-weight: 600;
}

.entry-content .njr-documents-search .form-control {
    flex: 1 1 280px;
    max-width: 520px;
    height: 40px;
    margin: 0;
}

.entry-content .njr-documents-search-count {
    flex: 0 0 auto;

    margin: 0 0 24px 0;

    color: #555;
    font-size: 14px;
    line-height: 1.4;
}

.entry-content .njr-documents-no-results {
    display: none;

    margin: 0 0 24px 0;
    padding: 12px 14px;

    border: 1px solid #ddd;
    background: #f8f8f8;
    color: #333;
}

.entry-content .njr-documents-no-results.is-visible {
    display: block;
}

/* Individual document card wrapper */
.entry-content .njr-documents > .document {
    display: flex !important;

    float: none !important;
    clear: none !important;

    width: auto !important;
    max-width: none;
    min-width: 0;

    height: auto;
    min-height: 0;

    margin: 0;
    padding: 0;

    position: static;
    overflow: visible;
}

.entry-content .njr-documents > .document.is-hidden {
    display: none !important;
}

/* Bootstrap thumbnail/card */
.entry-content .njr-documents > .document > .thumbnail {
    display: flex !important;
    flex-direction: column;

    width: 100%;
    max-width: none;
    min-width: 0;

    height: 100%;
    min-height: 0;

    margin: 0;
    padding: 0;

    position: relative;
    overflow: hidden;

    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Thumbnail image */
.entry-content .njr-documents > .document > .thumbnail > .thumbnail-img {
    display: block !important;

    width: 100%;
    max-width: none;

    height: 220px !important;
    min-height: 220px;
    max-height: 220px;
    flex: 0 0 220px;

    margin: 0;
    padding: 0;

    position: relative;
    inset: auto;

    border-bottom: 1px solid #ddd;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #fff;

    overflow: hidden;
}

.entry-content .njr-documents .document-language {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;

    display: inline-block;
    max-width: calc(100% - 20px);
    padding: 4px 7px;

    border-radius: 2px;
    background: #2f80c9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
}

/* Caption/content area */
.entry-content .njr-documents > .document > .thumbnail > .caption {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;

    width: 100%;
    max-width: none;
    min-width: 0;

    height: auto;
    min-height: 0;

    margin: 0;
    padding: 12px;

    position: static;
    inset: auto;

    overflow: visible;
    transform: none;
}

/* Reset text elements */
.entry-content .njr-documents .document-title,
.entry-content .njr-documents .document-meta,
.entry-content .njr-documents .help-block,
.entry-content .njr-documents .description,
.entry-content .njr-documents .document-actions {
    position: static;
    inset: auto;

    float: none !important;
    clear: none !important;

    width: auto;
    max-width: none;

    height: auto;
    min-height: 0;
    max-height: none;

    padding: 0;

    transform: none;
    overflow: visible;
    white-space: normal;
}

/* Title */
.entry-content .njr-documents .document-title {
    margin: 0 0 4px 0;

    font-size: 20px;
    line-height: 1.25;
    font-weight: 600;
}

/* Metadata */
.entry-content .njr-documents .document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;

    margin: 0 0 10px 0;

    color: #555;
    font-size: 13px;
    line-height: 1.35;
}

/* Date */
.entry-content .njr-documents .help-block {
    margin: 0 0 10px 0;

    font-size: 13px;
    line-height: 1.35;
}

/* Description fills remaining card height */
.entry-content .njr-documents .description {
    flex: 1 1 auto;

    margin: 0 0 16px 0;

    font-size: 16px;
    line-height: 1.45;
}

/* Button row at bottom */
.entry-content .njr-documents .document-actions {
    margin-top: auto;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 991px) {
    .entry-content .njr-documents {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    .entry-content .njr-documents-search {
        display: block;
    }

    .entry-content .njr-documents-search .form-control,
    .entry-content .njr-documents-search-count {
        display: block;
        width: 100%;
        max-width: none;
    }

    .entry-content .njr-documents-search-count {
        margin-top: 8px;
    }

    .entry-content .njr-documents {
        grid-template-columns: 1fr !important;
    }
}
