/* OAI Lightbox Gallery — standalone lightbox styles */

/* -------------------------
   Theme integration (clickable content images)
------------------------- */
.single-content .oai-igl-link,
.entry-content .oai-igl-link,
.ct-entry-content .oai-igl-link {
	display: block;
	text-decoration: none !important;
}

.single-content .gallery .oai-igl-link,
.entry-content .gallery .oai-igl-link,
.ct-entry-content .gallery .oai-igl-link,
.single-content .wp-block-gallery .oai-igl-link,
.entry-content .wp-block-gallery .oai-igl-link,
.ct-entry-content .wp-block-gallery .oai-igl-link,
.single-content .blocks-gallery-grid .oai-igl-link,
.entry-content .blocks-gallery-grid .oai-igl-link,
.ct-entry-content .blocks-gallery-grid .oai-igl-link {
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

.single-content .oai-igl-gallery--single .oai-igl-link,
.entry-content .oai-igl-gallery--single .oai-igl-link,
.ct-entry-content .oai-igl-gallery--single .oai-igl-link {
	display: inline-block;
	max-width: 100%;
}

/* -------------------------
   Lightbox overlay
------------------------- */
html.oai-igl-open,
html.oai-igl-open body {
	overflow: hidden !important;
}

body.oai-igl-open {
	position: fixed;
	width: 100%;
	left: 0;
	right: 0;
}

.oai-igl-overlay,
.oai-igl-ui,
.oai-igl-stage,
.oai-igl-imagewrap {
	position: relative;
	min-height: 0;
	height: 100%;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: translateZ(0);
	user-select: none;
	min-width: 0;
	max-width: 100%;
	max-height: 100%;
	overflow: hidden;
}

.oai-igl-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 200ms ease, visibility 0s linear 200ms;
	background: rgba(0,0,0,0.62);
	backdrop-filter: blur(6px);
}

.oai-igl-backdrop {
	position: absolute;
	inset: 0;
}

.oai-igl-overlay.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 220ms ease;
}

.oai-igl-ui {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	--oai-igl-ui-gap: 12px;
	gap: var(--oai-igl-ui-gap);
	padding: calc(12px + var(--admin-bar, 0px)) 12px 12px;
}

.oai-igl-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: #fff;
	user-select: none;
	width: 100%;
}

.oai-igl-counter {
	font-size: 14px;
	font-weight: 600;
	padding: 8px 10px;
	border-radius: 999px;
	background: rgba(0,0,0,0.45);
	backdrop-filter: blur(6px);
}

.oai-igl-actions {
	display: inline-flex;
	gap: 8px;
	align-items: center;
}

.oai-igl-btn,
.oai-igl-download {
	appearance: none;
	border: 0;
	cursor: pointer;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: rgba(0,0,0,0.45);
	backdrop-filter: blur(6px);
	text-decoration: none;
}

.oai-igl-btn svg,
.oai-igl-download svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.oai-igl-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: visible;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.oai-igl-btn:focus-visible,
.oai-igl-download:focus-visible {
	outline: 2px solid rgba(255,255,255,0.9);
	outline-offset: 2px;
}

.oai-igl-stage {
	position: relative;
	flex: 1;
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr) 52px;
	align-items: center;
	gap: 10px;
	min-height: 0;
	height: var(--oai-igl-stage-h, auto);
	max-height: none !important;
	padding: var(--oai-igl-ui-gap) 6px;
}

@media (max-width: 1024px) {
	.oai-igl-stage {
		grid-template-columns: minmax(0, 1fr);
		padding: 0;
	}
	.oai-igl-nav { display: none !important; }
}

.oai-igl-nav {
	width: 52px;
	height: 52px;
	border-radius: 999px;
	border: 0;
	cursor: pointer;
	color: #fff;
	background: rgba(0,0,0,0.45);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	user-select: none;
}

.oai-igl-nav:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

@media (hover: hover) {
	.oai-igl-nav:hover,
	.oai-igl-btn:hover,
	.oai-igl-download:hover {
		background: rgba(0,0,0,0.62);
	}
}

.oai-igl-imagewrap {
	position: relative;
	min-height: 0;
	height: 100%;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: translateZ(0);
	user-select: none;
	min-width: 0;
	max-width: 100%;
	max-height: 100%;
	overflow: visible;
}

.oai-igl-main {
	position: absolute;
	inset: 0;
	max-width: 100% !important;
	max-height: 100% !important;
	width: 100% !important;
	height: 100% !important;
	display: block;
	border-radius: 0 !important;
	object-fit: contain;
	pointer-events: auto;
	touch-action: pan-y pinch-zoom;
	-webkit-user-drag: none;
	will-change: transform, opacity;
	transition: transform 260ms ease, opacity 260ms ease;
	opacity: var(--oai-igl-img-op, 1);
	transform:
		translate3d(var(--oai-igl-img-x, 0px), var(--oai-igl-img-y, 0px), var(--oai-igl-img-z, 0px))
		rotateZ(var(--oai-igl-img-rot, 0deg))
		scale(var(--oai-igl-img-scale, 1));
}

.oai-igl-main--prev,
.oai-igl-main.is-prev {
	pointer-events: none;
}

.oai-igl-overlay.oai-igl-zoomed .oai-igl-main {
	touch-action: pan-x pan-y pinch-zoom;
}

.oai-igl-main.is-visible {
	opacity: 1;
}

/* -------------------------
   Bottom filmstrip
------------------------- */
.oai-igl-strip {
	position: relative;
	border-radius: 0;
	background: transparent;
	backdrop-filter: none;
	padding: 0;
	transition: max-height 220ms ease, opacity 220ms ease;
	max-height: 135px;
	overflow: visible;
	margin-top: 0;
}

.oai-igl-overlay.oai-igl-strip-hidden .oai-igl-strip {
	max-height: 0px;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
}

.oai-igl-fan {
	position: relative;
	height: 106px;
	width: 100%;
	margin: 0;
	padding: 0;
	touch-action: none;
	user-select: none;
	cursor: grab;
}

.oai-igl-thumb {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 62px;
	aspect-ratio: 5 / 7;
	border-radius: 0;
	overflow: hidden;
	background: transparent !important;
	-webkit-appearance: none;
	appearance: none;
	padding: 0;
	cursor: pointer;
	border: 1px solid rgba(255,255,255,0.85);
	outline: 0;
	box-shadow: none;
	transform-origin: center center;
	will-change: transform, opacity;
	backface-visibility: hidden;
	transform-style: preserve-3d;
	transition: none;
	user-select: none;
}

.oai-igl-thumb.is-loading {
	background: transparent !important;
}

.oai-igl-thumb.is-loading img {
	opacity: 0 !important;
}

.oai-igl-thumb.is-empty {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	background: transparent !important;
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
}

.oai-igl-thumb:focus,
.oai-igl-thumb:focus-visible {
	outline: none;
	box-shadow: none;
}

.oai-igl-thumb img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
	pointer-events: none;
	backface-visibility: hidden;
	transform: translateZ(0);
	opacity: 1 !important;
	visibility: visible !important;
	border-radius: 0 !important;
}

.oai-igl-thumb.is-active {
	outline: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

@media (max-width: 690px) {
	.oai-igl-thumb { width: 58px; }
}

@media (max-width: 1024px) {
	.oai-igl-ui { padding-left: 0; padding-right: 0; }
	.oai-igl-topbar { padding-left: 12px; padding-right: 12px; }
	.oai-igl-strip { padding-left: 12px; padding-right: 12px; }
}

@media (min-width: 1025px) {
	.oai-igl-strip { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.oai-igl-overlay,
	.oai-igl-main,
	.oai-igl-strip,
	.oai-igl-thumb {
		transition: none !important;
	}
}
