/* ---------- Card Component Styles ---------- */

/* CSS Variables (fallbacks in case other CSS files aren't loaded) */
:root {
	--ff-brand: "mozaic-geo-variable", sans-serif;
	--clr-pansy: #1b4799;
	--clr-watermelon: #d8575f;
	--clr-mid: #999;
}

.card {
	position: relative;
	width: 30vw;
	max-width: 640px;
	height: auto;
	container-type: inline-size;
	aspect-ratio: 2/3;
	font-family: "mozaic-geo-variable", sans-serif;
	transition: transform 0.3s ease;
}

.card svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%; /* Changed from 103.5% to prevent overflow */
	height: 100%;
	z-index: 0;
	/* Add iOS-specific fixes */
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	/* Ensure proper rendering on iOS */
	-webkit-mask-image: -webkit-radial-gradient(white, black);
}

.card-content {
	position: relative;
	display: flex;
	flex-flow: column nowrap;
	padding: 8.5cqw;
	z-index: 1;
	height: 100%;
}

/* Card Arrow Button */
.card-arrow-btn {
	position: absolute;
	top: -2%;
	right: 3%;
	width: 17.5%;
	height: 17.5%;
	border: none;
	background: none;
	cursor: pointer;
	z-index: 10;
	transition: transform 0.3s ease;
}

.card:hover .card-arrow-btn {
	transform: scale(1.1);
}

.card-arrow-btn svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Card Date */
.card-date {
	color: #999;
	font-size: 3cqw;
	font-style: normal;
	font-weight: 300;
	margin: 0;
	margin-top: 6cqw;
	margin-bottom: 7.5cqw;
}

/* Card Title */
.card-title {
	color: var(--Pansie, #1b4799);
	font-size: 5.75cqw;
	font-style: normal;
	font-weight: 500;
	line-height: 1.25;
	margin: 0;
	margin-bottom: 5cqw;
	margin-right: 7.5cqw;
}

/* Card Image */
.card-image {
	width: 100%;
	height: 35cqw;
	border-radius: 3cqw;
	background-color: lightgray;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	margin-bottom: 5cqw;
}

/* Card Excerpt */
.card-excerpt {
	color: #666;
	font-size: 3cqw;
	font-style: normal;
	font-weight: 300;
	line-height: 1.5;
	margin: 0;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	text-overflow: ellipsis;
}

/* Card Category */
.card-category {
	position: absolute;
	left: 8.5cqw;
	bottom: 10.5cqw;
	padding: 1.5cqw 4.5cqw;
	border-radius: 6cqw;
	border: 1px solid #eee;
	color: #333;
	text-align: center;
	font-size: 3.5cqw;
	font-style: normal;
	font-weight: 400;
	white-space: nowrap;
	z-index: 10;
}

/* ---------- Service Card Variant ---------- */

/* Service card specific styles */
.card--service {
	/* Override default card behavior for service variant */
	container-type: inline-size;

	.card-title {
		margin-top: 10cqw;
		margin-bottom: 5cqw;
		width: 60cqw;
	}

	.card-description {
		color: #666;
		font-size: 4cqw;
		font-style: normal;
		font-weight: 300;
		line-height: 1.2;
		margin: 0;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.card-image {
		position: absolute;
		bottom: 5.5cqw;
		left: 10cqw;
		width: 80cqw;
		height: auto;
		background: transparent;
		margin-bottom: 0;
	}

	.card-image img {
		width: 100%;
		height: auto;
		object-fit: contain;
		object-position: center bottom;
	}
}

/* ---------- Service Cards Section Layout ---------- */

.service-cards-section {
	position: relative;
	padding: 4rem 5vw;
	margin: 0 auto;
}

.service-cards-bg-gradient {
	position: absolute;
	bottom: -4rem;
	left: -4rem;
	width: 75rem;
	max-width: 100vw;
	height: 60rem;
	background: radial-gradient(50% 50% at 50% 50%, #c1d6ef 0%, rgba(193, 214, 239, 0) 100%);
	mix-blend-mode: multiply;
	flex-shrink: 0;
	pointer-events: none;
	z-index: 0;
}

.service-cards-mobile {
	display: none !important;
	padding: 0 5vw !important; /* Add default padding */
}

.service-cards-desktop {
	display: flex;
	flex-direction: row;
	gap: clamp(2rem, 2.5vw, 40px);
	overflow: visible;
	width: 100%;
	justify-content: flex-start;
	/* Performance optimizations for ScrollTrigger */
	will-change: transform;
	transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	perspective: 1000px;
	/* Force GPU layer creation */
	opacity: 0.9999;
}

.service-cards-desktop .card--service {
	flex-shrink: 0;
	width: 30vw;
	transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	opacity: 0.9999;
}

/* Swiper pagination styling */
.service-cards-mobile .swiper-pagination {
	position: relative;
	margin-top: 2rem;
	bottom: auto;
}

.service-cards-mobile .swiper-pagination-bullet {
	width: 12px;
	height: 12px;
	background: var(--clr-pansy);
	opacity: 0.3;
	margin: 0 6px;
}

.service-cards-mobile .swiper-pagination-bullet-active {
	opacity: 1;
}

/* Responsive adjustments for cards */
@media (max-width: 1200px) {
	.service-cards-section {
		padding: 2rem 0;
	}
	.service-cards-desktop {
		display: none;
	}

	.service-cards-mobile {
		display: block !important;
	}

	.service-cards-section .card--service {
		width: 100%;
	}
}

/* Responsive padding adjustments */
@media (max-width: 900px) {
	.service-cards-mobile {
		padding: 0 4vw !important;
	}
}

@media (max-width: 768px) {
	.service-cards-mobile {
		padding: 0 3vw !important;
	}
}

@media (max-width: 480px) {
	.service-cards-mobile {
		padding: 0 2vw !important;
	}
}
