/**
 * Project grid (shortcode [mh_project_grid])
 */

.filter-section .mh-projects {
	display: block;
}

.mh-projects {
	--mh-ink: #02232d;
	--mh-gold: #d8bd5f;
	--mh-gap: 28px;
	width: 100%;
}

.mh-projects__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 20px;
	margin: 0 0 28px;
}

.mh-projects__filter-label {
	flex: 0 0 auto;
	color: var(--mh-ink);
	font-size: 19px;
	line-height: 22px;
	font-weight: 600;
}

.mh-projects__filter-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mh-projects__filter-item {
	margin: 0;
	padding: 0;
}

.mh-projects__filter {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 59px;
	padding: 10px 18px;
	border: 1px solid var(--mh-ink);
	border-radius: 10px;
	background: #fff;
	color: var(--mh-ink);
	font-size: 19px;
	line-height: 22px;
	font-family: inherit;
	cursor: pointer;
	transition: border-width 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.mh-projects__filter:hover,
.mh-projects__filter:focus-visible {
	background: #f7f7f5;
	outline: none;
}

.mh-projects__filter.is-active {
	border: 1px solid var(--mh-gold);
	background: var(--mh-gold);
	box-shadow: none;
}

.mh-projects__filter-icon {
	width: 30px;
	height: 30px;
	object-fit: contain;
	flex: 0 0 auto;
}

.mh-projects__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--mh-gap);
}

.mh-projects.is-loading .mh-projects__filters {
	pointer-events: none;
}

.mh-projects__empty {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--mh-ink);
	font-size: 18px;
}

.mh-project {
	display: flex;
	flex-direction: column;
	min-width: 0;
	text-align: left;
	color: var(--mh-ink);
}

.mh-project.is-leaving {
	animation: mh-project-leave 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	animation-delay: var(--mh-stagger, 0ms);
}

.mh-project.is-entering {
	opacity: 0;
	transform: translateY(18px) scale(0.985);
}

.mh-project.is-entering.is-entered {
	opacity: 1;
	transform: translateY(0) scale(1);
	transition:
		opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: var(--mh-stagger, 0ms);
}

@keyframes mh-project-leave {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(-10px) scale(0.985);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mh-project.is-leaving,
	.mh-project.is-entering,
	.mh-project.is-entering.is-entered {
		animation: none;
		transition: none;
		opacity: 1;
		transform: none;
	}
}

.mh-project__media {
	position: relative;
	margin: 0 0 12px;
	overflow: hidden;
	background: #e8e8e6;
	aspect-ratio: 3 / 2;
}

.mh-project__image-link {
	display: block;
	height: 100%;
}

.mh-project__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1);
	transition: transform 0.45s ease;
	will-change: transform;
}

.mh-project__media:hover .mh-project__image,
.mh-project__media:focus-within .mh-project__image {
	transform: scale(1.1);
}

.mh-project__badges {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	pointer-events: none;
}

.mh-project__badge {
	display: inline-block;
	padding: 6px 10px;
	background: var(--mh-gold);
	color: var(--mh-ink);
	font-size: 14px;
	line-height: 17px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.mh-project__title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 22px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--mh-ink);
}

.mh-project__title a {
	color: inherit;
	text-decoration: none;
}

.mh-project__title a:hover,
.mh-project__title a:focus-visible {
	text-decoration: underline;
}

.mh-project__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.35;
	color: var(--mh-ink);
	white-space: normal;
}

@media screen and (max-width: 991px) {
	.mh-projects__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px;
	}

	.mh-projects__filter {
		min-height: 48px;
		padding: 8px 14px;
		font-size: 16px;
	}

	.mh-projects__filter-icon {
		width: 24px;
		height: 24px;
	}
}

@media screen and (max-width: 575px) {
	.mh-projects__filters {
		flex-direction: column;
		align-items: flex-start;
	}

	.mh-projects__grid {
		grid-template-columns: 1fr;
	}

	.mh-project__title {
		font-size: 20px;
	}
}
