/* AlphaShelf Frontend Gallery CSS */
:root {
	--alphashelf-primary: #254783;
	--alphashelf-primary-rgb: 37, 71, 131;
	--alphashelf-white: #ffffff;
	--alphashelf-dark: #0f172a;
	--alphashelf-gap: 16px;
	--alphashelf-radius: 8px;
	--alphashelf-ease: cubic-bezier(0.25, 1, 0.5, 1);
	--alphashelf-transition-duration: 0.4s;
}

.alphashelf-gallery-wrapper {
	position: relative;
	width: 100%;
	margin: 2rem 0;
	box-sizing: border-box;
}

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

.alphashelf-gallery-inner {
	display: grid;
	gap: var(--alphashelf-gap);
}

/* ==========================================
   LAYOUTS
   ========================================== */

/* 1. Justified Layout (Dynamic Aspect Ratios) */
.alphashelf-layout-justified .alphashelf-gallery-inner {
	display: flex;
	flex-wrap: wrap;
	gap: var(--alphashelf-gap);
}

.alphashelf-layout-justified .alphashelf-gallery-item {
	height: 240px;
	flex-grow: var(--aspect-ratio, 1);
	flex-basis: calc(240px * var(--aspect-ratio, 1));
	max-width: 100%;
}

.alphashelf-layout-justified .alphashelf-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 991px) {
	.alphashelf-layout-justified .alphashelf-gallery-item {
		height: 200px;
		flex-basis: calc(200px * var(--aspect-ratio, 1));
	}
}

@media (max-width: 767px) {
	.alphashelf-layout-justified .alphashelf-gallery-item {
		height: 160px;
		flex-basis: calc(160px * var(--aspect-ratio, 1));
	}
}

@media (max-width: 480px) {
	.alphashelf-layout-justified .alphashelf-gallery-item {
		height: 120px;
		flex-basis: calc(120px * var(--aspect-ratio, 1));
	}
}

/* 2. Metro / Mosaic Layout (CSS Grid) */
.alphashelf-layout-metro .alphashelf-gallery-inner {
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 240px;
	grid-auto-flow: dense;
}

.alphashelf-layout-metro .alphashelf-gallery-item {
	grid-column: span var(--col-span, 1);
	grid-row: span var(--row-span, 1);
}

@media (max-width: 991px) {
	.alphashelf-layout-metro .alphashelf-gallery-inner {
		grid-template-columns: repeat(3, 1fr);
		grid-auto-rows: 200px;
	}
}

@media (max-width: 767px) {
	.alphashelf-layout-metro .alphashelf-gallery-inner {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 160px;
	}
	.alphashelf-layout-metro .alphashelf-col-span-2 {
		grid-column: span 2;
	}
	.alphashelf-layout-metro .alphashelf-row-span-2 {
		grid-row: span 1;
	}
}

@media (max-width: 480px) {
	.alphashelf-layout-metro .alphashelf-gallery-inner {
		grid-template-columns: 1fr;
		grid-auto-rows: 220px;
	}
	.alphashelf-layout-metro .alphashelf-gallery-item {
		grid-column: span 1 !important;
		grid-row: span 1 !important;
	}
}

/* 3. Masonry Layout */
.alphashelf-layout-masonry .alphashelf-gallery-inner {
	display: block;
	column-count: 4;
	column-gap: var(--alphashelf-gap);
}

.alphashelf-layout-masonry .alphashelf-gallery-item {
	break-inside: avoid;
	margin-bottom: var(--alphashelf-gap);
	width: 100%;
}

@media (max-width: 991px) {
	.alphashelf-layout-masonry .alphashelf-gallery-inner {
		column-count: 3;
	}
}
@media (max-width: 767px) {
	.alphashelf-layout-masonry .alphashelf-gallery-inner {
		column-count: 2;
	}
}
@media (max-width: 480px) {
	.alphashelf-layout-masonry .alphashelf-gallery-inner {
		column-count: 1;
	}
}

/* 4. Classic Grid */
.alphashelf-layout-grid .alphashelf-gallery-inner {
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.alphashelf-layout-grid .alphashelf-gallery-item {
	aspect-ratio: 1 / 1;
}

/* 5. Carousel Slider Layout */
.alphashelf-layout-carousel {
	overflow: hidden;
	display: flex;
	align-items: center;
}

.alphashelf-layout-carousel .alphashelf-gallery-inner {
	display: flex;
	flex-flow: row nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none; /* Firefox */
	gap: var(--alphashelf-gap);
	width: 100%;
	scroll-behavior: smooth;
	padding: 10px 0;
}

.alphashelf-layout-carousel .alphashelf-gallery-inner::-webkit-scrollbar {
	display: none; /* Safari/Chrome */
}

.alphashelf-layout-carousel .alphashelf-gallery-item {
	flex: 0 0 300px;
	scroll-snap-align: start;
	aspect-ratio: 4 / 3;
}

@media (max-width: 767px) {
	.alphashelf-layout-carousel .alphashelf-gallery-item {
		flex: 0 0 240px;
	}
}

/* Carousel Nav Buttons */
.alphashelf-carousel-nav {
	background: var(--alphashelf-white);
	border: 1px solid rgba(var(--alphashelf-primary-rgb), 0.1);
	color: var(--alphashelf-primary);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	font-size: 18px;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: all 0.3s var(--alphashelf-ease);
}

.alphashelf-carousel-nav:hover {
	background: var(--alphashelf-primary);
	color: var(--alphashelf-white);
	box-shadow: 0 8px 20px rgba(var(--alphashelf-primary-rgb), 0.3);
}

.alphashelf-prev {
	left: 10px;
}
.alphashelf-next {
	right: 10px;
}

/* ==========================================
   IMAGE AND OVERLAY CONTAINER
   ========================================== */
.alphashelf-gallery-item {
	position: relative;
	border-radius: var(--alphashelf-radius);
	overflow: hidden;
}

.alphashelf-gallery-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.alphashelf-image-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.alphashelf-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--alphashelf-transition-duration) var(--alphashelf-ease),
				filter var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

.alphashelf-item-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(to top, rgba(var(--alphashelf-primary-rgb), 0.85) 0%, rgba(var(--alphashelf-primary-rgb), 0.2) 70%, rgba(var(--alphashelf-primary-rgb), 0) 100%);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 20px;
	opacity: 0;
	transition: opacity var(--alphashelf-transition-duration) var(--alphashelf-ease);
	z-index: 5;
}

.alphashelf-item-info {
	transform: translateY(20px);
	transition: transform var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

.alphashelf-item-title {
	margin: 0;
	color: var(--alphashelf-white);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.alphashelf-item-caption {
	margin: 5px 0 0 0;
	color: rgba(255, 255, 255, 0.8);
	font-size: 13px;
	line-height: 1.4;
}

/* Lightbox Icon overlay hint */
.alphashelf-icon-view {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 32px;
	height: 32px;
	background-color: rgba(255, 255, 255, 0.2);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
	background-size: 16px 16px;
	background-position: center;
	background-repeat: no-repeat;
	backdrop-filter: blur(4px);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.8);
	transition: opacity var(--alphashelf-transition-duration) var(--alphashelf-ease),
				transform var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

/* ==========================================
   WATERMARK LAYERS
   ========================================== */
.alphashelf-watermark-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 3;
}

.alphashelf-watermark-corner {
	position: absolute;
	pointer-events: none;
	z-index: 4;
	margin: 12px;
}

.alphashelf-watermark-corner img {
	display: block;
	height: auto !important;
	object-fit: contain !important;
	transition: none !important;
	transform: none !important;
}

.alphashelf-watermark-corner.pos-top-left { top: 0; left: 0; }
.alphashelf-watermark-corner.pos-top-right { top: 0; right: 0; }
.alphashelf-watermark-corner.pos-bottom-left { bottom: 0; left: 0; }
.alphashelf-watermark-corner.pos-bottom-right { bottom: 0; right: 0; }

.alphashelf-watermark-tiled {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 3;
}

/* ==========================================
   HOVER EFFECTS
   ========================================== */

/* Zoom & Lift (Default) */
.alphashelf-hover-zoom .alphashelf-gallery-item {
	transition: transform var(--alphashelf-transition-duration) var(--alphashelf-ease),
				box-shadow var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

.alphashelf-hover-zoom .alphashelf-gallery-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 15px 30px rgba(var(--alphashelf-primary-rgb), 0.2);
	z-index: 6;
}

.alphashelf-hover-zoom .alphashelf-gallery-item:hover img {
	transform: scale(1.08);
}

.alphashelf-hover-zoom .alphashelf-gallery-item:hover .alphashelf-item-overlay {
	opacity: 1;
}

.alphashelf-hover-zoom .alphashelf-gallery-item:hover .alphashelf-item-info {
	transform: translateY(0);
}

.alphashelf-hover-zoom .alphashelf-gallery-item:hover .alphashelf-icon-view {
	opacity: 1;
	transform: scale(1);
}

/* Alpha Glow Border */
.alphashelf-hover-glow .alphashelf-gallery-item {
	transition: box-shadow var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

.alphashelf-hover-glow .alphashelf-gallery-item:hover {
	box-shadow: 0 0 0 4px var(--alphashelf-white), 0 0 0 8px var(--alphashelf-primary);
	z-index: 6;
}

.alphashelf-hover-glow .alphashelf-gallery-item:hover .alphashelf-item-overlay {
	opacity: 1;
}

.alphashelf-hover-glow .alphashelf-gallery-item:hover .alphashelf-item-info {
	transform: translateY(0);
}

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

.alphashelf-hover-grayscale .alphashelf-gallery-item:hover img {
	filter: grayscale(0%);
	transform: scale(1.04);
}

.alphashelf-hover-grayscale .alphashelf-gallery-item:hover .alphashelf-item-overlay {
	opacity: 1;
}

.alphashelf-hover-grayscale .alphashelf-gallery-item:hover .alphashelf-item-info {
	transform: translateY(0);
}

/* Slide Up Overlay */
.alphashelf-hover-slide-up .alphashelf-item-overlay {
	background: var(--alphashelf-primary);
	opacity: 0;
	transform: translateY(100%);
	transition: opacity var(--alphashelf-transition-duration) var(--alphashelf-ease),
				transform var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

.alphashelf-hover-slide-up .alphashelf-gallery-item:hover .alphashelf-item-overlay {
	opacity: 0.95;
	transform: translateY(0);
}

.alphashelf-hover-slide-up .alphashelf-gallery-item:hover .alphashelf-item-info {
	transform: translateY(0);
}

/* ==========================================
   SCROLL ENTRANCE ANIMATIONS
   ========================================== */
.alphashelf-animation-fade-in .alphashelf-gallery-item,
.alphashelf-animation-slide-up .alphashelf-gallery-item,
.alphashelf-animation-scale-up .alphashelf-gallery-item {
	opacity: 0;
	transition: opacity 0.8s var(--alphashelf-ease),
				transform 0.8s var(--alphashelf-ease),
				box-shadow var(--alphashelf-transition-duration) var(--alphashelf-ease);
}

.alphashelf-animation-fade-in .alphashelf-gallery-item.alphashelf-revealed {
	opacity: 1;
}

.alphashelf-animation-slide-up .alphashelf-gallery-item {
	transform: translateY(30px);
}

.alphashelf-animation-slide-up .alphashelf-gallery-item.alphashelf-revealed {
	opacity: 1;
	transform: translateY(0);
}

.alphashelf-animation-scale-up .alphashelf-gallery-item {
	transform: scale(0.9);
}

.alphashelf-animation-scale-up .alphashelf-gallery-item.alphashelf-revealed {
	opacity: 1;
	transform: scale(1);
}

/* ==========================================
   PREMIUM LIGHTBOX POPUP CSS
   ========================================== */
.alphashelf-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgb(15 23 42 / 30%) !important;
	backdrop-filter: blur(8px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s var(--alphashelf-ease);
	font-family: system-ui, -apple-system, sans-serif;
}

.alphashelf-lightbox.active {
	opacity: 1;
	pointer-events: auto;
}

.alphashelf-lightbox-content {
	position: relative;
	max-width: 90%;
	max-height: 80%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.alphashelf-lightbox-image {
	max-width: 100%;
	max-height: 75vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
	transform: scale(0.95);
	opacity: 0;
	transition: transform 0.4s var(--alphashelf-ease),
				opacity 0.4s var(--alphashelf-ease);
}

.alphashelf-lightbox.active .alphashelf-lightbox-image {
	transform: scale(1);
	opacity: 1;
}

.alphashelf-lightbox-caption-bar {
	color: var(--alphashelf-white);
	margin-top: 15px;
	text-align: center;
	max-width: 600px;
}

.alphashelf-lightbox-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.alphashelf-lightbox-desc {
	margin: 5px 0 0 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.7);
}

/* Lightbox Controls */
.alphashelf-lightbox-close {
	position: absolute;
	top: 24px;
	right: 24px;
	background: transparent;
	border: none;
	color: var(--alphashelf-white);
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s;
	width: 44px;
	height: 44px;
}

.alphashelf-lightbox-close:hover {
	opacity: 1;
}

/* Refined Lightbox Arrow Buttons Styling */
.alphashelf-lightbox-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: var(--alphashelf-white);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px; /* Increased font-size */
	font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	font-weight: bold;
	line-height: 1;
	transition: all 0.3s var(--alphashelf-ease);
	padding: 0;
	z-index: 10000;
}

.alphashelf-lightbox-arrow-prev {
	left: 24px;
	padding-right: 4px; /* Visually centers the bold chevron symbol */
}

.alphashelf-lightbox-arrow-next {
	right: 24px;
	padding-left: 4px; /* Visually centers the bold chevron symbol */
}

.alphashelf-lightbox-arrow:hover {
	background: var(--alphashelf-primary);
	border-color: var(--alphashelf-primary);
	color: var(--alphashelf-white);
	box-shadow: 0 0 20px rgba(var(--alphashelf-primary-rgb), 0.6);
	transform: translateY(-50%) scale(1.1);
}

@media (max-width: 767px) {
	.alphashelf-lightbox-arrow {
		width: 44px;
		height: 44px;
		font-size: 18px;
	}
	.alphashelf-lightbox-arrow-prev {
		left: 12px;
		padding-right: 2px;
	}
	.alphashelf-lightbox-arrow-next {
		right: 12px;
		padding-left: 2px;
	}
	.alphashelf-lightbox-close {
		top: 12px;
		right: 12px;
	}
}

/* ==========================================
   PAGINATION & LOAD MORE STYLES
   ========================================== */
.alphashelf-gallery-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 30px;
	width: 100%;
	clear: both;
}

.alphashelf-page-btn {
	background: var(--alphashelf-white);
	border: 1px solid rgba(var(--alphashelf-primary-rgb), 0.2);
	color: var(--alphashelf-primary);
	width: 40px;
	height: 40px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s var(--alphashelf-ease);
	box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.alphashelf-page-btn:hover,
.alphashelf-page-btn.alphashelf-active {
	background: var(--alphashelf-primary);
	color: var(--alphashelf-white);
	border-color: var(--alphashelf-primary);
	box-shadow: 0 4px 10px rgba(var(--alphashelf-primary-rgb), 0.3);
}

.alphashelf-gallery-load-more-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 30px;
	width: 100%;
	clear: both;
}

.alphashelf-load-more-btn {
	background: var(--alphashelf-primary);
	border: none;
	color: var(--alphashelf-white);
	padding: 12px 28px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(var(--alphashelf-primary-rgb), 0.3);
	transition: all 0.25s var(--alphashelf-ease);
}

.alphashelf-load-more-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(var(--alphashelf-primary-rgb), 0.4);
}

.alphashelf-infinite-sentinel {
	height: 4px;
	width: 100%;
	opacity: 0;
	pointer-events: none;
	clear: both;
}

/* ==========================================
   HIGHLIGHT SLIDER BANNER (MARQUEE)
   ========================================== */
.alphashelf-highlight-marquee {
	position: relative;
	width: 100%;
	overflow: hidden;
	margin-bottom: var(--alphashelf-gap);
	border-radius: var(--alphashelf-radius);
}

.alphashelf-marquee-track {
	display: flex;
	width: max-content;
}

.alphashelf-marquee-list {
	display: flex;
	flex-shrink: 0;
	gap: var(--alphashelf-gap);
	padding-right: var(--alphashelf-gap);
}

.alphashelf-marquee-item {
	width: 320px;
	flex-shrink: 0;
	aspect-ratio: 4 / 3;
	position: relative;
	border-radius: var(--alphashelf-radius);
	overflow: hidden;
}

.alphashelf-marquee-item img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}

/* Captions inside items */
.alphashelf-marquee-caption {
	position: absolute;
	bottom: 12px;
	left: 12px;
	right: 12px;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(4px);
	border-radius: 6px;
	padding: 8px 12px;
	color: var(--alphashelf-white);
}

.alphashelf-marquee-caption p {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	font-weight: 500;
	text-align: center;
}

/* Animations */
.alphashelf-marquee-track.direction-left .alphashelf-marquee-list {
	animation: alphashelf-marquee-scroll-left var(--alphashelf-marquee-duration, 30s) linear infinite;
}

.alphashelf-marquee-track.direction-right .alphashelf-marquee-list {
	animation: alphashelf-marquee-scroll-right var(--alphashelf-marquee-duration, 30s) linear infinite;
}

@keyframes alphashelf-marquee-scroll-left {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(-100%);
	}
}

@keyframes alphashelf-marquee-scroll-right {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(0);
	}
}

/* Pause on hover */
.alphashelf-highlight-marquee:hover .alphashelf-marquee-list {
	animation-play-state: paused;
}

@media (max-width: 767px) {
	.alphashelf-marquee-item {
		width: 220px;
	}
}
