/**
 * Aeterna Tower 360° Compass Gallery Stylesheet
 * Ultra-modern luxury architectural UI (Dark Mode, Champagne Gold, Glassmorphism & Bento Grid)
 */

.atg-showcase-wrapper {
	--atg-bg-main: #0c0d10;
	--atg-bg-sidebar: #101217;
	--atg-gold: #dca85e;
	--atg-gold-light: #f6d69d;
	--atg-text-light: #f2ede4;
	--atg-text-muted: rgba(242, 237, 228, 0.58);
	--atg-border-subtle: rgba(220, 168, 94, 0.18);
	--atg-bento-height: 680px;

	position: relative;
	width: 100%;
	background-color: var(--atg-bg-main);
	color: var(--atg-text-light);
	border: 1px solid var(--atg-border-subtle);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Vazirmatn", "IRANSans", Tahoma, sans-serif;
	box-sizing: border-box;
	direction: ltr; /* حفظ ساختار دقیق قطب‌نما و مختصات؛ متون فارسی به‌طور خودکار پشتیبانی می‌شوند */
}

.atg-showcase-wrapper *,
.atg-showcase-wrapper *::before,
.atg-showcase-wrapper *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   ۱. نوار هدر بالای گالری (Top Bar)
   ========================================================================== */
.atg-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding: 18px 28px;
	background: linear-gradient(180deg, rgba(22, 25, 32, 0.92) 0%, rgba(12, 13, 16, 0.92) 100%);
	border-bottom: 1px solid var(--atg-border-subtle);
}

.atg-topbar-left {
	display: flex;
	align-items: center;
	gap: 18px;
}

.atg-brand-block {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.atg-brand-name {
	font-size: 19px;
	font-weight: 500;
	letter-spacing: 0.22em;
	color: var(--atg-gold-light);
	text-transform: uppercase;
}

.atg-brand-sub {
	font-size: 9px;
	letter-spacing: 0.36em;
	color: var(--atg-text-muted);
	margin-top: 2px;
	text-transform: uppercase;
}

.atg-topbar-divider {
	width: 1px;
	height: 24px;
	background: var(--atg-border-subtle);
}

.atg-breadcrumb {
	font-size: 12px;
	letter-spacing: 0.14em;
	color: var(--atg-gold);
	text-transform: uppercase;
}

.atg-topbar-right {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}

.atg-quick-dir-pills {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.03);
	padding: 4px;
	border-radius: 8px;
	border: 1px solid rgba(220, 168, 94, 0.14);
}

.atg-quick-pill {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--atg-text-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	padding: 5px 9px;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.25s ease;
}

.atg-quick-pill:hover {
	color: var(--atg-gold-light);
	background: rgba(220, 168, 94, 0.1);
}

.atg-quick-pill.is-active {
	background: linear-gradient(135deg, var(--atg-gold-light) 0%, var(--atg-gold) 100%);
	color: #121316;
	box-shadow: 0 2px 10px rgba(220, 168, 94, 0.35);
}

.atg-inquire-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 20px;
	background: linear-gradient(135deg, var(--atg-gold-light) 0%, var(--atg-gold) 100%);
	color: #111215 !important;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-decoration: none !important;
	border-radius: 6px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	box-shadow: 0 4px 15px rgba(220, 168, 94, 0.28);
}

.atg-inquire-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 22px rgba(220, 168, 94, 0.45);
}

/* ==========================================================================
   ۲. ساختار دو ستونه اصلی (Split-Screen Body)
   ========================================================================== */
.atg-main-body {
	display: grid;
	grid-template-columns: 310px 1fr;
	align-items: stretch;
	min-height: var(--atg-bento-height);
}

.atg-sidebar-right .atg-main-body {
	grid-template-columns: 1fr 310px;
}

.atg-sidebar-right .atg-sidebar {
	order: 2;
	border-right: none;
	border-left: 1px solid var(--atg-border-subtle);
}

.atg-sidebar-right .atg-gallery-stage {
	order: 1;
}

/* ==========================================================================
   ۳. پنل کناری: قطب‌نما + ماکت سه‌بعدی برج + سوییچ روز/شب
   ========================================================================== */
.atg-sidebar {
	background: var(--atg-bg-sidebar);
	border-right: 1px solid var(--atg-border-subtle);
	padding: 22px 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 14px;
	position: relative;
}

.atg-sidebar.is-sticky {
	position: sticky;
	top: 0;
	align-self: start;
	max-height: 100vh;
}

/* قطب‌نمای تعاملی */
.atg-compass-module {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.atg-compass-stage {
	position: relative;
	width: 248px;
	height: 248px;
	margin: 0 auto;
	user-select: none;
}

.atg-compass-svg {
	width: 100%;
	height: 100%;
	display: block;
	overflow: visible;
}

.atg-compass-cone-group,
.atg-tower-cone-group {
	transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* دکمه‌های ۸ جهت جغرافیایی دور دایره قطب‌نما */
.atg-compass-dir-btn {
	position: absolute;
	width: 38px;
	height: 38px;
	margin-left: -19px;
	margin-top: -19px;
	border-radius: 50%;
	border: 1px solid transparent;
	background: transparent;
	color: var(--atg-text-muted);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.06em;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.28s ease;
	padding: 0;
	z-index: 3;
}

.atg-compass-dir-btn:hover {
	color: var(--atg-gold-light);
	background: rgba(220, 168, 94, 0.1);
	border-color: rgba(220, 168, 94, 0.35);
	transform: scale(1.08);
}

.atg-compass-dir-btn.is-active {
	color: var(--atg-gold-light);
	font-weight: 700;
	font-size: 15px;
	text-shadow: 0 0 12px rgba(246, 214, 157, 0.85);
}

.atg-dir-dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--atg-gold);
	margin-top: 2px;
	opacity: 0.7;
}

.atg-compass-dir-btn.is-active .atg-dir-dot {
	background: var(--atg-gold-light);
	opacity: 1;
	box-shadow: 0 0 6px var(--atg-gold-light);
}

/* مختصات دقیق ۸ جهت روی دایره 248x248 (شعاع حدود 106px از مرکز 124,124) */
.atg-dir-n  { top: 16px;  left: 124px; }
.atg-dir-ne { top: 47px;  left: 201px; }
.atg-dir-e  { top: 124px; left: 232px; }
.atg-dir-se { top: 201px; left: 201px; }
.atg-dir-s  { top: 232px; left: 124px; }
.atg-dir-sw { top: 201px; left: 47px;  }
.atg-dir-w  { top: 124px; left: 16px;  }
.atg-dir-nw { top: 47px;  left: 47px;  }

.atg-active-dir-title {
	margin-top: 4px;
	font-size: 12px;
	color: var(--atg-text-muted);
	display: flex;
	align-items: center;
	gap: 6px;
	direction: rtl;
}

.atg-active-dir-value {
	color: var(--atg-gold-light);
	font-weight: 600;
}

/* متادیتای فنی (ORIENT / ALTITUDE) */
.atg-telemetry-row,
.atg-telemetry-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 9.5px;
	letter-spacing: 0.08em;
	color: rgba(242, 237, 228, 0.45);
	text-transform: uppercase;
	padding: 0 4px;
}

.atg-telemetry-col {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.atg-telemetry-right {
	text-align: right;
}

.atg-telemetry-item strong {
	color: var(--atg-gold-light);
	font-weight: 600;
}

/* ماکت ایزومتریک سه‌بعدی برج */
.atg-tower-diagram-box {
	position: relative;
	width: 100%;
	max-width: 240px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.atg-isometric-tower-svg {
	width: 100%;
	height: auto;
	max-height: 235px;
	display: block;
}

/* روشن شدن پنجره‌های ماکت سه‌بعدی برج در حالت شب */
.atg-iso-night-lights {
	opacity: 0.15;
	transition: opacity 0.45s ease;
}

.atg-mode-night .atg-iso-night-lights {
	opacity: 0.95;
}

.atg-custom-tower-wrap {
	position: relative;
	width: 220px;
	height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.atg-custom-tower-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.atg-tower-cone-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* دکمه تغییر وضعیت روز و شب (Day / Night Pill Switch) */
.atg-daynight-Wrap {
	display: flex;
	justify-content: center;
	margin: 4px 0;
}

.atg-daynight-toggle {
	display: inline-flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(220, 168, 94, 0.25);
	border-radius: 999px;
	padding: 3px;
	gap: 4px;
}

.atg-dn-btn {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--atg-text-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	padding: 7px 18px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.atg-dn-btn:hover {
	color: var(--atg-text-light);
}

.atg-dn-btn.is-active {
	background: linear-gradient(135deg, #fff3db 0%, var(--atg-gold-light) 45%, var(--atg-gold) 100%);
	color: #121316;
	box-shadow: 0 0 18px rgba(246, 214, 157, 0.45);
}

/* ==========================================================================
   ۴. شبکه تصاویر مدرن (Bento Grid Gallery)
   ========================================================================== */
.atg-gallery-stage {
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: stretch;
	background: radial-gradient(circle at 20% 20%, rgba(220, 168, 94, 0.04), transparent 60%);
}

.atg-bento-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	grid-auto-rows: minmax(120px, 1fr);
	gap: 16px;
	width: 100%;
	min-height: var(--atg-bento-height);
}

/* چیدمان هوشمند ۴ کارتی دقیقاً مطابق تصویر نمونه:
   کارت ۱: بالا چپ (۷ ستون، ۳ ردیف)
   کارت ۲: بالا راست - نمای عمودی برج (۵ ستون، ۴ ردیف)
   کارت ۳: پایین چپ - سالن پذیرایی (۷ ستون، ۳ ردیف)
   کارت ۴: پایین راست - جزئیات نما (۵ ستون، ۲ ردیف) */
.atg-span-auto-1 {
	grid-column: span 7;
	grid-row: span 3;
}

.atg-span-auto-2 {
	grid-column: span 5;
	grid-row: span 4;
}

.atg-span-auto-3 {
	grid-column: span 7;
	grid-row: span 3;
}

.atg-span-auto-4 {
	grid-column: span 5;
	grid-row: span 2;
}

/* کلاس‌های دستی انتخاب‌شده توسط کاربر در المنتور */
.atg-span-landscape {
	grid-column: span 7;
	grid-row: span 3;
}

.atg-span-tall {
	grid-column: span 5;
	grid-row: span 4;
}

.atg-span-detail {
	grid-column: span 5;
	grid-row: span 2;
}

.atg-span-half {
	grid-column: span 6;
	grid-row: span 3;
}

.atg-span-full {
	grid-column: span 12;
	grid-row: span 3;
}

/* کارت تصویر */
.atg-card {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	background: #151820;
	border: 1px solid rgba(255, 255, 255, 0.08);
	cursor: pointer;
	transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease;
	min-height: 210px;
}

.atg-card.is-hidden {
	display: none !important;
}

.atg-card.is-visible {
	animation: atgCardFadeIn 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes atgCardFadeIn {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.atg-card:hover {
	border-color: rgba(220, 168, 94, 0.55);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.atg-card-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.atg-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease, filter 0.55s ease;
}

.atg-card:hover .atg-img {
	transform: scale(1.045);
}

/* تغییر وضعیت نرم بین تصویر روز و تصویر شب */
.atg-img-night {
	opacity: 0;
	z-index: 2;
}

.atg-mode-night .atg-card[data-has-night="yes"] .atg-img-night {
	opacity: 1;
}

/* افکت هوشمند شب برای کارت‌هایی که تصویر شب مجزا ندارند */
.atg-showcase-wrapper[data-auto-night="yes"].atg-mode-night .atg-card[data-has-night="no"] .atg-img-day {
	filter: brightness(0.58) contrast(1.18) saturate(0.85) hue-rotate(195deg);
}

/* نوار شیشه‌ای کپشن در پایین هر کارت (Glassmorphism) */
.atg-card-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	padding: 13px 18px;
	background: linear-gradient(90deg, rgba(16, 18, 23, 0.78) 0%, rgba(28, 25, 22, 0.62) 100%);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.atg-caption-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.atg-card-title {
	margin: 0 !important;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.12em;
	color: var(--atg-text-light);
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.atg-card-sub {
	margin: 0 !important;
	font-size: 11px;
	color: var(--atg-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	direction: rtl;
	text-align: left;
}

.atg-expand-btn {
	appearance: none;
	width: 30px;
	height: 30px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.06);
	color: var(--atg-text-light);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.25s ease;
	padding: 0;
}

.atg-expand-btn:hover {
	background: var(--atg-gold);
	border-color: var(--atg-gold-light);
	color: #111215;
}

/* وضعیت خالی بودن یک جهت */
.atg-empty-direction-state {
	padding: 60px 24px;
	text-align: center;
	border: 1px dashed var(--atg-border-subtle);
	border-radius: 12px;
	margin: auto 0;
	direction: rtl;
}

.atg-empty-icon {
	font-size: 38px;
	display: block;
	margin-bottom: 12px;
}

.atg-empty-title {
	margin: 0 0 8px;
	font-size: 17px;
	color: var(--atg-gold-light);
}

.atg-empty-desc {
	margin: 0 auto;
	max-width: 480px;
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--atg-text-muted);
}

/* ==========================================================================
   ۵. مودال لایت‌باکس تمام‌صفحه اختصاصی (Fullscreen Lightbox)
   ========================================================================== */
.atg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.atg-lightbox.is-open {
	display: flex;
	animation: atgFadeIn 0.25s ease-out;
}

@keyframes atgFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.atg-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 7, 10, 0.92);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.atg-lightbox-content {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1180px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.atg-lightbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--atg-text-light);
}

.atg-lb-meta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.atg-lb-dir-badge {
	background: rgba(220, 168, 94, 0.18);
	border: 1px solid var(--atg-gold);
	color: var(--atg-gold-light);
	padding: 4px 12px;
	border-radius: 99px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
}

.atg-lb-counter {
	font-size: 13px;
	color: var(--atg-text-muted);
}

.atg-lb-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.atg-lb-dn-toggle {
	appearance: none;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(220, 168, 94, 0.4);
	color: var(--atg-gold-light);
	padding: 7px 15px;
	border-radius: 99px;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.25s ease;
}

.atg-lb-dn-toggle:hover {
	background: var(--atg-gold);
	color: #111215;
}

.atg-lb-close {
	appearance: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.atg-lb-close:hover {
	background: rgba(220, 68, 68, 0.8);
	border-color: transparent;
}

.atg-lightbox-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.atg-lb-figure {
	margin: 0;
	width: 100%;
	max-height: 78vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: #0f1116;
	border: 1px solid var(--atg-border-subtle);
	border-radius: 12px;
	overflow: hidden;
}

.atg-lb-img {
	width: 100%;
	max-height: 68vh;
	object-fit: contain;
	background: #090a0d;
	display: block;
}

.atg-lb-caption {
	width: 100%;
	padding: 14px 22px;
	background: rgba(16, 18, 24, 0.95);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

.atg-lb-title {
	font-size: 14px;
	letter-spacing: 0.1em;
	color: var(--atg-gold-light);
}

.atg-lb-subtitle {
	font-size: 13px;
	color: var(--atg-text-muted);
	direction: rtl;
}

.atg-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid rgba(220, 168, 94, 0.4);
	background: rgba(12, 13, 16, 0.8);
	color: var(--atg-gold-light);
	font-size: 18px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	z-index: 5;
}

.atg-lb-nav:hover {
	background: var(--atg-gold);
	color: #111215;
}

.atg-lb-prev { left: 16px; }
.atg-lb-next { right: 16px; }

/* ==========================================================================
   ۶. واکنش‌گرایی کامل (تبلت و موبایل)
   ========================================================================== */
@media (max-width: 1024px) {
	.atg-main-body,
	.atg-sidebar-right .atg-main-body {
		grid-template-columns: 1fr;
	}

	.atg-sidebar,
	.atg-sidebar-right .atg-sidebar {
		order: 1;
		border-right: none;
		border-left: none;
		border-bottom: 1px solid var(--atg-border-subtle);
		position: relative !important;
		max-height: none;
		padding: 20px;
	}

	.atg-gallery-stage {
		order: 2;
	}

	.atg-tower-diagram-box {
		max-width: 190px;
	}
}

@media (max-width: 767px) {
	.atg-topbar {
		padding: 14px 16px;
	}

	.atg-bento-grid {
		grid-template-columns: 1fr;
		grid-auto-rows: 250px;
		min-height: auto;
	}

	.atg-span-auto-1,
	.atg-span-auto-2,
	.atg-span-auto-3,
	.atg-span-auto-4,
	.atg-span-landscape,
	.atg-span-tall,
	.atg-span-detail,
	.atg-span-half,
	.atg-span-full {
		grid-column: span 1 !important;
		grid-row: span 1 !important;
	}
}
