/* v1.18: program galleries scroll sideways on the live site (the editor keeps the grid, so photos are easy to manage). */
.apia-gallery-wrap { position: relative; }
.apia-gallery.wp-block-gallery.has-nested-images {
	grid-auto-flow: column;
	grid-template-columns: none !important;
	grid-auto-columns: calc((100% - 3 * var(--apia-gap)) / 4.25);
	--apia-gap: var(--wp--style--unstable-gallery-gap, 1rem);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 0;
	padding-bottom: 0.75rem;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--maroon) var(--wp--preset--color--line);
}
.apia-gallery.wp-block-gallery.has-nested-images figure.wp-block-image { scroll-snap-align: start; }
.apia-gallery.wp-block-gallery.has-nested-images::-webkit-scrollbar { height: 6px; }
.apia-gallery.wp-block-gallery.has-nested-images::-webkit-scrollbar-track { background: var(--wp--preset--color--line); border-radius: 3px; }
.apia-gallery.wp-block-gallery.has-nested-images::-webkit-scrollbar-thumb { background: var(--wp--preset--color--maroon); border-radius: 3px; }
@media (max-width: 900px) {
	.apia-gallery.wp-block-gallery.has-nested-images { grid-auto-columns: calc((100% - 2 * var(--apia-gap)) / 2.6); }
}
@media (max-width: 600px) {
	.apia-gallery.wp-block-gallery.has-nested-images { grid-auto-columns: 72%; }
}

/* Arrow buttons (added by gallery-scroll.js) */
.apia-gallery-arrow {
	position: absolute;
	top: calc(50% - 0.375rem);
	transform: translateY(-50%);
	z-index: 2;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--maroon-dark);
	box-shadow: 0 2px 10px rgb(26 20 22 / 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s, background 0.2s;
}
.apia-gallery-arrow:hover { background: var(--wp--preset--color--maroon); color: var(--wp--preset--color--base); }
.apia-gallery-arrow:focus-visible { outline: 3px solid var(--wp--preset--color--sky-dark); outline-offset: 2px; }
.apia-gallery-arrow svg { width: 20px; height: 20px; }
.apia-gallery-arrow.is-prev { left: -14px; }
.apia-gallery-arrow.is-next { right: -14px; }
.apia-gallery-arrow[hidden] { display: none; }
@media (max-width: 600px) {
	.apia-gallery-arrow { display: none; } /* phones swipe */
}
@media (prefers-reduced-motion: no-preference) {
	.apia-gallery.wp-block-gallery.has-nested-images { scroll-behavior: smooth; }
}
