.vzg-gallery {
    --vzg-cols-d: 4;
    --vzg-cols-t: 3;
    --vzg-cols-m: 2;
    --vzg-gap: 12px;
    width: 100%;
}

.vzg-gallery * {
    box-sizing: border-box;
}

.vzg-gallery.vzg-layout-responsive,
.vzg-gallery.vzg-layout-tiles,
.vzg-gallery.vzg-layout-featured {
    display: grid;
    grid-template-columns: repeat(var(--vzg-cols-d), minmax(0, 1fr));
    gap: var(--vzg-gap);
}

.vzg-item {
    margin: 0;
    min-width: 0;
}

.vzg-open,
.vzg-image-wrap {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.vzg-open {
    cursor: zoom-in;
    color: inherit;
}

.vzg-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.vzg-open:hover .vzg-image,
.vzg-open:focus-visible .vzg-image {
    transform: scale(1.025);
}

.vzg-open:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.vzg-ratio-1-1 .vzg-open,
.vzg-ratio-1-1 .vzg-image-wrap { aspect-ratio: 1 / 1; }
.vzg-ratio-4-3 .vzg-open,
.vzg-ratio-4-3 .vzg-image-wrap { aspect-ratio: 4 / 3; }
.vzg-ratio-3-2 .vzg-open,
.vzg-ratio-3-2 .vzg-image-wrap { aspect-ratio: 3 / 2; }
.vzg-ratio-16-9 .vzg-open,
.vzg-ratio-16-9 .vzg-image-wrap { aspect-ratio: 16 / 9; }

.vzg-ratio-original .vzg-open,
.vzg-ratio-original .vzg-image-wrap {
    height: auto;
}
.vzg-ratio-original .vzg-image {
    height: auto;
    object-fit: contain;
}

.vzg-caption {
    margin-top: 8px;
    font-size: .9em;
    line-height: 1.4;
}

.vzg-layout-masonry {
    columns: var(--vzg-cols-d);
    column-gap: var(--vzg-gap);
}

.vzg-layout-masonry .vzg-item {
    break-inside: avoid;
    margin: 0 0 var(--vzg-gap);
}

.vzg-layout-masonry .vzg-open,
.vzg-layout-masonry .vzg-image-wrap,
.vzg-layout-masonry .vzg-image {
    height: auto;
    aspect-ratio: auto;
}

.vzg-layout-featured .vzg-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.vzg-layout-featured .vzg-item:first-child .vzg-open,
.vzg-layout-featured .vzg-item:first-child .vzg-image-wrap {
    height: 100%;
}

.vzg-empty {
    padding: 24px;
    border: 1px dashed rgba(0, 0, 0, .25);
    text-align: center;
}

html.vzg-lightbox-open,
html.vzg-lightbox-open body {
    overflow: hidden;
}

.vzg-lightbox[hidden] {
    display: none !important;
}

.vzg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(10, 10, 10, .94);
}

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

.vzg-lightbox-stage {
    margin: 0;
    max-width: min(92vw, 1600px);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.vzg-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.vzg-lightbox-caption {
    margin-top: 14px;
    color: #fff;
    text-align: center;
    line-height: 1.45;
}

.vzg-lightbox button {
    position: absolute;
    z-index: 2;
    border: 0;
    background: rgba(0, 0, 0, .22);
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font: inherit;
    font-size: 38px;
    line-height: 1;
}

.vzg-lightbox button:hover,
.vzg-lightbox button:focus-visible {
    background: rgba(255, 255, 255, .15);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.vzg-lightbox-close {
    top: 0;
    right: 0;
}

.vzg-lightbox-prev,
.vzg-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.vzg-lightbox-prev { left: 0; }
.vzg-lightbox-next { right: 0; }

.vzg-lightbox-counter {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    letter-spacing: .03em;
}

@media (max-width: 1024px) {
    .vzg-gallery.vzg-layout-responsive,
    .vzg-gallery.vzg-layout-tiles,
    .vzg-gallery.vzg-layout-featured {
        grid-template-columns: repeat(var(--vzg-cols-t), minmax(0, 1fr));
    }
    .vzg-layout-masonry { columns: var(--vzg-cols-t); }
}

@media (max-width: 767px) {
    .vzg-gallery.vzg-layout-responsive,
    .vzg-gallery.vzg-layout-tiles,
    .vzg-gallery.vzg-layout-featured {
        grid-template-columns: repeat(var(--vzg-cols-m), minmax(0, 1fr));
    }
    .vzg-layout-masonry { columns: var(--vzg-cols-m); }
    .vzg-layout-featured .vzg-item:first-child {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .vzg-lightbox {
        padding: 12px;
    }
    .vzg-lightbox-stage {
        max-width: 100%;
        max-height: 88vh;
    }
    .vzg-lightbox-image {
        max-height: 78vh;
    }
    .vzg-lightbox button {
        width: 44px;
        height: 44px;
        font-size: 32px;
    }
    .vzg-lightbox-prev { left: 2px; }
    .vzg-lightbox-next { right: 2px; }
}

/* Galerieübersicht */
.vzg-overview {
    --vzg-overview-cols-d: 4;
    --vzg-overview-cols-t: 3;
    --vzg-overview-cols-m: 2;
    --vzg-overview-gap: 16px;
    --vzg-horizontal-image: 42%;
    display: grid;
    grid-template-columns: repeat(var(--vzg-overview-cols-d), minmax(0, 1fr));
    gap: var(--vzg-overview-gap);
    width: 100%;
}

.vzg-overview * {
    box-sizing: border-box;
}

.vzg-overview-item {
    min-width: 0;
    margin: 0;
}

.vzg-overview-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition-property: transform, box-shadow, background-color, border-color;
    transition-duration: .25s;
    transition-timing-function: ease;
}

.vzg-overview-media {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    overflow: hidden;
    background: #f1f1f1;
}

.vzg-overview-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
    transition: background-color .25s ease, opacity .25s ease;
}

.vzg-overview-ratio-1-1 { --vzg-overview-ratio: 1 / 1; }
.vzg-overview-ratio-4-3 { --vzg-overview-ratio: 4 / 3; }
.vzg-overview-ratio-3-2 { --vzg-overview-ratio: 3 / 2; }
.vzg-overview-ratio-16-9 { --vzg-overview-ratio: 16 / 9; }
.vzg-overview-ratio-21-9 { --vzg-overview-ratio: 21 / 9; }
.vzg-overview-media { aspect-ratio: var(--vzg-overview-ratio, 4 / 3); }

.vzg-overview-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition-property: transform, filter, opacity;
    transition-duration: .25s;
    transition-timing-function: ease;
}

.vzg-overview-card:hover .vzg-overview-image,
.vzg-overview-card:focus-visible .vzg-overview-image {
    transform: scale(1.03);
}

.vzg-overview-card:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

.vzg-overview-info {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    padding: 12px 0 0;
}

.vzg-overview-copy {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.vzg-overview-title,
.vzg-overview-description,
.vzg-overview-count {
    display: block;
}

.vzg-overview-title {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    transition: color .2s ease;
}

.vzg-overview-description {
    margin: 6px 0 0;
    font-size: .92rem;
    font-weight: 400;
    line-height: 1.5;
    opacity: .82;
}

.vzg-overview-count {
    width: 100%;
    max-width: 100%;
    margin: 4px 0 0;
    font-size: .84rem;
    line-height: 1.35;
    opacity: .65;
}

/* Ansicht: Karten */
.vzg-overview-layout-cards .vzg-overview-card {
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.vzg-overview-layout-cards .vzg-overview-info {
    padding: 16px;
}

/* Ansicht: Text auf Bild */
.vzg-overview-layout-overlay .vzg-overview-card {
    min-height: 100%;
}

.vzg-overview-layout-overlay .vzg-overview-media {
    flex: 1 1 auto;
    min-height: 100%;
}

.vzg-overview-layout-overlay .vzg-overview-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: flex-end;
    padding: 52px 18px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    color: #fff;
}

.vzg-overview-layout-overlay .vzg-overview-title,
.vzg-overview-layout-overlay .vzg-overview-description,
.vzg-overview-layout-overlay .vzg-overview-count {
    color: inherit;
}

.vzg-overview-layout-overlay .vzg-overview-description {
    opacity: .88;
}

/* Ansicht: Magazin */
.vzg-overview-layout-magazine .vzg-overview-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-card,
.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-media {
    height: 100%;
}

.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-media {
    min-height: 100%;
}

.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: flex-end;
    padding: 70px 22px 22px;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    color: #fff;
}

.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-title,
.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-description,
.vzg-overview-layout-magazine .vzg-overview-item:first-child .vzg-overview-count {
    color: inherit;
}

/* Ansicht: Horizontal */
.vzg-overview-layout-horizontal {
    grid-template-columns: 1fr;
}

.vzg-overview-layout-horizontal .vzg-overview-card {
    display: grid;
    grid-template-columns: minmax(180px, var(--vzg-horizontal-image)) 1fr;
    align-items: stretch;
}

.vzg-overview-layout-horizontal .vzg-overview-media {
    height: 100%;
    min-height: 180px;
    aspect-ratio: auto;
}

.vzg-overview-layout-horizontal .vzg-overview-info {
    align-content: center;
    align-items: flex-start;
    padding: 24px;
}

.vzg-overview-layout-horizontal .vzg-overview-copy {
    align-self: center;
}

html.vzg-browser-open,
html.vzg-browser-open body {
    overflow: hidden;
}

.vzg-browser[hidden] {
    display: none !important;
}

.vzg-browser {
    position: fixed;
    inset: 0;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(10, 10, 10, .82);
}

.vzg-browser-shell {
    display: flex;
    flex-direction: column;
    width: min(1500px, 96vw);
    height: min(92vh, 1000px);
    background: #fff;
    color: #181818;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.vzg-browser-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 16px 20px 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.vzg-browser-title {
    margin: 0;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.vzg-browser-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #181818;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 30px;
    line-height: 1;
}

.vzg-browser-close:hover,
.vzg-browser-close:focus-visible {
    background: #333;
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.vzg-browser-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 24px;
    outline: none;
}

.vzg-browser-loading,
.vzg-browser-error {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    text-align: center;
}

@media (max-width: 1024px) {
    .vzg-overview:not(.vzg-overview-layout-horizontal) {
        grid-template-columns: repeat(var(--vzg-overview-cols-t), minmax(0, 1fr));
    }

    .vzg-overview-layout-magazine .vzg-overview-item:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .vzg-overview:not(.vzg-overview-layout-horizontal) {
        grid-template-columns: repeat(var(--vzg-overview-cols-m), minmax(0, 1fr));
    }

    .vzg-overview-info {
        display: block;
        padding-top: 8px;
    }

    .vzg-overview-count {
        display: block;
        margin-top: 4px;
    }

    .vzg-overview-layout-magazine .vzg-overview-item:first-child {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .vzg-overview-layout-horizontal .vzg-overview-card {
        grid-template-columns: 1fr;
    }

    .vzg-overview-layout-horizontal .vzg-overview-media {
        min-height: 0;
        height: auto;
        aspect-ratio: var(--vzg-overview-ratio, 4 / 3);
    }

    .vzg-overview-layout-horizontal .vzg-overview-info {
        padding: 14px;
    }

    .vzg-browser {
        padding: 0;
        align-items: stretch;
    }

    .vzg-browser-shell {
        width: 100%;
        height: 100%;
    }

    .vzg-browser-header {
        min-height: 64px;
        padding: 10px 10px 10px 16px;
    }

    .vzg-browser-title {
        font-size: 1.1rem;
    }

    .vzg-browser-content {
        padding: 12px;
    }
}

/* 1.2.2: robuste Frontend Steuerung, unabhängig von Theme und Elementor Button Styles */
body .vzg-browser .vzg-gallery button.vzg-open {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    text-decoration: none !important;
    text-transform: none !important;
    line-height: 0 !important;
}

body .vzg-browser .vzg-gallery button.vzg-open:hover,
body .vzg-browser .vzg-gallery button.vzg-open:active {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body .vzg-browser .vzg-gallery button.vzg-open:focus {
    outline: none !important;
}

body .vzg-browser .vzg-gallery button.vzg-open:focus-visible {
    outline: 2px solid #181818 !important;
    outline-offset: 2px !important;
}

.vzg-lightbox-stage {
    position: relative;
    width: fit-content;
    max-width: min(92vw, 1600px);
    max-height: 90vh;
    margin: 0;
}

.vzg-lightbox-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
}

.vzg-lightbox-image {
    flex: 0 1 auto;
}

.vzg-lightbox-counter {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    margin-top: 12px;
    text-align: center;
}

body .vzg-lightbox button.vzg-lightbox-close,
body .vzg-lightbox button.vzg-lightbox-prev,
body .vzg-lightbox button.vzg-lightbox-next,
body .vzg-browser button.vzg-browser-close {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    font-size: 0 !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

body .vzg-lightbox button.vzg-lightbox-close,
body .vzg-lightbox button.vzg-lightbox-prev,
body .vzg-lightbox button.vzg-lightbox-next {
    position: absolute !important;
    z-index: 5 !important;
    display: block !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    background: rgba(10, 10, 10, .72) !important;
    color: #fff !important;
    outline: 0 !important;
    transition: background-color .2s ease !important;
}

body .vzg-lightbox button.vzg-lightbox-close:hover,
body .vzg-lightbox button.vzg-lightbox-prev:hover,
body .vzg-lightbox button.vzg-lightbox-next:hover,
body .vzg-lightbox button.vzg-lightbox-close:focus-visible,
body .vzg-lightbox button.vzg-lightbox-prev:focus-visible,
body .vzg-lightbox button.vzg-lightbox-next:focus-visible {
    border: 0 !important;
    background: rgba(10, 10, 10, .92) !important;
    box-shadow: none !important;
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
}

body .vzg-lightbox button.vzg-lightbox-close {
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    transform: none !important;
}

body .vzg-lightbox button.vzg-lightbox-prev,
body .vzg-lightbox button.vzg-lightbox-next {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

body .vzg-lightbox button.vzg-lightbox-prev {
    left: 12px !important;
    right: auto !important;
}

body .vzg-lightbox button.vzg-lightbox-next {
    right: 12px !important;
    left: auto !important;
}

body .vzg-lightbox button.vzg-lightbox-close::before,
body .vzg-lightbox button.vzg-lightbox-close::after,
body .vzg-browser button.vzg-browser-close::before,
body .vzg-browser button.vzg-browser-close::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 18px !important;
    height: 2px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: currentColor !important;
    transform-origin: center !important;
}

body .vzg-lightbox button.vzg-lightbox-close::before,
body .vzg-browser button.vzg-browser-close::before {
    transform: translate(-50%, -50%) rotate(45deg) !important;
}

body .vzg-lightbox button.vzg-lightbox-close::after,
body .vzg-browser button.vzg-browser-close::after {
    transform: translate(-50%, -50%) rotate(-45deg) !important;
}

body .vzg-lightbox button.vzg-lightbox-prev::before,
body .vzg-lightbox button.vzg-lightbox-next::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-top: 2px solid currentColor !important;
    border-right: 2px solid currentColor !important;
    background: transparent !important;
    transform-origin: center !important;
}

body .vzg-lightbox button.vzg-lightbox-prev::before {
    transform: translate(-35%, -50%) rotate(-135deg) !important;
}

body .vzg-lightbox button.vzg-lightbox-next::before {
    transform: translate(-65%, -50%) rotate(45deg) !important;
}

body .vzg-browser button.vzg-browser-close {
    position: relative !important;
    flex: 0 0 44px !important;
    display: block !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    background: #181818 !important;
    color: #fff !important;
    outline: 0 !important;
}

body .vzg-browser button.vzg-browser-close:hover,
body .vzg-browser button.vzg-browser-close:focus-visible {
    border: 0 !important;
    background: #333 !important;
    box-shadow: none !important;
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}

@media (max-width: 767px) {
    .vzg-lightbox-stage,
    .vzg-lightbox-media {
        max-width: 100%;
    }

    body .vzg-lightbox button.vzg-lightbox-close,
    body .vzg-lightbox button.vzg-lightbox-prev,
    body .vzg-lightbox button.vzg-lightbox-next {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }

    body .vzg-lightbox button.vzg-lightbox-close {
        top: 8px !important;
        right: 8px !important;
    }

    body .vzg-lightbox button.vzg-lightbox-prev {
        left: 8px !important;
    }

    body .vzg-lightbox button.vzg-lightbox-next {
        right: 8px !important;
    }
}
