/**
 * Project Archive — view styles.
 *
 * Category filters, button resets, and loading state.
 *
 * @package RHM_Atelier_Latitude_Portfolio
 */

/* ==========================================================================
   Category Filters
   ========================================================================== */

.al-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	margin-bottom: var(--wp--preset--spacing--50);
	position: sticky;
	top: var(--al-header-height, 80px);
	z-index: 90;
	padding: var(--wp--preset--spacing--20) 0;
}

@media (max-width: 768px) {
	.al-filters {
		gap: var(--wp--preset--spacing--20);
	}
}

/* Full-width background layer — content stays within wide-size */
.al-filters::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(50% - 50vw);
	width: 100vw;
	background-color: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
	z-index: -1;
}

.al-filter {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--muted);
	background: none;
	border: none;
	padding: 0.4em 0;
	cursor: pointer;
	position: relative;
	transition: color 0.3s ease;
	--al-filter-color: var(--wp--preset--color--contrast);
}

.al-filter::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--al-filter-color);
	transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.al-filter:hover,
.al-filter.is-active {
	color: var(--wp--preset--color--contrast);
}

.al-filter.is-active::after,
.al-filter:hover::after {
	width: 100%;
}

.al-filter-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* Smooth grid transition during filtering (fallback for no View Transitions) */
.al-bento {
	transition: opacity 0.3s ease;
}

.al-bento.is-filtering {
	opacity: 0;
	pointer-events: none;
}

/* ==========================================================================
   Scroll Loader
   ========================================================================== */

.al-scroll-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--wp--preset--spacing--30) 0;
	min-height: 60px;
}

.al-spinner {
	display: block;
	width: 24px;
	height: 24px;
	border: 2px solid var(--wp--preset--color--muted, #ccc);
	border-top-color: var(--wp--preset--color--contrast, #000);
	border-radius: 50%;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.al-scroll-loader.is-loading .al-spinner {
	opacity: 1;
	animation: al-spin 0.8s linear infinite;
}

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