.photo-detail-gallery {
    .photo-header {
        position: relative;
        overflow: hidden;
        margin-bottom: 24px;

        .heading {
            margin-bottom: 8px;
        }

        .excerpt {
            width: 800px;
            max-width: 100%;
            margin: 0 auto;
        }
    }

    .photo-gallery-grid {
        position: relative;
        width: 100%;
        min-height: 220px;
        opacity: 0;
        transition: opacity .25s ease;

        &.is-ready {
            min-height: 0;
            opacity: 1;
        }

        &.is-fallback {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 2px;
            min-height: 0;
            opacity: 1;

            .photo-gallery-item {
                position: relative;
                width: auto !important;
                height: auto !important;
                aspect-ratio: 1 / 1;
                transform: none !important;
            }
        }
    }

    .photo-gallery-item {
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        overflow: hidden;
        border-radius: 0;
        background: #edf0f4;
        box-shadow: none;
        color: #fff;
        text-decoration: none;
        isolation: isolate;

        &::after {
            content: none;
        }


        img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scale(1.005);
            transition: transform .3s ease;
        }


        &:focus-visible {
            outline: 3px solid #8b5cf6;
            outline-offset: 3px;
        }
    }

    @media (max-width: 991px) {
        .photo-gallery-grid.is-fallback {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 600px) {
        .photo-header {
            margin-bottom: 18px;
        }

        .photo-gallery-grid.is-fallback {
            grid-template-columns: 1fr;
            gap: 2px;
        }

        .photo-gallery-item {
            border-radius: 0;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .photo-gallery-grid,
        .photo-gallery-item,
        .photo-gallery-item img {
            transition: none;
        }
    }
}
