/* Photo viewer (lightbox) for Recent projects, the Projects page and project photos. */

.bns-card__media { cursor: zoom-in; }
body.single-project .bns-prose img, body.single-project .bns-project-image img { cursor: zoom-in; }

.bns-lb { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 0; background: rgba(8, 18, 30, 0.95); opacity: 0; transition: opacity 0.25s ease; -webkit-tap-highlight-color: transparent; touch-action: pan-y pinch-zoom; user-select: none; }
.bns-lb[hidden] { display: none; }
.bns-lb.is-open { opacity: 1; }
body.bns-lb-open { overflow: hidden; }

/* The cursor shows which way a click will go. */
.bns-lb[data-side="left"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='20' fill='%23ffffff' fill-opacity='.92'/%3E%3Cpath d='M25 14l-8 8 8 8' fill='none' stroke='%230c1f33' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 22 22, w-resize; }
.bns-lb[data-side="right"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='20' fill='%23ffffff' fill-opacity='.92'/%3E%3Cpath d='M19 14l8 8-8 8' fill='none' stroke='%230c1f33' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 22 22, e-resize; }

.bns-lb__fig { display: grid; justify-items: center; gap: 0.9rem; width: 100%; min-width: 0; margin: 0; padding: 3.5rem 1rem 1rem; box-sizing: border-box; pointer-events: none; }
.bns-lb__img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 11rem); max-height: calc(100dvh - 11rem); object-fit: contain; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5); transition: opacity 0.25s ease; }
.bns-lb__img.is-loading { opacity: 0.25; }
.bns-lb__cap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.35rem 1.25rem; max-width: min(94vw, 60rem); color: #fff; font-size: 0.9375rem; line-height: 1.4; text-align: center; pointer-events: auto; }
.bns-lb__title { font-family: var(--bns-font-display, Georgia, serif); font-size: 1.15rem; }
.bns-lb__count { font-family: var(--bns-font-brand, Arial, sans-serif); font-size: 0.75rem; letter-spacing: 0.18em; color: rgba(255, 255, 255, 0.7); }
.bns-lb__link { color: #fff; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 0.25em; }
.bns-lb__link[hidden] { display: none; }

.bns-lb__btn { position: absolute; z-index: 2; display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; color: #0c1f33; background: rgba(255, 255, 255, 0.92); border: 0; border-radius: 50%; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; }
.bns-lb__btn:hover, .bns-lb__btn:focus-visible { background: #fff; transform: scale(1.08); }
.bns-lb__btn:focus-visible, .bns-lb__link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.bns-lb__btn svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bns-lb__close { top: 0.9rem; right: 0.9rem; }
.bns-lb__prev, .bns-lb__next { top: 50%; margin-top: -1.5rem; }
.bns-lb__prev { left: 0.9rem; }
.bns-lb__next { right: 0.9rem; }
.bns-lb--single .bns-lb__prev, .bns-lb--single .bns-lb__next { display: none; }

@media (max-width: 39.99rem) {
	.bns-lb__fig { padding: 4rem 0.5rem 1rem; }
	.bns-lb__img { max-width: 100%; max-height: calc(100vh - 12rem); max-height: calc(100dvh - 12rem); }
	.bns-lb__btn { width: 2.6rem; height: 2.6rem; background: rgba(255, 255, 255, 0.82); }
	.bns-lb__prev, .bns-lb__next { margin-top: -1.3rem; }
	.bns-lb__prev { left: 0.4rem; }
	.bns-lb__next { right: 0.4rem; }
}
@media (prefers-reduced-motion: reduce) {
	.bns-lb, .bns-lb__img, .bns-lb__btn { transition: none; }
}
