.photo-gallery h1,
.photo-gallery h2 {
    color: #130c7c;
    text-transform: none;
}

.photo-gallery h1 {
    margin: 0 0 20px;
    font-size: 36px;
    line-height: 1.2;
}

.photo-collections {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 32px;
    font-size: 18px;
}

.photo-collections label {
    margin: 0;
}

.photo-collections select {
    width: auto;
    max-width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 3px;
    background: #fff;
    color: #130c7c;
    font: inherit;
    font-family: inherit !important;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #130c7c 50%), linear-gradient(135deg, #130c7c 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 13px) center;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.photo-collections select option {
    font: inherit;
    font-family: inherit !important;
}

.photo-collections button {
    margin: 0;
}

.photo-gallery .sow-entry-thumbnail {
    aspect-ratio: 1;
    overflow: hidden;
}

.photo-gallery .sow-entry-thumbnail a {
    height: 100%;
    position: relative;
}

.photo-gallery .sow-entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-gallery .sow-entry-thumbnail .photo-hover-image {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease-in-out;
}

.photo-gallery .sow-entry-thumbnail a.photo-hover-ready:focus-visible .photo-hover-image {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .photo-gallery .sow-entry-thumbnail a.photo-hover-ready:hover .photo-hover-image {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-gallery .sow-entry-thumbnail .photo-hover-image {
        transition: none;
    }
}

.photo-detail {
    max-width: 1024px;
    margin: 0 auto;
}

.photo-back,
.photo-membership {
    margin-bottom: 20px;
    font-size: 18px;
}

.photo-description {
    font-size: 18px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.photo-detail .wp-block-gallery.has-nested-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 32px 0;
    gap: 20px;
}

.photo-detail .photo-item-description {
    grid-column: 1 / -1;
    min-width: 0;
}

.photo-detail .photo-item-description > :last-child {
    margin-bottom: 0;
}

.photo-detail .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
    width: 100%;
    aspect-ratio: 1;
    min-width: 0;
}

.photo-detail .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-detail .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image):first-child {
    grid-column: 1 / -1;
    aspect-ratio: auto;
}

.photo-detail .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image):first-child img {
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    flex: initial;
}

.photo-gallery .nav-links,
.photo-gallery .sow-nav-links {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.photo-gallery .sow-post-navigation {
    margin-top: 24px;
}

.photo-gallery .page-numbers,
.photo-gallery .sow-blog.sow-blog-layout-grid .sow-post-navigation .sow-nav-links .page-numbers {
    min-width: 40px;
    padding: 10px;
    border: 1px solid #d5d5d5;
    border-radius: 3px;
    color: #130c7c;
    font-size: 18px;
    text-align: center;
}

.photo-gallery .page-numbers.current,
.photo-gallery .page-numbers:hover,
.photo-gallery .page-numbers:focus,
.photo-gallery .sow-blog.sow-blog-layout-grid .sow-post-navigation .sow-nav-links .page-numbers.current,
.photo-gallery .sow-blog.sow-blog-layout-grid .sow-post-navigation .sow-nav-links .page-numbers:hover,
.photo-gallery .sow-blog.sow-blog-layout-grid .sow-post-navigation .sow-nav-links .page-numbers:focus {
    background: #130c7c;
    border-color: #130c7c;
    color: #fff;
}

@media (max-width: 1024px) {
    .photo-detail .wp-block-gallery.has-nested-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-gallery .sow-blog.sow-blog-layout-grid .sow-blog-posts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .photo-gallery h1 {
        font-size: 28px;
    }

    .photo-gallery .sow-blog.sow-blog-layout-grid .sow-blog-posts {
        grid-template-columns: minmax(0, 1fr);
    }

    .photo-detail .wp-block-gallery.has-nested-images {
        grid-template-columns: minmax(0, 1fr);
    }
}
