.akt-content-grid {
	--_padding: 40px;
	--_overlayBG: linear-gradient(to bottom, #0000005c 0%, #000000 100%);

	container-name: contentGrid;
	container-type: inline-size;

	&.akt-content-grid--agenturgruppe {
		--_overlayBG:
			linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 32.15%),
			linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 26.5%),
			linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.7) 100%);

		.akt-content-grid--grid {
			.akt-content-grid__title:not(h2) {
				max-width: 15ch;
				font-size: 36px;
				font-weight: 600;
				text-transform: none;
				line-height: 1.1;
			}
		}
	}

	.akt-content-grid--grid {
		--_gap: 2rem;
		--_itemWidthSmall: calc(100% * 0.4 - (var(--_gap) / 2));
		--_itemWidthLarge: calc(100% * 0.6 - (var(--_gap) / 2));

		@container contentGrid (width < 1200px) {
			--_itemWidthSmall: calc(100% * 0.5 - (var(--_gap) / 2));
			--_itemWidthLarge: var(--_itemWidthSmall);
		}

		@container contentGrid (width < 700px) {
			--_itemWidthSmall: 100%;
			--_itemWidthLarge: 100%;
		}

		display: flex;
		flex-wrap: wrap;
		gap: var(--_gap);

		.akt-content-grid__item {
			position: relative;
			width: var(--_itemWidthSmall);
			height: 450px;
			border-radius: 10px;
			overflow: hidden;
			flex: 0 0 auto;
			scroll-snap-align: start;
			order: 3;

			&:not(.akt-content-grid__content) {
				background-color: var(--card-color);
			}

			&:nth-child(4n - 3),
			&:nth-child(4n) {
				width: var(--_itemWidthLarge);
			}

			&.akt-content-grid__content {
				align-content: center;
				order: -1;
				width: var(--_itemWidthSmall);
				color: var(--heading-color);

				+ .akt-content-grid__item {
					order: 1;
					width: var(--_itemWidthLarge);
				}

				@container contentGrid (width < 700px) {
					height: unset;
				}

				@container contentGrid (width >= 700px) {
					order: 2;
				}
			}

			.akt-content-grid__content {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: flex-end;
				padding: var(--_padding);
				box-sizing: border-box;
				opacity: 0;
				transition: opacity 0.3s ease;
				background: var(--_overlayBG);
				backdrop-filter: blur(2px);
				-webkit-backdrop-filter: blur(2px);
			}

			&:hover {
				.akt-content-grid__image {
					transform: scale(1.05);
				}

				.akt-content-grid__content {
					opacity: 1;
				}
			}
		}

		.akt-content-grid__image {
			width: 100%;
			height: 100%;
			transition: transform 0.3s ease;
			background-size: cover;
			background-position: center;
		}

		.akt-content-grid__tags {
			position: absolute;
			top: var(--_padding);
			left: var(--_padding);
			margin: 0;
			padding-left: 20px;
			list-style: outside;

			& .akt-content-grid__tag {
				font-size: 1.25rem;
				list-style-type: "• ";

				&::marker {
					color: var(--accent-color);
				}
			}
		}

		.akt-content-grid__link {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
		}
	}

	.akt-content-grid--list {
		.akt-content-grid__item {
			display: flex;
			flex-wrap: wrap;

			&:not(:first-child) {
				margin-top: 100px;
			}

			> div {
				--_width: 100%;

				width: var(--_width);
			}

			.akt-content-grid__title {
				text-transform: uppercase;
				font-size: 36px;
				font-weight: 500;
				word-break: break-word;
			}

			p {
				margin: 0;
			}

			.akt-content-grid__meta {
				text-transform: uppercase;
				color: var(--heading-color);
				margin-top: 0.5rem;

				span:last-child:not(:first-child) {
					&::before {
						content: "•";
						color: var(--accent-color);
						margin: 0 8px;
					}
				}
			}

			.akt-content-grid__excerpt {
				gap: 2rem;
				margin-top: 1rem;

				a {
					margin-top: 2rem;
					display: block;
					width: 100px;
					aspect-ratio: 1 / 1;
					background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="103" height="105" viewBox="0 0 103 105" fill="none"><path d="M1.5 52.465L100.119 52.403M55.782 103.278L101.5 52.389L55.782 1.5" stroke="%23999999" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>');
					background-size: contain;
					background-repeat: no-repeat;
					background-position: center;
				}
			}
		}
	}

	.akt-content-grid--slider {
		gap: 40px;

		.akt-content-grid__item {
			background-color: var(--card-color);
			position: relative;
			min-width: 350px;
			aspect-ratio: 1 / 1;
			border-radius: 10px;
			padding: 40px;
			display: flex;
			align-items: flex-end;

			.akt-content-grid__title {
				word-break: break-word;
			}

			.akt-content-grid__link {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				z-index: 1;
			}
		}
	}

	.akt-slider {
		padding-top: 80px;

		.akt-slider__arrow-nav {
			button {
				top: 0 !important;
				transform: none !important;
				padding: 0 !important;

				&:first-child {
					left: unset !important;
					right: 64px;
				}

				&:last-child {
					right: 0;
				}

				svg {
					transition: stroke 0.3s ease;
				}

				&:hover {
					svg {
						stroke: #000;
					}
				}
			}
		}
	}
}

/* responsive anpassungen */
/* @media screen and (min-width: 769px) {
	.akt-content-grid .akt-content-grid--list {
		.akt-content-grid__item {
			> div {
				--_width: calc(100% * 1 / 2);

				&:first-child {
					padding-right: 2rem;
				}
			}
		}
	}
} */

@media screen and (min-width: 960px) {
	.akt-content-grid .akt-content-grid--list {
		.akt-content-grid__item {
			> div {
				&:first-child {
					--_width: calc(100% * 1 / 2);
					padding-right: 2rem;
				}

				&:last-child {
					--_width: calc(100% * 1 / 2);
				}
			}

			.akt-content-grid__excerpt {
				display: flex;
				margin-top: 0;

				p {
					width: calc(100% - 100px);
				}

				a {
					margin-top: 0;
				}
			}
		}
	}
}

.case-grid__item:hover .case-grid__category {
	color: var(--accent-color);
	font-size: 0.9rem;
	text-transform: uppercase;
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
}

.case-grid__category::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	background-color: var(--accent-color);
	border-radius: 50%;
	margin-right: 12px;
}

.case-grid__title {
	font-size: 32px;
	margin: 0;
	color: var(--text-color);
	hyphens: auto;
}

@media (max-width: 768px) {
	.case-grid__item {
		width: 280px;
		height: 280px;
	}

	.case-grid__title {
		font-size: 24px;
	}
	.akt-grid__navigation {
		display: none;
	}
}

.case-grid__container {
	display: flex;
	flex-direction: column;
	gap: 40px;
}
.case-grid__item-title {
	font-size: 32px;
	margin: 0;
	hyphens: auto;
	color: var(--text-color);
}

/* POPUP */
.case-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--background-color);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.15s ease,
		visibility 0.15s ease;
	pointer-events: none;
}

.case-popup.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.case-popup__content {
	color: var(--text-color);
	padding: 10rem 6rem;
	width: 100%;
	height: 100%;
	overflow-y: auto;
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2rem;
	max-width: 1400px;
	margin: 0 auto;
}

.case-popup__title {
	margin: 0;
	color: var(--text-color);
	font-size: 40px;
	text-transform: uppercase;
	font-weight: 500;
}

.case-popup__image {
	max-height: 348px;
	max-width: 348px;
	height: 100%;
	width: auto;
	background-size: cover;
	border-radius: 8px;
}

.case-popup__description,
.case-popup__button-container {
	margin-left: 60px;
	grid-column: 2/4;
}

.case-popup__description p {
	margin-bottom: 1rem;
}

.case-popup__description p:last-child {
	margin-bottom: 0;
}

.case-popup__description ul {
	padding-left: 20px;
	margin-left: 0px;
}

.case-popup__content-inner {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}
.case-popup__description {
	grid-column: 2 / 4;
}

body.popup-open {
	overflow: hidden;
}

/* Responsive Anpassungen */
/*
@media (max-width: 1200px) {
    .case-popup__content {
        padding: 8rem 4rem;
    }
}

@media (max-width: 768px) {
    .case-popup__content {
        padding: 6rem 2rem;
    }

    .case-popup__title {
        font-size: 2rem;
    }

    .case-popup__close {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
    }

    .case-popup__image {
        max-height: 40vh;
    }
}

@media (max-width: 480px) {
    .case-popup__content {
        padding: 4rem 1.5rem;
    }

    .case-popup__title {
        font-size: 1.75rem;
    }

    .case-popup__button {
        width: 100%;
        text-align: center;
    }
}
*/
/* Scrollbar Styling */
.case-popup__content::-webkit-scrollbar {
	width: 8px;
}

.case-popup__content::-webkit-scrollbar-track {
	background: var(--background-color);
}

.case-popup__content::-webkit-scrollbar-thumb {
	background: var(--accent-color);
	border-radius: 4px;
}

/* Animation für Popup Inhalt */
.case-popup__content > * {
	opacity: 0;
	transform: translateY(10px);
	transition:
		opacity 0.15s ease,
		transform 0.15s ease;
}

.case-popup.is-active .case-popup__content > * {
	opacity: 1;
	transform: translateY(0);
}

.case-popup.is-active .case-popup__title {
	transition-delay: 0.05s;
}

.case-popup.is-active .case-popup__image {
	transition-delay: 0.1s;
}

.case-popup.is-active .case-popup__description {
	transition-delay: 0.15s;
}

.case-popup.is-active .case-popup__button {
	transition-delay: 0.2s;
}
/* Optional: If you still want it smoother, you could use GPU acceleration */
.case-popup,
.case-popup__content > * {
	will-change: opacity, transform;
	backface-visibility: hidden;
}
/* 
* ÜBERARBEITETE MOBILE STYLES FÜR DAS CASE GRID
* - Zeigt nur eine Zeile an
* - Hover-Effekt und Text deaktiviert
*/
@media (max-width: 768px) {
	/* Grundlegende Slider-Einstellungen */
	.case-grid__row {
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 20px 0;
	}

	/* Nur die erste Zeile anzeigen, zweite Zeile ausblenden */
	.case-grid__row[data-row="2"] {
		display: none;
	}
	.case-grid__container {
		gap: 0;
	}
	/* Item-Styling */
	.case-grid__item {
		width: calc(100vw - 60px); /* Volle Breite mit Padding links und rechts */
		height: 280px;
		scroll-snap-align: center;
		margin-right: 0;
		/* Verhindert alle Hover-Effekte auf Touchscreens */
		pointer-events: auto;
	}

	/* Erstes Element hat etwas Platz links */
	.case-grid__row .case-grid__item:first-child {
		margin-left: 30px;
	}

	/* Letztes Element hat etwas Platz rechts */
	.case-grid__row .case-grid__item:last-child {
		margin-right: 30px;
	}

	/* Komplett ausblenden des Inhalts und Verhindern von Hover-Effekten */
	.case-grid__content {
		display: none;
	}

	/* Überschreibt den Hover-Effekt für das Bild */
	.case-grid__item:hover .case-grid__image {
		transform: none;
	}

	/* Slider Navigation für Mobile */
	.case-grid__mobile-nav {
		display: flex;
		justify-content: center;
		margin-top: 20px;
		gap: 10px;
	}

	.case-grid__mobile-nav-dot {
		width: 10px;
		height: 10px;
		border-radius: 50%;
		background-color: var(--color2);
		cursor: pointer;
		transition: background-color 0.3s ease;
	}

	.case-grid__mobile-nav-dot--active {
		background-color: var(--accent-color);
	}

	/* Verstecke Desktop-Navigation auf Mobilgeräten */
	.akt-grid__navigation {
		display: none;
	}
}
/* 
* MOBILE STYLES FÜR DAS CASE POPUP
* Ändert die Reihenfolge der Elemente und optimiert die Darstellung der Keypoints
*/
@media (max-width: 768px) {
	.case-grid {
		padding: 0px;
	}
	/* Grundlegende Popup-Anpassungen für mobile Geräte */
	.case-popup__content {
		padding: 80px 36px 36px 36px;
		display: flex;
		flex-direction: column;
		gap: 0;
	}

	/* Reihenfolge der Elemente ändern */
	.case-popup__title {
		order: 1;
		font-size: 30pt;
	}

	.case-popup__keywords-container {
		order: 2;
	}

	/* Container für Bild und Beschreibung umstrukturieren */
	.case-popup__content-inner {
		display: flex;
		flex-direction: column;
		grid-template-columns: unset; /* Grid-Layout zurücksetzen */
		order: 3;
	}

	/* Bild */
	.case-popup__image {
		order: 3;
		max-width: 100%;
		height: auto;
		margin-bottom: 1.5rem;
		aspect-ratio: 1; /* Quadratisches Format */
		object-fit: cover;
	}

	/* Beschreibung */
	.case-popup__description {
		order: 4;
		margin-left: 0; /* Zurücksetzen des Desktop-Margins */
		margin-bottom: 1.5rem;
		grid-column: unset; /* Grid-Spalte zurücksetzen */
	}

	/* Button-Container */
	.case-popup__button-container {
		order: 5;
		margin-left: 0; /* Zurücksetzen des Desktop-Margins */
		display: flex;
		justify-content: flex-start;
	}

	/* Keypoints anpassen: ein Keypoint pro Zeile mit orangenem Punkt links */
	.case-popup__keywords-list {
		flex-direction: column;
		gap: 10px;
		padding-left: 0;
	}

	.case-popup__keywords-list li {
		display: flex;
		align-items: center;
		width: 100%;
		margin-bottom: 5px;
	}

	.case-popup__keywords-list li::before {
		content: "•";
		color: #ff6600; /* Orangener Punkt */
		font-size: 1.4rem;
		margin-right: 8px;
		display: inline-block;
	}

	/* Der letzte Trennpunkt nach dem letzten Keypoint wird versteckt */
	.case-popup__keywords-list li:last-child {
		display: none;
	}
}
/* Firefox-spezifische Fixes für case-grid.css */

/* 1. TEXTUMBRUCH mit Bindestrich - alle Browser */
.case-grid__item-title {
	/* Silbentrennung mit Bindestrich */
	hyphens: auto;
	-webkit-hyphens: auto;
	-moz-hyphens: auto;
	-ms-hyphens: auto;

	/* Textumbruch-Eigenschaften */
	word-wrap: break-word;
	overflow-wrap: break-word;
	word-break: normal; /* Verhindert harten Umbruch, bevorzugt Silbentrennung */

	/* Zusätzliche Browser-Unterstützung */
	-moz-word-wrap: break-word;
	-webkit-word-wrap: break-word;
}

/* 2. SCROLLBALKEN ausblenden - alle Browser */
.case-grid__row {
	/* Firefox */
	scrollbar-width: none;

	/* Internet Explorer 10+ */
	-ms-overflow-style: none;
}

/* Webkit-Browser (Chrome, Safari, Edge) */
.case-grid__row::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.case-grid__row::-webkit-scrollbar-track,
.case-grid__row::-webkit-scrollbar-thumb,
.case-grid__row::-webkit-scrollbar-corner {
	display: none;
}

/* 3. POPUP SCROLLBAR ausblenden */
.case-popup__content {
	/* Firefox */
	scrollbar-width: none;

	/* Internet Explorer 10+ */
	-ms-overflow-style: none;
}

.case-popup__content::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.case-popup__content::-webkit-scrollbar-track,
.case-popup__content::-webkit-scrollbar-thumb,
.case-popup__content::-webkit-scrollbar-corner {
	display: none;
}

/* 4. MOBILE SCROLLBAR ausblenden */
@media (max-width: 768px) {
	.case-grid__row {
		scrollbar-width: none; /* Firefox */
		-ms-overflow-style: none; /* IE/Edge */
	}

	.case-grid__row::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
	}
}
