/* Shared gallery styles — album tiles, the masonry photo grid and the
   lightbox. Used by BOTH the gallery index (gallery.html) and an album page
   (gallery-album.html) on both tenants, so the two can't drift. */

/* ── Album tiles ── */
.gal-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.gal-album {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-bg-subtle, var(--gray-100, #f3f4f6));
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gal-album:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.18); transform: translateY(-2px); }
.gal-album-cover {
    position: relative;
    display: block;
    aspect-ratio: 4/3;
    background: var(--gray-200, #e5e7eb);
    overflow: hidden;
}
.gal-album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-album-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; opacity: 0.35;
}
.gal-album-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.gal-album-draft {
    position: absolute; top: .5rem; left: .5rem;
    background: rgba(0,0,0,0.72); color: #fff;
    font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    padding: .18rem .45rem; border-radius: 4px;
}
.gal-album-meta { display: block; padding: .7rem .85rem .85rem; }
.gal-album-name { display: block; font-size: 1rem; line-height: 1.3; }
.gal-album-sub {
    display: block; margin-top: .18rem;
    font-size: .82rem; color: var(--text-muted, #6b7280);
}
.gal-album-count {
    display: block; margin-top: .1rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--color-accent, var(--color-primary, #666));
}
.gal-loose-heading { margin: 0 0 1rem; font-size: 1.15rem; }

/* Album page header bits */
.gal-back {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .85rem; text-decoration: none; opacity: .85;
}
.gal-back:hover { opacity: 1; }
.gal-album-eventlink {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-top: .6rem; padding: .4rem .75rem;
    border-radius: 999px; text-decoration: none;
    font-size: .85rem; font-weight: 600;
    background: rgba(255,255,255,0.15);
    color: inherit;
    border: 1px solid rgba(255,255,255,0.35);
}
.gal-album-eventlink:hover { background: rgba(255,255,255,0.25); }

/* ── Public gallery grid ── */
.gallery-grid {
    columns: 4;
    column-gap: 0.75rem;
}
.gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 0.75rem;
    overflow: hidden;
    border-radius: 8px;
    cursor: zoom-in;
    background: var(--gray-100, #f3f4f6);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}
.gallery-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.25s ease, opacity 0.3s ease;
    opacity: 0;
}
.gallery-item img.loaded { opacity: 1; }
.gallery-item:hover img { transform: scale(1.04); }

.gallery-video-thumb {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 16/9;
    pointer-events: none;
}
.gallery-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.gallery-item:hover .gallery-play-icon { opacity: 1; }

.gallery-download-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 140px;
    background: var(--gray-100, #f3f4f6);
    color: var(--text-muted, #666);
    text-align: center;
    gap: 0.4rem;
}
.gallery-download-icon { font-size: 2rem; }
.gallery-download-name {
    font-size: 0.75rem;
    word-break: break-all;
    max-width: 100%;
    opacity: 0.8;
}
.gallery-download-note { font-size: 0.7rem; opacity: 0.6; }

@media (max-width: 1024px) { .gallery-grid { columns: 3; } }
@media (max-width: 640px)  { .gallery-grid { columns: 2; } }
@media (max-width: 400px)  { .gallery-grid { columns: 1; } }

/* ── Lightbox ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.93);
    z-index: 3000;
    user-select: none;
}
.lightbox.active { display: flex; align-items: center; justify-content: center; }

.lightbox-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}
.lightbox-stage.zoomed { cursor: move; }

.lightbox-stage img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.7);
    transition: transform 0.15s ease;
    transform-origin: center center;
    pointer-events: none;
    will-change: transform;
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 3010;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    border: none;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    width: 3rem;
    height: 5rem;
    cursor: pointer;
    z-index: 3010;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; background: rgba(0,0,0,0.7); }

.lightbox-counter {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    z-index: 3010;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .lightbox-prev { left: 0; border-radius: 0 4px 4px 0; }
    .lightbox-next { right: 0; border-radius: 4px 0 0 4px; }
    .lightbox-stage img { max-width: 100vw; max-height: 88vh; border-radius: 0; }
}
