/* Modern Gallery Styles - Replacement for Flash SimpleViewer */

.gallery-wrapper {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: 650px;
    max-width: 100%;
    background-color: #d8d8da;
}

.gallery-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gallery-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    padding: 10px;
}

.gallery-image-frame {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    background: #ffffff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-image {
    display: block;
    max-width: 550px;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #827d74;
    font-size: 14px;
    display: none;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 40px;
    height: 60px;
    font-size: 30px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.5);
}

.gallery-prev {
    left: 5px;
}

.gallery-next {
    right: 5px;
}

.gallery-caption {
    padding: 15px 20px;
    color: #827d74;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    min-height: 80px;
}

.gallery-caption a,
.gallery-caption a:link,
.gallery-caption a:visited {
    color: #a2a09c;
    text-decoration: none;
}

.gallery-caption a:hover {
    color: #58534b;
    text-decoration: underline;
}

.gallery-thumbs-container {
    width: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 10px 10px 0;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.gallery-thumb {
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    background: #ffffff;
    padding: 3px;
}

.gallery-thumb:hover {
    border-color: #827d74;
}

.gallery-thumb.active {
    border-color: #46423c;
}

.gallery-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Scrollbar styling for thumbnails */
.gallery-thumbs-container::-webkit-scrollbar {
    width: 8px;
}

.gallery-thumbs-container::-webkit-scrollbar-track {
    background: #e8e8e8;
}

.gallery-thumbs-container::-webkit-scrollbar-thumb {
    background: #a0a0a0;
    border-radius: 4px;
}

.gallery-thumbs-container::-webkit-scrollbar-thumb:hover {
    background: #808080;
}

/* Responsive adjustments */
@media (max-width: 800px) {
    .gallery-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .gallery-thumbs-container {
        width: 100%;
        max-height: 200px;
        padding: 10px;
    }
    
    .gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gallery-image {
        max-width: 100%;
        max-height: 400px;
    }
}
