/**
 * Gallery HD Image Quality Fix
 * Ensures images are displayed in highest quality
 */

/* Experience Gallery - Force HD images */
#experience-gallery img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
}

/* PhotoSwipe - Maximum quality settings */
.pswp__img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    -ms-interpolation-mode: bicubic;

    /* Ensure full quality for desktop */
    max-width: none !important;
    max-height: none !important;

    /* Smooth scaling */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Mobile optimization - prevent cropping */
@media (max-width: 768px) {
    .pswp__img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        width: auto !important;
    }
}


/* Prevent image compression artifacts */
.pswp__zoom-wrap img {
    image-rendering: auto;
    -webkit-font-smoothing: subpixel-antialiased;
    transform: translateZ(0);
}

/* Gallery grid images - Better quality */
.gallery-item img {
    /* Better quality during transform */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);

    /* Optimize rendering */
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
}

/* Hover state - maintain quality during scale */
.gallery-item:hover img {
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* PhotoSwipe zoom - Ultra HD */
.pswp--zoomed-in .pswp__img {
    image-rendering: auto !important;
    -ms-interpolation-mode: bicubic !important;
}

/* Lazy loading - prevent blur */
img[loading="lazy"] {
    image-rendering: auto;
}

/* Responsive images - maintain quality */
img[srcset] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
}

/* PhotoSwipe background - darker for better contrast */
.pswp__bg {
    background-color: rgba(0, 0, 0, 0.95) !important;
}

/* Prevent blurry images during animation */
.pswp__content {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* High quality scaling */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery-item img,
    .pswp__img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
