/* General Styles */
body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

header h1 {
    margin: 0;
    font-size: 2rem;
}

/* Certificate Gallery Layout */
.certificate-gallery {
    display: grid;
    /* Responsive grid: Creates as many columns between 280px and 1fr as fit */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    /* Spacing between items */
    padding: 20px;
    max-width: 1200px;
    /* Max width of the gallery */
    margin: 0 auto;
    /* Center the gallery */
}

/* Individual Certificate Item Styling */
.certificate-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    /* Keeps image corners rounded */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Stack image and info vertically */
}

.certificate-item:hover {
    transform: translateY(-5px);
    /* Slight lift effect */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.certificate-image {
    width: 100%;
    height: auto;
    /* Maintain aspect ratio */
    display: block;
    /* Remove extra space below image */
    cursor: pointer;
    /* Indicate it's clickable */
    /* Optional: Fixed height if certificates have varied aspect ratios
       height: 200px;
       object-fit: cover;
       object-position: top; // Adjust as needed
    */
}

.certificate-info {
    padding: 15px;
    flex-grow: 1;
    /* Allows info section to fill space if items vary height */
}

.certificate-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #333;
}

.certificate-info p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}

.certificate-info a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9em;
}

.certificate-info a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.85);
    /* Black w/ opacity */
    padding-top: 50px;
    /* Location of the box */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    /* Limit height */
    width: auto;
    /* Adjust based on image aspect ratio */
    height: auto;
    /* Adjust based on image aspect ratio */
}

/* Modal Caption (Image Text) - Optional */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px;
    /* Reserve space */
}

/* Close Button */
.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
}

/* Add Animation - Optional */
.modal-content,
#caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #ddd;
    color: #333;
    font-size: 0.9em;
}

/* Responsive adjustments if needed */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }

    .certificate-gallery {
        padding: 10px;
        gap: 15px;
    }

    .modal-content {
        max-width: 95%;
    }
}