/* --- ESTILOS PARA LA BIBLIOTECA (DOCUMENTOS) --- */
.document-grid {
    display: grid;
    /* Define 4 columns of equal width for desktop */
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 2rem 0;
}

.document-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Ensures image corners match item corners */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.document-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.document-item img {
    width: 100%;
    height: 200px; /* Fixed height for consistent previews */
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.document-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1; /* Allows info section to take up remaining space */
}

.document-info h3 {
    font-family: var(--font-main1);
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.document-meta {
    font-size: 0.85rem;
    color: var(--color-secondary-text);
    margin-bottom: 1rem;
}

.download-link {
    display: block;
    text-align: center;
    padding: 0.5rem 1rem;
    background-color: var(--color-accent);
    color: var(--color-text);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-top: auto; /* Pushes the link to the bottom */
}

.download-link:hover {
    background-color: #90BEE0; /* Slightly darker light blue */
}


/* --- Responsive Overrides for the Grid --- */
@media (max-width: 1200px) {
    .document-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on smaller desktops/large tablets */
    }
}

@media (max-width: 768px) {
    .document-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}

@media (max-width: 480px) {
    .document-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}
