/* ==========================================================
   Gallery (/gallery)
   ========================================================== */
.gallery { padding-top: 36px; padding-bottom: 70px; }
.gallery__empty { text-align: center; color: var(--muted); padding: 40px 0; }

.gallery__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.gallery__filter {
    padding: 8px 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 17px;
    font-weight: 500;
    transition: background .2s, color .2s, border-color .2s;
}

.gallery__filter:hover { border-color: var(--navy); color: var(--navy); }
.gallery__filter.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.gallery__grid { position: relative; }
.gallery__grid.is-ready { transition: height .45s ease; }

.gallery__item {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(13, 45, 94, .08);
}

.gallery__grid.is-ready .gallery__item {
    transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .4s ease;
}

.gallery__item.is-hidden { opacity: 0; pointer-events: none; }

.gallery__thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    cursor: zoom-in;
    overflow: hidden;
}

.gallery__thumb img {
    width: 100%;
    height: auto;
    transition: transform .5s ease;
}

.gallery__zoom {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(13, 45, 94, .45);
    color: #fff;
    opacity: 0;
    transition: opacity .3s;
}

.gallery__zoom svg { width: 42px; height: 42px; }
.gallery__thumb:hover img { transform: scale(1.06); }
.gallery__thumb:hover .gallery__zoom { opacity: 1; }

.gallery__caption {
    padding: 10px 14px 12px;
    font-size: 16px;
    line-height: 1.5;
}

.gallery__tag {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 70px;
    background: rgba(5, 14, 30, .92);
}

.lightbox[hidden] { display: none; }

.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }

.lightbox__figure img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.lightbox__caption { margin-top: 14px; color: #fff; font-size: 18px; }

.lightbox__close,
.lightbox__nav {
    position: absolute;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-radius: 50%;
    transition: background .2s;
}

.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 255, 255, .25); }

.lightbox__close { top: 16px; right: 18px; width: 44px; height: 44px; font-size: 30px; line-height: 1; }
.lightbox__nav { top: 50%; width: 50px; height: 50px; margin-top: -25px; font-size: 36px; line-height: 1; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }

@media (max-width: 640px) {
    .gallery { padding-top: 26px; padding-bottom: 44px; }
    .gallery__filter { padding: 6px 14px; font-size: 15px; }
    .lightbox { padding: 60px 10px; }
    .lightbox__nav { top: auto; bottom: 14px; margin-top: 0; }
    .lightbox__nav--prev { left: calc(50% - 60px); }
    .lightbox__nav--next { right: calc(50% - 60px); }
}
