.hb-gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hb-gal-item {
    aspect-ratio: 1; overflow: hidden; border-radius: 12px;
    position: relative; cursor: zoom-in;
    background: var(--hb-line, #eee7d4);
}
.hb-gal-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.hb-gal-item:hover img { transform: scale(1.06); }
.hb-gal-item::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(15,23,42,.4));
    opacity: 0; transition: opacity .2s;
}
.hb-gal-item:hover::after { opacity: 1; }

/* Lightbox — full-viewport zoom. Grid centering is bullet-proof
   against upstream img rules from bootstrap.min.css that had been
   pulling the image to a corner. */
.hb-gal-lb {
    display: none; position: fixed; inset: 0;
    background: rgba(15,23,42,.96); z-index: 9999;
    place-items: center;
    padding: 0;
    box-sizing: border-box;
}
.hb-gal-lb.show { display: grid; }
.hb-gal-lb img {
    grid-area: 1 / 1;
    /* Fill the entire viewport, preserving aspect ratio. The image
       expands to the largest size that still fits inside 100vw × 100vh
       without cropping. Portrait shots become tall; landscape shots
       become wide — always as large as possible. */
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw; max-height: 100vh;
    object-fit: contain;
    border-radius: 0;
    display: block;
    margin: 0;
    border: 0;
}
.hb-gal-lb-btn {
    position: fixed;                 /* fixed, not absolute — no ambiguity re. containing block */
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff;
    border: none; cursor: pointer;
    display: grid; place-items: center;
    z-index: 2;
    transition: background .12s, transform .12s;
    padding: 0;
}
.hb-gal-lb-btn:hover { background: rgba(255,255,255,.28); transform: scale(1.06); }
.hb-gal-lb-btn i { line-height: 1; font-size: 18px; }
.hb-gal-lb-close { top: 24px;  right: 24px; }
.hb-gal-lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.hb-gal-lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.hb-gal-lb-prev:hover,
.hb-gal-lb-next:hover { transform: translateY(-50%) scale(1.06); }

@media (max-width: 900px) { .hb-gal-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 480px) { .hb-gal-grid { grid-template-columns: 1fr; } .hb-gal-lb-prev, .hb-gal-lb-next { display: none; } }
