/* =========================================================
   Luxury Gallery — Frontend Styles
   Palette: burgundy #962C1F, deep burgundy #6F1F17, warm ink #241816, ivory #FBF7F4
   Font: Plus Jakarta Sans
   ========================================================= */

.luxgal-wrap {
	--luxgal-gold: #962C1F;
	--luxgal-gold-soft: #D48679;
	--luxgal-gold-deep: #6F1F17;
	--luxgal-ink: #241816;
	--luxgal-charcoal: #321A17;
	--luxgal-ivory: #FBF7F4;
	--luxgal-line: rgba(150, 44, 31, 0.30);

	--luxgal-per-row: 8;

	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	max-width: 1280px;
	margin: 0 auto;
	padding: 64px 24px;
	box-sizing: border-box;
	color: var(--luxgal-ink);
}

.luxgal-wrap *,
.luxgal-wrap *::before,
.luxgal-wrap *::after {
	box-sizing: border-box;
}

/* ---------------- Header ---------------- */

.luxgal-header {
	position: relative;
	max-width: 860px;
	margin: 0 auto 46px;
	padding: 27px 34px 29px;
	text-align: left;
	background: linear-gradient(135deg, rgba(150, 44, 31, 0.055), rgba(255,255,255,0.96) 56%, rgba(150,44,31,0.025));
	border: 1px solid rgba(150, 44, 31, 0.13);
	border-left: 4px solid var(--luxgal-gold);
	border-radius: 14px;
	overflow: hidden;
}

.luxgal-header::before {
	content: "";
	position: absolute;
	top: -54px;
	right: -36px;
	width: 150px;
	height: 150px;
	border: 1px solid rgba(150,44,31,0.08);
	border-radius: 50%;
}

.luxgal-header::after {
	content: "";
	position: absolute;
	right: 31px;
	bottom: 24px;
	width: 72px;
	height: 2px;
	background: linear-gradient(90deg, rgba(150,44,31,0), var(--luxgal-gold));
}

.luxgal-header-eyebrow {
	display: inline-flex;
	align-items: center;
	width: 48px;
	height: 3px;
	margin: 0 0 15px;
	background: linear-gradient(90deg, var(--luxgal-gold), #C7675B);
	border-radius: 99px;
	position: relative;
}

.luxgal-header-eyebrow::before {
	content: "";
	position: absolute;
	right: -9px;
	top: 50%;
	width: 6px;
	height: 6px;
	background: var(--luxgal-gold);
	border: 2px solid #fff;
	border-radius: 50%;
	transform: translateY(-50%);
	box-shadow: 0 0 0 1px rgba(150,44,31,.18);
}

.luxgal-header-title {
	position: relative;
	z-index: 2;
	max-width: 720px;
	font-family: 'Plus Jakarta Sans', sans-serif;
	font-weight: 800;
	font-size: clamp(28px, 3.1vw, 43px);
	line-height: 1.15;
	letter-spacing: -0.035em;
	text-transform: none;
	margin: 0 0 11px;
	color: var(--luxgal-ink);
}

.luxgal-header-title::after {
	content: ".";
	color: var(--luxgal-gold);
	margin-left: 2px;
}

.luxgal-header-subtitle {
	position: relative;
	z-index: 2;
	max-width: 690px;
	margin: 0;
	font-weight: 500;
	font-size: 14.5px;
	line-height: 1.75;
	letter-spacing: 0;
	color: #746762;
}

/* ---------------- Grid ---------------- */

.luxgal-grid {
	display: grid;
	grid-template-columns: repeat(var(--luxgal-per-row), 1fr);
	gap: 10px;
}

.luxgal-item {
	margin: 0;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 4px;
	background: var(--luxgal-charcoal);
}

.luxgal-item::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid transparent;
	border-radius: 4px;
	transition: border-color 0.35s ease;
	pointer-events: none;
}

.luxgal-item:hover::after {
	border-color: var(--luxgal-gold);
}

.luxgal-item-btn {
	all: unset;
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
	position: relative;
}

.luxgal-item-btn img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
	filter: saturate(0.96) brightness(0.97);
}

.luxgal-item:hover .luxgal-item-btn img {
	transform: scale(1.08);
	filter: saturate(1.05) brightness(1);
}

.luxgal-item-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(180deg, rgba(36, 24, 22, 0) 40%, rgba(36, 24, 22, 0.58) 100%);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.luxgal-item:hover .luxgal-item-overlay {
	opacity: 1;
}

.luxgal-item-overlay i {
	color: var(--luxgal-gold-soft);
	font-size: 18px;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--luxgal-gold);
	border-radius: 50%;
	background: rgba(36, 24, 22, 0.48);
	transform: translateY(6px);
	transition: transform 0.35s ease;
}

.luxgal-item:hover .luxgal-item-overlay i {
	transform: translateY(0);
}

/* Ẩn/hiện theo ngưỡng riêng cho desktop và mobile.
   Mặc định (>768px) áp dụng ngưỡng desktop; trong media query mobile
   ngưỡng desktop được bỏ qua và ngưỡng mobile được áp dụng thay. */
.luxgal-item.luxgal-hide-desktop {
	display: none;
}

.luxgal-wrap.is-expanded .luxgal-item.luxgal-hide-desktop,
.luxgal-wrap.is-expanded .luxgal-item.luxgal-hide-mobile {
	display: block;
	animation: luxgal-fade-in 0.5s ease both;
}

@keyframes luxgal-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------------- Xem thêm ---------------- */

.luxgal-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 36px;
}

.luxgal-more-btn {
	all: unset;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 32px;
	border: 1px solid var(--luxgal-gold);
	border-radius: 2px;
	color: var(--luxgal-gold-deep);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	transition: background 0.35s ease, color 0.35s ease;
}

.luxgal-more-btn:hover {
	background: var(--luxgal-gold);
	color: #ffffff;
}

.luxgal-more-btn i {
	font-size: 11px;
	transition: transform 0.35s ease;
}

.luxgal-more-btn:hover i {
	transform: translateY(2px);
}

.luxgal-label-less {
	display: none;
}

.luxgal-wrap.is-expanded .luxgal-label-more {
	display: none;
}

.luxgal-wrap.is-expanded .luxgal-label-less {
	display: inline;
}

.luxgal-wrap.is-expanded .luxgal-more-icon {
	transform: rotate(180deg);
}

.luxgal-wrap.is-expanded .luxgal-more-btn:hover i {
	transform: rotate(180deg) translateY(2px);
}

/* ---------------- Lightbox ---------------- */

.luxgal-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.luxgal-lightbox.is-open {
	visibility: visible;
	opacity: 1;
}

.luxgal-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, #321C19 0%, #160C0A 100%);
}

.luxgal-lightbox-inner {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.luxgal-lightbox-topbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	z-index: 5;
	font-family: 'Plus Jakarta Sans', sans-serif;
}

.luxgal-lightbox-counter {
	color: var(--luxgal-gold-soft);
	font-size: 13px;
	letter-spacing: 0.08em;
	border: 1px solid var(--luxgal-line);
	padding: 6px 14px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.03);
}

.luxgal-lightbox-actions {
	display: flex;
	gap: 10px;
}

.luxgal-lightbox-zoom,
.luxgal-lightbox-close {
	all: unset;
	cursor: pointer;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--luxgal-line);
	border-radius: 50%;
	color: var(--luxgal-gold-soft);
	font-size: 15px;
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.luxgal-lightbox-zoom:hover,
.luxgal-lightbox-close:hover {
	background: var(--luxgal-gold);
	color: #ffffff;
	border-color: var(--luxgal-gold);
}

.luxgal-lightbox-zoom.is-zoomed {
	background: var(--luxgal-gold);
	color: #ffffff;
}

.luxgal-lightbox-stage {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 88px 90px;
	overflow: hidden;
}

.luxgal-lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border: 1px solid var(--luxgal-line);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
	transition: transform 0.25s ease, opacity 0.3s ease;
	cursor: zoom-in;
	user-select: none;
	opacity: 0;
	transform: scale(0.97);
}

.luxgal-lightbox-image.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.luxgal-lightbox-image.is-zoomed {
	cursor: grab;
	transform: scale(1.9);
}

.luxgal-lightbox-image.is-zoomed.is-dragging {
	cursor: grabbing;
	transition: none;
}

.luxgal-lightbox-nav {
	all: unset;
	cursor: pointer;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--luxgal-line);
	border-radius: 50%;
	color: var(--luxgal-gold-soft);
	font-size: 16px;
	background: rgba(36, 24, 22, 0.38);
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
	z-index: 5;
}

.luxgal-lightbox-nav:hover {
	background: var(--luxgal-gold);
	color: #ffffff;
	border-color: var(--luxgal-gold);
}

.luxgal-lightbox-prev {
	left: 24px;
}

.luxgal-lightbox-next {
	right: 24px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
	.luxgal-grid {
		grid-template-columns: repeat(min(6, var(--luxgal-per-row)), 1fr);
	}
}

@media (max-width: 768px) {
	.luxgal-wrap {
		padding: 44px 16px;
	}
	.luxgal-header {
		margin-bottom: 30px;
		padding: 22px 21px 23px;
		border-left-width: 3px;
		border-radius: 11px;
	}
	.luxgal-header-title {
		font-size: clamp(25px, 7vw, 33px);
	}
	.luxgal-header-subtitle {
		font-size: 13px;
		line-height: 1.65;
	}
	.luxgal-header::after {
		display: none;
	}
	.luxgal-grid {
		grid-template-columns: repeat(var(--luxgal-per-row-mobile, 3), 1fr);
		gap: 6px;
	}

	/* Trên mobile: ngưỡng desktop bị bỏ qua (hiện lại), ngưỡng mobile được áp dụng. */
	.luxgal-item.luxgal-hide-desktop {
		display: block;
	}
	.luxgal-item.luxgal-hide-mobile {
		display: none;
	}
	.luxgal-wrap.is-expanded .luxgal-item.luxgal-hide-mobile {
		display: block;
	}

	.luxgal-lightbox-stage {
		padding: 76px 20px;
	}
	.luxgal-lightbox-nav {
		width: 42px;
		height: 42px;
	}
	.luxgal-lightbox-prev {
		left: 8px;
	}
	.luxgal-lightbox-next {
		right: 8px;
	}
}

@media (max-width: 480px) {
	.luxgal-header {
		padding: 19px 17px 20px;
	}
	.luxgal-header-title {
		font-size: 25px;
	}
	.luxgal-lightbox-topbar {
		padding: 14px;
	}
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.luxgal-item-btn img,
	.luxgal-lightbox-image,
	.luxgal-more-btn i {
		transition: none !important;
	}
}

/* Keyboard focus visibility */
.luxgal-item-btn:focus-visible,
.luxgal-more-btn:focus-visible,
.luxgal-lightbox-nav:focus-visible,
.luxgal-lightbox-zoom:focus-visible,
.luxgal-lightbox-close:focus-visible {
	outline: 2px solid var(--luxgal-gold);
	outline-offset: 2px;
}

body.luxgal-noscroll {
	overflow: hidden !important;
}
