/*
|--------------------------------------------------------------------------
| Sana Gallery - Frontend Main Gallery
|--------------------------------------------------------------------------
*/

/* ==========================================================================
   Wrapper
   ========================================================================== */

.sg-gallery {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}


/* ==========================================================================
   Navigation - Sticky Gallery Tabs
   ========================================================================== */

.sg-gallery-navigation {
	position: -webkit-sticky !important;
	position: sticky !important;

	/*
	 * فاصله از بالای صفحه هنگام Sticky شدن
	 * فعلاً صفر؛ اگر هدر سایت روی آن قرار گرفت بعداً دقیق تنظیم می‌کنیم.
	 */
	top: 0 !important;

	z-index: 99999 !important;

	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;

	width: 100% !important;
	max-width: 100% !important;

	margin: 0 0 30px !important;
	padding: 6px !important;

	box-sizing: border-box;

	border: 1px solid #e5e7eb;
	border-radius: 12px;

	background: #fff !important;

	box-shadow:
		0 3px 12px rgba(0, 0, 0, 0.08);

	/*
	 * باعث می‌شود محتوای پشت تب‌ها دیده نشود.
	 */
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}


/* ==========================================================================
   Navigation Button
   ========================================================================== */

.sg-gallery-nav-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	flex: 0 0 auto;

	min-height: 44px;

	margin: 0 !important;
	padding: 10px 18px;

	border: 0;
	border-radius: 8px;

	background: transparent;
	color: #4b5563;

	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;

	white-space: nowrap;

	cursor: pointer;

	box-sizing: border-box;

	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		box-shadow 0.2s ease;
}


.sg-gallery-nav-item:hover {
	background: #f3f4f6;
	color: #111827;
}


.sg-gallery-nav-item.is-active {
	background: #111827;
	color: #fff;

	box-shadow:
		0 2px 6px rgba(0, 0, 0, 0.12);
}


/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

@media (max-width: 850px) {

	.sg-gallery-navigation {
		justify-content: flex-start;

		flex-wrap: nowrap;

		overflow-x: auto;
		overflow-y: hidden;

		scrollbar-width: thin;

		-webkit-overflow-scrolling: touch;

		/*
		 * Sticky را حفظ می‌کنیم.
		 */
		position: -webkit-sticky !important;
		position: sticky !important;

		top: 0 !important;

		z-index: 99999 !important;
	}
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 600px) {

	.sg-gallery-navigation {
		gap: 6px;

		margin-bottom: 20px !important;

		padding: 5px !important;

		border-radius: 10px;
	}

	.sg-gallery-nav-item {
		min-height: 40px;

		padding: 9px 14px;

		font-size: 13px;
	}
}


/* ==========================================================================
   Very Small Mobile
   ========================================================================== */

@media (max-width: 400px) {

	.sg-gallery-nav-item {
		padding-left: 12px;
		padding-right: 12px;
	}
}

/* ==========================================================================
   Gallery Content / Sections
   ========================================================================== */

.sg-gallery-content {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}


.sg-gallery-section {
	width: 100%;
	max-width: 100%;

	margin: 0 0 40px;
	padding: 0;

	box-sizing: border-box;
}


.sg-gallery-section:last-child {
	margin-bottom: 0;
}


.sg-gallery-section.is-hidden {
	display: none !important;
}


/* ==========================================================================
   Generic Gallery Grid
   ========================================================================== */

.sg-gallery-items {
	display: grid !important;

	grid-template-columns:
		repeat(4, minmax(0, 1fr)) !important;

	grid-auto-flow: row;

	gap: 24px;

	width: 100% !important;
	max-width: 100% !important;

	margin: 0 !important;
	padding: 0 !important;

	box-sizing: border-box;

	align-items: start;
}


/* ==========================================================================
   Generic Gallery Direct Children
   ========================================================================== */

.sg-gallery-items > * {
	min-width: 0 !important;
	max-width: 100% !important;

	box-sizing: border-box;
}


/* ==========================================================================
   Generic Gallery Card
   ========================================================================== */

.sg-gallery-item {
	position: relative;

	display: flex;
	flex-direction: column;

	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;

	margin: 0 !important;
	padding: 16px !important;

	box-sizing: border-box;

	background: #fff;

	border: 1px solid #e5e7eb;
	border-radius: 12px;

	overflow: hidden;

	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}


.sg-gallery-item:hover {
	transform: translateY(-2px);

	box-shadow:
		0 8px 24px rgba(0, 0, 0, 0.08);
}


/* ==========================================================================
   Generic Image
   ========================================================================== */

.sg-gallery-image {
	position: relative;

	display: block;

	width: 100%;
	height: 220px;

	margin: 0 0 14px;
	padding: 0;

	overflow: hidden;

	border-radius: 9px;

	background: #f3f4f6;

	box-sizing: border-box;
}


.sg-gallery-image img {
	display: block;

	width: 100% !important;
	height: 100% !important;

	max-width: 100% !important;

	margin: 0 !important;
	padding: 0 !important;

	object-fit: cover;
	object-position: center;

	box-sizing: border-box;
}


/* ==========================================================================
   Gallery Type
   ========================================================================== */

.sg-gallery-type {
	display: inline-flex;
	align-items: center;

	align-self: flex-start;

	width: auto;
	max-width: 100%;

	margin: 0 0 8px;
	padding: 5px 9px;

	border-radius: 6px;

	background: #f3f4f6;
	color: #374151;

	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;

	box-sizing: border-box;
}


/* ==========================================================================
   Typography
   ========================================================================== */

.sg-gallery-item .sg-gallery-display-title,
.sg-gallery-item .sg-gallery-subtitle,
.sg-gallery-item .sg-gallery-item-title,
.sg-gallery-item .sg-gallery-summary,
.sg-gallery-item .sg-gallery-description,
.sg-gallery-item .sg-gallery-meta {
	width: 100%;
	max-width: 100%;

	box-sizing: border-box;
}


.sg-gallery-item .sg-gallery-display-title {
	margin: 0 0 5px;
}


.sg-gallery-item .sg-gallery-subtitle {
	margin: 0 0 10px;
}


.sg-gallery-item .sg-gallery-item-title {
	margin: 0 0 8px;
}


.sg-gallery-item .sg-gallery-summary {
	margin: 10px 0 0;
}


.sg-gallery-item .sg-gallery-description {
	margin: 10px 0 0;
}


.sg-gallery-item .sg-gallery-meta {
	margin: 7px 0 0;
}


/* ==========================================================================
   Hidden Items
   ========================================================================== */

.sg-gallery-item.is-hidden {
	display: none !important;
}


/* ==========================================================================
   More Button
   ========================================================================== */

.sg-gallery-more {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;

	margin: 30px 0 0;
	padding: 0;

	box-sizing: border-box;
}


.sg-gallery-more-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-width: 150px;
	min-height: 44px;

	margin: 0;
	padding: 10px 22px;

	border: 1px solid #d1d5db;
	border-radius: 8px;

	background: #fff;
	color: #111827;

	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;

	cursor: pointer;

	box-sizing: border-box;

	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease;
}


.sg-gallery-more-button:hover {
	background: #111827;
	border-color: #111827;
	color: #fff;
}


/* ==========================================================================
   Tablet - 3 Columns
   ========================================================================== */

@media (max-width: 1100px) {

	.sg-gallery-items {
		grid-template-columns:
			repeat(3, minmax(0, 1fr)) !important;

		gap: 20px;
	}

}


/* ==========================================================================
   Small Tablet - 2 Columns
   ========================================================================== */

@media (max-width: 850px) {

	.sg-gallery-navigation {
		justify-content: flex-start;

		flex-wrap: nowrap;

		overflow-x: auto;
		overflow-y: hidden;

		scrollbar-width: thin;

		-webkit-overflow-scrolling: touch;
	}


	.sg-gallery-nav-item {
		flex: 0 0 auto;
	}


	.sg-gallery-items {
		grid-template-columns:
			repeat(2, minmax(0, 1fr)) !important;

		gap: 18px;
	}

}


/* ==========================================================================
   Mobile - 1 Column
   ========================================================================== */

@media (max-width: 600px) {

	.sg-gallery-navigation {
		gap: 6px;

		margin-bottom: 20px;
		padding: 5px;

		border-radius: 10px;
	}


	.sg-gallery-nav-item {
		min-height: 40px;

		padding: 9px 14px;

		font-size: 13px;
	}


	.sg-gallery-items {
		grid-template-columns:
			1fr !important;

		gap: 16px;
	}


	.sg-gallery-item {
		padding: 14px !important;

		border-radius: 10px;
	}


	.sg-gallery-image {
		height: 210px;

		margin-bottom: 12px;

		border-radius: 8px;
	}

}


/* ==========================================================================
   Very Small Mobile
   ========================================================================== */

@media (max-width: 400px) {

	.sg-gallery-nav-item {
		padding-left: 12px;
		padding-right: 12px;
	}


	.sg-gallery-item {
		padding: 12px !important;
	}


	.sg-gallery-image {
		height: 190px;
	}

}