/* ==========================================================================
   Services widget  (.aew-services)
   ========================================================================== */

.aew-services {
	--aew-accent: var(--aew-red);   /* control: Brand colour */
	--aew-gutter: 24px;             /* control: Side gap */

	box-sizing: border-box;
	background-color: #fff;
	color: #111;
	font-family: var(--aew-font);
	-webkit-font-smoothing: antialiased;
}

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

.aew-services__inner {
	width: calc(100% - (var(--aew-gutter) * 2));
	max-width: 1076px;
	margin-inline: auto;
}

/* ---- Heading ---- */

.aew-services__head {
	margin-bottom: 58px;
	text-align: center;
}

.aew-services__eyebrow {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 0 0 19px;
	font-size: 11.2px;
	font-weight: 700;
	letter-spacing: 1.2px;
	line-height: 1.4;
	text-transform: uppercase;
}

.aew-services__eyebrow-line {
	flex: none;
	display: block;
	width: 35px;
	height: 2px;
	background: var(--aew-accent);
}

.aew-services__eyebrow-text {
	color: var(--aew-accent);
}

/* extra class so the Elementor kit's global h1–h6 styles don't win */
.aew-services .aew-services__title {
	margin: 0 0 14px;
	padding: 0;
	font-family: inherit;
	font-size: 41.8px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
}

.aew-services__title-text {
	color: #111;
}

.aew-services__title-accent {
	color: var(--aew-accent);
}

.aew-services__subtitle {
	max-width: 500px;
	margin: 0 auto;
	font-size: 12.25px;
	line-height: 1.55;
	color: #5b6170;
}

/* ---- Grid ---- */

.aew-services__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.aew-services__item {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.aew-services__card {
	--aew-overlay: rgba(0, 0, 0, 0.5);

	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #e8e8e8;
	background-color: #f9f9f9;
	color: inherit;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

a.aew-services__card:focus-visible {
	outline: 2px solid var(--aew-accent);
	outline-offset: 3px;
}

.aew-services__photo {
	position: relative;
	display: block;
	flex: none;
	aspect-ratio: 9 / 5;
	overflow: hidden;
	background-color: #2a2624;
}

/* darkening under the icon, so a white icon stays readable on bright photos */
.aew-services__photo::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to top, var(--aew-overlay) 0%, transparent 45%);
}

.aew-services__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.aew-services__icon {
	position: absolute;
	bottom: 11px;
	left: 17px;
	z-index: 1;
	display: inline-flex;
	font-size: 17px;
	line-height: 1;
	color: #fff;
}

.aew-services__icon svg,
.aew-services__icon i {
	width: 1em;
	height: 1em;
	color: inherit;
}

.aew-services__icon svg:not([stroke]) {
	fill: currentColor;
}

.aew-services__body {
	display: block;
	flex: 1 1 auto;
	padding: 17px 18px 18px;
}

.aew-services__card-title,
.aew-services__card-text {
	display: block;
}

.aew-services__card-title {
	margin: 0 0 8px;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.3;
	text-transform: uppercase;
	color: #111;
}

.aew-services__card-text {
	font-size: 10.5px;
	line-height: 1.62;
	color: #666;
}

/* ---- Hover (switchable) ---- */

@media (hover: hover) {
	.aew-services--hover .aew-services__card:hover {
		transform: translateY(-4px);
		border-color: var(--aew-accent);
		box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
	}

	.aew-services--hover .aew-services__card:hover .aew-services__img {
		transform: scale(1.05);
	}
}

/* ---- Responsive (columns are also a control; these are the defaults) ---- */

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

@media (max-width: 600px) {
	.aew-services__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.aew-services__card,
	.aew-services__img {
		transition: none;
	}

	.aew-services--hover .aew-services__card:hover,
	.aew-services--hover .aew-services__card:hover .aew-services__img {
		transform: none;
	}
}
