/**
 * Workflow Section Styles - Mobile First
 * 
 * Responsive workflow section with two-column layout and animations
 * 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;
}

/* Animation Classes */
.gh-anim-hidden {
	transform: translateY(16px);
	opacity: 0;
	will-change: transform, opacity;
}

.gh-anim-show {
	transform: translateY(0);
	opacity: 1 !important;
	visibility: visible !important;
	transition: transform 0.48s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.36s ease;
}

/* Fallback: Ensure steps are visible even if animation fails */
.gh-workflow-step {
	min-height: 1px;
	display: flex !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	.gh-anim-hidden {
		transform: none;
		opacity: 1;
	}
	
	.gh-anim-show {
		transition: none;
	}
	
	.gh-workflow-step {
		transition: none !important;
	}
	
	.gh-step-desc {
		transition: none !important;
	}
	
	.gh-workflow-title::after {
		animation: none;
		width: 50px;
		opacity: 1;
	}
	
	.gh-step-connector {
		animation: none;
	}
	
	.gh-workflow-media::after {
		animation: none;
	}
}

/* Workflow Section Container - Standardized */
.gh-workflow-section {
	background-color: var(--gh-bg);
	background-image: 
		radial-gradient(circle at 10% 20%, rgba(198, 40, 40, 0.05) 0%, transparent 40%),
		radial-gradient(circle at 90% 80%, rgba(255, 111, 97, 0.04) 0%, transparent 40%),
		linear-gradient(180deg, transparent 0%, rgba(198, 40, 40, 0.02) 100%);
	padding: 2rem 0;
	position: relative;
	width: 100%;
	max-width: 100vw;
	overflow-x: hidden;
	box-sizing: border-box;
}

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

.gh-workflow-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, var(--gh-accent) 20%, var(--gh-accent-2) 50%, var(--gh-accent) 80%, transparent 100%);
	opacity: 0.3;
}

.gh-workflow-section::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, var(--gh-accent) 20%, var(--gh-accent-2) 50%, var(--gh-accent) 80%, transparent 100%);
	opacity: 0.3;
}

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

/* Workflow Header - Enhanced Graphics */
.gh-workflow-header {
	margin-bottom: 0.75rem;
	text-align: center;
	position: relative;
	padding: 0.75rem 0.75rem;
	background: 
		radial-gradient(circle at 20% 50%, rgba(198, 40, 40, 0.08) 0%, transparent 50%),
		radial-gradient(circle at 80% 50%, rgba(255, 111, 97, 0.06) 0%, transparent 50%),
		linear-gradient(180deg, transparent 0%, rgba(198, 40, 40, 0.03) 100%);
	border-radius: 8px;
	border: 1px solid rgba(198, 40, 40, 0.12);
	box-shadow: 
		inset 0 1px 2px rgba(255, 255, 255, 0.05),
		0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Mobile: Reduce workflow header padding */
@media (max-width: 767px) {
	.gh-workflow-header {
		padding: 0.625rem 0.5rem;
		margin-bottom: 0.875rem;
		border-radius: 8px;
	}
}

.gh-workflow-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent 0%, var(--gh-accent) 50%, transparent 100%);
	border-radius: 12px 12px 0 0;
}

.gh-workflow-title {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 0.375rem 0;
	letter-spacing: -0.5px;
	color: var(--gh-text);
	position: relative;
	display: inline-block;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.gh-workflow-title::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%);
	width: 40px;
	height: 2px;
	background: linear-gradient(90deg, var(--gh-accent) 0%, var(--gh-accent-2) 100%);
	border-radius: 2px;
	box-shadow: 0 2px 4px rgba(198, 40, 40, 0.4);
	animation: fadeInUnderline 0.6s ease-out 0.3s both;
}

@keyframes fadeInUnderline {
	from {
		width: 0;
		opacity: 0;
	}
	to {
		width: 40px;
		opacity: 1;
	}
}

.gh-workflow-title-accent {
	color: var(--gh-accent);
	position: relative;
}

.gh-workflow-subtitle {
	font-size: 0.6875rem;
	color: var(--gh-muted);
	margin: 0.375rem 0 0 0;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0.3px;
}

/* Workflow Content - Mobile: Stacked */
.gh-workflow-content {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: 100%;
}

/* Workflow Left - Text and Steps */
.gh-workflow-left {
	flex: 1;
	width: 100%;
}

/* Workflow Steps List */
.gh-workflow-steps {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	position: relative;
}

/* Mobile: Smaller workflow steps gap */
@media (max-width: 767px) {
	.gh-workflow-steps {
		gap: 0.375rem;
	}
}

.gh-workflow-step {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.5rem;
	margin: 0;
	position: relative;
	cursor: pointer;
	outline: none;
	border-radius: 6px;
	background: rgba(20, 22, 24, 0.4);
	border: 1px solid rgba(198, 40, 40, 0.1);
	box-shadow: 
		inset 0 1px 2px rgba(255, 255, 255, 0.03),
		0 1px 3px rgba(0, 0, 0, 0.1);
	transition: all 0.2s ease;
}

/* Mobile: Smaller workflow step padding */
@media (max-width: 767px) {
	.gh-workflow-step {
		padding: 0.375rem;
		gap: 0.375rem;
		border-radius: 5px;
	}
}

.gh-workflow-step:focus-visible {
	outline: 2px solid var(--gh-accent);
	outline-offset: 2px;
	background-color: rgba(198, 40, 40, 0.08);
	border-color: rgba(198, 40, 40, 0.3);
	box-shadow: 
		inset 0 1px 2px rgba(255, 255, 255, 0.05),
		0 0 0 2px rgba(198, 40, 40, 0.2),
		0 2px 6px rgba(0, 0, 0, 0.15);
}

.gh-workflow-step:hover {
	background-color: rgba(198, 40, 40, 0.06);
	border-color: rgba(198, 40, 40, 0.2);
	transform: translateY(-1px);
	box-shadow: 
		inset 0 1px 2px rgba(255, 255, 255, 0.05),
		0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Step Icon */
.gh-step-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gh-accent);
	position: relative;
	z-index: 2;
	background: radial-gradient(circle, rgba(198, 40, 40, 0.15) 0%, transparent 70%);
	border-radius: 50%;
	padding: 2px;
	transition: all 0.2s ease;
}

/* Mobile: Smaller step icon */
@media (max-width: 767px) {
	.gh-step-icon {
		width: 18px;
		height: 18px;
		padding: 1.5px;
	}
}

.gh-workflow-step:hover .gh-step-icon {
	background: radial-gradient(circle, rgba(198, 40, 40, 0.25) 0%, transparent 70%);
	transform: scale(1.1);
}

.gh-step-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Step Content */
.gh-step-content {
	flex: 1;
	min-width: 0;
}

.gh-step-title {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--gh-text);
	margin: 0;
	line-height: 1.25;
	letter-spacing: 0.2px;
	position: relative;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Mobile: Smaller step title */
@media (max-width: 767px) {
	.gh-step-title {
		font-size: 0.75rem;
		line-height: 1.2;
	}
}

.gh-step-desc {
	font-size: 0.875rem;
	color: var(--gh-muted);
	margin: 0.5rem 0 0 0;
	line-height: 1.5;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
	display: block !important;
	visibility: visible !important;
}

.gh-workflow-step[aria-expanded="true"] .gh-step-desc {
	opacity: 1 !important;
}

/* Mobile: Smaller step description */
@media (max-width: 767px) {
	.gh-step-desc {
		font-size: 0.8125rem;
		line-height: 1.4;
		margin-top: 0.375rem;
	}
}

.gh-workflow-step[aria-expanded="true"] .gh-step-desc {
	max-height: 200px;
	opacity: 1;
	margin-top: 0.75rem;
}

/* Step Connector (Desktop Timeline) */
.gh-step-connector {
	display: none;
}

/* Workflow Right - Image Container */
.gh-workflow-right {
	flex: 1;
	width: 100%;
}

.gh-workflow-media {
	width: 100%;
	min-height: 160px;
	background-color: var(--gh-surface);
	background-image: 
		radial-gradient(circle at 30% 30%, rgba(198, 40, 40, 0.1) 0%, transparent 50%),
		radial-gradient(circle at 70% 70%, rgba(255, 111, 97, 0.08) 0%, transparent 50%);
	border-radius: 8px;
	background-size: cover, cover !important;
	background-position: center, center !important;
	background-repeat: no-repeat, no-repeat !important;
	border: 1px solid rgba(198, 40, 40, 0.15);
	box-shadow: 
		inset 0 1px 2px rgba(255, 255, 255, 0.05),
		0 2px 8px rgba(0, 0, 0, 0.2);
	position: relative;
	overflow: hidden;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Ensure background image is visible when set via inline style */
.gh-workflow-media[style*="background-image"] {
	background-size: cover !important;
	background-position: center center !important;
	background-repeat: no-repeat !important;
}

.gh-workflow-media::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(198, 40, 40, 0.05) 0%, transparent 50%, rgba(255, 111, 97, 0.05) 100%);
	pointer-events: none;
}

.gh-workflow-media::after {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(198, 40, 40, 0.1) 0%, transparent 70%);
	animation: pulseGlow 4s ease-in-out infinite;
	pointer-events: none;
}

@keyframes pulseGlow {
	0%, 100% {
		opacity: 0.3;
		transform: scale(1);
	}
	50% {
		opacity: 0.5;
		transform: scale(1.1);
	}
}

/* Tablet Layout */
@media (min-width: 768px) {
	.gh-workflow-section {
		padding: 1.25rem 0;
	}
	
	.gh-workflow-container {
		padding: 0 1.25rem;
		max-width: min(1000px, calc(100% - 2.5rem));
	}
	
	.gh-workflow-header {
		margin-bottom: 1rem;
		padding: 1rem 1rem;
	}
	
	.gh-workflow-title {
		font-size: 1.5rem;
	}
	
	.gh-workflow-title::after {
		width: 45px;
	}
	
	@keyframes fadeInUnderline {
		from {
			width: 0;
			opacity: 0;
		}
		to {
			width: 45px;
			opacity: 1;
		}
	}
	
	.gh-workflow-subtitle {
		font-size: 0.75rem;
	}
	
	.gh-workflow-content {
		gap: 1rem;
	}
	
	.gh-workflow-steps {
		gap: 0.75rem;
	}
	
	.gh-step-icon {
		width: 22px;
		height: 22px;
	}
	
	.gh-step-title {
		font-size: 0.875rem;
	}
	
	.gh-step-desc {
		font-size: 0.75rem;
	}
	
	.gh-workflow-media {
		min-height: 240px;
		border-radius: 10px;
	}
}

/* Desktop Layout - Two Column with Timeline */
@media (min-width: 1024px) {
	.gh-workflow-container {
		padding: 0 1.25rem;
		max-width: min(1000px, calc(100% - 2.5rem));
	}
	
	.gh-workflow-header {
		padding: 1.25rem 1.5rem;
		margin-bottom: 1.25rem;
	}
	
	.gh-workflow-title {
		font-size: 1.75rem;
	}
	
	.gh-workflow-title::after {
		width: 55px;
	}
	
	@keyframes fadeInUnderline {
		from {
			width: 0;
			opacity: 0;
		}
		to {
			width: 55px;
			opacity: 1;
		}
	}
	
	.gh-workflow-content {
		flex-direction: row;
		align-items: flex-start;
		gap: 1.5rem;
	}
	
	/* Image on left */
	.gh-workflow-content.image-left {
		flex-direction: row-reverse;
	}
	
	.gh-workflow-left {
		flex: 1;
		max-width: 50%;
		position: relative;
	}
	
	.gh-workflow-right {
		flex: 1;
		max-width: 50%;
	}
	
	/* Timeline Visual - Vertical Line */
	.gh-workflow-steps::before {
		content: '';
		position: absolute;
		left: 11px;
		top: 20px;
		bottom: 0;
		width: 2px;
		background: linear-gradient(180deg, var(--gh-accent) 0%, rgba(198, 40, 40, 0.3) 100%);
		z-index: 1;
		box-shadow: 0 0 4px rgba(198, 40, 40, 0.3);
	}
	
	.gh-workflow-steps {
		gap: 1rem;
		padding-left: 0;
	}
	
	.gh-workflow-step {
		padding-left: 0.875rem;
		margin-left: 0;
		padding-top: 0.625rem;
		padding-bottom: 0.625rem;
	}
	
	/* Step Connector - Red Dot on Timeline */
	.gh-step-connector {
		display: block;
		position: absolute;
		left: 6px;
		top: 10px;
		width: 10px;
		height: 10px;
		background-color: var(--gh-accent);
		border-radius: 50%;
		border: 2px solid var(--gh-bg);
		z-index: 2;
		box-shadow: 0 0 0 2px var(--gh-accent), 0 0 6px rgba(198, 40, 40, 0.5);
		animation: pulseDot 2s ease-in-out infinite;
	}
	
	@keyframes pulseDot {
		0%, 100% {
			transform: scale(1);
			opacity: 1;
		}
		50% {
			transform: scale(1.2);
			opacity: 0.8;
		}
	}
	
	.gh-step-icon {
		width: 24px;
		height: 24px;
		margin-left: 0.5rem;
	}
	
	.gh-step-title {
		font-size: 0.9375rem;
	}
	
	.gh-step-desc {
		font-size: 0.8125rem;
	}
	
	.gh-workflow-media {
		min-height: 300px;
		border-radius: 12px;
	}
}

/* Large Desktop */
@media (min-width: 1280px) {
	.gh-workflow-container {
		padding: 0 1.5rem;
		max-width: min(1000px, calc(100% - 3rem));
	}
	
	.gh-workflow-content {
		gap: 2rem;
	}
	
	.gh-workflow-steps {
		gap: 1.25rem;
	}
	
	.gh-step-title {
		font-size: 1rem;
	}
	
	.gh-workflow-media {
		min-height: 320px;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.gh-workflow-section {
		padding: 0.75rem 0;
	}
	
	.gh-workflow-container {
		padding: 0 0.875rem;
		max-width: calc(100% - 1.75rem);
	}
	
	.gh-workflow-header {
		padding: 0.625rem 0.625rem;
		margin-bottom: 0.75rem;
	}
	
	.gh-workflow-title {
		font-size: 1.125rem;
	}
	
	.gh-workflow-title::after {
		width: 30px;
	}
	
	.gh-workflow-subtitle {
		font-size: 0.625rem;
	}
	
	.gh-workflow-steps {
		gap: 0.5rem;
	}
	
	.gh-workflow-step {
		padding: 0.375rem;
	}
	
	.gh-step-icon {
		width: 18px;
		height: 18px;
	}
	
	.gh-step-title {
		font-size: 0.75rem;
	}
	
	.gh-step-desc {
		font-size: 0.625rem;
	}
	
	.gh-workflow-media {
		min-height: 150px;
	}
}
