/* Khối Hình ảnh – mosaic-5 + bảng ảnh toàn màn hình. Mobile trước, mốc 640px / 1024px. */

/* Lưới: mobile = ảnh lớn trên, ảnh nhỏ 2 cột bên dưới. */
.vh-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vh-gallery--single .vh-gallery__grid {
	grid-template-columns: minmax(0, 1fr);
}

.vh-gallery__tile {
	position: relative;
	min-width: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--vh-radius-media);
	background: var(--vh-color-surface);
}

.vh-gallery__tile--big {
	grid-column: 1 / -1;
	aspect-ratio: 16 / 10;
}

/* Ảnh (hoặc ô giữ chỗ) phủ kín ô, cắt theo khung. */
.vh-gallery__media {
	position: absolute;
	inset: 0;
	display: block;
}

.vh-gallery__media > *,
.vh-gallery__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border-radius: 0;
}

.vh-gallery__media img {
	object-fit: cover;
}

/* Nút trong suốt phủ cả ô: bấm mở bảng ảnh. */
.vh-gallery__btn {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: transparent;
	color: var(--vh-white);
	font: inherit;
	cursor: zoom-in;
}

/* G1: vòng đôi vẽ BÊN TRONG ô vì ô có overflow:hidden (vòng ngoài bị cắt mất):
   mép trắng 2px + vòng đậm 2px ngay trong, đủ tương phản với mọi điểm ảnh.
   Vẽ bằng ::after để nằm trên cả lớp phủ "Xem N ảnh"; outline trong suốt giữ vòng ở chế độ tương phản cao. */
.vh-gallery__btn:focus-visible {
	outline: 2px solid transparent;
	outline-offset: -4px;
}

.vh-gallery__btn:focus-visible::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
	box-shadow: inset 0 0 0 2px var(--vh-color-focus-on-deep), inset 0 0 0 4px var(--vh-color-focus);
	pointer-events: none;
}

/* Ô "Xem N ảnh": lớp phủ .70 (R12). Chữ trắng cố định (≥5,5:1 trên mọi ảnh);
   không dùng --vh-color-on-deep vì mẫu có thể đặt nó xám nhạt (Mini Gọn #CBD2D9 chỉ ~3,6:1). */
.vh-gallery__more {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.5rem;
	background: rgba(var(--vh-color-overlay) / 0.7);
	color: var(--vh-white);
	font-weight: var(--vh-fw-bold);
	font-size: var(--vh-fs-body);
	line-height: var(--vh-lh-heading);
	text-align: center;
}

/* Đủ ảnh trong lưới: nhãn nhỏ ở góc, không che ảnh cuối. */
.vh-gallery__more--pill {
	inset: auto 0.75rem 0.75rem auto;
	min-height: 48px;
	padding: 0.5rem 1rem;
	border-radius: var(--vh-radius-chip);
	font-size: var(--vh-fs-small);
}

@media (prefers-reduced-motion: no-preference) {
	.vh-gallery__media img {
		transition: transform 0.4s ease;
	}

	.vh-gallery__tile:hover .vh-gallery__media img {
		transform: scale(1.03);
	}
}

@media (min-width: 640px) {
	.vh-gallery__grid {
		gap: 0.75rem;
	}

	/* 1 lớn (2×2) + 4 nhỏ. */
	.vh-gallery--mosaic-5 .vh-gallery__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-template-rows: repeat(2, minmax(0, 1fr));
		aspect-ratio: 2 / 1;
	}

	.vh-gallery--mosaic-5 .vh-gallery__tile,
	.vh-gallery--mosaic-3 .vh-gallery__tile {
		aspect-ratio: auto;
	}

	.vh-gallery--mosaic-5 .vh-gallery__tile--big {
		grid-column: 1 / span 2;
		grid-row: 1 / span 2;
	}

	/* 1 lớn + 2 nhỏ xếp dọc bên phải. */
	.vh-gallery--mosaic-3 .vh-gallery__grid {
		grid-template-columns: 2fr 1fr;
		grid-template-rows: repeat(2, minmax(0, 1fr));
		aspect-ratio: 2 / 1;
	}

	.vh-gallery--mosaic-3 .vh-gallery__tile--big {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	.vh-gallery--single .vh-gallery__tile--big {
		aspect-ratio: 21 / 9;
	}
}

@media (min-width: 1024px) {
	.vh-gallery__more {
		font-size: var(--vh-fs-lead);
	}

	.vh-gallery__more--pill {
		font-size: var(--vh-fs-small);
	}
}

/* ---- Bảng ảnh toàn màn hình (mở bằng data-vh-sheet-open) ---- */

.vh-sheet.vh-gallery-sheet {
	inset: 0;
	max-height: none;
	padding: 0;
	border-radius: 0;
	background: var(--vh-color-deep);
}

.vh-gallery-sheet__panel {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: none;
	height: 100%;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0 0 max(1rem, env(safe-area-inset-bottom));
	border-radius: 0;
	background: var(--vh-color-deep);
	color: var(--vh-color-on-deep);
}

.vh-gallery-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--vh-header-h);
	padding: 0.5rem var(--vh-page-pad);
}

.vh-gallery-sheet__title {
	margin: 0;
	font-family: var(--vh-font-heading);
	font-size: var(--vh-fs-lead);
	font-weight: var(--vh-fw-bold);
	line-height: var(--vh-lh-heading);
	color: inherit;
}

.vh-gallery-sheet__count {
	font-weight: var(--vh-fw-body);
	color: var(--vh-color-muted-on-deep);
}

.vh-gallery-sheet__close {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--vh-color-muted-on-deep);
	border-radius: 50%;
	background: transparent;
	color: var(--vh-color-on-deep);
	cursor: pointer;
}

.vh-gallery-sheet__close:hover {
	border-color: var(--vh-color-on-deep);
}

.vh-gallery-sheet__close:focus-visible,
.vh-gallery-sheet__track:focus-visible,
.vh-gallery-sheet__carousel button:focus-visible {
	outline: 3px solid var(--vh-color-focus-on-deep);
	outline-offset: 2px;
}

.vh-gallery-sheet__carousel {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

/* Cuộn ngang scroll-snap: vuốt được cả khi JS chưa chạy. */
.vh-gallery-sheet__track {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}

.vh-gallery-sheet__slide {
	display: flex;
	flex: 0 0 100%;
	min-width: 0;
	padding: 0 var(--vh-page-pad);
	scroll-snap-align: center;
	scroll-snap-stop: always;
}

.vh-gallery-sheet__figure {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.75rem;
	min-height: 0;
	margin: 0;
}

.vh-gallery-sheet__media {
	position: relative;
	flex: 1 1 auto;
	min-height: 12rem;
}

.vh-gallery-sheet__media > * {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
}

.vh-gallery-sheet__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.vh-gallery-sheet__caption {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	font-size: var(--vh-fs-small);
	color: var(--vh-color-muted-on-deep);
}

.vh-gallery-sheet__index {
	flex: none;
	font-variant-numeric: tabular-nums;
}

/* Mũi tên trước/sau: điện thoại vuốt nên ẩn; từ 640px nằm ở lề tối hai bên ảnh. */
.vh-gallery-sheet__nav {
	display: none;
}

@media (min-width: 640px) {
	.vh-gallery-sheet__nav {
		position: absolute;
		top: 50%;
		z-index: 1;
		display: inline-grid;
		place-items: center;
		width: 48px;
		height: 48px;
		margin-top: -24px;
		padding: 0;
		border: 1px solid var(--vh-color-muted-on-deep);
		border-radius: 50%;
		background: var(--vh-color-deep);
		color: var(--vh-color-on-deep);
		cursor: pointer;
	}

	.vh-gallery-sheet__nav:hover {
		border-color: var(--vh-color-on-deep);
	}

	.vh-gallery-sheet__nav--prev {
		left: 0.5rem;
	}

	.vh-gallery-sheet__nav--next {
		right: 0.5rem;
	}

	.vh-gallery-sheet__nav[disabled],
	.vh-gallery-sheet__nav[aria-disabled="true"] {
		opacity: 0.4;
		cursor: default;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.vh-gallery-sheet__track {
		scroll-behavior: smooth;
	}
}

@media (min-width: 640px) {
	.vh-gallery-sheet__slide {
		padding: 0 4rem;
	}
}

@media (min-width: 1024px) {
	.vh-gallery-sheet__slide {
		padding: 0 calc(var(--vh-page-pad) + 3.5rem);
	}

	.vh-gallery-sheet__nav--prev {
		left: var(--vh-page-pad);
	}

	.vh-gallery-sheet__nav--next {
		right: var(--vh-page-pad);
	}

	.vh-gallery-sheet__caption {
		font-size: var(--vh-fs-body);
	}
}

/* =====================================================================
 * Thành phần chung của nhóm khối thông tin (sec-info: location, policies, faq, reviews, gallery, cta-band).
 * Đặt ở đây vì thư viện PHP chung nằm ở sections/gallery/_info-lib.php. Chỉ thêm lớp mới, không đổi luật Mini Gọn ở trên.
 * ===================================================================== */

/* Thanh tab (vh_t_in_tabs): chip cuộn ngang trên điện thoại, mỗi nút ≥ 44px. */
.vh-itabs {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
	padding: 0.25rem 0.125rem;
	overflow-x: auto;
	scrollbar-width: thin;
	scroll-snap-type: x proximity;
}

.vh-itabs__tab {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 1px solid var(--vh-color-border-strong);
	border-radius: var(--vh-radius-chip);
	background: var(--vh-color-bg);
	color: var(--vh-color-text);
	font: inherit;
	font-size: var(--vh-fs-small);
	font-weight: var(--vh-fw-medium);
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	scroll-snap-align: start;
}

.vh-itabs__tab:hover {
	border-color: var(--vh-color-primary);
	color: var(--vh-color-primary-hover);
}

.vh-itabs__tab[aria-selected="true"] {
	border-color: var(--vh-color-primary);
	background: var(--vh-color-primary);
	color: var(--vh-color-on-primary);
}

.vh-itabs__tab:focus-visible {
	outline: 3px solid var(--vh-color-focus);
	outline-offset: 2px;
}

.vh-itabs__count {
	font-weight: var(--vh-fw-body);
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

.vh-deep .vh-itabs__tab {
	border-color: var(--vh-color-muted-on-deep);
	background: transparent;
	color: var(--vh-color-on-deep);
}

.vh-deep .vh-itabs__tab:focus-visible {
	outline-color: var(--vh-color-focus-on-deep);
}

/* Có thanh tab (JS chạy): tiêu đề nhóm trùng chữ với tab chỉ còn cho trình đọc màn hình. */
.vh-js .vh-routes__origin--tabbed,
.vh-js .vh-pdl__heading--tabbed,
.vh-js .vh-faq__topic--tabbed {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Dấu "Cập nhật 10/2026" và cảnh báo đường đi. */
.vh-istamp {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0;
	color: var(--vh-color-muted);
	font-size: var(--vh-fs-small);
	font-variant-numeric: tabular-nums;
}

.vh-deep .vh-istamp {
	color: var(--vh-color-muted-on-deep);
}

.vh-iwarn {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	margin: 0;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--vh-color-low-stock);
	border-radius: var(--vh-radius-input);
	background: var(--vh-color-accent);
	color: var(--vh-color-accent-ink);
	font-size: var(--vh-fs-small);
	line-height: var(--vh-lh-body);
}

.vh-iwarn .vh-i {
	flex: none;
	margin-top: 0.125rem;
}

/* Bảng ảnh (lightbox) mở từ các biến thể mới: cùng giao diện bảng của mosaic-5 ở trên. */
[data-vh-lightbox] .vh-gallery-sheet__track:focus-visible {
	outline-offset: -3px;
}

/* ---- mosaic-5, big_tile tall: ảnh dọc bên trái, 4 ảnh so le bên phải; 3–4 ảnh thành bộ ba ---- */
@media (min-width: 640px) {
	.vh-gallery--tall.vh-gallery--mosaic-5 .vh-gallery__grid {
		grid-template-columns: 2fr 1fr 1fr;
		grid-template-rows: repeat(4, minmax(0, 1fr));
		aspect-ratio: 16 / 10;
	}

	.vh-gallery--tall.vh-gallery--mosaic-5 .vh-gallery__tile--big {
		grid-column: 1;
		grid-row: 1 / span 4;
	}

	/* So le không chừa lỗ: cột giữa cao-thấp, cột phải thấp-cao. */
	.vh-gallery--tall.vh-gallery--mosaic-5 .vh-gallery__tile:nth-child(2) {
		grid-column: 2;
		grid-row: 1 / span 3;
	}

	.vh-gallery--tall.vh-gallery--mosaic-5 .vh-gallery__tile:nth-child(3) {
		grid-column: 3;
		grid-row: 1 / span 1;
	}

	.vh-gallery--tall.vh-gallery--mosaic-5 .vh-gallery__tile:nth-child(4) {
		grid-column: 2;
		grid-row: 4 / span 1;
	}

	.vh-gallery--tall.vh-gallery--mosaic-5 .vh-gallery__tile:nth-child(5) {
		grid-column: 3;
		grid-row: 2 / span 3;
	}

	/* Bộ ba: ba ảnh dọc bằng nhau. */
	.vh-gallery--tall.vh-gallery--mosaic-3 .vh-gallery__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-rows: none;
		aspect-ratio: auto;
	}

	.vh-gallery--tall.vh-gallery--mosaic-3 .vh-gallery__tile,
	.vh-gallery--tall.vh-gallery--mosaic-3 .vh-gallery__tile--big {
		grid-column: auto;
		grid-row: auto;
		aspect-ratio: 3 / 4;
	}
}

/* ---- Ô ảnh bấm mở lightbox (strip, masonry, grid, then-and-now): nút trong suốt phủ ảnh, vòng focus đôi vẽ bên trong ---- */
.vh-strip__media,
.vh-masonry__media,
.vh-pgrid__media {
	position: relative;
	overflow: hidden;
	border-radius: var(--vh-radius-media);
	background: var(--vh-color-surface);
}

.vh-strip__img > *,
.vh-masonry__img > *,
.vh-pgrid__img > * {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	border-radius: 0;
}

.vh-strip__img img,
.vh-masonry__img img,
.vh-pgrid__img img {
	height: auto;
	object-fit: cover;
	filter: var(--vh-media-filter, none);
}

.vh-strip__btn,
.vh-masonry__btn,
.vh-pgrid__btn {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: transparent;
	cursor: zoom-in;
}

/* G1: ô có overflow:hidden nên vòng đôi vẽ bên trong: mép trắng 2px + vòng đậm 2px. */
.vh-strip__btn:focus-visible,
.vh-masonry__btn:focus-visible,
.vh-pgrid__btn:focus-visible {
	outline: 2px solid transparent;
	outline-offset: -4px;
	box-shadow: inset 0 0 0 2px var(--vh-color-focus-on-deep), inset 0 0 0 4px var(--vh-color-focus);
}

@media (prefers-reduced-motion: no-preference) {
	.vh-strip__img img,
	.vh-masonry__img img,
	.vh-pgrid__img img {
		transition: transform 0.4s ease;
	}

	.vh-strip__media:hover img,
	.vh-masonry__media:hover img,
	.vh-pgrid__media:hover img {
		transform: scale(1.03);
	}
}
