@import url("MyColors.css");

/* ==========================================================================
   GalleryPhotos.css
   Styles for Photo Album / Gallery & Lightbox Modal (compsOperaPhotos.html)
   ========================================================================== */

/* --- Gallery Header --- */
.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-header h2 {
    margin-bottom: 5px;
    font-weight: normal;
    letter-spacing: 1px;
}

.gallery-header p {
    color: var(--color-slate-charcoal, #666);
    font-size: 0.9em;
}

/* --- 3-Column Flexbox Masonry Layout for Photos --- */
.gallery-photo-grid {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.gallery-photo-col {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0px !important;
    min-width: 0 !important;
    gap: 15px !important;
}

.gallery-photo-col img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    object-fit: cover !important;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-photo-col img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
    .gallery-photo-grid {
        flex-wrap: wrap !important;
    }
    .gallery-photo-col {
        flex: 1 1 calc(50% - 15px) !important;
    }
}

@media (max-width: 520px) {
    .gallery-photo-grid {
        flex-direction: column !important;
    }
    .gallery-photo-col {
        flex: 1 1 100% !important;
    }
}

/* --- Lightbox Modal Styling --- */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    padding-top: 40px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.gallery-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    background-color: black;
}

.gallery-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: var(--color-warm-gray, #878383);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 3005; /* Ensures it's on top */
}

.gallery-close:hover {
    color: var(--color-light-neutral, #bbb);
}

#gallery-caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: var(--color-off-white, #ccc);
    padding: 15px 0;
    font-size: 1.5em;
}

/* --- Next & Previous Buttons --- */
.gallery-prev,
.gallery-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: var(--color-pure-white, #fff);
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(154, 52, 51, 0.5); /* Semi-transparent signature maroon */
    z-index: 3001; /* Layer above the image */
}

/* Position the "previous button" to the far left */
.gallery-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

/* Position the "next button" to the far right */
.gallery-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* On hover, darken the background */
.gallery-prev:hover,
.gallery-next:hover {
    background-color: rgba(154, 52, 51, 0.9);
}

/* --- Mobile Optimization --- */
@media only screen and (max-width: 1000px) {
    /* 1. Make the modal/lightbox background fill the entire screen */
    .gallery-modal {
        width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background-color: rgba(0, 0, 0, 1) !important; /* Solid black for better full-screen effect */
    }

    /* 2. Make the image expand to the edges without stretching */
    .gallery-modal-content {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        object-fit: contain !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide caption on mobile to maximize photo size if desired (optional) */
    #gallery-caption {
        position: absolute;
        bottom: 20px;
        width: 100%;
        background: rgba(0, 0, 0, 0.5);
    }
}

