/**
 * CM Artist Gallery - Frontend Gallery Styles
 *
 * WICHTIG: Transparente Hover-Effekte mit schwarzer feiner Schrift!
 */

/* ============================================
   Gallery Container
   ============================================ */

.cm-artist-gallery {
	width: 100%;
	max-width: 100%;
	margin: 0 auto 40px;
}

/* ============================================
   Filter Buttons
   ============================================ */

.cm-gallery-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	/*border-bottom: 1px solid rgba(0, 0, 0, 0.1);*/
}

.cm-filter-btn {
	/* WICHTIG: Transparent, keine Boxen! */
	background: transparent;
	border: none;
	padding: 8px 0;

	/* Schwarze feine Schrift */
	color: #000;
	font-size: 15px;
	font-weight: 300;
	letter-spacing: 0.5px;

	cursor: pointer;
	position: relative;
	transition: all 0.3s ease;
}

.cm-filter-btn::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 1px;
	background: #000;
	transition: width 0.3s ease;
}

.cm-filter-btn:hover,
.cm-filter-btn.active {
	font-weight: 400;
}

.cm-filter-btn.active::after {
	width: 100%;
}

.cm-filter-btn:hover::after {
	width: 100%;
}

/* ============================================
   Gallery Grid
   ============================================ */

.cm-gallery-grid {
	display: grid;
	gap: 20px;
	margin: 0;
	padding: 0;
}

/* Column Layouts (for Grid layout only, not Masonry) */
.cm-layout-grid.cm-columns-1 .cm-gallery-grid {
	grid-template-columns: 1fr;
}

.cm-layout-grid.cm-columns-2 .cm-gallery-grid {
	grid-template-columns: repeat(2, 1fr);
}

.cm-layout-grid.cm-columns-3 .cm-gallery-grid {
	grid-template-columns: repeat(3, 1fr);
}

.cm-layout-grid.cm-columns-4 .cm-gallery-grid {
	grid-template-columns: repeat(4, 1fr);
}

.cm-layout-grid.cm-columns-5 .cm-gallery-grid {
	grid-template-columns: repeat(5, 1fr);
}

.cm-layout-grid.cm-columns-6 .cm-gallery-grid {
	grid-template-columns: repeat(6, 1fr);
}

/* Masonry Layout - JS-based positioning */
.cm-layout-masonry .cm-gallery-grid {
	position: relative;
	display: block;
}

.cm-layout-masonry .cm-gallery-item {
	position: absolute;
	left: 0;
	top: 0;
	transition: all 0.3s ease;
}

/* ============================================
   Gallery Items
   ============================================ */

.cm-gallery-item {
	position: relative;
	overflow: hidden;
	opacity: 1;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Filtering Animation */
.cm-gallery-item.cm-filtered-out {
	display: none;
}

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

.cm-lightbox-link {
	display: block;
	position: relative;
	text-decoration: none;
	cursor: pointer;
}

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

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

/* ============================================
   Hover Info Overlay - TRANSPARENT!
   ============================================ */

.cm-item-info {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;

	/* Weißer Hintergrund mit 80% Transparenz */
	background: rgba(255, 255, 255, 0.8);

	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 20px;

	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.cm-gallery-item:hover .cm-item-info {
	opacity: 1;
}

.cm-item-title {
	/* Schwarze feine Schrift */
	color: #000;
	font-size: 18px;
	font-weight: 300;
	letter-spacing: 0.5px;
	text-align: center;
	margin: 0 0 5px 0;
	line-height: 1.2em;
	padding: 3px;
}

.cm-item-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
	align-items: center;
	justify-content: center;
}

.cm-meta-technik,
.cm-meta-masse {
	/* Schwarze feine Schrift */
	color: #000;
	font-size: 14px;
	font-weight: 300;
	letter-spacing: 0.3px;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
	/* Grid Layout */
	.cm-layout-grid.cm-columns-5 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-6 .cm-gallery-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.cm-layout-grid.cm-columns-4 .cm-gallery-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	/* Grid Layout */
	.cm-layout-grid.cm-columns-3 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-4 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-5 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-6 .cm-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.cm-gallery-grid {
		gap: 15px;
	}

	.cm-gallery-filters {
		gap: 15px;
	}

	.cm-item-title {
		font-size: 16px;
	}

	.cm-meta-technik,
	.cm-meta-masse {
		font-size: 13px;
	}
}

/* Mobile */
@media (max-width: 480px) {
	/* Grid Layout */
	.cm-layout-grid.cm-columns-2 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-3 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-4 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-5 .cm-gallery-grid,
	.cm-layout-grid.cm-columns-6 .cm-gallery-grid {
		grid-template-columns: 1fr;
	}

	.cm-gallery-grid {
		gap: 10px;
	}

	.cm-gallery-filters {
		gap: 10px;
	}

	.cm-filter-btn {
		font-size: 14px;
	}

	.cm-item-title {
		font-size: 15px;
	}

	.cm-meta-technik,
	.cm-meta-masse {
		font-size: 12px;
	}
}

/* ============================================
   Empty State
   ============================================ */

.cm-gallery-empty,
.cm-gallery-error {
	padding: 40px 20px;
	text-align: center;
	color: #666;
	font-style: italic;
}

.cm-gallery-error {
	color: #d63638;
}

/* ============================================
   Loading State (for future AJAX)
   ============================================ */

.cm-artist-gallery.cm-loading {
	opacity: 0.6;
	pointer-events: none;
}

.cm-artist-gallery.cm-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #000;
	border-radius: 50%;
	animation: cm-spin 0.6s linear infinite;
}

@keyframes cm-spin {
	to {
		transform: rotate(360deg);
	}
}
