/* Khối Phòng nổi bật – magazine-index, kèm thẻ kiểu tạp chí (parts/room-card-index.php, cả trang /phong/ của mẫu boutique).
 * Khối ảnh 4:5 lệch nhau, mục lục số nghiêng, thông số chữ đơn cách (--vh-font-accent), chuyển Mục lục / Lưới,
 * ảnh nổi theo con trỏ trên máy tính. Không đặt chữ lên ảnh. Mobile trước, mốc 640px / 1024px. */

.vh-mi {
	position: relative;
}

/* ---- Khối nổi bật ---- */
.vh-mi__blocks {
	display: grid;
	gap: clamp(32px, 5vw, 48px) var(--vh-card-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.vh-mi__blocks--n2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: clamp(24px, 4vw, 64px);
	}
}

@media (min-width: 1024px) {
	.vh-mi__blocks--offset > .vh-mi__block:nth-child(2) {
		margin-top: 120px;
	}

	.vh-mi__blocks--n1 .vh-rc-index--block {
		display: grid;
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		align-items: end;
		gap: clamp(24px, 4vw, 64px);
	}
}

.vh-rc-index {
	position: relative;
	min-width: 0;
	color: var(--vh-color-text);
}

.vh-rc-index--block .vh-room-card__frame {
	aspect-ratio: 4 / 5;
	border-radius: var(--vh-radius-media);
}

.vh-rc-index--block .vh-rc-index__body {
	display: grid;
	gap: 0.5rem;
	padding-top: 1rem;
}

.vh-rc-index--block .vh-room-card__pager {
	padding-inline: 0;
}

.vh-rc-index__name {
	margin: 0;
	color: var(--vh-color-text);
	font-family: var(--vh-font-heading);
	font-size: var(--vh-fs-h3);
	font-weight: var(--vh-fw-heading);
	font-variation-settings: var(--vh-heading-variation, normal);
	line-height: var(--vh-lh-heading);
	overflow-wrap: anywhere;
}

.vh-rc-index--block .vh-rc-index__name {
	font-size: var(--vh-fs-h2);
}

.vh-rc-index__num {
	margin-right: 0.3em;
	color: var(--vh-color-accent-ink);
	font-family: var(--vh-font-heading);
	font-style: italic;
	font-weight: var(--vh-fw-body);
	font-variant-numeric: tabular-nums;
}

.vh-rc-index__specs,
.vh-rc-index__art {
	margin: 0;
	color: var(--vh-color-muted);
	font-family: var(--vh-font-accent, var(--vh-font-body));
	font-size: 0.8125rem;
	line-height: 1.5;
	letter-spacing: 0.02em;
}

.vh-rc-index__art-label {
	display: block;
	color: var(--vh-color-text);
	font-weight: var(--vh-fw-bold);
	letter-spacing: var(--vh-ls-label, 0.06em);
	text-transform: var(--vh-label-transform, uppercase);
	line-height: 1.5;
}

.vh-rc-index__foot {
	display: grid;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

.vh-rc-index__price {
	margin: 0;
}

/* Phòng hết ngày khách chọn: gạch tên, vẫn giữ trong danh sách (xếp cuối). */
.vh-rc-index.is-sold-out .vh-rc-index__name a {
	text-decoration: line-through;
}

/* ---- Mục lục ---- */
.vh-mi__index {
	margin-top: clamp(40px, 6vw, 88px);
}

.vh-mi__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--vh-color-text);
}

.vh-mi__title {
	margin: 0;
	color: var(--vh-color-text);
	font-family: var(--vh-font-accent, var(--vh-font-ui, var(--vh-font-body)));
	font-size: var(--vh-fs-small);
	font-weight: var(--vh-fw-bold);
	line-height: var(--vh-lh-label, 1.45);
	letter-spacing: var(--vh-ls-label, 0.08em);
	text-transform: var(--vh-label-transform, uppercase);
}

.vh-mi__toggle {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--vh-color-border-strong);
	border-radius: var(--vh-radius-chip);
}

.vh-mi__view {
	min-height: 40px;
	padding: 0.375rem 0.875rem;
	border: 0;
	border-radius: var(--vh-radius-chip);
	background: transparent;
	color: var(--vh-color-text);
	font: inherit;
	font-family: var(--vh-font-ui, var(--vh-font-body));
	font-size: var(--vh-fs-small);
	font-weight: var(--vh-fw-medium);
	cursor: pointer;
}

.vh-mi__view[aria-pressed="true"] {
	background: var(--vh-color-text);
	color: var(--vh-color-bg);
}

.vh-mi__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vh-mi__item {
	border-bottom: 1px solid var(--vh-color-border);
}

/* Dòng mục lục, điện thoại: số | ảnh 72px | tên + thông số, giá + đặt phòng ở hàng dưới. */
.vh-rc-index--line {
	display: grid;
	grid-template-areas:
		"num thumb body"
		"num thumb end";
	grid-template-columns: 2.25rem 72px minmax(0, 1fr);
	align-items: start;
	gap: 0.375rem 0.75rem;
	padding: 1rem 0;
}

.vh-rc-index--line .vh-rc-index__num {
	grid-area: num;
	font-size: 1.25rem;
	line-height: 1.3;
	white-space: nowrap;
}

.vh-rc-index__thumb {
	grid-area: thumb;
	width: 72px;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--vh-radius-media);
	background: var(--vh-color-surface);
}

.vh-rc-index__thumb > * {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	aspect-ratio: auto;
	object-fit: cover;
}

.vh-rc-index__thumb > .vh-ph {
	display: flex;
	padding: 0.375rem;
	box-shadow: none;
}

.vh-rc-index__thumb .vh-ph__type {
	font-size: 0.75rem;
	line-height: 1.3;
}

/* Ô 72px không đủ chỗ cho nhãn; ở chế độ Lưới nhãn hiện lại. */
.vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index__thumb .vh-ph__tag {
	display: none;
}

.vh-rc-index--line .vh-rc-index__body {
	display: grid;
	grid-area: body;
	gap: 0.25rem;
	min-width: 0;
}

.vh-rc-index--line .vh-rc-index__name {
	font-size: 1.25rem;
}

.vh-rc-index__end {
	display: flex;
	flex-wrap: wrap;
	grid-area: end;
	align-items: center;
	gap: 0.25rem 1rem;
}

.vh-rc-index__stock {
	margin: 0;
}

.vh-rc-index__arrow {
	display: none;
	color: var(--vh-color-text);
}

/* Cả dòng bấm được nhờ link tên phủ kín; "Đặt phòng này" nằm trên lớp phủ. */
.vh-rc-index__link {
	color: inherit;
	text-decoration: none;
}

.vh-rc-index__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.vh-rc-index--line:hover .vh-rc-index__link {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.vh-rc-index__book {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--vh-color-text);
	font-size: var(--vh-fs-small);
	font-weight: var(--vh-fw-medium);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

.vh-rc-index__book:hover {
	color: var(--vh-color-primary);
}

/* Vòng tiêu điểm bao cả dòng (trình duyệt hỗ trợ :has), không thì vòng quanh tên như thường. */
@supports selector(:has(a)) {
	.vh-rc-index__link:focus-visible {
		outline: none;
	}

	.vh-rc-index--line:has(.vh-rc-index__link:focus-visible) {
		outline: 3px solid var(--vh-color-focus);
		outline-offset: 2px;
	}
}

/* ---- Máy tính, chế độ Mục lục: dòng một hàng, số lớn, mũi tên; ảnh nhỏ nhường chỗ cho ảnh nổi theo con trỏ ---- */
@media (min-width: 1024px) {
	.vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index--line {
		grid-template-areas: "num thumb body end arrow";
		grid-template-columns: 4rem 72px minmax(0, 1fr) auto 32px;
		align-items: center;
		gap: 0 1.5rem;
		padding: 1.25rem 0;
	}

	.vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index__num {
		font-size: 2rem;
	}

	.vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index__name {
		font-size: var(--vh-fs-h2);
	}

	.vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index__end {
		justify-content: flex-end;
		text-align: right;
	}

	.vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index__arrow {
		display: block;
		grid-area: arrow;
	}
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
	.vh-js .vh-mi[data-vh-mi-hover] .vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index--line {
		grid-template-areas: "num body end arrow";
		grid-template-columns: 4rem minmax(0, 1fr) auto 32px;
	}

	.vh-js .vh-mi[data-vh-mi-hover] .vh-mi__list[data-vh-mi-mode="list"] .vh-rc-index__thumb {
		display: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.vh-rc-index__arrow {
		transition: transform 0.2s ease;
	}

	.vh-rc-index--line:hover .vh-rc-index__arrow {
		transform: translateX(4px);
	}
}

/* ---- Chế độ Lưới: ô ảnh 4:5, tên nằm trên dải nền dưới ảnh ---- */
.vh-mi__list[data-vh-mi-mode="grid"] {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem var(--vh-card-gap);
	padding-top: 1.5rem;
}

@media (min-width: 1024px) {
	.vh-mi__list[data-vh-mi-mode="grid"] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-mi__item {
	border-bottom: 0;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index--line {
	grid-template-areas:
		"thumb"
		"num"
		"body"
		"end";
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	gap: 0;
	height: 100%;
	padding: 0;
	background: var(--vh-color-card);
}

/* Ô lưới hẹp: thông số nhỏ lại, nhãn tác phẩm để dành cho chế độ Mục lục. */
.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__specs {
	font-size: 0.75rem;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__art {
	display: none;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__thumb {
	width: 100%;
	border-radius: var(--vh-radius-media) var(--vh-radius-media) 0 0;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__thumb .vh-ph__type {
	font-size: clamp(1rem, 0.8rem + 1vw, 1.5rem);
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__num {
	padding: 0.75rem 0.75rem 0;
	font-size: 1rem;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__body,
.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__end {
	padding: 0.25rem 0.75rem 0;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__end {
	padding-bottom: 0.5rem;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__name {
	font-size: 1.125rem;
}

.vh-mi__list[data-vh-mi-mode="grid"] .vh-rc-index__arrow {
	display: none;
}

.vh-mi__note {
	margin-top: 1rem;
}

/* ---- Ảnh nổi theo con trỏ (rooms.js tạo, aria-hidden, không bắt chuột) ---- */
.vh-mi__float {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 5;
	width: clamp(220px, 22vw, 320px);
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--vh-radius-media);
	box-shadow: var(--vh-shadow-panel, var(--vh-shadow-card));
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

.vh-mi__float img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: var(--vh-color-surface);
}

.vh-mi__float.is-on {
	visibility: visible;
	opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
	.vh-mi__float {
		transition: opacity 0.15s ease, visibility 0.15s ease;
	}
}
