/* =========================================================
   Luxury Gallery — Frontend Styles
   Palette: gold #C9A43B, ink #16130D, charcoal #221D14, ivory #F7F3E8
   Font: Plus Jakarta Sans
   ========================================================= */

.luxgal-wrap {
	--luxgal-gold: #C9A43B;
	--luxgal-gold-soft: #E4C876;
	--luxgal-gold-deep: #9C7A20;
	--luxgal-ink: #16130D;
	--luxgal-charcoal: #221D14;
	--luxgal-ivory: #F8F5EC;
	--luxgal-line: rgba(201, 164, 59, 0.35);

	--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 {
	text-align: center;
	margin: 0 0 44px;
}

.luxgal-header-eyebrow {
	display: inline-block;
	width: 64px;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--luxgal-gold), transparent);
	margin-bottom: 18px;
	position: relative;
}

.luxgal-header-eyebrow::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 6px;
	height: 6px;
	background: var(--luxgal-gold);
	border-radius: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
}

.luxgal-header-title {
	font-family: 'Plus Jakarta Sans', sans-serif;
	font-weight: 700;
	font-size: clamp(26px, 3.2vw, 40px);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin: 0 0 12px;
	color: var(--luxgal-ink);
}

.luxgal-header-subtitle {
	font-weight: 400;
	font-size: 15px;
	letter-spacing: 0.02em;
	color: #6b5f45;
	max-width: 560px;
	margin: 0 auto;
	line-height: 1.7;
}

/* ---------------- 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(22, 19, 13, 0) 40%, rgba(22, 19, 13, 0.55) 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(22, 19, 13, 0.45);
	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: var(--luxgal-ink);
}

.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, #241f15 0%, #100d08 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: var(--luxgal-ink);
	border-color: var(--luxgal-gold);
}

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

.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(22, 19, 13, 0.35);
	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: var(--luxgal-ink);
	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-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-title {
		font-size: 22px;
	}
	.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;
}

/* Version 1.2: refined corners and immersive lightbox */
.luxgal-item,.luxgal-item::after{border-radius:8px}
.luxgal-item-btn:focus-visible{outline:3px solid var(--luxgal-gold);outline-offset:-3px}
.luxgal-more-btn{border-radius:8px;letter-spacing:.035em;text-transform:none;padding:12px 24px}
.luxgal-lightbox{z-index:999999;background:#101010}
.luxgal-lightbox-backdrop{background:rgba(10,10,11,.97);backdrop-filter:blur(12px)}
.luxgal-lightbox-inner{isolation:isolate}
.luxgal-lightbox-topbar{padding:14px 24px;background:linear-gradient(to bottom,rgba(0,0,0,.65),transparent);color:#fff}
.luxgal-lightbox-counter{border:1px solid rgba(255,255,255,.22);border-radius:7px;background:rgba(255,255,255,.09);color:#fff;font-variant-numeric:tabular-nums}
.luxgal-lightbox-zoom,.luxgal-lightbox-close,.luxgal-lightbox-nav{border-radius:8px;border:1px solid rgba(255,255,255,.24);background:rgba(35,35,35,.65);color:#fff}
.luxgal-lightbox-zoom:hover,.luxgal-lightbox-close:hover,.luxgal-lightbox-nav:hover{background:#d8b669;color:#1a1711;border-color:#d8b669}
.luxgal-lightbox-stage{padding:74px 85px 144px;touch-action:pan-y}
.luxgal-lightbox-image{max-width:100%;max-height:100%;width:auto;height:auto;border:0;border-radius:7px;box-shadow:0 20px 70px rgba(0,0,0,.55);object-fit:contain;transform:scale(.985)}
.luxgal-lightbox-image.is-loaded{transform:scale(1)}
.luxgal-lightbox-image.is-zoomed{transform:scale(1.9);touch-action:none}
.luxgal-lightbox-bottom{position:absolute;bottom:0;left:0;right:0;z-index:6;display:flex;flex-direction:column;align-items:center;gap:9px;padding:8px 20px 15px;background:linear-gradient(to top,rgba(0,0,0,.88),rgba(0,0,0,.15))}
.luxgal-lightbox-caption{max-width:min(800px,90vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#eee;font-size:12px;line-height:1.5}
.luxgal-lightbox-thumbs{display:flex;align-items:center;gap:7px;max-width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;padding:3px 4px 4px}
.luxgal-lightbox-thumb{all:unset;box-sizing:border-box;display:block;flex:0 0 49px;width:49px;height:49px;overflow:hidden;border:2px solid transparent;border-radius:6px;opacity:.56;cursor:pointer;transition:opacity .2s,border-color .2s}
.luxgal-lightbox-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.luxgal-lightbox-thumb.is-active,.luxgal-lightbox-thumb:hover{border-color:#dfbf78;opacity:1}
.luxgal-lightbox-thumb:focus-visible{outline:2px solid #fff;outline-offset:2px}
.luxgal-lightbox-loading{display:none;position:absolute;width:28px;height:28px;border:3px solid rgba(255,255,255,.18);border-top-color:#dfbf78;border-radius:50%;animation:luxgal-spin .8s linear infinite}
.luxgal-lightbox.is-loading .luxgal-lightbox-loading{display:block}
@keyframes luxgal-spin{to{transform:rotate(360deg)}}
body.luxgal-noscroll{overflow:hidden!important}
@media(max-width:768px){.luxgal-item,.luxgal-item::after{border-radius:6px}.luxgal-lightbox-stage{padding:75px 13px 133px}.luxgal-lightbox-topbar{padding:12px}.luxgal-lightbox-nav{width:37px;height:43px;top:48%;background:rgba(15,15,15,.65)}.luxgal-lightbox-prev{left:5px}.luxgal-lightbox-next{right:5px}.luxgal-lightbox-thumb{flex-basis:43px;width:43px;height:43px}.luxgal-lightbox-bottom{padding:8px 9px 10px}}
@media(prefers-reduced-motion:reduce){.luxgal-lightbox-loading{animation:none}}

/* Hide the thumbnail strip scrollbar while keeping swipe, wheel/trackpad and automatic active-thumbnail scrolling. */
.luxgal-lightbox-thumbs::-webkit-scrollbar{display:none;width:0;height:0}
