/**
 * Services Section Styles - Mobile First
 * 
 * Responsive services grid/row layout
 * Uses Palette A CSS variables for consistent theming
 *
 * @package Garage_At_Home
 */

/* Palette A CSS Variables */
:root {
	--gh-bg: #0F1113;
	--gh-surface: #141618;
	--gh-accent: #C62828;
	--gh-accent-2: #FF6F61;
	--gh-text: #F5F6F7;
	--gh-muted: #BFC4C6;
}

/* Services Section Container - Standardized */
.gh-services-section {
	background-color: var(--gh-bg);
	padding: 2rem 0;
	position: relative;
	width: 100%;
	max-width: 100vw;
	overflow-x: hidden;
	box-sizing: border-box;
}

/* Mobile: Consistent padding */
@media (max-width: 767px) {
	.gh-services-section {
		padding: 1.5rem 0;
	}
}

.gh-services-container {
	max-width: min(1200px, 100%);
	margin: 0 auto;
	padding: 0 1rem;
	width: 100%;
	box-sizing: border-box;
	overflow-x: hidden;
}

/* Services Header */
.gh-services-header {
	margin-bottom: 2rem;
	text-align: center;
}

/* Mobile: Reduce services header margin */
@media (max-width: 767px) {
	.gh-services-header {
		margin-bottom: 1.5rem;
	}
}

.gh-services-title {
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 0.5rem 0;
	letter-spacing: -0.5px;
	color: var(--gh-text);
}

/* Mobile: Smaller services title */
@media (max-width: 767px) {
	.gh-services-title {
		font-size: 1.375rem;
		margin: 0 0 0.375rem 0;
	}
}

.gh-services-subtitle {
	font-size: 0.875rem;
	color: var(--gh-muted);
	margin: 0;
	font-weight: 400;
	letter-spacing: 0.3px;
}

/* Services Wrapper */
.gh-services-wrapper {
	width: 100%;
	overflow-x: hidden;
	overflow-y: hidden;
	box-sizing: border-box;
}

/* Desktop: Enable auto-scroll container */
@media (min-width: 1024px) {
	.gh-services-wrapper {
		overflow: hidden;
		position: relative;
	}
}

/* Services Grid - Mobile: 2 columns */
.gh-services-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	width: 100%;
	max-width: 100%;
	padding: 0;
	margin: 0;
	list-style: none;
	box-sizing: border-box;
	align-items: stretch;
}

/* Service Card */
.gh-service-card {
	background: var(--gh-surface);
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid rgba(255, 111, 97, 0.1);
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	justify-content: flex-start;
	gap: 0.75rem;
	min-height: 200px;
	max-height: none;
	cursor: pointer;
	outline: none;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow: visible;
	/* Allow page scroll when touching cards */
	touch-action: manipulation;
	/* Ensure consistent card structure */
	position: relative;
}

.gh-service-card:hover {
	transform: translateY(-4px);
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(255, 111, 97, 0.2);
	border-color: rgba(255, 111, 97, 0.3);
}

.gh-service-card:focus {
	outline: 2px solid var(--gh-accent-2);
	outline-offset: 4px;
}

.gh-service-card:active {
	transform: translateY(-2px);
}

/* Service Icon Container */
.gh-service-icon {
	width: 64px;
	height: 64px;
	min-width: 64px;
	max-width: 64px;
	border-radius: 12px;
	background: rgba(255, 111, 97, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-bottom: 0;
	padding: 8px;
	box-sizing: border-box;
}

.gh-service-icon img,
.gh-service-icon svg {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 8px;
}

.gh-service-icon svg {
	filter: drop-shadow(0 2px 4px rgba(255, 111, 97, 0.3));
}

/* Service Title */
.gh-service-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--gh-text);
	margin: 0;
	line-height: 1.3;
	letter-spacing: 0.2px;
	word-wrap: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
	flex-shrink: 0;
	/* Ensure title is always visible */
	visibility: visible !important;
	display: block !important;
}

/* Service Description */
.gh-service-desc {
	font-size: 0.8125rem;
	color: var(--gh-muted);
	margin: 0;
	line-height: 1.5;
	font-weight: 400;
	opacity: 0.9;
	word-wrap: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
	/* Ensure description is always visible */
	overflow: visible;
	display: block;
	text-overflow: ellipsis;
	flex-shrink: 1;
	flex-grow: 0;
	/* Always show description */
	visibility: visible !important;
	opacity: 0.9 !important;
	min-height: auto;
}

/* Tablet Layout: 3 columns */
@media (min-width: 768px) {
	.gh-services-section {
		padding: 4rem 0;
	}
	
	.gh-services-container {
		padding: 0 2rem;
		max-width: calc(100% - 4rem);
	}
	
	.gh-services-header {
		margin-bottom: 2.5rem;
		text-align: left;
	}
	
	.gh-services-title {
		font-size: 2.25rem;
	}
	
	.gh-services-subtitle {
		font-size: 1rem;
		text-align: left;
	}
	
	.gh-services-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 1.5rem;
		max-width: 100%;
		align-items: stretch;
	}
	
	.gh-service-card {
		padding: 1.75rem;
		min-height: 240px;
		width: 100%;
		max-width: 100%;
		/* Ensure cards align properly in grid */
		align-self: stretch;
		display: flex;
		flex-direction: column;
		/* Fix bottom spacing by pushing description down */
	}
	
	.gh-service-card .gh-service-icon {
		flex-shrink: 0;
	}
	
	.gh-service-card .gh-service-title {
		flex-shrink: 0;
		margin-bottom: 0.25rem;
	}
	
	.gh-service-card .gh-service-desc {
		flex: 1;
		margin-top: auto;
	}
	
	.gh-service-icon {
		width: 64px;
		height: 64px;
		min-width: 64px;
		max-width: 64px;
		margin-bottom: 0;
	}
	
	.gh-service-title {
		font-size: 1.125rem;
	}
	
	.gh-service-desc {
		font-size: 0.875rem;
		line-height: 1.5;
		display: block !important;
		visibility: visible !important;
		opacity: 0.9 !important;
		min-height: auto;
		/* Remove any line-clamp restrictions */
		-webkit-line-clamp: unset;
		max-height: none;
		overflow: visible;
	}
}

/* Desktop Layout: Auto-scrolling horizontal container */
@media (min-width: 1024px) {
	.gh-services-wrapper {
		overflow: hidden;
		width: 100%;
		position: relative;
	}
	
	.gh-services-grid {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 1.5rem;
		width: max-content;
		padding: 0 1rem;
		animation: scrollServices 30s linear infinite;
	}
	
	.gh-services-grid:hover {
		animation-play-state: paused;
	}
	
	.gh-service-card {
		flex: 0 0 auto;
		width: 200px;
		min-width: 200px;
		max-width: 200px;
		min-height: auto;
		padding: 1.75rem 1.5rem;
	}
	
	.gh-service-icon {
		width: 64px;
		height: 64px;
		min-width: 64px;
		max-width: 64px;
		margin-bottom: 0;
	}
	
	.gh-service-title {
		font-size: 1.125rem;
	}
	
	.gh-service-desc {
		font-size: 0.875rem;
	}
}

/* Auto-scroll animation */
@keyframes scrollServices {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(calc(-50% - 0.75rem));
	}
}

/* Large Desktop: Wider cards in auto-scroll */
@media (min-width: 1280px) {
	.gh-services-grid {
		gap: 2rem;
	}
	
	.gh-service-card {
		width: 220px;
		min-width: 220px;
		max-width: 220px;
	}
}

/* Extra Large Desktop: Even wider cards in auto-scroll */
@media (min-width: 1440px) {
	.gh-services-grid {
		gap: 2.5rem;
	}
	
	.gh-service-card {
		width: 240px;
		min-width: 240px;
		max-width: 240px;
		padding: 2rem 1.75rem;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.gh-services-section {
		padding: 2rem 0;
	}
	
	.gh-services-title {
		font-size: 1.5rem;
	}
	
	.gh-services-grid {
		gap: 0.75rem;
		align-items: stretch;
	}
	
	.gh-service-card {
		padding: 1rem 0.875rem;
		min-height: 180px;
		gap: 0.5rem;
		align-self: stretch;
		display: flex;
		flex-direction: column;
	}
	
	.gh-service-card .gh-service-icon {
		flex-shrink: 0;
	}
	
	.gh-service-card .gh-service-title {
		flex-shrink: 0;
		margin-bottom: 0.125rem;
	}
	
	.gh-service-card .gh-service-desc {
		flex: 1;
		margin-top: auto;
	}
	
	.gh-service-icon {
		width: 48px;
		height: 48px;
		min-width: 48px;
		max-width: 48px;
		margin-bottom: 0;
		padding: 6px;
	}
	
	.gh-service-title {
		font-size: 0.875rem;
		line-height: 1.25;
		visibility: visible !important;
		display: block !important;
	}
	
	.gh-service-desc {
		font-size: 0.75rem;
		line-height: 1.5;
		display: block !important;
		visibility: visible !important;
		opacity: 0.9 !important;
		min-height: auto;
		/* Remove line-clamp to show full description */
		-webkit-line-clamp: unset;
		max-height: none;
		overflow: visible;
		/* Ensure text is readable */
		word-break: break-word;
	}
}

/* Keyboard Navigation Enhancement */
.gh-service-card:focus-visible {
	outline: 3px solid var(--gh-accent-2);
	outline-offset: 4px;
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(255, 111, 97, 0.2);
}

