/* ---------- Layout ---------- */
.og-gallery {
	--og-gap: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: var(--og-gap);
	box-sizing: border-box;
	width: 100%;
}

/* Break out of the theme container to span the full screen width */
.og-gallery.og-full {
	width: 100vw;
	max-width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
}

.og-item {
	display: block;
	line-height: 0;
	cursor: zoom-in;
	box-sizing: border-box;
}

/* Horizontal = full width */
.og-item.og-h {
	flex: 0 0 100%;
	max-width: 100%;
}

/* Vertical = half width (minus half the gap so two fit exactly side by side) */
.og-item.og-v {
	flex: 0 0 calc(50% - (var(--og-gap) / 2));
	max-width: calc(50% - (var(--og-gap) / 2));
}

.og-img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

/* Stops the 100vw breakout from causing a horizontal scrollbar */
body:has(.og-gallery.og-full) {
	overflow-x: clip;
}

/* ---------- Lightbox ---------- */
.og-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.og-lightbox.is-open {
	display: flex;
}
.og-lightbox.is-visible {
	opacity: 1;
}

.og-lightbox__img {
	max-width: 92vw;
	max-height: 88vh;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.og-lightbox button {
	position: absolute;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	opacity: 0.75;
	transition: opacity 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}
.og-lightbox button:hover,
.og-lightbox button:focus-visible {
	opacity: 1;
}

.og-lightbox__close {
	top: 14px;
	right: 20px;
	font-size: 40px;
}
.og-lightbox__prev,
.og-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 56px;
	padding: 20px 16px !important;
}
.og-lightbox__prev { left: 6px; }
.og-lightbox__next { right: 6px; }

.og-lightbox__count {
	position: absolute;
	bottom: 14px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	opacity: 0.7;
	font: 14px/1 sans-serif;
}

body.og-noscroll {
	overflow: hidden;
}
