/* ═══════════════════════════════════════════════════════════════════════
   RoyalJewarLands – Public Gallery Styles
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────────────── */
.re-gallery-hero {
	position: relative;
	min-height: 320px;
	display: flex;
	align-items: center;
	overflow: hidden;
	background: var(--re-brand, #102030);
}

.rg-hero-bg {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 80% 60% at 60% 50%, rgba(200,164,107,0.18) 0%, transparent 70%),
		linear-gradient(135deg, #0c1e2c 0%, #1a3548 50%, #0d2535 100%);
	z-index: 0;
}

.rg-hero-bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E");
}

.re-gallery-hero-inner {
	position: relative;
	z-index: 1;
	padding: 80px 0 64px;
	text-align: center;
}

.re-gallery-hero-inner .re-eyebrow {
	color: var(--re-accent, #c8a46b);
	font-size: 0.8rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	margin-bottom: 0.6rem;
	font-weight: 600;
}

.re-gallery-hero-inner h1 {
	color: #fff;
	font-size: clamp(2rem, 5vw, 3.2rem);
	font-weight: 700;
	line-height: 1.15;
	margin-bottom: 0.8rem;
}

.rg-hero-sub {
	color: rgba(255,255,255,0.65);
	font-size: 1.05rem;
	max-width: 560px;
	margin: 0 auto;
	line-height: 1.65;
}

/* ── Filter Bar ─────────────────────────────────────────────────────────── */
.rg-filter-bar-wrap {
	background: #fff;
	border-bottom: 1px solid rgba(0,0,0,0.08);
	position: sticky;
	top: 0;
	z-index: 200;
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.rg-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 14px 0;
	align-items: center;
}

.rg-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	border: 1.5px solid rgba(0,0,0,0.12);
	border-radius: 999px;
	background: transparent;
	color: #555;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.22s ease;
	line-height: 1;
	white-space: nowrap;
}

.rg-filter-btn:hover {
	border-color: var(--re-accent, #c8a46b);
	color: var(--re-accent, #c8a46b);
	background: rgba(200,164,107,0.06);
}

.rg-filter-btn.is-active {
	background: var(--re-brand, #102030);
	border-color: var(--re-brand, #102030);
	color: #fff;
	box-shadow: 0 4px 12px rgba(10,32,48,0.25);
}

.rg-filter-icon { font-size: 0.9rem; line-height: 1; }

/* ── Gallery Section ─────────────────────────────────────────────────────── */
.rg-section { padding-top: 48px; padding-bottom: 80px; }

/* ── Masonry-like Grid ──────────────────────────────────────────────────── */
.rg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	grid-auto-rows: 220px;
	gap: 14px;
}

/* Span rules for visual variety */
.rg-grid .rg-item:nth-child(5n+1) {
	grid-column: span 2;
}
.rg-grid .rg-item--video {
	grid-column: span 2;
}

@media (max-width: 860px) {
	.rg-grid .rg-item:nth-child(5n+1),
	.rg-grid .rg-item--video {
		grid-column: span 1;
	}
}
@media (max-width: 560px) {
	.rg-grid {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 168px;
		gap: 8px;
	}
}

/* ── Gallery Item ────────────────────────────────────────────────────────── */
.rg-item {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	cursor: pointer;
	background: #e8eaed;
	/* Entrance animation — starts hidden */
	opacity: 0;
	transform: translateY(20px) scale(0.97);
	transition:
		opacity 480ms ease,
		transform 480ms ease,
		box-shadow 280ms ease;
	outline: none;
}

.rg-item--visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.rg-item--hidden {
	display: none;
}

.rg-item:hover,
.rg-item:focus-visible {
	box-shadow: 0 12px 36px rgba(0,0,0,0.22);
	z-index: 2;
}

.rg-item:focus-visible {
	outline: 3px solid var(--re-accent, #c8a46b);
	outline-offset: 2px;
}

/* Thumbnail */
.rg-item__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 500ms cubic-bezier(.25,.46,.45,.94);
}

.rg-item:hover .rg-item__thumb,
.rg-item:focus-visible .rg-item__thumb {
	transform: scale(1.07);
}

/* Placeholder for items without image */
.rg-item__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
	font-size: 2.5rem;
	color: #94a3b8;
}

/* Overlay */
.rg-item__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(5, 18, 28, 0.80) 0%,
		rgba(5, 18, 28, 0.20) 50%,
		transparent 100%
	);
	display: flex;
	align-items: flex-end;
	opacity: 0;
	transition: opacity 300ms ease;
}

.rg-item:hover .rg-item__overlay,
.rg-item:focus-visible .rg-item__overlay {
	opacity: 1;
}

.rg-item__overlay-inner {
	padding: 16px;
	width: 100%;
}

.rg-item__title {
	color: #fff;
	font-size: 0.88rem;
	font-weight: 600;
	margin: 0 0 6px;
	line-height: 1.3;
	text-shadow: 0 1px 4px rgba(0,0,0,0.5);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rg-item__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.rg-tag {
	background: rgba(200,164,107,0.85);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	padding: 3px 9px;
	border-radius: 999px;
	text-transform: uppercase;
}

/* Play / Zoom icon */
.rg-play-btn,
.rg-zoom-btn {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255,255,255,0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 10px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
	transition: transform 220ms ease, background 220ms ease;
}

.rg-play-btn svg,
.rg-zoom-btn svg {
	width: 20px;
	height: 20px;
	color: var(--re-brand, #102030);
}

.rg-play-btn svg { fill: var(--re-brand, #102030); }

.rg-item:hover .rg-play-btn,
.rg-item:hover .rg-zoom-btn {
	transform: scale(1.12);
	background: #fff;
}

/* Video badge */
.rg-video-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(10, 20, 30, 0.78);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 4px 10px 4px 8px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	gap: 5px;
	backdrop-filter: blur(4px);
	border: 1px solid rgba(255,255,255,0.15);
	text-transform: uppercase;
}

.rg-video-badge svg { color: #f87171; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.rg-empty-state {
	text-align: center;
	padding: 80px 24px;
	color: #888;
}

.rg-empty-icon {
	font-size: 4rem;
	margin-bottom: 16px;
	opacity: 0.5;
}

.rg-empty-state h3 {
	font-size: 1.4rem;
	color: #333;
	margin-bottom: 8px;
}

.rg-empty-state p {
	font-size: 1rem;
	max-width: 380px;
	margin: 0 auto;
}

/* ── Modal / Lightbox ────────────────────────────────────────────────────── */
.rg-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 280ms ease;
}

.rg-modal.is-active {
	opacity: 1;
}

.rg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 12, 20, 0.93);
	backdrop-filter: blur(10px);
	cursor: pointer;
}

.rg-modal__box {
	position: relative;
	z-index: 1;
	max-width: min(90vw, 1100px);
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 20px;
}

/* Media container */
.rg-modal__media {
	width: 100%;
	max-height: 70vh;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	overflow: hidden;
	background: rgba(0,0,0,0.4);
}

.rg-modal__img {
	max-width: 100%;
	max-height: 70vh;
	object-fit: contain;
	border-radius: 12px;
	animation: rgPop 280ms cubic-bezier(.34,1.56,.64,1) both;
	display: block;
}

.rg-modal__iframe,
.rg-modal__video {
	width: 100%;
	aspect-ratio: 16 / 9;
	border: none;
	border-radius: 12px;
	animation: rgPop 280ms cubic-bezier(.34,1.56,.64,1) both;
	display: block;
	max-height: 70vh;
}

@keyframes rgPop {
	from { opacity: 0; transform: scale(0.9); }
	to   { opacity: 1; transform: scale(1); }
}

/* Info bar */
.rg-modal__info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
}

.rg-modal__title {
	color: #fff;
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0;
}

.rg-modal__caption {
	color: rgba(255,255,255,0.6);
	font-size: 0.88rem;
	margin: 0;
	max-width: 600px;
}

.rg-modal__counter {
	color: rgba(255,255,255,0.4);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 4px 12px;
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 999px;
	margin-top: 4px;
}

/* Close button */
.rg-modal__close {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255,255,255,0.12);
	border: 1px solid rgba(255,255,255,0.2);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 200ms, transform 200ms;
	z-index: 10;
}

.rg-modal__close svg { width: 18px; height: 18px; }

.rg-modal__close:hover {
	background: rgba(255,255,255,0.25);
	transform: scale(1.1);
}

/* Nav arrows */
.rg-modal__nav {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.18);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 200ms, transform 200ms;
	z-index: 10;
}

.rg-modal__nav svg { width: 22px; height: 22px; }

.rg-modal__prev { left: 20px; }
.rg-modal__next { right: 20px; }

.rg-modal__nav:hover {
	background: rgba(255,255,255,0.22);
	transform: translateY(-50%) scale(1.08);
}

/* Body lock */
.rg-modal-open { overflow: hidden; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
	.rg-filter-bar {
		gap: 5px;
		padding: 10px 0;
		overflow-x: auto;
		flex-wrap: nowrap;
		/* Hide scrollbar visually */
		-ms-overflow-style: none;
		scrollbar-width: none;
	}
	.rg-filter-bar::-webkit-scrollbar { display: none; }

	.rg-modal__prev { left: 8px; }
	.rg-modal__next { right: 8px; }
	.rg-modal__nav { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
	.rg-modal__box { gap: 10px; padding: 12px; }
	.rg-modal__media { max-height: 55vh; }
	.rg-modal__img { max-height: 55vh; }
}
