/* 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--beau-sans); /* quy chuẩn chữ — trước rơi về system-ui (không có preset 'body') */
}

.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: var(--tri-fw-bold);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tri-lb__cap {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-size: var(--tri-fs-6);
	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: var(--tri-fs-7);
	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;
	}
}

/* ── Chế độ album (09/10/2026 — thư viện ảnh khối Giới thiệu trang chủ) ──────────────
   Khung ảnh CỐ ĐỊNH 16:10 (ảnh dọc / ngang đều nằm gọn trong cùng một khung, không nhảy),
   dải ảnh nhỏ dưới cùng cuộn ngang (vuốt / lăn), ảnh đang xem viền cam. Ẩn thanh xoay / lật. */
.tri-lb--album .tri-lb__mask {
	background: var(--wp--preset--color--navy-active, #0a1a3f);
	background: color-mix(in srgb, var(--wp--preset--color--navy-active, #0a1a3f) 92%, transparent);
	backdrop-filter: blur(6px);
}

.tri-lb--album .tri-lb__bar {
	display: none;
}

.tri-lb--album .tri-lb__stage {
	inset: 56px 0 128px;
	padding: 0 72px;
}

.tri-lb--album .tri-lb__img {
	width: min(100%, 1120px, calc((100vh - 200px) * 1.6));
	height: auto;
	max-width: none;
	max-height: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover; /* lấp kín khung, không chừa viền trống (user 09/10/2026) */
	border-radius: 18px;
	background: transparent;
	background: color-mix(in srgb, var(--wp--preset--color--white) 6%, transparent);
	animation: tri-lb-album 0.35s ease;
}

.tri-lb--album.is-loading .tri-lb__img {
	opacity: 0.35;
}

.tri-lb__thumbs {
	position: absolute;
	right: 0;
	bottom: 18px;
	left: 0;
	display: flex;
	gap: 10px;
	width: max-content;
	max-width: min(100% - 32px, 1120px);
	margin-inline: auto;
	padding: 6px 4px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.tri-lb__thumbs::-webkit-scrollbar {
	display: none;
}

.tri-lb__thumbs[hidden] {
	display: none;
}

.tri-lb__thumb {
	flex: 0 0 auto;
	width: 104px;
	height: 68px;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 12px;
	background: transparent;
	background: color-mix(in srgb, var(--wp--preset--color--white) 10%, transparent);
	opacity: 0.55;
	cursor: pointer;
	scroll-snap-align: center;
	transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tri-lb__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tri-lb__thumb:hover,
.tri-lb__thumb:focus-visible {
	opacity: 0.9;
	transform: translateY(-2px);
}

.tri-lb__thumb.is-on {
	border-color: var(--wp--preset--color--orange);
	opacity: 1;
}

@keyframes tri-lb-album {
	from {
		opacity: 0;
		transform: scale(0.98);
	}
}

@media (max-width: 767px) {
	.tri-lb--album .tri-lb__stage {
		inset: 56px 0 104px;
		padding: 0 12px;
	}

	.tri-lb__thumbs {
		bottom: 14px;
		gap: 8px;
	}

	.tri-lb__thumb {
		width: 76px;
		height: 52px;
		border-radius: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tri-lb--album .tri-lb__img,
	.tri-lb__thumb {
		transition: none;
		animation: none;
	}
}
