.og-gallery {
    --og-gap: 16px;
    --og-radius: 8px;
    --og-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --og-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.13);
    width: 100%;
}

.og-gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--og-gap);
}

.og-gallery .og-gallery-item {
    min-width: 0;
    margin: 0;
}

.og-gallery-link {
    display: block;
    overflow: hidden;
    border-radius: var(--og-radius);
    box-shadow: var(--og-shadow);
    background: #f3f3f3;
    transform: translateY(0);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.og-gallery-link:hover,
.og-gallery-link:focus-visible {
    transform: translateY(-3px);
    box-shadow: var(--og-shadow-hover);
}

.og-gallery-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.og-gallery-image {
    display: block;
    width: 100%;
    height: clamp(150px, 14vw, 230px);
    max-width: none;
    object-fit: cover;
    border-radius: var(--og-radius);
    transition: transform 350ms ease;
}

.og-gallery-link:hover .og-gallery-image {
    transform: scale(1.025);
}

.og-gallery-actions {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.og-load-more {
    appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    padding: 11px 22px;
    background: #fff;
    color: #111;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.og-load-more:hover,
.og-load-more:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.1);
}

.og-load-more:disabled {
    cursor: wait;
    opacity: 0.6;
}

/* Lightbox */
.og-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px 76px;
    background: rgba(9, 10, 12, 0.9);
    backdrop-filter: blur(7px);
}

.og-lightbox.is-open {
    display: flex;
}

.og-lightbox-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 1500px);
    max-height: calc(100vh - 56px);
}

.og-lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
}

.og-lightbox-caption {
    max-width: 900px;
    margin-top: 12px;
    color: #fff;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
}

.og-lightbox-caption:empty {
    display: none;
}

.og-lightbox-close[hidden],
.og-lightbox-prev[hidden],
.og-lightbox-next[hidden] {
    display: none !important;
}

.og-lightbox-close,
.og-lightbox-prev,
.og-lightbox-next {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 31px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.og-lightbox-close:hover,
.og-lightbox-prev:hover,
.og-lightbox-next:hover,
.og-lightbox-close:focus-visible,
.og-lightbox-prev:focus-visible,
.og-lightbox-next:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

.og-lightbox-close {
    position: fixed;
    top: 22px;
    right: 22px;
    font-size: 27px;
}

.og-lightbox-prev {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.og-lightbox-next {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.og-lightbox-prev:hover,
.og-lightbox-next:hover,
.og-lightbox-prev:focus-visible,
.og-lightbox-next:focus-visible {
    transform: translateY(-50%) scale(1.05);
}

body.og-lightbox-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .og-gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .og-gallery-image {
        height: 190px;
    }
}

@media (max-width: 820px) {
    .og-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .og-gallery-image {
        height: 180px;
    }
}

@media (max-width: 620px) {
    .og-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .og-gallery-image {
        height: 170px;
    }

    .og-lightbox {
        padding: 18px 14px;
    }

    .og-lightbox-image {
        max-height: calc(100vh - 110px);
    }

    .og-lightbox-close,
    .og-lightbox-prev,
    .og-lightbox-next {
        width: 42px;
        height: 42px;
    }

    .og-lightbox-close {
        top: 12px;
        right: 12px;
    }

    .og-lightbox-prev {
        left: 9px;
    }

    .og-lightbox-next {
        right: 9px;
    }
}

@media (max-width: 420px) {
    .og-gallery-grid {
        grid-template-columns: 1fr;
    }

    .og-gallery-image {
        height: 240px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .og-gallery-link,
    .og-gallery-image,
    .og-load-more,
    .og-lightbox-close,
    .og-lightbox-prev,
    .og-lightbox-next {
        transition: none;
    }
}
