.sapoco-gallery { --sapoco-gallery-brand: #d71920; width: 100%; margin: 24px 0; font: inherit; }
.sapoco-gallery .sapoco-gallery__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px); list-style: none; padding: 0; margin: 0; }
.sapoco-gallery .sapoco-gallery__item { min-width: 0; padding: 0; margin: 0; list-style: none; }
.sapoco-gallery .sapoco-gallery__link { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: #edf0f2; box-shadow: 0 5px 22px #1323330b; line-height: 0; }
.sapoco-gallery .sapoco-gallery__image { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .25s ease; }
.sapoco-gallery .sapoco-gallery__zoom { display: flex; align-items: center; justify-content: center; position: absolute; inset-inline-end: 13px; bottom: 13px; width: 35px; height: 35px; border-radius: 50%; background: var(--sapoco-gallery-brand); color: #fff; font: 24px/1 Arial, sans-serif; box-shadow: 0 2px 10px #0002; pointer-events: none; }
.sapoco-gallery .sapoco-gallery__link:hover .sapoco-gallery__image { transform: scale(1.035); }
.sapoco-gallery .sapoco-gallery__link:focus-visible { outline: 3px solid var(--sapoco-gallery-brand); outline-offset: 5px; }
html.sapoco-gallery-lightbox-open { overflow: hidden; }
dialog.sapoco-gallery__lightbox { width: min(1100px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 54px 14px 15px; border: 0; border-radius: 14px; background: #121a21; color: #fff; box-shadow: 0 20px 90px #0005; font: inherit; overflow: auto; }
dialog.sapoco-gallery__lightbox::backdrop { background: #0c131bd9; }
.sapoco-gallery__lightbox .sapoco-gallery__stage { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 10px; }
.sapoco-gallery__lightbox .sapoco-gallery__full-image { display: block; grid-column: 2; grid-row: 1; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); margin: 0 auto; object-fit: contain; }
.sapoco-gallery__lightbox button { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #ffffff55; border-radius: 50%; background: #ffffff0d; color: #fff; cursor: pointer; font: 30px/1 Arial, sans-serif; box-shadow: none; }
.sapoco-gallery__lightbox button:hover { border-color: #d71920; background: #d71920; color: #fff; }
.sapoco-gallery__lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sapoco-gallery__lightbox button[hidden] { display: none; }
.sapoco-gallery__lightbox .sapoco-gallery__close { position: absolute; top: 9px; right: 12px; width: 34px; height: 34px; font-size: 25px; }
.sapoco-gallery__lightbox .sapoco-gallery__previous { grid-column: 1; grid-row: 1; }
.sapoco-gallery__lightbox .sapoco-gallery__next { grid-column: 3; grid-row: 1; }
.sapoco-gallery__lightbox .sapoco-gallery__counter { margin: 13px 0 0; text-align: center; color: #e3e9ed; font: inherit; font-size: 13px; line-height: 1.7; }
@media (max-width: 900px) { .sapoco-gallery .sapoco-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
    .sapoco-gallery .sapoco-gallery__grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    dialog.sapoco-gallery__lightbox { width: calc(100vw - 16px); padding-inline: 7px; }
    .sapoco-gallery__lightbox .sapoco-gallery__stage { grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 4px; }
    .sapoco-gallery__lightbox .sapoco-gallery__stage button { width: 30px; height: 36px; font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) { .sapoco-gallery .sapoco-gallery__image { transition: none; } .sapoco-gallery .sapoco-gallery__link:hover .sapoco-gallery__image { transform: none; } }
