/* Portfolio Endless Scroll – Frontend Styles */

/* ── Filter bar ── */
.wetzlar-portfolio-filter-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	padding: 24px 48px;
	border-bottom: 1px solid var(--wp--preset--color--outline-variant, #5b403f);
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(19, 19, 19, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .wetzlar-portfolio-filter-bar {
	background: rgba(245, 245, 244, 0.85);
	border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* ── Dropdown ── */
.wetzlar-filter-dropdown {
	position: relative;
}

.wetzlar-filter-trigger {
	background: none;
	border: 1px solid var(--wp--preset--color--outline, #ab8987);
	color: var(--wp--preset--color--on-surface, #e5e2e1);
	font-family: var(--wp--preset--font-family--label);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 10px 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s ease;
}

.wetzlar-filter-trigger:hover {
	border-color: var(--wp--preset--color--primary, #ffb3b1);
	color: var(--wp--preset--color--primary, #ffb3b1);
}

.wetzlar-filter-trigger::after {
	content: '';
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
	transition: transform 0.2s ease;
}

.wetzlar-filter-dropdown.is-open .wetzlar-filter-trigger::after {
	transform: rotate(180deg);
}

[data-theme="light"] .wetzlar-filter-trigger {
	color: #1a1a1a;
	border-color: rgba(0, 0, 0, 0.2);
}

/* ── Dropdown menu ── */
.wetzlar-filter-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 200px;
	background: var(--wp--preset--color--surface-container, #202020);
	border: 1px solid var(--wp--preset--color--outline-variant, #5b403f);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: all 0.2s ease;
	z-index: 60;
}

.wetzlar-filter-dropdown.is-open .wetzlar-filter-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

[data-theme="light"] .wetzlar-filter-menu {
	background: #fff;
	border-color: rgba(0, 0, 0, 0.1);
	box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.wetzlar-filter-option {
	background: none;
	border: none;
	color: var(--wp--preset--color--on-surface, #e5e2e1);
	font-family: var(--wp--preset--font-family--label);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 10px 20px;
	width: 100%;
	text-align: left;
	cursor: pointer;
	transition: all 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wetzlar-filter-option:hover,
.wetzlar-filter-option.is-active {
	background: var(--wp--preset--color--surface-container-high, #2a2a2a);
	color: var(--wp--preset--color--primary, #ffb3b1);
}

.wetzlar-filter-option.is-active::after {
	content: '✓';
	font-size: 11px;
}

[data-theme="light"] .wetzlar-filter-option {
	color: #1a1a1a;
}

[data-theme="light"] .wetzlar-filter-option:hover,
[data-theme="light"] .wetzlar-filter-option.is-active {
	background: rgba(0,0,0,0.05);
	color: #ff535b;
}

/* ── Active filter chips ── */
.wetzlar-active-filters {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.wetzlar-filter-chip {
	background: var(--wp--preset--color--surface-container-high, #2a2a2a);
	color: var(--wp--preset--color--on-surface, #e5e2e1);
	font-family: var(--wp--preset--font-family--label);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 6px 14px;
	border: 1px solid var(--wp--preset--color--outline-variant, #5b403f);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.15s ease;
}

.wetzlar-filter-chip:hover {
	border-color: var(--wp--preset--color--primary, #ffb3b1);
	color: var(--wp--preset--color--primary, #ffb3b1);
}

.wetzlar-filter-chip .remove {
	font-size: 14px;
	line-height: 1;
	opacity: 0.6;
}

[data-theme="light"] .wetzlar-filter-chip {
	background: rgba(0,0,0,0.05);
	color: #1a1a1a;
	border-color: rgba(0,0,0,0.1);
}

/* ── Gallery grid ── */
.wetzlar-endless-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
}

.wetzlar-endless-gallery .wetzlar-gallery-item {
	aspect-ratio: 3 / 4;
	position: relative;
	overflow: hidden;
	cursor: pointer;
	background: #1a1a1a;
}

.wetzlar-endless-gallery .wetzlar-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	user-select: none;
	-webkit-user-drag: none;
}

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

.wetzlar-endless-gallery .wetzlar-gallery-item.is-hidden {
	display: none;
}

/* Overlay on hover */
.wetzlar-endless-gallery .wetzlar-gallery-item .wetzlar-gallery-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	opacity: 0;
	transition: opacity 0.3s ease;
	padding: 16px;
}

.wetzlar-endless-gallery .wetzlar-gallery-item:hover .wetzlar-gallery-overlay,
.wetzlar-endless-gallery .wetzlar-gallery-item:focus .wetzlar-gallery-overlay {
	opacity: 1;
}

.wetzlar-endless-gallery .wetzlar-gallery-overlay .title {
	color: #e5e2e1;
	font-family: var(--wp--preset--font-family--display);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-align: center;
}

.wetzlar-endless-gallery .wetzlar-gallery-overlay .meta {
	color: rgba(229, 226, 225, 0.6);
	font-family: var(--wp--preset--font-family--label);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* ── Load more / sentinel ── */
.wetzlar-gallery-sentinel {
	width: 100%;
	height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wetzlar-gallery-sentinel .spinner {
	width: 32px;
	height: 32px;
	border: 2px solid var(--wp--preset--color--outline-variant, #5b403f);
	border-top-color: var(--wp--preset--color--primary, #ffb3b1);
	border-radius: 50%;
	animation: wetzlar-spin 0.8s linear infinite;
}

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

.wetzlar-gallery-sentinel.is-done {
	display: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
	.wetzlar-endless-gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.wetzlar-portfolio-filter-bar {
		padding: 16px 24px;
		gap: 12px;
		flex-wrap: wrap;
	}

	.wetzlar-endless-gallery {
		grid-template-columns: repeat(2, 1fr);
		gap: 2px;
	}

	.wetzlar-filter-trigger {
		padding: 8px 14px;
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.wetzlar-endless-gallery {
		grid-template-columns: 1fr;
	}
}
