/**
 * Service Boxes Styles
 * 
 * Responsive styles for service boxes with hover effects.
 * Uses WordPress CSS custom properties for full theme compatibility.
 * 
 * @package Custom Patterns
 */

/* Service Box Container */
.custom-service-box {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--preset--spacing--20, clamp(0.5rem, 1vw, 1rem));
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Hover effect on container */
.custom-service-box:hover {
	transform: translateY(calc(var(--wp--preset--spacing--20, 0.5rem) * -1));
	box-shadow: 0 var(--wp--preset--spacing--40, clamp(1.5rem, 4vw, 3rem)) var(--wp--preset--spacing--50, clamp(2.5rem, 8vw, 4rem)) rgba(0, 0, 0, 0.2);
}

/* Cover image background */
.custom-service-box .wp-block-cover__image-background {
	width: 100%;
	height: 100%;
	object-fit: cover;
	position: absolute;
	top: 0;
	left: 0;
	transform-origin: center center;
	transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	transform: scale(1);
}

/* Zoom effect on hover - image background - slower animation */
.custom-service-box:hover .wp-block-cover__image-background {
	transform: scale(1.15);
}

/* Inner container - ensure content is above image */
.custom-service-box .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* Responsive adjustments */
@media (max-width: 782px) {
	.custom-service-box {
		min-height: 300px !important;
		margin-bottom: var(--wp--preset--spacing--40, clamp(1.5rem, 4vw, 3rem));
	}

	/* Reduce padding on mobile */
	.custom-service-box .wp-block-cover__inner-container {
		padding: var(--wp--preset--spacing--30, clamp(1rem, 2vw, 1.5rem)) !important;
	}
}

@media (max-width: 600px) {
	.custom-service-box {
		min-height: 250px !important;
	}

	/* Smaller text on very small screens */
	.custom-service-box h3 {
		font-size: var(--wp--preset--font-size--medium, clamp(1.125rem, 2.5vw, 1.5rem)) !important;
	}

	.custom-service-box p {
		font-size: var(--wp--preset--font-size--small, clamp(0.875rem, 2vw, 1rem)) !important;
	}
}

/* Ensure proper stacking on columns */
.wp-block-columns .wp-block-column .custom-service-box {
	height: 100%;
}

/* Query Loop Layout - 2 columns on desktop */
@media (min-width: 783px) {
	.wp-block-query.alignfull {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0;
	}

	.wp-block-query.alignfull .wp-block-post {
		width: 100%;
	}
}

/* Mobile: stack posts vertically */
@media (max-width: 782px) {
	.wp-block-query.alignfull {
		display: flex;
		flex-direction: column;
	}

	.wp-block-query.alignfull .wp-block-post {
		width: 100%;
	}
}

/* Make post-link wrapper full size */
.wp-block-post-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

/* Make post title look good */
.custom-service-box .wp-block-post-title {
	color: #ffffff !important;
	text-decoration: none;
	margin: 0;
}

.custom-service-box .wp-block-post-title a {
	color: #ffffff !important;
	text-decoration: none;
}

.custom-service-box:hover .wp-block-post-title {
	text-decoration: underline;
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
	.custom-service-box {
		transition: none;
	}

	.custom-service-box:hover {
		transform: none;
	}

	.custom-service-box .wp-block-cover__image-background {
		transition: none;
		transform: scale(1) !important;
	}

	.custom-service-box:hover .wp-block-cover__image-background {
		transform: scale(1) !important;
	}
}

/* Print styles */
@media print {
	.custom-service-box {
		break-inside: avoid;
		box-shadow: none;
	}

	.custom-service-box .wp-block-cover__image-background {
		opacity: 0.3;
	}
}

