.document-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    padding: 20px;
    grid-auto-rows: minmax(300px, auto); 
}

.document-item {
    position: relative;
    cursor: pointer; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%; 
    overflow: hidden; 
}

.document-item img {
    width: 100%;
    height: auto;
    object-fit: cover; 
}

.document-name {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: #BD2133;
    color: white;
    text-align: center;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; 
    max-height: 40px; 
}

/* ------------------------------------ Mobile Responsiveness Start ------------------------------ */
@media (min-width: 768px) and (max-width: 1240px){
    .document-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (min-width: 300px) and (max-width: 767px) {
    .document-grid {
        grid-template-columns: 1fr; 
    }
    .document-name {
        font-size: 12px; 
    }
}
