/* ============================================
   Vespa Gallery - Match Prototype AI Studio
   Clean, modern, elegant for Flatsome
   ============================================ */

:root {
	--gallery-bg: #fafafa;
	--gallery-text: #1a1a1a;
	--gallery-muted: #666;
	--gallery-accent: #2c3e2d; /* dark green-ish like logo */
	--gallery-radius: 16px;
	--gallery-shadow: 0 4px 20px rgba(0,0,0,0.08);
	--gallery-shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
}

/* ========== ARCHIVE ========== */
.gallery-header {
	margin-bottom: 50px;
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
}

.album-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #e8e8e8;
	color: #555;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding: 6px 14px;
	border-radius: 50px;
	margin-bottom: 20px;
	text-transform: uppercase;
}

.album-badge svg {
	opacity: 0.7;
}

.gallery-subtitle {
	max-width: 800px;
}

/* Grid cards */
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin: 0 auto;
}

@media (max-width: 768px) {
	.gallery-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

.gallery-card {
	display: block;
	background: #fff;
	border-radius: var(--gallery-radius);
	overflow: hidden;
	box-shadow: var(--gallery-shadow);
	transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
	            box-shadow 0.35s ease;
	text-decoration: none;
	color: inherit;
}

.gallery-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--gallery-shadow-hover);
}

.card-image {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.gallery-card:hover .card-image img {
	transform: scale(1.05);
}

.gallery-card:hover .overlay {
    backdrop-filter: blur(2px);
}

.card-count {
    display: inline-flex;
    gap: 5px;
    color: #fff;
    background: #ffffff1a;
    padding: 0.2rem 0.75rem;
    backdrop-filter: blur(2px);
    border-radius: 99px;
    font-size: 0.8em;
    width: fit-content;
    align-items: center;
    margin-bottom: 5px;
}

.card-count svg {
    color: #efc07b;
}

.card-image .overlay {
    background: linear-gradient(0deg, #375258 10%, rgb(47 57 54 / 74%) 60%, rgb(0 0 0 / 24%) 74%);
}

.card-body {
	position: absolute;
    bottom: 14px;
    color: #333;
    padding: 5px 14px;
}

.card-title {
    font-weight: 500;
    color: #fff;
    margin: 0px 0px 5px;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.8em;
    color: #ffffffbf;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== SINGLE ALBUM ========== */
.vespa-gallery-single {
	background: #fff;
	padding: 40px 0 80px;
	min-height: 70vh;
}

.back-to-gallery {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #555;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-decoration: none;
	margin-bottom: 30px;
	transition: color 0.2s;
	text-transform: uppercase;
}

.back-to-gallery:hover {
	color: var(--gallery-accent);
}

.back-to-gallery svg {
	transition: transform 0.2s;
}

.back-to-gallery:hover svg {
	transform: translateX(-3px);
}

.album-header {
	margin-bottom: 40px;
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
}

.album-title {
    font-size: 28pt;
    font-weight: 500;
    color: #426167;
    margin: 0 0 14px;
}

/* Gallery images layout */
.album-gallery-grid {
	display: grid;
	gap: 24px;
	margin: 0 auto;
}

/* Default: 2 columns (for 3,5,6... images) */
.album-gallery-grid.layout-default {
	grid-template-columns: repeat(3, 1fr);
}

/* Special 4-image layout: left stack 3 + right tall 1 */
.album-gallery-grid.layout-4 {
	grid-template-columns: 1fr 1.35fr;
	grid-template-rows: repeat(3, 1fr);
	height: auto;
	min-height: 680px;
}

.album-gallery-grid.layout-4 .gallery-item:nth-child(1) {
	grid-column: 1;
	grid-row: 1;
}

.album-gallery-grid.layout-4 .gallery-item:nth-child(2) {
	grid-column: 1;
	grid-row: 2;
}

.album-gallery-grid.layout-4 .gallery-item:nth-child(3) {
	grid-column: 1;
	grid-row: 3;
}

.album-gallery-grid.layout-4 .gallery-item:nth-child(4) {
	grid-column: 2;
	grid-row: 1 / span 3;
}

.gallery-item {
	position: relative;
	padding: unset!important;
	border-radius: 20px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img.gallery-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.gallery-item:hover img.gallery-img {
	transform: scale(1.04);
}

/* Make default items have nice aspect */
.album-gallery-grid.layout-default .gallery-item {
	aspect-ratio: 4 / 3;
}

/* Tall right image fills height */
.album-gallery-grid.layout-4 .gallery-item:nth-child(4) {
	height: 100%;
}

.album-gallery-grid.layout-4 .gallery-item:nth-child(1),
.album-gallery-grid.layout-4 .gallery-item:nth-child(2),
.album-gallery-grid.layout-4 .gallery-item:nth-child(3) {
	aspect-ratio: 16 / 10;
	height: auto;
}

.item-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 14px 18px;
	background: linear-gradient(transparent, rgba(0,0,0,0.7));
	color: #fff;
	font-size: 0.9rem;
	line-height: 1.4;
}

/* Mobile single */
@media (max-width: 768px) {
	.album-gallery-grid.layout-4,
	.album-gallery-grid.layout-default {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		min-height: auto;
	}
	
	.album-gallery-grid.layout-4 .gallery-item:nth-child(1),
	.album-gallery-grid.layout-4 .gallery-item:nth-child(2),
	.album-gallery-grid.layout-4 .gallery-item:nth-child(3),
	.album-gallery-grid.layout-4 .gallery-item:nth-child(4) {
		grid-column: 1;
		grid-row: auto;
		aspect-ratio: 4 / 3;
	}
}

/* ========== LIGHTBOX ========== */
.vespa-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(20, 25, 30, 0.96);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s;
	backdrop-filter: blur(4px);
}

.vespa-lightbox.active {
	opacity: 1;
	visibility: visible;
}

.lb-close {
	position: absolute;
	top: 24px;
	right: 28px;
	width: 48px;
	height: 48px;
	border: none;
	background: rgba(255,255,255,0.1);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	z-index: 10;
}

.lb-close:hover {
	background: rgba(255,255,255,0.2);
}

.lb-prev,
.lb-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border: none;
	background: rgba(255,255,255,0.12);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, transform 0.2s;
	z-index: 10;
}

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

.lb-prev:hover,
.lb-next:hover {
	background: rgba(255,255,255,0.25);
	transform: translateY(-50%) scale(1.08);
}

.lb-content {
	max-width: 90vw;
	max-height: 85vh;
	text-align: center;
	position: relative;
}

.lb-image {
	max-width: 90vw;
	max-height: 78vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.4);
	opacity: 0;
	transform: scale(0.96);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.lb-caption {
	color: rgba(255,255,255,0.9);
	font-size: 1rem;
	margin-top: 16px;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
	line-height: 1.5;
}

.lb-counter {
	color: rgba(255,255,255,0.55);
	font-size: 0.85rem;
	margin-top: 8px;
	letter-spacing: 0.05em;
}

/* Loading state */
.lb-image.loading {
	opacity: 0.3;
}

/* Hide Flatsome default if conflict */
.vespa-gallery-single .page-title,
.vespa-gallery-archive .page-title {
	display: none !important;
}

/* No albums / no images */
.no-albums,
.no-images {
	text-align: center;
	color: #888;
	padding: 60px 20px;
	font-size: 1.1rem;
}
