/**
 * Gallery Styles
 *
 * Photo gallery grid, filters, and lightbox
 */

/* ========================================
   GALLERY FILTERS
   ======================================== */
.bp-gallery-filters {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: var(--space-sm);
	margin-bottom: var(--space-2xl);
	padding-bottom: var(--space-lg);
}

.bp-gallery-filter {
	padding: var(--space-sm) var(--space-lg);
	font-size: var(--text-body);
	font-weight: var(--font-weight-semibold);
	background: var(--color-white);
	color: var(--color-charcoal);
	border: 2px solid var(--color-cream);
	border-radius: var(--radius-full);
	cursor: pointer;
	transition: all var(--transition-speed) var(--transition-easing);
	min-height: 44px;
}

.bp-gallery-filter:hover,
.bp-gallery-filter:focus {
	background: var(--color-pink-primary);
	color: var(--color-white);
	border-color: var(--color-pink-primary);
	transform: translateY(-2px);
}

.bp-gallery-filter.active {
	background: var(--gradient-billie);
	color: var(--color-white);
	border-color: transparent;
}

.bp-gallery-filter .count {
	font-size: var(--text-sm);
	opacity: 0.8;
	margin-left: 4px;
}

/* Loading Indicator */
.bp-gallery-loading {
	text-align: center;
	padding: var(--space-2xl);
	color: var(--color-gray);
	font-size: var(--text-body-lg);
}

/* ========================================
   GALLERY GRID
   ======================================== */
.bp-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	grid-auto-rows: 300px;
	gap: var(--space-lg);
}

/* Make some items taller for visual variety */
.bp-gallery-item:nth-child(7n + 1) {
	grid-row: span 2;
}

/* Gallery Item */
.bp-gallery-item {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	transition: all var(--transition-speed) var(--transition-easing);
	cursor: pointer;
}

.bp-gallery-item:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-hover);
	z-index: 10;
}

/* Gallery Link */
.bp-gallery-link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}

.bp-gallery-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-speed) var(--transition-easing);
}

.bp-gallery-item:hover .bp-gallery-link img {
	transform: scale(1.1);
}

/* Gallery Caption */
.bp-gallery-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: var(--space-md);
	background: var(--gradient-overlay);
	color: var(--color-white);
	font-size: var(--text-sm);
	transform: translateY(100%);
	transition: transform var(--transition-speed) var(--transition-easing);
}

.bp-gallery-item:hover .bp-gallery-caption {
	transform: translateY(0);
}

/* Gallery Empty State */
.bp-gallery-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: var(--space-3xl);
	color: var(--color-gray);
}

/* ========================================
   GALLERY LIGHTBOX
   ======================================== */
.bp-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: var(--z-lightbox);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: all var(--transition-speed) var(--transition-easing);
}

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

/* Lightbox Overlay */
.bp-lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.95);
	z-index: 1;
}

/* Lightbox Content */
.bp-lightbox-content {
	position: relative;
	z-index: 2;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Lightbox Image */
.bp-lightbox-image-wrapper {
	position: relative;
}

.bp-lightbox-image {
	max-width: 90vw;
	max-height: 80vh;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
}

/* Lightbox Caption */
.bp-lightbox-caption {
	position: absolute;
	bottom: -60px;
	left: 0;
	right: 0;
	text-align: center;
	color: var(--color-white);
	font-size: var(--text-body);
	padding: var(--space-md);
}

/* Lightbox Controls */
.bp-lightbox-close,
.bp-lightbox-prev,
.bp-lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.9);
	color: var(--color-charcoal);
	border: none;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	cursor: pointer;
	transition: all var(--transition-speed) var(--transition-easing);
	z-index: 3;
}

.bp-lightbox-close:hover,
.bp-lightbox-prev:hover,
.bp-lightbox-next:hover,
.bp-lightbox-close:focus,
.bp-lightbox-prev:focus,
.bp-lightbox-next:focus {
	background: var(--color-white);
	transform: scale(1.1);
}

.bp-lightbox-close {
	top: 20px;
	right: 20px;
}

.bp-lightbox-prev {
	top: 50%;
	left: 20px;
	transform: translateY(-50%);
}

.bp-lightbox-prev:hover {
	transform: translateY(-50%) scale(1.1);
}

.bp-lightbox-next {
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
}

.bp-lightbox-next:hover {
	transform: translateY(-50%) scale(1.1);
}

/* ========================================
   RESPONSIVE GALLERY
   ======================================== */
@media (max-width: 1024px) {
	.bp-gallery-grid {
		grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
		grid-auto-rows: 250px;
	}
}

@media (max-width: 768px) {
	.bp-gallery-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		grid-auto-rows: 200px;
		gap: var(--space-md);
	}

	.bp-gallery-filters {
		gap: var(--space-xs);
	}

	.bp-gallery-filter {
		padding: var(--space-sm) var(--space-md);
		font-size: var(--text-sm);
		min-height: 40px;
	}

	/* Lightbox adjustments for mobile */
	.bp-lightbox-image {
		max-width: 95vw;
		max-height: 70vh;
	}

	.bp-lightbox-close,
	.bp-lightbox-prev,
	.bp-lightbox-next {
		width: 44px;
		height: 44px;
		font-size: 24px;
	}

	.bp-lightbox-close {
		top: 10px;
		right: 10px;
	}

	.bp-lightbox-prev {
		left: 10px;
	}

	.bp-lightbox-next {
		right: 10px;
	}

	.bp-lightbox-caption {
		font-size: var(--text-sm);
		bottom: -50px;
	}
}

@media (max-width: 480px) {
	.bp-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 150px;
		gap: var(--space-sm);
	}

	/* All gallery items same height on small screens */
	.bp-gallery-item:nth-child(7n + 1) {
		grid-row: span 1;
	}
}

/* ========================================
   GALLERY PREVIEW (Homepage)
   ======================================== */
.bp-gallery-preview {
	margin-bottom: var(--space-xl);
}

.bp-gallery-preview .bp-gallery-item:nth-child(7n + 1) {
	grid-row: span 1;
}
