.cge-gallery {
    width: 100%;
}

.cge-gallery-grid {
    width: 100%;
}

.cge-layout-masonry {
    column-count: 3;
    column-gap: 16px;
}

.cge-layout-masonry .cge-gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
}

.cge-layout-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.cge-layout-grid .cge-gallery-item,
.cge-layout-grid .cge-gallery-frame,
.cge-layout-grid .cge-gallery-link,
.cge-layout-grid .cge-gallery-frame img {
    height: 100%;
}

.cge-layout-grid .cge-gallery-frame img {
    object-fit: cover;
}

.cge-layout-justified {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.cge-layout-justified .cge-gallery-item {
    flex: 1 1 240px;
}

.cge-layout-justified .cge-gallery-frame,
.cge-layout-justified .cge-gallery-link,
.cge-layout-justified .cge-gallery-frame img {
    height: 240px;
}

.cge-layout-justified .cge-gallery-frame img {
    object-fit: cover;
}

.cge-layout-metro {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 180px;
    gap: 16px;
}

.cge-layout-metro .cge-gallery-item:nth-child(6n+1) {
    grid-column: span 2;
    grid-row: span 2;
}

.cge-layout-metro .cge-gallery-item:nth-child(6n+4) {
    grid-column: span 2;
}

.cge-layout-metro .cge-gallery-item,
.cge-layout-metro .cge-gallery-frame,
.cge-layout-metro .cge-gallery-link,
.cge-layout-metro .cge-gallery-frame img {
    height: 100%;
}

.cge-layout-metro .cge-gallery-frame img {
    object-fit: cover;
}

.cge-gallery-item {
    position: relative;
}

.cge-gallery-frame {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.cge-gallery-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.cge-gallery-frame img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .25s ease, opacity .25s ease, filter .25s ease;
}

.cge-hover-zoom .cge-gallery-item:hover .cge-gallery-frame > .cge-gallery-link img {
    transform: scale(1.04);
}

.cge-hover-fade .cge-gallery-item:hover .cge-gallery-frame > .cge-gallery-link img {
    opacity: .82;
}

.cge-hover-grayscale .cge-gallery-item:hover .cge-gallery-frame > .cge-gallery-link img {
    filter: grayscale(1);
}

.cge-hover-blur .cge-gallery-item:hover .cge-gallery-frame > .cge-gallery-link img {
    filter: blur(2px);
}

.cge-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.cge-caption-always .cge-caption,
.cge-caption-hover .cge-gallery-item:hover .cge-caption {
    opacity: 1;
    transform: translateY(0);
}

.cge-watermark {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    max-width: 60%;
}

.cge-watermark-text {
    color: #fff;
    background-color: rgba(0,0,0,.45);
    padding: 7px 10px;
    border-radius: 6px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,.45);
    line-height: 1;
    white-space: nowrap;
}

.cge-watermark-image img {
    width: 100%;
    height: auto;
    display: block;
}

.cge-wm-top-left { top: 12px; left: 12px; }
.cge-wm-top-right { top: 12px; right: 12px; }
.cge-wm-bottom-left { bottom: 12px; left: 12px; }
.cge-wm-bottom-right { bottom: 12px; right: 12px; }
.cge-wm-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }

.cge-hidden-item {
    display: none !important;
}

.cge-load-more-wrap {
    text-align: center;
    margin-top: 24px;
}

.cge-load-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    padding: 12px 22px;
    border-radius: 8px;
    background: #111;
    color: #fff;
}

.cge-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.92);
    padding: 28px;
    touch-action: none;
}

.cge-lightbox.cge-lightbox-open {
    display: flex;
}

.cge-lightbox-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cge-lightbox-image {
    max-width: 100%;
    max-height: 88vh;
    display: block;
    user-select: none;
}

.cge-lightbox-caption {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    text-align: center;
    max-width: min(700px, 90vw);
}

.cge-lightbox-button {
    position: absolute;
    border: 0;
    color: #fff;
    background: rgba(255,255,255,.12);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    z-index: 2;
}

.cge-lightbox-button:hover {
    background: rgba(255,255,255,.22);
}

.cge-lightbox-close { top: 18px; right: 18px; }
.cge-lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.cge-lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }
.cge-lightbox-download { top: 18px; right: 74px; font-size: 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 1024px) {
    .cge-layout-metro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .cge-layout-metro { grid-auto-rows: 150px; }
    .cge-layout-metro .cge-gallery-item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
    .cge-lightbox { padding: 16px; }
    .cge-lightbox-prev { left: 8px; }
    .cge-lightbox-next { right: 8px; }
}
