/* ============================================================
   Shared photo lightbox — assets/lightbox.js
   Prefixed `hham-lb-` so it cannot collide with the older
   `.lightbox` rules in assets/fullmoon.css, which the event
   pages still load.
   ============================================================ */

.hham-lb {
    position: fixed;
    inset: 0;
    /* Must clear the fixed header (1000) and the skip link (10000). */
    z-index: 10050;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.hham-lb.is-open { opacity: 1; visibility: visible; }
/* An author `display: flex` beats the UA sheet's [hidden]{display:none}, so the
   closed dialog would otherwise stay in the layout and swallow clicks. */
.hham-lb[hidden] { display: none; }

.hham-lb-content {
    position: relative;
    /* Room reserved for the nav buttons so they never sit off-screen —
       the pattern this replaces put them at left/right: -60px outside a
       max-width:90% box, which pushed them out of view on narrow screens. */
    width: min(1100px, 100vw - 7rem);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.hham-lb-figure {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.hham-lb-img {
    max-width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
}

.hham-lb-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    color: #fff;
}
.hham-lb-caption { font-size: .95rem; line-height: 1.5; opacity: .95; }
.hham-lb-count { font-size: .8rem; opacity: .7; white-space: nowrap; font-variant-numeric: tabular-nums; }

.hham-lb-close,
.hham-lb-nav {
    position: absolute;
    background: rgba(255, 255, 255, .9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}
.hham-lb-close:hover,
.hham-lb-nav:hover { background: #fff; transform: scale(1.06); }
.hham-lb-close:focus-visible,
.hham-lb-nav:focus-visible { outline: 3px solid #27ae60; outline-offset: 3px; }

.hham-lb-close {
    top: -3rem; right: 0;
    width: 40px; height: 40px;
    font-size: 1.4rem; line-height: 1;
}
.hham-lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    font-size: 1.6rem; line-height: 1;
}
.hham-lb-nav:hover { transform: translateY(-50%) scale(1.06); }
.hham-lb-prev { left: -3.5rem; }
.hham-lb-next { right: -3.5rem; }
.hham-lb-nav[hidden] { display: none; }

@media (max-width: 780px) {
    .hham-lb-content { width: calc(100vw - 1.5rem); }
    /* Below this width there is no room beside the image, so the controls
       move onto it rather than off the screen. */
    .hham-lb-nav { width: 42px; height: 42px; background: rgba(255, 255, 255, .82); }
    .hham-lb-prev { left: .35rem; }
    .hham-lb-next { right: .35rem; }
    .hham-lb-close { top: -2.75rem; right: .35rem; }
    .hham-lb-img { max-height: 64vh; }
    .hham-lb-bar { flex-direction: column; align-items: flex-start; gap: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hham-lb, .hham-lb-close, .hham-lb-nav { transition: none; }
}
