/* ACF Lite Gallery — grid v3.0.0
   Namespaced under .alg- so it will not collide with theme styles. */

.alg-wrap {
	--alg-cols: 3;
	--alg-gap: 12px;
	--alg-ratio: 1 / 1;
	--alg-radius: 4px;
	--alg-fg: currentColor;
	--alg-accent: #111;
	--alg-accent-fg: #fff;
	margin: 0 0 1.5rem;
}

/* ---------- Grid ---------- */

.alg-gallery {
	display: grid;
	grid-template-columns: repeat(var(--alg-cols), minmax(0, 1fr));
	gap: var(--alg-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.alg-item {
	margin: 0;
	padding: 0;
	min-width: 0;
}

.alg-link {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--alg-radius);
	background: rgba(127, 127, 127, 0.12);
	line-height: 0;
	text-decoration: none;
	aspect-ratio: var(--alg-ratio);
}

.alg-link:focus-visible {
	outline: 2px solid var(--alg-accent);
	outline-offset: 3px;
}

.alg-link .alg-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

@media (hover: hover) {
	.alg-link:hover .alg-img {
		transform: scale(1.04);
	}
}

/* Newly appended tiles */
.alg-item--new {
	animation: alg-in 0.35s ease both;
}

@keyframes alg-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 900px) {
	.alg-gallery {
		grid-template-columns: repeat(min(var(--alg-cols), 2), minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.alg-gallery {
		grid-template-columns: repeat(min(var(--alg-cols), 1), minmax(0, 1fr));
	}
}

/* ---------- Load more ---------- */

.alg-actions {
	display: flex;
	justify-content: center;
	margin-top: calc(var(--alg-gap) * 1.5);
}

.alg-more {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.7em 1.6em;
	border: 1px solid var(--alg-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--alg-accent);
	font: inherit;
	font-size: 0.95em;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.alg-more:hover,
.alg-more:focus-visible {
	background: var(--alg-accent);
	color: var(--alg-accent-fg);
}

.alg-more[disabled] {
	cursor: default;
	opacity: 0.6;
}

.alg-spinner {
	display: none;
	width: 0.9em;
	height: 0.9em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: alg-spin 0.7s linear infinite;
}

.alg-more.is-loading .alg-spinner {
	display: block;
}

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

.alg-status {
	margin: 0.75em 0 0;
	text-align: center;
	font-size: 0.9em;
}

.alg-status:empty {
	margin: 0;
}

.alg-status--error {
	color: #b3261e;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.alg-link .alg-img,
	.alg-item--new {
		transition: none;
		animation: none;
	}

	.alg-link:hover .alg-img {
		transform: none;
	}
}

@media (prefers-color-scheme: dark) {
	.alg-wrap {
		--alg-accent: #f2f2f2;
		--alg-accent-fg: #111;
	}
}
