.dmwpg-gallery {
    --dmwpg-gap: clamp(0.65rem, 1.6vw, 1.1rem);
    --dmwpg-heading-color: #1d1d1f;
    --dmwpg-focus: #8a6f3c;
    color: inherit;
}

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

.dmwpg-wedding-section + .dmwpg-wedding-section {
    margin-top: clamp(2rem, 5vw, 4rem);
}

.dmwpg-wedding-heading {
    margin: 0 0 1rem;
    color: var(--dmwpg-heading-color);
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    font-weight: 500;
    line-height: 1.15;
}

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

.dmwpg-item {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: #f4f1ed;
    cursor: zoom-in;
}

.dmwpg-item:focus-visible {
    outline: 3px solid var(--dmwpg-focus);
    outline-offset: 3px;
}

.dmwpg-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease, filter 180ms ease;
}

.dmwpg-item:hover .dmwpg-thumb,
.dmwpg-item:focus-visible .dmwpg-thumb {
    filter: brightness(0.94);
    transform: scale(1.025);
}

.dmwpg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    background: rgba(8, 8, 10, 0.94);
}

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

.dmwpg-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: min(92vw, 1400px);
    max-height: 88vh;
    margin: 0;
}

.dmwpg-lightbox__image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 82vh;
    object-fit: contain;
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

.dmwpg-lightbox__caption {
    margin-top: 0.75rem;
    color: #f4f4f4;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
}

.dmwpg-lightbox__button {
    position: absolute;
    min-width: 48px;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 2.1rem;
    line-height: 1;
    touch-action: manipulation;
}

.dmwpg-lightbox__button:hover,
.dmwpg-lightbox__button:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    outline: none;
}

.dmwpg-lightbox__close {
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
}

.dmwpg-lightbox__prev,
.dmwpg-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
}

.dmwpg-lightbox__prev {
    left: max(0.75rem, env(safe-area-inset-left));
}

.dmwpg-lightbox__next {
    right: max(0.75rem, env(safe-area-inset-right));
}

.dmwpg-error {
    padding: 0.85rem 1rem;
    border-left: 4px solid #b3261e;
    background: #fff3f1;
    color: #5f1711;
}

@media (min-width: 720px) {
    .dmwpg-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

@media (max-width: 359px) {
    .dmwpg-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dmwpg-lightbox {
        padding: 0.75rem;
    }

    .dmwpg-lightbox__prev,
    .dmwpg-lightbox__next {
        bottom: max(1rem, env(safe-area-inset-bottom));
        top: auto;
        transform: none;
    }
}
/* Hide visible image caption text per gallery display preference. */
.dmwpg-lightbox__caption {
    display: none;
}
