/* Custom resets and styling for AMG Gallery */
.amg-gallery-wrapper {
	width: 100%;
	margin: 20px 0;
	box-sizing: border-box;
}

.amg-gallery-wrapper * {
	box-sizing: border-box;
}

/* Filters styling */
.amg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 25px;
	justify-content: center;
}

.amg-filter-btn {
	background: transparent;
	border: 1px solid #e2e8f0;
	color: #64748b;
	padding: 8px 20px;
	border-radius: 9999px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.amg-filter-btn:hover,
.amg-filter-btn.active {
	background: #0f172a;
	border-color: #0f172a;
	color: #ffffff;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
	transform: translateY(-1px);
}

/* Grid Layout container using CSS grid */
.amg-layout-grid .amg-gallery-items-container {
	display: grid;
	grid-template-columns: repeat(var(--amg-cols-desktop, 3), 1fr);
	gap: var(--amg-gap-desktop, 15px);
	transition: opacity 0.3s ease;
}

/* Masonry Layout container */
.amg-layout-masonry .amg-gallery-items-container {
	margin-left: calc(var(--amg-gap-desktop, 15px) * -1);
	transition: opacity 0.3s ease;
}

.amg-layout-masonry .amg-gallery-item,
.amg-layout-masonry .amg-grid-sizer {
	width: calc(100% / var(--amg-cols-desktop, 3) - var(--amg-gap-desktop, 15px));
	margin-left: var(--amg-gap-desktop, 15px);
	margin-bottom: var(--amg-gap-desktop, 15px);
	float: left;
}

/* General Item styling */
.amg-gallery-item {
	position: relative;
	overflow: hidden;
	border-radius: var(--amg-radius, 8px);
	background: #f8fafc;
	will-change: transform;
}

.amg-item-inner {
	position: relative;
	width: 100%;
	height: 100%;
	display: block;
}

.amg-media-container {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.amg-layout-grid .amg-media-container {
	aspect-ratio: 4/3; /* Sleek aspect ratio for grid layout */
}

.amg-layout-grid .amg-item-video .amg-media-container {
	aspect-ratio: 16/9; /* Standard widescreen for videos in grid */
}

.amg-media-container img,
.amg-media-container video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.6s ease;
}

/* Overlay & Hover Details styling */
.amg-item-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.2) 60%, rgba(15, 23, 42, 0) 100%);
	display: flex;
	align-items: flex-end;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.4s ease;
	z-index: 2;
}

.amg-item-details {
	color: #ffffff;
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transform: translateY(10px);
	transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.amg-item-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	color: #ffffff;
	text-shadow: 0 1px 2px rgba(0,0,0,0.2);
	font-family: inherit;
}

.amg-item-icon {
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
	border: 1px solid rgba(255, 255, 255, 0.3);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #ffffff;
}

/* Hover effect triggers */
.amg-gallery-item:hover .amg-item-overlay {
	opacity: 1;
}

.amg-gallery-item:hover .amg-item-details {
	transform: translateY(0);
}

/* Zoom Effect */
.amg-hover-zoom:hover img,
.amg-hover-zoom:hover video {
	transform: scale(1.08);
}

/* Sleek Dark Overlay */
.amg-hover-overlay:hover img,
.amg-hover-overlay:hover video {
	transform: scale(1.08);
}

.amg-hover-overlay .amg-item-overlay {
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(2px);
}

/* Grayscale */
.amg-hover-grayscale img,
.amg-hover-grayscale video {
	filter: grayscale(100%);
}

.amg-hover-grayscale:hover img,
.amg-hover-grayscale:hover video {
	filter: grayscale(0%);
	transform: scale(1.05);
}

/* Video Placeholder icon */
.amg-video-placeholder {
	width: 100%;
	aspect-ratio: 16/9;
	background: #1e293b;
	color: #94a3b8;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease;
}

.amg-play-icon {
	width: 60px;
	height: 60px;
	color: #ffffff;
	opacity: 0.8;
	transition: transform 0.3s ease;
}

.amg-gallery-item:hover .amg-play-icon {
	transform: scale(1.1);
	opacity: 1;
}

/* responsive controls (Tablets) */
@media (max-width: 1024px) {
	.amg-layout-grid .amg-gallery-items-container {
		grid-template-columns: repeat(var(--amg-cols-tablet, 2), 1fr);
		gap: var(--amg-gap-tablet, 10px);
	}
	
	.amg-layout-masonry .amg-gallery-items-container {
		margin-left: calc(var(--amg-gap-tablet, 10px) * -1);
	}
	
	.amg-layout-masonry .amg-gallery-item,
	.amg-layout-masonry .amg-grid-sizer {
		width: calc(100% / var(--amg-cols-tablet, 2) - var(--amg-gap-tablet, 10px));
		margin-left: var(--amg-gap-tablet, 10px);
		margin-bottom: var(--amg-gap-tablet, 10px);
	}
}

/* responsive controls (Mobiles) */
@media (max-width: 767px) {
	.amg-layout-grid .amg-gallery-items-container {
		grid-template-columns: repeat(var(--amg-cols-mobile, 1), 1fr);
		gap: var(--amg-gap-mobile, 5px);
	}
	
	.amg-layout-masonry .amg-gallery-items-container {
		margin-left: calc(var(--amg-gap-mobile, 5px) * -1);
	}
	
	.amg-layout-masonry .amg-gallery-item,
	.amg-layout-masonry .amg-grid-sizer {
		width: calc(100% / var(--amg-cols-mobile, 1) - var(--amg-gap-mobile, 5px));
		margin-left: var(--amg-gap-mobile, 5px);
		margin-bottom: var(--amg-gap-mobile, 5px);
	}
	
	.amg-filters {
		gap: 6px;
	}
	
	.amg-filter-btn {
		padding: 6px 14px;
		font-size: 12px;
	}
}

/* Fade animation during AJAX update */
.amg-gallery-items-container.amg-loading {
	opacity: 0.5;
	pointer-events: none;
}
