.hm-services {
	width: 100%;
	padding: var(--hm-layout-section-top) var(--hm-layout-gutter) var(--hm-layout-section-bottom);
	background: var(--hm-color-background);
}

.hm-services__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2vw;
	width: 100%;
	margin: 0 0 var(--hm-layout-block-gap);
}

.hm-services__title {
	margin: 0;
	color: var(--hm-color-text);
	font-size: clamp(34px, 3vw, 52px);
	font-weight: 400;
	line-height: 1.08;
	letter-spacing: -0.025em;
}

.hm-services__header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(0.65rem, 0.9vw, 0.9rem);
}

.hm-services__all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75em 1.45em;
	border: 1px solid var(--hm-color-border-strong);
	border-radius: 0.45em;
	background: var(--hm-color-surface);
	color: var(--hm-color-text);
	font-size: clamp(16px, 1.05vw, 18px);
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hm-services__all:hover,
.hm-services__all:focus-visible {
	border-color: var(--hm-color-accent-hover);
	background: var(--hm-color-accent-hover);
	color: var(--hm-color-surface);
}

/* Manuelle Navigation für horizontale Leistungslisten auf Geräten mit Maus. */
.hm-services__controls {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.hm-services__controls[hidden] {
	display: none;
}

.hm-services__control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: clamp(2.7rem, 3vw, 3.15rem);
	aspect-ratio: 1;
	padding: 0;
	border: 1px solid var(--hm-color-border-strong);
	border-radius: 50%;
	background: var(--hm-color-surface);
	color: var(--hm-color-text);
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hm-services__control svg {
	width: 46%;
	height: 46%;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.hm-services__control:hover:not(:disabled),
.hm-services__control:focus-visible:not(:disabled) {
	border-color: var(--hm-color-accent-hover);
	background: var(--hm-color-accent-hover);
	color: var(--hm-color-surface);
}

.hm-services__control:disabled {
	border-color: var(--hm-color-border-soft);
	background: var(--hm-color-surface-soft);
	color: var(--hm-color-muted);
	cursor: default;
}

.hm-services__control:focus-visible,
.hm-services__all:focus-visible {
	outline: 2px solid var(--hm-color-accent);
	outline-offset: 3px;
}

.hm-services__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 21vw;
	gap: 1.4vw;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0.65rem 0 1.4rem;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.hm-services__track::-webkit-scrollbar {
	display: none;
}

.hm-services__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.4vw;
	width: 100%;
}

/*
 * Karten erhalten bewusst etwas Tiefe: Im Ruhezustand liegen sie auf der
 * weicheren Fläche. Hover und Tastaturfokus heben die ganze Karte an, machen
 * die Fläche heller und ergänzen eine dezente Schattenkante aus der Palette.
 */
.hm-service-card {
	position: relative;
	z-index: 0;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--hm-color-border-soft);
	border-radius: 1.1rem;
	background: var(--hm-color-surface-soft);
	scroll-snap-align: start;
	transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.hm-service-card:hover,
.hm-service-card:focus-within {
	z-index: 2;
	border-color: var(--hm-color-accent);
	background: var(--hm-color-surface);
	box-shadow: 0 1.25rem 2rem -1rem var(--hm-color-border-soft);
	transform: translateY(-0.45rem);
}

.hm-service-card__link {
	display: flex;
	height: 100%;
	color: inherit;
	text-decoration: none;
	flex-direction: column;
}

/* Der eigene Medienrahmen hält den Bild-Zoom sauber innerhalb der Karte. */
.hm-service-card__media {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--hm-color-border-soft);
}

.hm-service-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transition: transform 340ms ease;
}

.hm-service-card__link:hover .hm-service-card__image,
.hm-service-card__link:focus-visible .hm-service-card__image {
	transform: scale(1.045);
}

.hm-service-card__body {
	display: flex;
	flex: 1;
	min-height: 12vw;
	padding: 1.2vw 1.35vw 1.1vw;
	flex-direction: column;
}

.hm-service-card__title {
	margin: 0 0 0.45em;
	color: var(--hm-color-text);
	font-size: clamp(20px, 1.45vw, 28px);
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: -0.018em;
}

.hm-service-card__text {
	margin: 0;
	color: var(--hm-color-muted);
	font-size: clamp(16px, 1vw, 18px);
	font-weight: 400;
	line-height: 1.45;
}

.hm-service-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.1vw;
	aspect-ratio: 1;
	margin: auto 0 0 auto;
	border: 1px solid var(--hm-color-border-soft);
	border-radius: 50%;
	background: var(--hm-color-surface);
	color: var(--hm-color-muted);
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hm-service-card__arrow svg {
	width: 46%;
	height: 46%;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.hm-service-card__link:hover .hm-service-card__arrow,
.hm-service-card__link:focus-visible .hm-service-card__arrow {
	border-color: var(--hm-color-accent-hover);
	background: var(--hm-color-accent-hover);
	color: var(--hm-color-surface);
}

.hm-service-card__link:focus-visible {
	outline: 2px solid var(--hm-color-accent);
	outline-offset: -3px;
}

@media (max-width: 1100px) {
	.hm-services__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2vw;
	}
}

@media (max-width: 767px) {
	.hm-services__header {
		align-items: flex-start;
		margin-bottom: 2rem;
		flex-direction: column;
	}

	.hm-services__header-actions {
		width: 100%;
		justify-content: flex-start;
	}

	.hm-services__controls {
		display: none;
	}

	.hm-services__track {
		grid-auto-columns: 82vw;
		gap: 4vw;
	}

	.hm-services__grid {
		grid-template-columns: 1fr;
		gap: 4vw;
	}

	.hm-service-card__body {
		min-height: 52vw;
		padding: 5vw;
	}

	.hm-service-card__arrow {
		width: 13vw;
	}
}

/* Kompakter Kartenmodus für Telefone und kleine Tablets im Querformat. */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 600px) {
	.hm-services {
		padding-top: 2rem;
		padding-bottom: 2rem;
	}

	.hm-services__header {
		margin-bottom: 1.25rem;
	}

	.hm-services__track {
		grid-auto-columns: min(76vw, 44rem);
		gap: 1rem;
		padding-top: 0.35rem;
		padding-bottom: 0.8rem;
	}

	.hm-services__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}

	.hm-service-card {
		height: var(--hm-layout-landscape-card-height);
	}

	.hm-service-card__link {
		display: grid;
		grid-template-columns: minmax(11rem, 38%) minmax(0, 1fr);
		height: 100%;
	}

	.hm-service-card__media {
		position: relative;
		align-self: stretch;
		height: auto;
		min-height: 0;
		aspect-ratio: auto;
	}

	.hm-service-card__image {
		position: absolute;
		inset: 0;
	}

	.hm-service-card__body {
		min-height: 0;
		padding: 0.8rem 1rem;
	}

	.hm-service-card__title {
		margin-bottom: 0.35em;
		font-size: clamp(1.05rem, 2.3vw, 1.3rem);
	}

	.hm-service-card__text {
		font-size: 0.9rem;
		line-height: 1.3;
	}

	.hm-service-card__arrow {
		width: 2.25rem;
	}
}

@media (hover: none) and (pointer: coarse) {
	.hm-services__controls {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hm-service-card,
	.hm-service-card__image,
	.hm-service-card__arrow,
	.hm-services__all,
	.hm-services__control {
		transition: none;
	}

	.hm-service-card:hover,
	.hm-service-card:focus-within,
	.hm-service-card__link:hover .hm-service-card__image,
	.hm-service-card__link:focus-visible .hm-service-card__image {
		transform: none;
	}
}
