/**
 * Services widget (cards: image, icon, overlay; layouts: grid, carousel, list).
 */

/* Image + icon badge: the icon overlaps the image edge. */
.dw-service-card--image.has-image .dw-service-icon {
	position: relative;
	z-index: 2;
	margin-block: calc(-36px - var(--dw-space-6)) var(--dw-space-4);
	border: 4px solid var(--dw-color-white);
	background: var(--dw-color-primary);
	box-shadow: var(--dw-shadow);
}

.dw-service-card--image .dw-service-icon {
	margin-block-end: var(--dw-space-4);
}

.dw-service-card--image:hover .dw-service-icon {
	background: var(--dw-color-secondary);
	color: var(--dw-color-white);
}

.dw-card__text {
	margin-block-end: 0;
}

/* Icon box: no image; the whole card fills with navy on hover. */
.dw-service-card--icon .dw-card__body {
	padding: var(--dw-space-7) var(--dw-space-6);
}

.dw-service-card--icon .dw-service-icon {
	margin-block-end: var(--dw-space-5);
}

.dw-service-card--icon::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: var(--dw-color-secondary);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform 0.45s var(--dw-ease);
}

.dw-service-card--icon .dw-card__body {
	position: relative;
	z-index: 1;
}

.dw-service-card--icon:hover::before {
	transform: scaleY(1);
}

.dw-service-card--icon:hover .dw-card__title,
.dw-service-card--icon:hover .dw-card__title a,
.dw-service-card--icon:hover .dw-link-arrow {
	color: var(--dw-color-white);
}

.dw-service-card--icon:hover .dw-card__text {
	color: rgba(255, 255, 255, 0.8);
}

.dw-service-card--icon:hover .dw-service-icon {
	background: var(--dw-color-primary);
	color: var(--dw-color-on-primary);
}

/* Image overlay: content sits on the image behind a gradient. */
.dw-service-card--overlay {
	min-height: 420px;
	border: 0;
	background: var(--dw-color-secondary);
}

.dw-service-card--overlay .dw-card__media {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
}

.dw-service-card--overlay .dw-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(35, 42, 52, 0.05) 20%, rgba(35, 42, 52, 0.92) 100%);
}

.dw-service-card--overlay .dw-card__body {
	position: relative;
	z-index: 1;
	justify-content: flex-end;
}

.dw-service-card--overlay .dw-card__title,
.dw-service-card--overlay .dw-card__title a,
.dw-service-card--overlay .dw-link-arrow {
	color: var(--dw-color-white);
}

.dw-service-card--overlay .dw-card__text {
	color: rgba(255, 255, 255, 0.82);
}

.dw-service-card--overlay .dw-link-arrow {
	color: var(--dw-color-accent);
}

/* List layout: image beside the content on wider screens. */
.dw-services__list.dw-grid {
	grid-template-columns: minmax(0, 1fr) !important;
}

@media (min-width: 768px) {
	.dw-services--list .dw-service-card.has-image {
		flex-direction: row;
	}

	.dw-services--list .dw-service-card.has-image .dw-card__media {
		flex: 0 0 38%;
		aspect-ratio: auto;
		min-height: 240px;
	}

	.dw-services--list .dw-service-card--image.has-image .dw-service-icon {
		margin-block-start: 0;
	}
}

/* Spotlight: services on both sides of a circular image. */
.dw-services--spotlight {
	display: grid;
	gap: var(--dw-space-7);
	align-items: center;
}

@media (min-width: 1025px) {
	.dw-services--spotlight {
		grid-template-columns: 1fr minmax(260px, 360px) 1fr;
	}
}

.dw-spotlight__col {
	display: grid;
	gap: var(--dw-space-7);
	margin: 0;
	padding: 0;
	list-style: none;
}

.dw-spotlight__item {
	display: flex;
	gap: var(--dw-space-5);
	align-items: flex-start;
}

.dw-spotlight__item .dw-service-icon {
	flex: 0 0 auto;
}

.dw-spotlight__item:hover .dw-service-icon,
.dw-spotlight__item:focus-within .dw-service-icon {
	background: var(--dw-color-primary);
	color: var(--dw-color-on-primary);
}

.dw-spotlight__body .dw-card__title {
	margin: 0 0 var(--dw-space-2);
	font-size: var(--dw-fs-md);
	text-transform: uppercase;
}

.dw-spotlight__body .dw-card__title a {
	color: var(--dw-color-heading);
	text-decoration: none;
}

.dw-spotlight__body .dw-card__title a:hover {
	color: var(--dw-color-primary);
}

.dw-spotlight__body .dw-card__text {
	margin: 0;
}

@media (min-width: 1025px) {
	.dw-spotlight__col--start .dw-spotlight__item {
		flex-direction: row-reverse;
		text-align: end;
	}
}

.dw-spotlight__media {
	justify-self: center;
	width: min(100%, 360px);
	aspect-ratio: 1;
	overflow: hidden;
	border: 10px solid #fff;
	border-radius: 50%;
	box-shadow: var(--dw-shadow);
}

.dw-spotlight__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 1024px) {
	.dw-spotlight__media {
		grid-row: 1;
		width: min(100%, 280px);
	}
}

/*
 * Bento: the first service as a large photo tile beside a column of two,
 * then a row of three. Each tile is a single link; the title sits on a
 * shade at the bottom of the photo.
 */
.dw-services--bento {
	display: grid;
	grid-template-columns: 1fr;
	grid-auto-rows: minmax(220px, auto);
	gap: var(--dw-space-4);
}

@media (min-width: 768px) {
	.dw-services--bento {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-rows: minmax(240px, auto);
	}

	.dw-bento-tile--featured {
		grid-column: span 2;
		min-height: 380px;
	}
}

@media (min-width: 1025px) {
	.dw-services--bento {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-auto-flow: dense;
		grid-auto-rows: minmax(250px, auto);
	}

	.dw-bento-tile--featured {
		grid-row: span 2;
	}
}

.dw-bento-tile {
	position: relative;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	min-height: 220px;
	background: var(--dw-color-secondary-dark);
	isolation: isolate;
}

.dw-bento-tile__media {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.dw-bento-tile .dw-bento-tile__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--dw-ease-out);
}

/* Shade only where the words are. */
.dw-bento-tile::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(0deg, rgba(20, 25, 32, 0.9) 0%, rgba(20, 25, 32, 0.55) 38%, rgba(20, 25, 32, 0.05) 72%);
	transition: opacity 0.4s var(--dw-ease-out);
}

.dw-bento-tile__body {
	padding: var(--dw-space-5) var(--dw-space-6);
}

.dw-bento-tile__title {
	margin: 0;
	color: var(--dw-color-white);
	font-size: var(--dw-fs-lg);
	font-weight: 700;
	line-height: 1.15;
}

.dw-bento-tile--featured .dw-bento-tile__body {
	padding: var(--dw-space-7);
}

.dw-bento-tile--featured .dw-bento-tile__title {
	font-size: var(--dw-fs-display-sm);
}

.dw-bento-tile__title a {
	color: inherit;
	text-decoration: none;
}

/* The title link covers the whole tile. */
.dw-bento-tile__title a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.dw-bento-tile__title a::after {
	content: "";
	display: inline-block;
	width: 0.7em;
	height: 0.7em;
	margin-inline-start: 0.35em;
	vertical-align: 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.3s var(--dw-ease-out);
}

.dw-bento-tile__text {
	max-width: 46ch;
	margin: var(--dw-space-2) 0 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: var(--dw-fs-sm);
	line-height: 1.55;
}

.dw-bento-tile--featured .dw-bento-tile__text {
	font-size: var(--dw-fs-md);
}

@media (hover: hover) and (pointer: fine) {
	.dw-bento-tile:hover .dw-bento-tile__media img {
		transform: scale(1.05);
	}

	.dw-bento-tile:hover .dw-bento-tile__title a::after {
		transform: translate(3px, -3px);
	}
}

.dw-bento-tile:focus-within {
	outline: 3px solid var(--dw-color-accent);
	outline-offset: 3px;
}

.dw-bento-tile__title a:focus-visible {
	outline: none;
}

.dw-bento-tile:active {
	transform: scale(0.99);
	transition: transform 0.08s var(--dw-ease-out);
}

@media (prefers-reduced-motion: reduce) {
	.dw-bento-tile .dw-bento-tile__media img,
	.dw-bento-tile:active {
		transform: none !important;
	}
}

/* Category label on each tile, for scanning the grid by type. */
.dw-bento-tile__label {
	position: absolute;
	top: var(--dw-space-4);
	inset-inline-start: var(--dw-space-4);
	padding: 0.375rem 0.625rem;
	background: rgba(20, 25, 32, 0.72);
	color: var(--dw-color-white);
	font-family: var(--dw-font-heading);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-transform: uppercase;
}

.dw-bento-tile--featured .dw-bento-tile__label {
	top: var(--dw-space-6);
	inset-inline-start: var(--dw-space-7);
	background: var(--dw-color-primary);
}

/* Prompt under the grid: the next step for visitors who are unsure. */
.dw-services__prompt {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--dw-space-4) var(--dw-space-6);
	margin-block-start: var(--dw-space-7);
	padding-block-start: var(--dw-space-6);
	border-block-start: 1px solid color-mix(in srgb, var(--dw-color-heading) 16%, transparent);
}

.dw-services__prompt-text {
	max-width: 52ch;
	margin: 0;
	color: var(--dw-color-heading);
	font-size: var(--dw-fs-md);
	font-weight: 500;
	line-height: 1.5;
}

/* Phones: the featured tile gets room for its longer text, and its label
   and padding match the other tiles so nothing overlaps. */
@media (max-width: 767px) {
	.dw-bento-tile--featured {
		min-height: 360px;
	}

	.dw-bento-tile--featured .dw-bento-tile__label {
		top: var(--dw-space-4);
		inset-inline-start: var(--dw-space-4);
	}

	.dw-bento-tile--featured .dw-bento-tile__body,
	.dw-bento-tile__body {
		padding: var(--dw-space-7) var(--dw-space-5) var(--dw-space-5);
	}
}
