.vgp-gallery {
    --vgp-height: 560px;
    --vgp-mobile-height: 300px;
    --vgp-gap: 8px;
    --vgp-radius: 14px;
    position: relative;
    width: 100%;
}

.vgp-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--vgp-gap);
    height: var(--vgp-height);
    border-radius: var(--vgp-radius);
    overflow: hidden;
}

.vgp-tile {
    position: relative;
    padding: 0;
    border: 0;
    background: #ddd;
    cursor: pointer;
    overflow: hidden;
}

.vgp-tile-1 { grid-row: 1 / 3; }

.vgp-tile img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}

.vgp-tile:hover img,
.vgp-tile:focus-visible img { transform: scale(1.035); }
.vgp-no-hover-zoom .vgp-tile:hover img,
.vgp-no-hover-zoom .vgp-tile:focus-visible img { transform: none; }
.vgp-tile:focus-visible { outline: 3px solid currentColor; outline-offset: -3px; }

.vgp-more {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-weight: 700;
}

.vgp-more span { font-size: 32px; line-height: 1; }
.vgp-more small { margin-top: 6px; font-size: 13px; }

/* Shared fullscreen behavior */
.vgp-grid-modal[hidden],
.vgp-lightbox[hidden] { display: none !important; }

.vgp-grid-modal,
.vgp-lightbox {
    position: fixed !important;
    inset: 0 !important;
    isolation: isolate;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Intermediate image overview */
.vgp-grid-modal {
    z-index: 2147483646 !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    color: #17191c;
}

.vgp-grid-modal-inner {
    position: relative;
    width: min(100% - 48px, 920px);
    margin: 0 auto;
    padding: 64px 0 56px;
}

.vgp-grid-toolbar {
    position: fixed;
    z-index: 4;
    top: 18px;
    right: 22px;
}

.vgp-grid-close,
.vgp-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0 !important;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: none !important;
    font-family: Arial, sans-serif;
    font-size: 38px;
    font-weight: 300;
    line-height: 1;
}

.vgp-grid-close {
    background: rgba(255, 255, 255, .94) !important;
    color: #17191c !important;
    box-shadow: 0 2px 18px rgba(0, 0, 0, .10) !important;
}

.vgp-mosaic {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 8px;
}

.vgp-mosaic-item {
    grid-column: span 6;
    position: relative;
    min-width: 0;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 0;
    background: #ececec;
    cursor: zoom-in;
    overflow: hidden;
}

.vgp-mosaic-item:nth-child(1) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
}

.vgp-mosaic-item:nth-child(6n + 4) { grid-column: span 8; aspect-ratio: 16 / 10; }
.vgp-mosaic-item:nth-child(6n + 5) { grid-column: span 4; aspect-ratio: 4 / 5; }
.vgp-mosaic-item:nth-child(6n + 6) { grid-column: span 4; aspect-ratio: 4 / 5; }
.vgp-mosaic-item:nth-child(6n + 7) { grid-column: span 8; aspect-ratio: 16 / 10; }

.vgp-mosaic-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .3s ease, opacity .3s ease;
}

.vgp-mosaic-item:hover img,
.vgp-mosaic-item:focus-visible img { transform: scale(1.025); opacity: .94; }
.vgp-mosaic-item:focus-visible { outline: 3px solid #111; outline-offset: 3px; z-index: 2; }

/* Full image lightbox */
.vgp-lightbox { z-index: 2147483647 !important; }
.vgp-backdrop { position: absolute; inset: 0; z-index: 0; background: rgba(8, 10, 14, .96); }

.vgp-lightbox-ui {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 70px;
    grid-template-rows: 64px minmax(0, 1fr) 100px;
    color: #fff;
}

.vgp-toolbar {
    grid-column: 1 / 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
}

.vgp-close {
    position: relative;
    z-index: 5;
    background: rgba(0, 0, 0, .28) !important;
    color: #fff !important;
    font-size: 42px;
}

.vgp-nav {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
}

.vgp-stage {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.vgp-lightbox-image { max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; }
.vgp-caption { min-height: 24px; margin-top: 10px; font-size: 14px; color: #ddd; }

.vgp-strip {
    grid-column: 1 / 4;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 20px;
}

.vgp-strip button {
    flex: 0 0 92px;
    height: 68px;
    padding: 0;
    border: 2px solid transparent;
    background: #222;
    opacity: .55;
    cursor: pointer;
}

.vgp-strip button.is-active { border-color: #fff; opacity: 1; }
.vgp-strip img { width: 100%; height: 100%; object-fit: cover; }
.vgp-no-scroll, .vgp-modal-open { overflow: hidden !important; overscroll-behavior: none !important; }

@media (max-width: 767px) {
    .vgp-grid {
        grid-template-columns: 2fr 1fr;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        height: var(--vgp-mobile-height);
        border-radius: min(var(--vgp-radius), 10px);
    }

    .vgp-tile-1 { grid-row: 1 / 3; }
    .vgp-tile-4, .vgp-tile-5 { display: none; }
    .vgp-grid-modal-inner { width: min(100% - 24px, 920px); padding-top: 72px; }
    .vgp-grid-toolbar { top: 10px; right: 12px; }
    .vgp-mosaic { gap: 6px; }
    .vgp-lightbox-ui { grid-template-columns: 48px minmax(0, 1fr) 48px; grid-template-rows: 56px minmax(0, 1fr) 88px; }
    .vgp-nav { font-size: 30px; }
    .vgp-lightbox-image { max-height: calc(100vh - 165px); }
    .vgp-strip button { flex-basis: 76px; height: 56px; }
}

@media (max-width: 540px) {
    .vgp-mosaic { display: block; }
    .vgp-mosaic-item { display: block; width: 100%; margin: 0 0 6px; aspect-ratio: 4 / 3 !important; }
    .vgp-mosaic-item:first-child { aspect-ratio: 4 / 3 !important; }
}

@media (max-width: 480px) {
    .vgp-grid { grid-template-columns: 1fr; grid-template-rows: 1fr; height: var(--vgp-mobile-height); }
    .vgp-tile-1 { grid-row: auto; }
    .vgp-tile:not(.vgp-tile-1) { display: none; }
    .vgp-tile-1::after {
        content: 'Se alle billeder';
        position: absolute;
        right: 12px;
        bottom: 12px;
        padding: 9px 12px;
        border-radius: 999px;
        background: rgba(0, 0, 0, .72);
        color: #fff;
        font-size: 13px;
        font-weight: 600;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vgp-tile img,
    .vgp-mosaic-item img { transition: none; }
}
