/* =============================================================================
   Gallery page — masonry grid + full-screen lightbox.
   ========================================================================== */

/* ---------- Masonry ---------- */
.masonry { column-count: 4; column-gap: 16px; }
@media (max-width: 1200px) { .masonry { column-count: 3; } }
@media (max-width: 760px)  { .masonry { column-count: 2; } }
@media (max-width: 460px)  { .masonry { column-count: 1; } }

.ph {
    display: block; break-inside: avoid; margin-bottom: 16px; position: relative;
    border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in;
    border: 1px solid var(--stroke); background: var(--surface-2);
    box-shadow: var(--shadow);
}
.ph img { width: 100%; display: block; transition: transform .7s var(--ease), filter .6s; }
.ph:hover img { transform: scale(1.06); filter: saturate(1.1); }
.ph::after {
    content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s;
    background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--accent) 60%, transparent));
}
.ph:hover::after { opacity: 1; }
.ph .ph-eye {
    position: absolute; right: 12px; bottom: 12px; z-index: 2; opacity: 0; transform: translateY(8px);
    transition: opacity .35s, transform .35s; color: #fff;
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: color-mix(in srgb, var(--accent) 70%, transparent); backdrop-filter: blur(6px);
}
.ph:hover .ph-eye { opacity: 1; transform: none; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 200; display: none;
    align-items: center; justify-content: center;
    background: rgba(6, 4, 12, .94); backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; animation: lbFade .25s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lightbox figure { margin: 0; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.lightbox img {
    max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 8px;
    box-shadow: 0 30px 90px -20px rgba(0,0,0,.8);
}
.lb-btn {
    position: absolute; z-index: 3; width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: blur(8px); transition: background .25s, transform .25s;
}
.lb-btn:hover { background: color-mix(in srgb, var(--accent) 60%, transparent); transform: scale(1.08); }
.lb-close { top: 20px; right: 20px; }
.lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.08); }
.lb-prev svg { transform: rotate(180deg); }
.lb-counter { color: var(--text-dim); font-size: .9rem; font-family: var(--font-display); letter-spacing: .05em; }
@media (max-width: 620px) { .lb-prev { left: 10px; } .lb-next { right: 10px; } .lb-btn { width: 44px; height: 44px; } }

.gallery-count { color: var(--text-mute); font-size: .9rem; }
