/**
 * Gallery mode of the IBIA lightbox (assets/js/ibia-lightbox.js), 16 Oct 2026.
 *
 * The base overlay, pane and close button are in ibia.css, built for the
 * organigram. Photos differ: they fit the screen whole rather than scrolling,
 * sit on the dark backdrop without the chart's white card, and a gallery adds
 * Previous / Next and a counter. Everything here is scoped to
 * .ibia-lightbox--gallery, so the organigram is unchanged.
 */

/* Darker than the organigram's 88%: behind a photo the page showed through. */
.ibia-lightbox--gallery { overflow: hidden; background-color: rgba(0, 0, 0, 0.95); }

.ibia-lightbox--gallery .ibia-lightbox__pane {
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 72px 88px 64px;
}

.ibia-lightbox--gallery .ibia-lightbox__img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	background: none;
	border-radius: 0;
	user-select: none;
	-webkit-user-drag: none;
}

/* Previous / Next: the close button's look, centred on either side. */
.ibia-lightbox__nav { display: none; }

.ibia-lightbox--set .ibia-lightbox__nav {
	position: fixed;
	top: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	padding: 0;
	border: 0;
	border-radius: var(--fw-radius);
	background-color: var(--fw-white);
	color: var(--fw-navy);
	cursor: pointer;
}

.ibia-lightbox__nav--prev { left: 20px; }
.ibia-lightbox__nav--next { right: 20px; }

.ibia-lightbox--set .ibia-lightbox__nav:hover:not(:disabled),
.ibia-lightbox--set .ibia-lightbox__nav:focus-visible {
	background-color: var(--fw-navy);
	color: var(--fw-white);
}

.ibia-lightbox--set .ibia-lightbox__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.ibia-lightbox__close:focus-visible,
.ibia-lightbox__nav:focus-visible {
	outline: 2px solid var(--fw-white);
	outline-offset: 3px;
}

/* "12 of 286", centred under the photo. */
.ibia-lightbox__count { display: none; }

.ibia-lightbox--set .ibia-lightbox__count {
	position: fixed;
	right: 0;
	bottom: 20px;
	left: 0;
	z-index: 1;
	display: block;
	margin: 0;
	color: var(--fw-white);
	font-size: 15px;
	line-height: 24px;
	text-align: center;
}

/* Every gallery photo is now a way into the gallery. */
.wp-block-gallery figure.wp-block-image a,
.wp-block-gallery figure.wp-block-image img[role="button"] { cursor: zoom-in; }

/* Phones: the photo takes the full width, the buttons sit along the foot
   either side of the count, clear of the picture, and a swipe also works. */
@media (max-width: 782px) {
	.ibia-lightbox--gallery .ibia-lightbox__pane { padding: 64px 0 88px; }

	.ibia-lightbox--set .ibia-lightbox__nav {
		top: auto;
		bottom: 16px;
		margin-top: 0;
		width: 44px;
		height: 44px;
	}

	.ibia-lightbox__nav--prev { left: 16px; }
	.ibia-lightbox__nav--next { right: 16px; }

	.ibia-lightbox--set .ibia-lightbox__count { bottom: 26px; }
}
