/* --- Project card --- */

.ut-project-card {
	display: block;
	color: var(--wp--preset--color--foreground);
	--ut-project-card-radius: 0.5rem;
}

.ut-project-card__media {
	position: relative;
	border-radius: var(--ut-project-card-radius);
	overflow: hidden;
}

.ut-project-card__figure-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ut-project-card__figure {
	position: relative;
	margin: 0;
	border-radius: var(--ut-project-card-radius);
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background-color: var(--wp--preset--color--accent);
}

.ut-project-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ut-project-card__video-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* Override jeditable-img-field's edit-mode position:relative + min-height
   so the video-layer keeps filling the figure when edit mode is on. */
body.jeditable-edit-active .ut-project-card__video-layer.jeditable-img-field {
	position: absolute;
	inset: 0;
	min-width: 0;
	min-height: 0;
	pointer-events: auto;
}

.ut-project-card__video-layer > video,
.ut-project-card__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ut-project-card__video-layer .jeditable-img-change-btn--video {
	left: 8px;
	right: auto;
}

.ut-project-card__video-layer .jeditable-img-remove-btn--video {
	left: 8px;
	right: auto;
}

/* Lift all card image/video controls above overlay (z-index 3) */
body.jeditable-edit-active .ut-project-card .jeditable-img-change-btn,
body.jeditable-edit-active .ut-project-card .jeditable-img-remove-btn {
	z-index: 20;
}

.ut-project-card__name {
	display: -webkit-box;
	margin-top: clamp(0.85rem, 1vw, 1.1rem);
	font-family: var(--wp--preset--font-family--makira);
	font-size: clamp(1.2rem, 1.2vw, 3rem);
	line-height: 1.02;
	letter-spacing: -0.02em;
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.ut-project-card:hover .ut-project-card__name,
.ut-project-card:focus-within .ut-project-card__name {
	opacity: 0.18;
	transform: translateY(-0.2rem);
}

.ut-project-card__category {
	display: block;
	margin-top: 0.25em;
	font-size: var(--ut-caption-size);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.6;
}

.ut-project-card__description {
	margin-top: 0.45rem;
	font-size: var(--ut-text-size);
	opacity: 0.8;
}

.ut-project-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: clamp(1.15rem, 2vw, 1.85rem);
	color: #ffffff;
	background: linear-gradient(
		180deg,
		rgba( 4, 4, 4, 0 ) 6%,
		rgba( 8, 8, 8, 0.1 ) 28%,
		rgba( 8, 8, 8, 0.44 ) 64%,
		rgba( 8, 8, 8, 0.68 ) 100%
	);
	opacity: 0;
	transform: translateY(1.15rem);
	pointer-events: none;
	transition: opacity 0.45s var(--ut-ease-out-expo),
		transform 0.45s var(--ut-ease-out-expo);
}

.ut-project-card:hover .ut-project-card__overlay,
.ut-project-card:focus-within .ut-project-card__overlay {
	opacity: 1;
	transform: translateY(0);
	pointer-events: none;
}

body.jeditable-edit-active .ut-project-card:hover .ut-project-card__overlay,
body.jeditable-edit-active .ut-project-card:focus-within .ut-project-card__overlay {
	pointer-events: auto;
}

.ut-project-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin: auto 0 0;
	max-width: 90%;
	font-family: var(--wp--preset--font-family--makira);
	font-size: clamp(1rem, 0.75vw + 0.78rem, 1rem);
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: 0.01em;
	text-transform: none;
	color: #ffffff;
	font-weight: 400;
	opacity: 0;
	transform: translateY(0.8rem);
	display: none;
}

.ut-project-card__meta-item {
	display: inline-flex;
	align-items: center;
	padding: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	backdrop-filter: none;
}

.ut-project-card__overlay-description {
	width: 100%;
	margin-top: 0;
	font-family: var(--wp--preset--font-family--makira);
	font-size: clamp(1.4rem, 1.5vw, 3rem);
	font-weight: 400;
	line-height: 1.22;
	letter-spacing: 0;
	max-width: 100%;
	overflow: hidden;
	text-wrap: pretty;
	color: #ffffff;
	opacity: 0;
	transform: translateY(0.8rem);
}

.ut-project-card__overlay-description span {
	max-width: none;
}

.ut-project-card__overlay-description p {
	margin: 0;
	max-width: none;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	line-clamp: 3;
	-webkit-line-clamp: 3;
}


.ut-project-card__overlay-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem 1rem;
	align-items: center;
	pointer-events: none;
	opacity: 0;
	transform: translateY(0.8rem);
}

.ut-project-card__overlay-link {
	align-self: flex-start;
	margin-top: 0;
	pointer-events: auto;
	font-size: var(--ut-text-size);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
	display: none;
}

.ut-project-card__overlay-link--case:hover,
.ut-project-card__overlay-link--case:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.ut-project-card__overlay-link--visit {
	align-self: flex-end;
	margin-bottom: auto;
	opacity: 0;
	transform: translateY(-0.6rem);
	display: none;
}

.ut-project-card__overlay-link--visit,
.ut-project-card__meta,
.ut-project-card__overlay-description,
.ut-project-card__overlay-actions {
	transition:
		opacity 0.45s var(--ut-ease-out-expo),
		transform 0.45s var(--ut-ease-out-expo);
}

.ut-project-card:hover .ut-project-card__overlay-link--visit,
.ut-project-card:focus-within .ut-project-card__overlay-link--visit {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.08s;
}

.ut-project-card:hover .ut-project-card__meta,
.ut-project-card:focus-within .ut-project-card__meta {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.14s;
}

.ut-project-card:hover .ut-project-card__overlay-description,
.ut-project-card:focus-within .ut-project-card__overlay-description {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.2s;
}

body.jeditable-edit-active .ut-project-card:hover .ut-project-card__overlay-description,
body.jeditable-edit-active .ut-project-card:focus-within .ut-project-card__overlay-description,
body.jeditable-edit-active .ut-project-card:hover .ut-project-card__overlay-actions,
body.jeditable-edit-active .ut-project-card:focus-within .ut-project-card__overlay-actions {
	pointer-events: auto;
}

.ut-project-card:hover .ut-project-card__overlay-actions,
.ut-project-card:focus-within .ut-project-card__overlay-actions {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.26s;
}
/* ==========================================================================
   Projects — Hero
   ========================================================================== */

.ut-projects-hero {
	padding-top: var(--ut-space-md);
	padding-bottom: var(--ut-space-sm);
}

.ut-projects-hero__title {
	margin: 0;
	/* max-width: 18em; */
	font-size: var(--ut-display-size);
	line-height: var(--ut-h2-line-height);
}

.ut-projects-hero__filter-link {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	overflow: hidden;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	z-index: 0;
	transition: color 0.25s ease;
}

.ut-projects-hero__filter-text,
.ut-projects-hero__filter-comma {
	display: inline-block;
	transition: filter 0.25s ease, opacity 0.25s ease, transform 1s var(--ut-ease-out-expo);
}

.ut-projects.has-active-project-filters .ut-projects-hero__filter-link {
	color: var(--wp--preset--color--foreground);
}

.ut-projects.has-active-project-filters .ut-projects-hero__filter-link .ut-projects-hero__filter-text,
.ut-projects.has-active-project-filters .ut-projects-hero__filter-link .ut-projects-hero__filter-comma {
	filter: blur(0.02em);
	opacity: 0.55;
}

.ut-projects.has-active-project-filters .ut-projects-hero__filter-link:hover,
.ut-projects.has-active-project-filters .ut-projects-hero__filter-link:focus-visible,
.ut-projects-hero__filter-link:hover,
.ut-projects-hero__filter-link:focus-visible {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-underline-offset: 0.12em;
	z-index: 2;
}

.ut-projects.has-active-project-filters .ut-projects-hero__filter-link:hover .ut-projects-hero__filter-text,
.ut-projects.has-active-project-filters .ut-projects-hero__filter-link:hover .ut-projects-hero__filter-comma,
.ut-projects.has-active-project-filters .ut-projects-hero__filter-link:focus-visible .ut-projects-hero__filter-text,
.ut-projects.has-active-project-filters .ut-projects-hero__filter-link:focus-visible .ut-projects-hero__filter-comma,
.ut-projects-hero__filter-link:hover .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:hover .ut-projects-hero__filter-comma,
.ut-projects-hero__filter-link:focus-visible .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:focus-visible .ut-projects-hero__filter-comma {
	filter: none;
	opacity: 1;
}

.ut-projects.has-active-project-filters .ut-projects-hero__filter-link.is-active,
.ut-projects-hero__filter-link.is-active {
	color: var(--wp--preset--color--accent);
	z-index: 1;
}

.ut-projects.has-active-project-filters .ut-projects-hero__filter-link.is-active .ut-projects-hero__filter-text,
.ut-projects.has-active-project-filters .ut-projects-hero__filter-link.is-active .ut-projects-hero__filter-comma,
.ut-projects-hero__filter-link.is-active .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link.is-active .ut-projects-hero__filter-comma {
	filter: none;
	opacity: 1;
}

/* --- Projects filter: staggered reveal --- */

.ut-projects-hero.ut-scroll-reveal {
	opacity: 1;
	transform: none;
	transition: none;
}

.ut-projects-hero__filter-link .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link .ut-projects-hero__filter-comma {
	transform: translateY(115%);
}

.ut-projects-hero.ut-anim-ready .ut-projects-hero__filter-link .ut-projects-hero__filter-text,
.ut-projects-hero.ut-anim-ready .ut-projects-hero__filter-link .ut-projects-hero__filter-comma {
	transform: translateY(0);
}

.ut-projects-hero__filter-link:nth-child(1) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(1) .ut-projects-hero__filter-comma { transition-delay: 0s; }
.ut-projects-hero__filter-link:nth-child(2) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(2) .ut-projects-hero__filter-comma { transition-delay: 0.06s; }
.ut-projects-hero__filter-link:nth-child(3) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(3) .ut-projects-hero__filter-comma { transition-delay: 0.12s; }
.ut-projects-hero__filter-link:nth-child(4) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(4) .ut-projects-hero__filter-comma { transition-delay: 0.18s; }
.ut-projects-hero__filter-link:nth-child(5) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(5) .ut-projects-hero__filter-comma { transition-delay: 0.24s; }
.ut-projects-hero__filter-link:nth-child(6) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(6) .ut-projects-hero__filter-comma { transition-delay: 0.30s; }
.ut-projects-hero__filter-link:nth-child(7) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(7) .ut-projects-hero__filter-comma { transition-delay: 0.36s; }
.ut-projects-hero__filter-link:nth-child(n+8) .ut-projects-hero__filter-text,
.ut-projects-hero__filter-link:nth-child(n+8) .ut-projects-hero__filter-comma { transition-delay: 0.42s; }

/* ==========================================================================
   Projects — Grid
   ========================================================================== */

.ut-projects-grid {
	padding-bottom: var(--ut-space-lg);
}

.ut-projects-grid__items {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--ut-gutter);
}

.ut-project-card--is-hidden {
	display: none;
}

/* Staggered card reveal */

.ut-projects-grid .ut-project-card {
	opacity: 0;
	transform: translateY(2.5rem);
	transition: opacity 0.9s var(--ut-ease-out-expo),
	            transform 0.9s var(--ut-ease-out-expo);
}

.ut-projects-grid.ut-anim-ready .ut-project-card {
	opacity: 1;
	transform: translateY(0);
}

.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(1) { transition-delay: 0.1s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(2) { transition-delay: 0.2s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(3) { transition-delay: 0.3s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(4) { transition-delay: 0.4s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(5) { transition-delay: 0.5s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(6) { transition-delay: 0.6s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(7) { transition-delay: 0.7s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(8) { transition-delay: 0.8s; }
.ut-projects-grid.ut-anim-ready .ut-project-card:nth-child(n+9) { transition-delay: 0.9s; }

.ut-projects-grid__empty {
	grid-column: 1 / -1;
}

.ut-projects-grid__empty-card {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 1rem;
	min-height: clamp(14rem, 24vw, 18rem);
	padding: clamp(1.5rem, 3vw, 2.75rem);
	border: 1px solid rgba( 26, 26, 26, 0.14 );
	border-radius: 1rem;
	background:
		linear-gradient( 135deg,
			color-mix( in srgb, var(--wp--preset--color--accent) 22%, var(--wp--preset--color--background) ) 0%,
			color-mix( in srgb, var(--wp--preset--color--warm) 88%, var(--wp--preset--color--background) ) 52%,
			color-mix( in srgb, var(--wp--preset--color--background) 92%, var(--wp--preset--color--accent) ) 100%
		);
	box-shadow: 0 18px 48px rgba( 26, 26, 26, 0.08 );
	text-align: left;
}

.ut-projects-grid__empty-card::after {
	content: '';
	position: absolute;
	top: -20%;
	right: -5%;
	width: clamp(8rem, 18vw, 12rem);
	height: clamp(8rem, 18vw, 12rem);
	border-radius: 50%;
	background: color-mix( in srgb, var(--wp--preset--color--accent) 38%, transparent );
	filter: blur( 8px );
	pointer-events: none;
}

.ut-projects-grid__empty-eyebrow {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.65rem;
	border: 1px solid rgba( 26, 26, 26, 0.12 );
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.58 );
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ut-projects-grid__empty-text {
	position: relative;
	z-index: 1;
	margin: 0;
	max-width: 30rem;
	font-family: var(--wp--preset--font-family--pp-woodland);
	font-size: clamp(1.5rem, 1.4vw + 1rem, 2.35rem);
	line-height: 1.02;
	color: var(--wp--preset--color--foreground);
}

.ut-button,
.ut-project-single__visit,
.ut-project-single__meta-button,
.ut-projects-grid__empty-link {
	appearance: button;
	background-color: var(--wp--preset--color--foreground);
	background-image: none;
	border: 1px solid var(--wp--preset--color--foreground);
	border-radius: 0.25rem;
	box-shadow:
		var(--wp--preset--color--warm) 4px 4px 0 0,
		var(--wp--preset--color--foreground) 4px 4px 0 1px;
	box-sizing: border-box;
	color: var(--wp--preset--color--background);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: fit-content;
	overflow: visible;
	padding: 0.78rem 1.2rem;
	font-family: var(--wp--preset--font-family--makira);
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	touch-action: manipulation;
	user-select: none;
	-webkit-user-select: none;
	vertical-align: middle;
	white-space: nowrap;
	transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.ut-button:hover,
.ut-button:focus-visible,
.ut-project-single__visit:hover,
.ut-project-single__visit:focus-visible,
.ut-project-single__meta-button:hover,
.ut-project-single__meta-button:focus-visible,
.ut-projects-grid__empty-link:hover,
.ut-projects-grid__empty-link:focus-visible {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--foreground);
	box-shadow:
		var(--wp--preset--color--warm) 5px 5px 0 0,
		var(--wp--preset--color--foreground) 5px 5px 0 1px;
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
}

.ut-button--secondary,
.ut-project-single__back.ut-button--secondary,
.ut-project-single__meta-button.ut-button--secondary {
	background-color: var(--wp--preset--color--warm);
	border-color: var(--wp--preset--color--foreground);
	box-shadow:
		rgba(255, 255, 255, 0.92) 4px 4px 0 0,
		var(--wp--preset--color--foreground) 4px 4px 0 1px;
	color: var(--wp--preset--color--foreground);
}

.ut-button--secondary:hover,
.ut-button--secondary:focus-visible,
.ut-project-single__back.ut-button--secondary:hover,
.ut-project-single__back.ut-button--secondary:focus-visible,
.ut-project-single__meta-button.ut-button--secondary:hover,
.ut-project-single__meta-button.ut-button--secondary:focus-visible {
	background-color: var(--wp--preset--color--background);
	box-shadow:
		rgba(255, 255, 255, 0.96) 5px 5px 0 0,
		var(--wp--preset--color--foreground) 5px 5px 0 1px;
	color: var(--wp--preset--color--foreground);
}


.ut-button:active,
.ut-project-single__visit:active,
.ut-project-single__meta-button:active,
.ut-projects-grid__empty-link:active {
	outline: 0;
	box-shadow: rgba( 0, 0, 0, 0.14 ) 0 3px 5px inset;
}

.ut-button:not([disabled]):active,
.ut-project-single__visit:not([disabled]):active,
.ut-project-single__meta-button:not([disabled]):active,
.ut-projects-grid__empty-link:not([disabled]):active {
	box-shadow:
		var(--wp--preset--color--warm) 2px 2px 0 0,
		var(--wp--preset--color--foreground) 2px 2px 0 1px;
	transform: translate(2px, 2px);
}

.ut-projects-grid__empty-link {
	position: relative;
	z-index: 1;
}

.ut-button__icon {
	width: 0.9rem;
	height: 0.9rem;
	flex-shrink: 0;
	fill: currentColor;
	display: block;
	transform: translateY(0.02em);
}

body.jeditable-edit-active .ut-button.jeditable-field:not(.is-editing):hover {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--foreground);
}

body.jeditable-edit-active .ut-button.ut-button--secondary.jeditable-field:not(.is-editing):hover {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
}

body.jeditable-edit-active .ut-button.jeditable-field.is-editing {
	background-color: var(--wp--preset--color--foreground);
	border-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
	padding: 0.78rem 1.2rem;
	border-radius: 0.25rem;
	cursor: pointer;
}

body.jeditable-edit-active .ut-button.ut-button--secondary.jeditable-field.is-editing {
	background-color: var(--wp--preset--color--warm);
	border-color: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--foreground);
}


body.jeditable-edit-active .ut-button .jeditable-field:not(.is-editing):hover {
	background-color: transparent;
}


body.jeditable-edit-active .ut-button .jeditable-field.is-editing {
	background-color: transparent;
	color: inherit;
	box-shadow: none;
	padding: 0;
	border-radius: 0;
}

.ut-projects .ut-services-image img {
	width: 100%;
	height: auto;
	display: block;
}

/* --- Coming soon grid --- */

.ut-projects-coming-soon {
	padding-bottom: var(--ut-space-lg);
}

.ut-projects-coming-soon__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--ut-gutter);
}
