/**
 * Product grid for the services page.
 *
 * Sits directly under the (dark, photographic) services cards, so this block is
 * deliberately the opposite: a light tinted band with white, bordered cards and
 * the technical drawing as artwork. The band plus the eyebrow label is what
 * signals "different kind of thing" without pushing it far down the page.
 */

.ddsp {
	--ddsp-accent: #1f6fb2;
	--ddsp-ink: #1c1c1c;
	--ddsp-muted: #5b6067;
	--ddsp-line: #d8dbdf;
	--ddsp-band: #f2f4f6;

	margin: 3rem 0 0;
	padding: 2.5rem 1.75rem 2.75rem;
	background: var(--ddsp-band);
	border-top: 3px solid var(--ddsp-accent);
	border-radius: 4px;
	color: var(--ddsp-ink);
}

.ddsp *,
.ddsp *::before,
.ddsp *::after {
	box-sizing: border-box;
}

.ddsp__inner {
	max-width: 1180px;
	margin: 0 auto;
}

/* ----------------------------------------------------------------- head --- */

.ddsp__head {
	max-width: 62ch;
	margin: 0 0 2rem;
}

.ddsp__eyebrow {
	margin: 0 0 0.4rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ddsp-accent);
}

.ddsp__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.4rem, 1.15rem + 1.1vw, 2rem);
	line-height: 1.2;
	text-wrap: balance;
}

.ddsp__intro {
	margin: 0;
	color: var(--ddsp-muted);
	font-size: 0.98rem;
	line-height: 1.6;
}

/* ----------------------------------------------------------------- grid --- */

.ddsp__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1100px) {
	.ddsp__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.ddsp__grid {
		grid-template-columns: 1fr;
	}

	.ddsp {
		padding: 2rem 1.15rem 2.25rem;
	}
}

.ddsp__card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--ddsp-line);
	border-radius: 5px;
	overflow: hidden;
	transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.ddsp__card:hover {
	border-color: var(--ddsp-accent);
	box-shadow: 0 6px 18px rgba(16, 32, 48, 0.1);
	transform: translateY(-2px);
}

/*
 * The drawing is line art on white, so it needs breathing room rather than a
 * cover crop — contain it and let the card's own padding frame it.
 */
.ddsp__art {
	flex: none;
	display: grid;
	place-items: center;
	padding: 0.55rem;
	background: #fff;
	border-bottom: 1px solid var(--ddsp-line);
}

/*
 * Height is pinned on the image rather than set as an aspect-ratio on the box:
 * the four drawings have different intrinsic ratios (510x426 to 510x471), and an
 * auto-height box sizes to the image, which left the code badges sitting at four
 * different heights across the row.
 */
/* Two classes deep on purpose: Elementor ships `.elementor img { height: auto }`
   at the same specificity and loads after this file, which silently defeats a
   plain `.ddsp__art img` height rule. */
.ddsp .ddsp__art img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: clamp(120px, 13vw, 185px);
	object-fit: contain;
	object-position: center;
}

.ddsp__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem 1.1rem 1.15rem;
	flex: 1;
}

.ddsp__code {
	align-self: flex-start;
	padding: 0.15em 0.5em;
	border: 1px solid var(--ddsp-line);
	border-radius: 3px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	color: var(--ddsp-muted);
}

.ddsp__name {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
	text-wrap: balance;
}

/* Matches hover/focus/active too: the theme's global `a:hover{color:#000}` would
   otherwise override the card title colour on interaction. */
.ddsp__link,
.ddsp__card .ddsp__link:hover,
.ddsp__card .ddsp__link:focus,
.ddsp__card .ddsp__link:active {
	color: var(--ddsp-ink);
	text-decoration: none;
}

/* Stretch the hit area over the whole card while keeping one real link. */
.ddsp__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ddsp__cta {
	margin-top: auto;
	padding-top: 0.6rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ddsp-accent);
}

.ddsp__cta::after {
	content: " \2192";
}

.ddsp__missing {
	margin-top: auto;
	padding-top: 0.6rem;
	font-size: 0.78rem;
	color: #b32d2e;
}

.ddsp__card:has(.ddsp__link:focus-visible) {
	outline: 3px solid var(--ddsp-accent);
	outline-offset: 2px;
}

@supports not selector(:has(*)) {
	.ddsp__link:focus-visible {
		outline: 3px solid var(--ddsp-accent);
		outline-offset: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ddsp__card {
		transition: none;
	}

	.ddsp__card:hover {
		transform: none;
	}
}
