/* Unlayered: the Swiper vendor stylesheet is unlayered too, so layered utilities would lose to it. */
.nomon-post-carousel {
	--swiper-navigation-size: 48px;
	--swiper-navigation-sides-offset: -24px;
	--swiper-navigation-color: var(--wp--preset--color--white);
}

/* Room for the 48px button plus a 16px gap once the 1440px track leaves 64px gutters. */
@media (min-width: 1568px) {
	.nomon-post-carousel {
		--swiper-navigation-sides-offset: -64px;
	}
}

.nomon-post-carousel .swiper-button-prev,
.nomon-post-carousel .swiper-button-next {
	padding: 0;
	border: 0;
	background: color-mix(in srgb, var(--wp--preset--color--black) 70%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: background 0.15s ease;
}

.nomon-post-carousel :is(.swiper-button-prev, .swiper-button-next):hover {
	background: color-mix(in srgb, var(--wp--preset--color--black) 85%, transparent);
}

/* Pre-init and editor widths; the editor's Tailwind compile drops arbitrary calc() utilities. */
.nomon-post-carousel .swiper-slide {
	width: calc((100% - 7.5px) / 1.5);
	height: auto;
	margin-right: 15px;
}

/* Bleeds to the viewport's right edge (the section's overflow-x-clip stops it); the left edge stays flush. */
.nomon-post-carousel .swiper {
	overflow: visible;
	clip-path: inset(-100vh -100vw -100vh 0);
}

.nomon-post-carousel .post-card {
	background: var(--wp--preset--color--white);
}

@media (min-width: 479px) {
	.nomon-post-carousel .swiper-slide {
		width: calc((100% - 22.5px) / 2.5);
	}
}

@media (min-width: 768px) {
	.nomon-post-carousel .swiper-slide {
		width: calc(25% - 11.25px);
	}
}

/* Centred on the 3:2 card image of a 4-up row; percentages in `top` would follow the height. */
.nomon-post-carousel__track {
	container-type: inline-size;
	--swiper-navigation-top-offset: calc((100cqw - 45px) / 12);
}

@media (max-width: 767px) {
	.nomon-post-carousel :is(.swiper-button-prev, .swiper-button-next) {
		display: none;
	}
}

.nomon-post-carousel :is(.swiper-button-prev, .swiper-button-next) svg {
	width: 18px;
	height: 18px;
	fill: none;
}

.nomon-post-carousel .swiper-button-prev svg {
	rotate: 90deg;
}

.nomon-post-carousel .swiper-button-next svg {
	rotate: -90deg;
}
