/* Trình xem ảnh kiểu antd — assets/js/lightbox.js */

.tri-lb-open {
	overflow: hidden;
}

.tri-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
}

.tri-lb:not([open]) {
	display: none;
}

.tri-lb::backdrop {
	background: transparent;
}

.tri-lb__mask {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	animation: tri-lb-fade 0.2s ease;
}

.tri-lb__stage {
	position: absolute;
	inset: 56px 0 72px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: none;
	user-select: none;
}

.tri-lb__img {
	max-width: min(92vw, 1400px);
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	cursor: grab;
	transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
	will-change: transform;
	animation: tri-lb-zoom 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tri-lb.is-dragging .tri-lb__img {
	cursor: grabbing;
}

.tri-lb.is-loading .tri-lb__img {
	opacity: 0.25;
}

.tri-lb.is-loading .tri-lb__stage::after {
	content: "";
	position: absolute;
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tri-lb-spin 0.8s linear infinite;
}

.tri-lb__top {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	height: 56px;
	padding: 0 12px 0 20px;
	background: linear-gradient(rgba(0, 0, 0, 0.45), transparent);
}

.tri-lb__count {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tri-lb__cap {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-size: 14px;
	opacity: 0.85;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tri-lb__bar {
	position: absolute;
	bottom: 16px;
	left: 50%;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px 10px;
	border-radius: 100px;
	background: rgba(0, 0, 0, 0.55);
	transform: translateX(-50%);
	backdrop-filter: blur(6px);
}

.tri-lb__tool,
.tri-lb__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.tri-lb__tool {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	opacity: 0.85;
}

.tri-lb__tool:hover,
.tri-lb__tool:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	opacity: 1;
}

.tri-lb__zoom {
	min-width: 48px;
	font-size: 13px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.tri-lb__nav {
	position: absolute;
	top: 50%;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
}

.tri-lb__nav:hover,
.tri-lb__nav:focus-visible {
	background: rgba(0, 0, 0, 0.6);
}

.tri-lb__nav[hidden] {
	display: none;
}

.tri-lb__nav--prev {
	left: 16px;
}

.tri-lb__nav--next {
	right: 16px;
}

@media (max-width: 767px) {
	.tri-lb__bar {
		bottom: 10px;
		max-width: calc(100% - 20px);
		padding: 2px 6px;
	}

	.tri-lb__tool {
		width: 36px;
		height: 36px;
	}

	.tri-lb__zoom {
		display: none;
	}

	.tri-lb__nav {
		display: none;
	}
}

@keyframes tri-lb-fade {
	from {
		opacity: 0;
	}
}

@keyframes tri-lb-zoom {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
}

@keyframes tri-lb-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tri-lb__img,
	.tri-lb__mask {
		transition: none;
		animation: none;
	}
}
