/**
 * Projects Portfolio widget.
 */

.dw-projects__masonry {
	column-count: 3;
	column-gap: var(--dw-space-5);
}

@media (max-width: 1024px) {
	.dw-projects__masonry {
		column-count: 2;
	}
}

@media (max-width: 767px) {
	.dw-projects__masonry {
		column-count: 1;
	}
}

.dw-projects__masonry .dw-projects__item {
	margin-block-end: var(--dw-space-5);
	break-inside: avoid;
}

.dw-projects__item[hidden] {
	display: none;
}

.dw-project {
	position: relative;
	overflow: hidden;
	border-radius: var(--dw-radius-lg);
	background: var(--dw-color-secondary);
	isolation: isolate;
}

.dw-project__media img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.7s var(--dw-ease);
}

.dw-projects--grid .dw-project__media {
	aspect-ratio: 10 / 7;
}

.dw-projects--grid .dw-project__media img {
	height: 100%;
	object-fit: cover;
}

.dw-project__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	color: rgba(255, 255, 255, 0.4);
}

.dw-project:hover .dw-project__media img,
.dw-project:focus-within .dw-project__media img {
	transform: scale(1.07);
}

.dw-project__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: var(--dw-space-6);
	background: linear-gradient(180deg, transparent 35%, rgba(35, 42, 52, 0.92) 100%);
}

.dw-project__type {
	/* A solid chip, like the service tile tags: legible on any photo. */
	align-self: flex-start;
	margin-block-end: var(--dw-space-3);
	padding: 0.3rem 0.6rem;
	background: var(--dw-color-secondary);
	color: var(--dw-color-white);
	font-family: var(--dw-font-heading);
	font-size: var(--dw-fs-xs);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.dw-project__title {
	margin: 0;
	padding-inline-end: 56px;
	color: var(--dw-color-white);
	font-size: var(--dw-fs-lg);
}

.dw-project__title a {
	color: inherit;
	text-decoration: none;
}

/* Whole card links to the project; the zoom button sits above that link. */
.dw-project__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.dw-project__zoom {
	position: absolute;
	inset-block-end: var(--dw-space-6);
	inset-inline-end: var(--dw-space-6);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--dw-color-primary);
	color: var(--dw-color-on-primary);
	opacity: 0;
	transform: scale(0.7);
	transition: opacity var(--dw-duration) var(--dw-ease), transform var(--dw-duration) var(--dw-ease), background-color var(--dw-duration) var(--dw-ease);
}

.dw-project:hover .dw-project__zoom,
.dw-project__zoom:focus-visible {
	opacity: 1;
	transform: none;
}

.dw-project__zoom:hover {
	background: var(--dw-color-white);
}

/* Touch devices have no hover: always show the zoom button. */
@media (hover: none) {
	.dw-project__zoom {
		opacity: 1;
		transform: none;
	}
}
