/* New Image Gallery Styles */
/* Image Gallery Table */
.image-gallery {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

/* Table Cells */
.image-gallery td {
    padding: 15px;
    border: 2px solid #ccc; /* Light gray border for separation */
    text-align: left; /* Keeps text left-aligned */
    vertical-align: top;
    background-color: #fff; /* White background for clarity */
}

/* Centering Images */
.image-gallery td img {
    display: block;
    margin: 0 auto 20px auto; /* Centers image and adds spacing below */
}

/* Thumbnails */
.image-gallery img {
    width: 220px; /* Thumbnail size */
    height: auto;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.image-gallery img:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

/* Metadata Styling */
.metadata {
    margin-top: 20px;
    font-size: 14px;
    color: #555;
    text-align: left; /* Ensures metadata stays left-aligned */
}

.metadata span {
    display: block; /* Each metadata item appears on a new line */
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    animation: fadeIn 0.3s ease-in-out;
}

.lightbox img {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 10px;
}

/* Lightbox Caption */
.caption {
    color: #fff;
    margin-top: 10px;
    font-size: 18px;
    font-style: italic;
    padding: 10px 20px;
    max-width: 80%;
}

/* Navigation Buttons */
.close, .prev, .next {
    position: absolute;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    top: 50%;
    transform: translateY(-50%);
    transition: 0.3s;
}

.close:hover, .prev:hover, .next:hover {
    color: #f0f0f0;
}

.close {
    top: 20px;
    right: 30px;
    font-size: 30px;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design for Mobile */
@media (max-width: 600px) {
    .image-gallery img {
        width: 100px; /* Smaller thumbnails on mobile */
    }
}

.thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;  /* Ensures no distortion */
    object-position: center center;  /* Crops from the center */
    border-radius: 5px;
}
