/* Photos from locals on a directory listing page, "Through the viewfinder" (includes/listings.php, bp_listing_photos_section).
 * Loaded only on single listing pages, with the photo viewer (lightbox.js). Mobile first: the strip is a swipeable row on phones and
 * a grid from 600px. Brand colours come from the theme where it has them. */
.bp-locals {
	--bp-l-red: var(--wp--preset--color--base, #990000);
	--bp-l-red-d: var(--wp--preset--color--accent-2, #7a0000);
	--bp-l-ink: #1f1f1f;
	--bp-l-mut: #4a4a4a;
	--bp-l-warm: #f5f3ef;
	--bp-l-line: #d9d9d6;
	min-width: 0;
	max-width: 100%;
	margin: 2rem 0;
	color: var(--bp-l-ink);
}
.bp-locals h2 { margin: 0 0 .85rem; }
.bp-locals ul { list-style: none; margin: 0; padding: 0; }
.bp-locals li { margin: 0; padding: 0; }
.bp-locals li::before { content: none; }
.bp-locals figure { margin: 0; }
.bp-locals p { margin: 0; }

/* Photos */
.bp-locals-img { display: block; overflow: hidden; border-radius: 10px; background: var(--bp-l-warm); cursor: zoom-in; }
.bp-locals-img picture { display: block; height: 100%; }
.bp-locals-img img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; border-radius: inherit; transition: transform .5s ease; }
.bp-locals-img:hover img { transform: scale(1.02); }
.bp-locals-img:focus-visible { outline: 3px solid var(--bp-l-red); outline-offset: 3px; }
.bp-locals-hero .bp-locals-img { aspect-ratio: 3 / 2; }
.bp-locals-hero figcaption { display: flex; flex-wrap: wrap; gap: .15rem 1rem; margin-top: .5rem; color: var(--bp-l-mut); font-size: .875rem; line-height: 1.4; }
.bp-locals-hero .bp-credit-name, .bp-locals-hero .bp-credit-anon { color: var(--bp-l-ink); }
.bp-locals-hero .bp-credit-link { margin-left: .35rem; }
.bp-locals-hero .bp-link-icon { vertical-align: -3px; }

.bp-locals .bp-locals-strip {
	display: flex;
	gap: 8px;
	max-width: 100%;
	margin-top: 8px;
	padding-bottom: 4px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}
.bp-locals-strip li { flex: 0 0 40%; min-width: 0; scroll-snap-align: start; }
.bp-locals-strip .bp-locals-img { aspect-ratio: 1 / 1; border-radius: 8px; }
@media (min-width: 600px) {
	.bp-locals .bp-locals-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding-bottom: 0; overflow: visible; scroll-snap-type: none; }
	.bp-locals h2 + .bp-locals-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* no lead photo: bigger tiles */
}

.bp-locals .bp-locals-more { margin-top: .6rem; font-size: .925rem; }
.bp-locals .bp-locals-first { margin-top: .5rem; color: var(--bp-l-mut); font-size: .875rem; line-height: 1.4; }
.bp-locals .bp-locals-first + .bp-locals-first { margin-top: .15rem; }
.bp-locals-more a, .bp-locals-add a { color: var(--bp-l-red); text-underline-offset: 3px; }
.bp-locals-more a:hover, .bp-locals-add a:hover { color: var(--bp-l-red-d); }
.bp-locals .bp-locals-add { margin-top: 1rem; }
.bp-locals .bp-locals-flag { margin-top: .2rem; font-size: .8rem; line-height: 1.3; }

/* The viewfinder: a warm panel inside four crimson corner marks, with a slowly blinking red dot. */
.bp-vf { position: relative; margin-top: 1rem; padding: 1.4rem 1.4rem 1.3rem; border-radius: 10px; background: var(--bp-l-warm); }
.bp-locals h2 + .bp-vf { margin-top: 0; padding: 2rem 1.6rem 1.7rem; }
.bp-vf-k { position: absolute; width: 16px; height: 16px; border: 0 solid var(--bp-l-red); pointer-events: none; }
.bp-vf-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.bp-vf-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.bp-vf-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.bp-vf-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }
.bp-vf-head { color: var(--bp-l-ink); font-size: 1.075rem; font-weight: 600; line-height: 1.4; }
.bp-vf-dot { display: inline-block; width: 9px; height: 9px; margin: 0 .55rem 0 0; border-radius: 50%; background: var(--bp-l-red); vertical-align: 1px; animation: bp-vf-blink 1.6s ease-in-out infinite; }
@keyframes bp-vf-blink { 50% { opacity: .25; } }
.bp-locals .bp-vf-hint { margin-top: .3rem; color: var(--bp-l-mut); font-size: .95rem; line-height: 1.45; }
.bp-locals .bp-vf-tip { margin-top: .45rem; color: var(--bp-l-mut); font-size: .875rem; font-style: italic; line-height: 1.45; }
.bp-locals .bp-vf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .9rem; }
.bp-vf-chips a, .bp-vf-chips s { display: inline-flex; align-items: center; min-height: 32px; box-sizing: border-box; padding: .25rem .8rem; border: 1px solid var(--bp-l-line); border-radius: 999px; font-size: .85rem; line-height: 1.2; }
.bp-vf-chips a { background: #fff; color: var(--bp-l-ink); text-decoration: none; }
.bp-vf-chips a:hover, .bp-vf-chips .is-next a { border-color: var(--bp-l-red); color: var(--bp-l-red); }
.bp-vf-chips s { color: var(--bp-l-mut); text-decoration: line-through; }
.bp-locals .bp-vf-act { margin-top: 1.1rem; }
.bp-vf-btn { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: .55rem 1.35rem; border-radius: 999px; background: var(--bp-l-red); color: #fff !important; font-weight: 600; line-height: 1.2; text-decoration: none !important; }
.bp-vf-btn:hover { background: var(--bp-l-red-d); }
.bp-vf-btn:focus-visible, .bp-vf-chips a:focus-visible, .bp-locals-more a:focus-visible, .bp-locals-add a:focus-visible, .bp-locals-flag a:focus-visible { outline: 3px solid var(--bp-l-red); outline-offset: 2px; }

.bp-locals-vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
	.bp-vf-dot { animation: none; }
	.bp-locals-img img { transition: none; }
	.bp-locals-img:hover img { transform: none; }
}

/* The photo viewer's toolbar, zoom, details card and toast. The directory's stylesheet already has the viewer's base rules (.bo-lb,
 * backdrop, figure, buttons); these are the ones this plugin's viewer adds, copied from public.css. */
.bo-lb__page { display: inline-block; margin-top: .5rem; color: rgba(245, 243, 239, .85); font-size: .9rem; text-decoration: underline; }
.bo-lb__page:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.bo-lb__tools { position: absolute; top: .75rem; right: .9rem; z-index: 3; display: flex; gap: .5rem; }
.bo-lb__tools .bo-lb__btn { position: static; }
.bo-lb__btn:disabled { opacity: .35; cursor: default; }
.bo-lb__stage { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.bo-lb.is-zoomed .bo-lb__stage { width: min(1200px, calc(100vw - 2rem)); height: calc(100vh - 11rem); height: calc(100dvh - 11rem); cursor: grab; }
.bo-lb.is-zoomed .bo-lb__stage:active { cursor: grabbing; }
.bo-lb__img { transform-origin: center center; will-change: transform; }
.bo-lb.is-zoomed .bo-lb__img { transition: none; }
.bo-lb__toast { position: absolute; left: 50%; bottom: 1rem; z-index: 5; max-width: calc(100% - 2rem); margin: 0; padding: .55rem 1rem; transform: translateX(-50%); border-radius: 999px; background: #ffffff; color: #1f1f1f; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s ease; overflow-wrap: anywhere; user-select: text; }
.bo-lb__toast.is-on { opacity: 1; pointer-events: auto; }
.bo-lb__info { position: absolute; left: 50%; bottom: 1rem; z-index: 4; box-sizing: border-box; width: min(26rem, calc(100% - 1.5rem)); max-height: min(34rem, calc(100% - 5rem)); overflow: auto; transform: translateX(-50%); padding: 1rem 1.1rem 1.1rem; border-radius: 14px; background: #ffffff; color: #1f1f1f; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); text-align: left; }
.bo-lb__info[hidden] { display: none; }
.bo-lb__info .bo-lb__info-x { position: absolute; top: .5rem; right: .5rem; width: 38px; height: 38px; color: #1f1f1f; border-color: rgba(31, 31, 31, .25); background: rgba(31, 31, 31, .06); }
.bo-lb__info .bo-lb__info-x:hover { background: rgba(31, 31, 31, .14); }
.bo-lb__info-title { margin: 0 2.6rem .5rem 0; font-size: 1.15rem; line-height: 1.3; }
.bo-lb__info p { margin: 0 0 .6rem; font-size: .95rem; line-height: 1.45; }
.bo-lb__facts { margin: 0 0 .7rem; }
.bo-lb__facts div { display: flex; gap: .6rem; padding: .2rem 0; font-size: .92rem; }
.bo-lb__facts dt { flex: 0 0 5.2rem; color: #6b5d55; }
.bo-lb__facts dd { margin: 0; }
.bo-lb__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; padding: 0; list-style: none; }
.bo-lb__tags a { display: inline-block; padding: .2rem .65rem; border: 1px solid rgba(31, 31, 31, .25); border-radius: 999px; color: #990000; font-size: .85rem; text-decoration: none; }
.bo-lb__map { display: block; margin: 0 0 .8rem; border: 1px solid rgba(31, 31, 31, .2); border-radius: 10px; overflow: hidden; color: #1f1f1f; text-decoration: none; }
.bo-lb__map:focus-visible, .bo-lb__info a:focus-visible { outline: 3px solid #990000; outline-offset: 2px; }
.bo-lb__map-img { display: block; aspect-ratio: 300 / 170; background: #f1eee6; }
.bo-lb__map-img svg { display: block; width: 100%; height: 100%; }
.bo-lb__map-cap { display: block; padding: .45rem .7rem; background: #fff; font-size: .85rem; font-weight: 600; color: #990000; }
.bo-lb__info-page { color: #990000; font-size: .9rem; }
@media (max-width: 700px) {
	.bo-lb__tools { right: .5rem; gap: .35rem; }
	.bo-lb__tools .bo-lb__btn { width: 44px; height: 44px; }
	.bo-lb.is-zoomed .bo-lb__stage { height: calc(100vh - 12.5rem); height: calc(100dvh - 12.5rem); }
	.bo-lb__info { bottom: .5rem; max-height: calc(100% - 4.5rem); }
}
