.gpr-gallery,
.gpr-gallery * {
    box-sizing: border-box;
}

.gpr-gallery {
    --gpr-accent: #1a73e8;
    --gpr-gap: 4px;
    --gpr-columns: 4;
    --gpr-row-height: 220px;
    position: relative;
    width: 100%;
    max-width: none;
    color: inherit;
    font-family: inherit;
}

.gpr-gallery .gpr-toolbar {
    position: sticky;
    z-index: 20;
    top: 10px;
    display: flex;
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .12);
    backdrop-filter: blur(10px);
}

.gpr-gallery .gpr-button,
.gpr-gallery .gpr-item-download {
    min-width: 0;
    min-height: 0;
    margin: 0;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #1f2937;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
}

.gpr-gallery .gpr-button {
    padding: 9px 12px;
}

.gpr-gallery .gpr-button:hover,
.gpr-gallery .gpr-button:focus-visible {
    background: #eef4ff;
    color: var(--gpr-accent);
    outline: none;
}

.gpr-gallery .gpr-button:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.gpr-gallery .gpr-download-selected {
    background: var(--gpr-accent);
    color: #fff;
}

.gpr-gallery .gpr-download-selected:hover,
.gpr-gallery .gpr-download-selected:focus-visible {
    background: #155fc0;
    color: #fff;
}

.gpr-gallery .gpr-selected-count {
    display: inline-grid;
    min-width: 20px;
    min-height: 20px;
    margin-left: 3px;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
}

.gpr-gallery .gpr-status {
    max-width: 300px;
    padding: 0 7px;
    color: #475569;
    font-size: 12px;
}

.gpr-gallery .gpr-items {
    width: 100%;
    gap: var(--gpr-gap);
}

.gpr-gallery.gpr-layout-grid .gpr-items {
    display: grid;
    grid-template-columns: repeat(var(--gpr-columns), minmax(0, 1fr));
}

.gpr-gallery.gpr-layout-masonry .gpr-items {
    display: block;
    column-count: var(--gpr-columns);
    column-gap: var(--gpr-gap);
}

.gpr-gallery.gpr-layout-masonry .gpr-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 var(--gpr-gap);
}

.gpr-gallery.gpr-layout-justified .gpr-items {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.gpr-gallery.gpr-layout-justified .gpr-items::after {
    content: '';
    flex-grow: 999999;
    min-width: calc(var(--gpr-row-height) * 1.5);
}

.gpr-gallery.gpr-layout-justified .gpr-item {
    flex-basis: calc(var(--gpr-aspect) * var(--gpr-row-height));
    flex-grow: var(--gpr-aspect);
    aspect-ratio: var(--gpr-aspect);
}

.gpr-gallery .gpr-item {
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 0;
    border-radius: 3px;
    background: #e8eaed;
    box-shadow: none;
}

.gpr-gallery.gpr-layout-grid .gpr-item {
    aspect-ratio: 1 / 1;
}

.gpr-gallery .gpr-photo-button {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: inherit;
    background: transparent;
    box-shadow: none;
    cursor: zoom-in;
}

.gpr-gallery .gpr-photo-button img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: cover;
    transition: transform .22s ease, filter .22s ease;
}

.gpr-gallery.gpr-layout-masonry .gpr-photo-button img {
    height: auto;
    object-fit: contain;
}

.gpr-gallery .gpr-photo-button:hover img,
.gpr-gallery .gpr-photo-button:focus-visible img {
    filter: brightness(.92);
    transform: scale(1.015);
}

.gpr-gallery .gpr-photo-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -4px;
}

.gpr-gallery .gpr-select-label {
    position: absolute;
    z-index: 3;
    top: 9px;
    left: 9px;
    width: 30px;
    height: 30px;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    transform: scale(.86);
    transition: opacity .16s ease, transform .16s ease;
}

.gpr-gallery .gpr-item:hover .gpr-select-label,
.gpr-gallery .gpr-item:focus-within .gpr-select-label,
.gpr-gallery .gpr-item.is-selected .gpr-select-label {
    opacity: 1;
    transform: scale(1);
}

.gpr-gallery .gpr-select-label input {
    position: absolute;
    opacity: 0;
}

.gpr-gallery .gpr-select-label span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: rgba(15, 23, 42, .46);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}

.gpr-gallery .gpr-select-label input:checked + span {
    background: var(--gpr-accent);
}

.gpr-gallery .gpr-select-label input:checked + span::after {
    content: '\2713';
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.gpr-gallery .gpr-select-label input:focus-visible + span {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.gpr-gallery .gpr-item.is-selected::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    border: 4px solid var(--gpr-accent);
    border-radius: inherit;
    content: '';
    pointer-events: none;
}

.gpr-gallery .gpr-item-download {
    position: absolute;
    z-index: 3;
    right: 9px;
    bottom: 9px;
    padding: 8px 11px;
    background: rgba(15, 23, 42, .76);
    color: #fff;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity .16s ease, transform .16s ease, background .16s ease;
}

.gpr-gallery .gpr-item:hover .gpr-item-download,
.gpr-gallery .gpr-item:focus-within .gpr-item-download {
    opacity: 1;
    transform: translateY(0);
}

.gpr-gallery .gpr-item-download:hover,
.gpr-gallery .gpr-item-download:focus-visible {
    background: var(--gpr-accent);
    color: #fff;
    outline: 2px solid #fff;
}

.gpr-gallery .gpr-caption {
    position: absolute;
    z-index: 2;
    right: 96px;
    bottom: 10px;
    left: 10px;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px #000;
    white-space: nowrap;
}

.gpr-gallery .gpr-lightbox[hidden] {
    display: none;
}

.gpr-gallery .gpr-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    align-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, .96);
}

.gpr-gallery .gpr-lightbox figure {
    display: grid;
    min-width: 0;
    max-height: calc(100vh - 48px);
    justify-items: center;
    margin: 0;
}

.gpr-gallery .gpr-lightbox img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 160px);
    object-fit: contain;
}

.gpr-gallery .gpr-lightbox figcaption {
    padding-top: 9px;
    color: #fff;
    font-size: 14px;
}

.gpr-gallery .gpr-lightbox button {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    font-size: 48px;
}

.gpr-gallery .gpr-lightbox-close {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 18px;
}

.gpr-gallery .gpr-lightbox .gpr-lightbox-download {
    z-index: 3;
    display: inline-flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .3);
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
}

.gpr-gallery .gpr-lightbox .gpr-lightbox-download:hover,
.gpr-gallery .gpr-lightbox .gpr-lightbox-download:focus-visible {
    border-color: #fff;
    background: var(--gpr-accent);
    color: #fff;
    outline: 3px solid rgba(255, 255, 255, .65);
    outline-offset: 2px;
}

.gpr-gallery .gpr-lightbox .gpr-lightbox-download span {
    font-size: 19px;
    line-height: 1;
}

.gpr-lightbox-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .gpr-gallery { --gpr-row-height: 180px; }
    .gpr-gallery.gpr-layout-grid .gpr-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gpr-gallery.gpr-layout-masonry .gpr-items { column-count: 3; }
}

@media (max-width: 640px) {
    .gpr-gallery { --gpr-row-height: 130px; }
    .gpr-gallery .gpr-toolbar { position: relative; top: auto; width: 100%; border-radius: 12px; }
    .gpr-gallery .gpr-button { flex: 1 1 auto; padding: 9px 10px; }
    .gpr-gallery .gpr-status { width: 100%; max-width: none; }
    .gpr-gallery.gpr-layout-grid .gpr-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gpr-gallery.gpr-layout-masonry .gpr-items { column-count: 2; }
    .gpr-gallery .gpr-lightbox { grid-template-columns: 42px minmax(0, 1fr) 42px; padding: 12px; }
    .gpr-gallery .gpr-lightbox button { font-size: 38px; }
    .gpr-gallery .gpr-lightbox .gpr-lightbox-download { padding: 10px 14px; font-size: 14px; }
}

@media (hover: none) {
    .gpr-gallery .gpr-select-label { opacity: 1; transform: none; }
    .gpr-gallery .gpr-item-download { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gpr-gallery .gpr-photo-button img,
    .gpr-gallery .gpr-select-label,
    .gpr-gallery .gpr-item-download { transition: none; }
}
