.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.project-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(52, 73, 94, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 450px; /* Fixed height for all cards */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(52, 73, 94, 0.15);
}

.project-preview {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.project-preview h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 10px 0;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.5em; /* Adjust based on your line-height */
}

.project-brief {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    flex-grow: 1;
    overflow: hidden;
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.project-tools {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: auto;
}

.view-details-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.view-details-btn:hover {
    background-color: var(--secondary-color);
}

.project-details.hidden {
    display: none;
}



/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    height: 90%;
    max-height: 80vh;
    border-radius: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-content img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

.modal-content h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin: 0 0 15px 0;
}

.modal-content .project-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-content .project-info {
    margin-bottom: 15px;
}

.modal-content .project-links {
    margin-top: 20px;
}

.modal-content .project-links a {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 5px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.modal-content .project-links a:hover {
    background-color: var(--secondary-color);
}

.close {
    color: #aaa;
    align-self: flex-end;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}