/* ══════════════════════════════════════════════════════════════════
   Lightbox — design taken from gallery.html
   Dark full-screen viewer, auto-fit image, round controls.
   ══════════════════════════════════════════════════════════════════ */

html.hp-lb-lock { overflow: hidden; }

.hp-lb {
    position: fixed;
    inset: 0;
    z-index: 999999; /* above the WP admin bar and theme headers */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 65px 75px 55px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.96);
    overscroll-behavior: contain;
}

.hp-lb.is-open { display: flex; }

.hp-lb *,
.hp-lb *::before,
.hp-lb *::after { box-sizing: border-box; }

/* ── Image frame: fits any ratio inside the padded area ───────────── */
.hp-lb-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    border-radius: 10px;
}

.hp-lb-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.hp-lb-img.is-ready { opacity: 1; }

/* Spinner while the next file loads */
.hp-lb-frame.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hp-lb-spin 0.7s linear infinite;
}

@keyframes hp-lb-spin { to { transform: rotate(360deg); } }

/* ── Controls ─────────────────────────────────────────────────────── */
.hp-lb-btn {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hp-lb-btn:hover { background: #ccc; }

.hp-lb-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.hp-lb-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.hp-lb-close {
    top: 15px;
    right: 20px;
    width: 46px;
    height: 46px;
}

.hp-lb-prev,
.hp-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.hp-lb-prev { left: 15px; }
.hp-lb-next { right: 15px; }

.hp-lb-count {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.875rem;
    color: #fff;
    pointer-events: none;
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .hp-lb { padding: 60px 45px; }

    .hp-lb-frame { width: 100%; }

    .hp-lb-prev,
    .hp-lb-next {
        width: 36px;
        height: 36px;
    }

    .hp-lb-prev { left: 4px; }
    .hp-lb-next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .hp-lb-img { transition: none; }
    .hp-lb-frame.is-loading::after { animation-duration: 1.6s; }
}

.hp-lb-btn svg {
    width: 55%;
    height: 55%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Inline SVG icons (no font dependency) */
.hp-lb-btn svg {
    width: 50%;
    height: 50%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
