/**
 * Acty Portfolio Carousel
 *
 * Scoped under .acty-pc throughout, and free of !important, so that Divi's
 * generated design styles (fonts, spacing, borders set in the Design tab)
 * always win over these defaults.
 */

.acty-pc {
	--acty-pc-gap: 48px;
	--acty-pc-media-bg: #f4f5f7;
	--acty-pc-arrow-size: 44px;
	--acty-pc-accent: #355ffb; /* Acty blue, from the logo */
}

/* -------------------------------------------------------------------------
 * Visibility is controlled here, not by splide-core.
 *
 * splide-core.min.css ships `.splide{visibility:hidden}` paired with
 * `.splide.is-initialized{visibility:visible}`. That pairing does not survive
 * a CSS optimiser that strips selectors it cannot see on the page: Perfmatters
 * Remove Unused CSS is active on this site and keeps the base rule while
 * pruning the state rule, because nothing carries `is-initialized` at scan
 * time. The result is a carousel that is permanently invisible. Overriding
 * the base rule with a higher-specificity selector that always matches keeps
 * the module visible no matter what happens to the vendor state rule.
 *
 * Before Splide mounts we show the first slide only, correctly laid out, so
 * that delayed or blocked JavaScript degrades to a usable single project
 * rather than an empty hole or a stacked dump of every slide.
 * ---------------------------------------------------------------------- */

.acty-pc .splide {
	visibility: visible;
}

/*
 * Give each slide its full width before mount, and let the track's own
 * overflow clipping hide the rest. Do NOT use display: none here: Splide
 * measures slide geometry during mount and only adds is-initialized once it
 * has finished, so a rule keyed on :not(.is-initialized) is still live while
 * it measures. Hiding slides at that moment makes it lay the track out
 * against zero-width slides and land on the wrong offset.
 */
.acty-pc .splide:not(.is-initialized) .splide__slide {
	flex: 0 0 100%;
	max-width: 100%;
}

/*
 * A placement can nominate a category to start on. The server marks the slides
 * that category leaves out, and they stay hidden until the script rebuilds the
 * list - otherwise the visitor briefly sees a slide from the wrong category.
 *
 * This hides slides, which the comment above warns about. It is safe only
 * because the script removes these same slides from the list before mounting,
 * so Splide never measures one of them. If that ever stops being true, this
 * rule brings the zero-width bug back.
 */
.acty-pc .splide:not(.is-initialized) .acty-pc__slide--filtered-out {
	display: none;
}

/* -------------------------------------------------------------------------
 * Category filter row.
 * ---------------------------------------------------------------------- */

.acty-pc__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 28px;
}

.acty-pc__filter {
	padding: 8px 16px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.acty-pc__filter:hover {
	border-color: var(--acty-pc-accent);
	color: var(--acty-pc-accent);
}

.acty-pc__filter.is-active {
	border-color: var(--acty-pc-accent);
	background: var(--acty-pc-accent);
	color: #fff;
}

.acty-pc__filter:focus-visible {
	outline: 2px solid var(--acty-pc-accent);
	outline-offset: 2px;
}

/* Announced to screen readers on filter change; not shown visually. */
.acty-pc__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------------------
 * Slide layout: text left, image right.
 * ---------------------------------------------------------------------- */

.acty-pc .splide {
	position: relative;
}

.acty-pc__slide {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--acty-pc-gap);
	align-items: center;
}

.acty-pc__slide--no-media {
	grid-template-columns: minmax(0, 1fr);
}

.acty-pc__text > *:first-child {
	margin-top: 0;
}

.acty-pc__text > *:last-child {
	margin-bottom: 0;
}

.acty-pc__cats {
	margin: 0 0 8px;
	font-size: 0.8125em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
}

.acty-pc__title {
	margin: 0 0 14px;
}

.acty-pc__title a {
	text-decoration: none;
	color: inherit;
}

.acty-pc__title a:hover {
	text-decoration: underline;
}

.acty-pc__excerpt {
	margin: 0 0 20px;
}

.acty-pc__excerpt > *:last-child {
	margin-bottom: 0;
}

/*
 * Tags sit under the body text. They are static labels, so they are styled
 * flatter than the filter buttons above the carousel - nothing here should
 * look clickable when it is not.
 */
.acty-pc__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 20px;
}

.acty-pc__tag {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.06);
	font-size: 0.8125em;
	line-height: 1.5;
}

.acty-pc__link {
	display: inline-block;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 2px solid currentColor;
	padding-bottom: 2px;
}

/* -------------------------------------------------------------------------
 * Media column.
 *
 * Fixed aspect box with object-fit: contain. Most project featured images on
 * this site are small square client logos rather than 900x640 landscape
 * shots, so contain keeps them centered and deliberate instead of stretched
 * or cropped. Larger landscape images fill the box with no code change.
 * ---------------------------------------------------------------------- */

.acty-pc__media {
	margin: 0;
}

.acty-pc__media a {
	display: block;
}

.acty-pc__image {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 900 / 640;
	object-fit: contain;
	background-color: var(--acty-pc-media-bg);
	padding: 16px;
	box-sizing: border-box;
	/* Default only: an Image border radius set on the module's Design tab
	   is generated by Divi at higher specificity and overrides this. */
	border-radius: 25px;
}

/* -------------------------------------------------------------------------
 * Arrows and pagination.
 *
 * splide-core ships no theme, so the controls are styled here. Arrows sit in
 * dedicated side gutters rather than on top of the slide, so they can never
 * overlap the text.
 * ---------------------------------------------------------------------- */

@media (min-width: 981px) {
	.acty-pc {
		--acty-pc-side-gutter: calc(var(--acty-pc-arrow-size) + 16px);
	}

	.acty-pc .splide {
		padding-left: var(--acty-pc-side-gutter);
		padding-right: var(--acty-pc-side-gutter);
	}

	/* Start the filter row on the same vertical line as the slide text,
	   rather than out in the arrow gutter. */
	.acty-pc__filters {
		padding-left: var(--acty-pc-side-gutter);
		padding-right: var(--acty-pc-side-gutter);
	}
}

.acty-pc .splide__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--acty-pc-arrow-size);
	height: var(--acty-pc-arrow-size);
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.acty-pc .splide__arrow svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.acty-pc .splide__arrow:hover:not(:disabled) {
	border-color: var(--acty-pc-accent);
	color: var(--acty-pc-accent);
}

.acty-pc .splide__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.acty-pc .splide__arrow:focus-visible {
	outline: 2px solid var(--acty-pc-accent);
	outline-offset: 2px;
}

.acty-pc .splide__arrow--prev {
	left: 0;
}

/* Splide draws both arrows with the same right-pointing icon and relies on
   its full theme stylesheet to mirror the previous one. Only splide-core is
   loaded here, so the mirroring has to be done in this file. */
.acty-pc .splide__arrow--prev svg {
	transform: scaleX(-1);
}

.acty-pc .splide__arrow--next {
	right: 0;
}

.acty-pc .splide__pagination {
	margin: 24px 0 0;
	padding: 0;
	gap: 8px;
}

.acty-pc .splide__pagination__page {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.22);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.acty-pc .splide__pagination__page.is-active {
	background: var(--acty-pc-accent);
	transform: scale(1.25);
}

.acty-pc .splide__pagination__page:focus-visible {
	outline: 2px solid var(--acty-pc-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Mobile: single column, image above the text.
 * ---------------------------------------------------------------------- */

@media (max-width: 980px) {
	.acty-pc {
		--acty-pc-gap: 24px;
	}

	.acty-pc__filters {
		margin-bottom: 20px;
	}

	.acty-pc__filter {
		padding: 7px 13px;
		font-size: 0.9375em;
	}

	.acty-pc__slide {
		grid-template-columns: minmax(0, 1fr);
	}

	.acty-pc__media {
		order: -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.acty-pc .splide__arrow,
	.acty-pc .splide__pagination__page,
	.acty-pc__filter {
		transition: none;
	}
}
