/* ==========================================================================
   Reusable photo gallery block ("Photos from the event") + lightbox
   Drop a .event-gallery-grid.js-lightbox anywhere; main.js wires the viewer.
   ========================================================================== */
.event-gallery { margin: 48px 0 8px; }
.event-gallery-title {
    font-size: 22px; font-weight: 700; color: #101828; margin: 0 0 16px;
}
.event-gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.eg-thumb {
    padding: 0; border: none; background: #EEF2F4;
    border-radius: 8px; overflow: hidden; cursor: pointer;
    aspect-ratio: 1; position: relative; display: block;
}
.eg-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.eg-thumb:hover img { transform: scale(1.06); }
.eg-thumb:focus-visible { outline: 2px solid #2D738C; outline-offset: 2px; }
.eg-thumb.is-hidden { display: none; }
.eg-more {
    position: absolute; inset: 0; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    background: rgba(9, 18, 26, 0.55);
    color: #FFFFFF; font-size: 18px; font-weight: 700;
    pointer-events: none;
}

/* ---------- Full-screen lightbox (injected once by main.js) ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
    background: rgba(9, 18, 26, 0.93); padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox-img {
    max-width: 92vw; max-height: 82vh; object-fit: contain;
    border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none; -webkit-user-drag: none;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute; background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF; border: none; cursor: pointer; border-radius: 50%;
    width: 48px; height: 48px; font-size: 24px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-close { top: 20px; right: 20px; font-size: 28px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-caption {
    position: absolute; bottom: 18px; left: 0; right: 0;
    text-align: center; color: rgba(255, 255, 255, 0.85);
    font-size: 14px; padding: 0 24px;
}
/* "Go to project" button (only shown for gallery-page albums) */
.lightbox-project {
    position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center;
    padding: 9px 18px; border-radius: 999px;
    background: #E8833A; color: #FFFFFF;
    font-size: 14px; font-weight: 600; text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-project::after { content: "\00a0\2192"; }
.lightbox-project:hover { background: #D9752E; transform: translateX(-50%) translateY(-1px); }
.lightbox-project[hidden] { display: none; }

@media (max-width: 700px) {
    .event-gallery { margin: 36px 0 8px; }
    .event-gallery-title { font-size: 19px; margin: 0 0 12px; }
    .event-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}
@media (max-width: 600px) {
    .lightbox { padding: 12px; }
    .lightbox-img { max-width: 96vw; max-height: 80vh; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close { top: 12px; right: 12px; }
    .lightbox-caption { font-size: 12.5px; bottom: 12px; }
}
