.container {
    width: 90%; /* Increased to use more screen space */
    margin: 0 auto;
    /*text-align: center; */
}

/* Row and Columns */
.photo-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Adds spacing between columns */
    flex-wrap: wrap; /* Allows wrapping for small screens */
}

.photo-column {
    flex: 1 1 calc(33.33% - 20px); /* Flex basis for 3 columns with gap adjustments */
    max-width: 33.33%; /* Ensures a maximum width of one-third of the row */
    min-width: 200px; /* Minimum width to prevent images from shrinking too much */
    overflow: hidden; /* Prevents any overflow issues */
}

.photo-column img {
    width: 100%; /* Makes images fully responsive */
    height: auto; /* Maintains aspect ratio */
    aspect-ratio: 4 / 3; /* Keeps a consistent aspect ratio */
    object-fit: cover; /* Ensures images fill the area without distortion */
    cursor: pointer;
    transition: transform 0.3s ease;
}

.photo-column img:hover {
    transform: scale(1.05); /* Zoom effect */
}

/* Popup Styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Popup Content */
.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    border: 5px solid #333333;
    padding: 10px;
    border-radius: 10px;
    max-width: 90%; /* Makes popup responsive */
    max-height: 90%;
    overflow: hidden;
}

.popup-content img {
    max-width: 100%;
    max-height: 70vh;
    border-bottom: 2px solid #ddd;
}

/* Caption Area */
.caption-area {
    width: 100%;
    text-align: center;
    padding: 10px;
    background-color: #f1f1f1;
    color: #333;
    font-size: 16px;
}

/* Close Button */
#close-button {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #ff5555;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#close-button:hover {
    background-color: #ff3333;
}

/* --- Responsive Design --- */

/* Tablet View */
@media (max-width: 768px) {
    .photo-row {
        flex-direction: row; /* Keeps row layout but allows wrapping */
    }

    .photo-column {
        flex: 1 1 calc(50% - 20px); /* Switch to 2 columns */
        max-width: 50%;
    }

    .photo-column img {
        height: auto; /* Ensures responsive resizing */
    }
}

/* Mobile View */
@media (max-width: 480px) {
    .photo-row {
        flex-direction: column; /* Stack vertically */
    }

    .photo-column {
        flex: 1 1 100%; /* Full width for mobile */
        max-width: 100%;
    }

    .photo-column img {
        height: auto; /* Adjusts height dynamically */
    }

    .caption-area {
        font-size: 14px; /* Slightly smaller text */
    }

    #close-button {
        padding: 5px 8px; /* Smaller button size */
    }
}