/* NGO Impressionen – Frontend
   Nutzt die Theme-Design-Tokens (mit Fallbacks), damit die Galerie ohne
   eigene Farbwelt zum Theme passt. */

.ngo-impressionen {
    --ngo-imp-gap: 16px;
    margin: 0 auto;
}

/* Full-width: bricht sauber aus dem zentrierten Container aus.
   (Theme setzt body{overflow-x:hidden}, daher kein horizontaler Scroll.) */
.ngo-impressionen.is-fullwidth {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0 clamp(16px, 4vw, 48px);
}

.ngo-imp-event {
    margin-bottom: clamp(40px, 6vw, 72px);
}

.ngo-imp-event:last-child {
    margin-bottom: 0;
}

/* Event-Kopf: Titel + Datum, dezent im Marken-Look */
.ngo-imp-event-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(26, 107, 181, 0.12);
}

.ngo-imp-event-title {
    margin: 0;
    font-size: clamp(1.3rem, 2.6vw, 1.9rem);
    color: var(--color-heading, #1a6bb5);
    line-height: 1.2;
}

.ngo-imp-event-date {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-secondary, #4a9a3e);
    letter-spacing: 0.02em;
}

/* Masonry per CSS-Columns – kein JS-Lib, kein externer Abruf (DSGVO) */
.ngo-imp-grid {
    column-count: 4;
    column-gap: var(--ngo-imp-gap);
}

@media (max-width: 1100px) { .ngo-imp-grid { column-count: 3; } }
@media (max-width: 760px)  { .ngo-imp-grid { column-count: 2; } }
@media (max-width: 480px)  { .ngo-imp-grid { column-count: 1; } }

.ngo-imp-item {
    display: block;
    break-inside: avoid;
    margin: 0 0 var(--ngo-imp-gap);
    border-radius: var(--border-radius, 12px);
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
    transition: var(--transition, all 0.3s ease);
    cursor: zoom-in;
    position: relative;
}

.ngo-imp-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(26, 107, 181, 0) 60%, rgba(26, 107, 181, 0.18) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ngo-imp-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover, 0 15px 50px rgba(26, 107, 181, 0.18));
}

.ngo-imp-item:hover::after {
    opacity: 1;
}

.ngo-imp-img {
    display: block;
    width: 100%;
    height: auto;
}

.ngo-imp-empty {
    text-align: center;
    color: var(--color-text-light, #6c757d);
}

@media (prefers-reduced-motion: reduce) {
    .ngo-imp-item,
    .ngo-imp-item::after { transition: none; }
    .ngo-imp-item:hover { transform: none; }
}

/* ---------- Lightbox ---------- */
.ngo-imp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 30, 40, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    padding: 4vmin;
}

.ngo-imp-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.ngo-imp-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--border-radius, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ngo-imp-lb-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngo-imp-lb-btn:hover { background: rgba(255, 255, 255, 0.28); }
.ngo-imp-lb-close { top: 3vmin; right: 3vmin; }
.ngo-imp-lb-prev  { left: 3vmin;  top: 50%; transform: translateY(-50%); }
.ngo-imp-lb-next  { right: 3vmin; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
    .ngo-imp-lb-prev { left: 2vmin; }
    .ngo-imp-lb-next { right: 2vmin; }
}
