.pub-gallery {
    max-width: 1180px;
    margin: 24px auto 48px;
    padding: 0 16px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}
.pub-gallery h1 {
    margin: 0 0 8px;
    color: #ef7720;
    font-size: 28px;
    letter-spacing: 0.03em;
}
.pub-gallery .intro {
    margin: 0 0 18px;
    color: #c5d2ea;
}
.gallery-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}
.gallery-cats a {
    color: #d8eaff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(140, 170, 255, 0.28);
    background: rgba(10, 22, 52, 0.72);
}
.gallery-cats a:hover {
    border-color: rgba(230, 240, 255, 0.7);
    color: #fff;
}
.gallery-category {
    margin-bottom: 36px;
}
.gallery-category h2 {
    margin: 0 0 14px;
    color: #8ec8ff;
    font-size: 20px;
    border-bottom: 1px solid rgba(140, 170, 255, 0.22);
    padding-bottom: 8px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid rgba(180, 200, 255, 0.28);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(8, 16, 40, 0.7);
    cursor: pointer;
    aspect-ratio: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}
.gallery-thumb:hover img,
.gallery-thumb:focus img {
    transform: scale(1.05);
}
.gallery-empty {
    color: #9bb4cc;
    padding: 28px 0;
}
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    background: rgba(2, 4, 16, 0.94);
}
.gallery-lightbox.is-open {
    display: block;
}
.lb-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 52px 56px 16px;
}
.lb-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.lb-close,
.lb-nav {
    position: absolute;
    border: 1px solid rgba(190, 215, 255, 0.45);
    background: radial-gradient(circle at 32% 28%, rgba(140, 180, 255, 0.55), rgba(12, 22, 52, 0.92) 58%);
    color: #f6f9ff;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.lb-close {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    z-index: 6;
}
.lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    z-index: 3;
}
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.lb-tray {
    position: absolute;
    z-index: 4;
    color: #dce6f5;
    background: rgba(8, 16, 40, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: transform 0.28s ease;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 42vw);
    border-left: 1px solid rgba(180, 200, 255, 0.22);
    transform: translateX(105%);
    pointer-events: none;
}
.lb-tray.is-open {
    transform: translateX(0);
    pointer-events: auto;
}
.lb-tray-toggle {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(190, 215, 255, 0.45);
    border-radius: 999px;
    background: rgba(12, 22, 52, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #8ec8ff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.lb-tray-toggle .chev {
    display: inline-block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 9px 6px 0;
    border-color: transparent #8ec8ff transparent transparent;
    transition: transform 0.2s ease;
}
.lb-tray.is-open ~ .lb-tray-toggle .chev {
    transform: rotate(180deg);
}
.lb-tray-body {
    height: 100%;
    overflow-y: auto;
    padding: 56px 20px 72px;
    box-sizing: border-box;
}
.lb-title {
    margin: 0 0 8px;
    color: #ef7720;
    font-size: 18px;
}
.lb-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 0;
    margin: 0 0 12px;
    font-size: 13px;
}
.lb-meta span {
    display: block;
    color: #8ec8ff;
    font-weight: 700;
    margin-right: 0;
    margin-bottom: 2px;
}
.lb-desc {
    margin: 0;
    color: #c5d2ea;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}
body.lb-locked {
    overflow: hidden;
}
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    .lb-stage {
        padding: 48px 12px 8px;
    }
    .lb-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    .lb-nav.prev { left: 4px; }
    .lb-nav.next { right: 4px; }
    .lb-tray {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: min(58vh, 420px);
        border-left: 0;
        border-top: 1px solid rgba(180, 200, 255, 0.22);
        border-radius: 16px 16px 0 0;
        transform: translateY(105%);
        background: rgba(8, 16, 40, 0.58);
    }
    .lb-tray.is-open {
        transform: translateY(0);
    }
    .lb-tray-toggle .chev {
        border-width: 0 6px 9px 6px;
        border-color: transparent transparent #8ec8ff transparent;
    }
    .lb-tray.is-open ~ .lb-tray-toggle .chev {
        transform: rotate(180deg);
    }
    .lb-tray-body {
        height: auto;
        max-height: min(58vh, 420px);
        padding: 16px 16px 72px;
    }
    .lb-meta {
        grid-template-columns: 1fr 1fr;
    }
}
