/* =========================================================
   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;
}
