/* ─── PPA Patient Journey ─── */

/* Reset: prevent Elementor global button / link styles bleeding in */
.ppa-hscroll-outer button,
.ppa-hscroll-outer [type="button"] {
	font-family: inherit;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	min-width: 0;
	min-height: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.ppa-hscroll-outer a {
	text-decoration: none;
	color: inherit;
}

/* ─── Horizontal scroll outer ─── */
.ppa-hscroll-outer {
	position: relative;
	height: calc(100vh * (var(--ppa-total-steps) + var(--ppa-scroll-buffer, 0.5)));
}

.ppa-hscroll-sticky {
	height: 100vh;
	overflow: hidden;
	background: var(--ppa-warm-bg);
}

/* JS adds these classes to simulate sticky when CSS sticky is broken
   by an ancestor with overflow:hidden (e.g. ee-offcanvas__container) */
.ppa-hscroll-sticky--fixed {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
}

.ppa-hscroll-sticky--bottom {
	position: absolute !important;
	bottom: 0;
	left: 0;
	right: 0;
}

/* ─── Progress bar ─── */
.ppa-progress-bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--ppa-cream-dark);
	z-index: 20;
}

.ppa-progress-fill {
	height: 100%;
	width: 0%;
	background: var(--ppa-orange);
	transition: width 0.05s linear;
	border-radius: 0 2px 2px 0;
}

/* ─── Step counter ─── */
.ppa-step-counter {
	position: absolute;
	top: 32px;
	left: 40px;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
}

.ppa-step-current {
	font-family: 'Playfair Display', serif;
	font-size: 48px;
	font-weight: 500;
	color: var(--ppa-orange);
	line-height: 1;
	min-width: 36px;
	transition: all 0.3s;
}

.ppa-step-divider {
	width: 40px;
	height: 1.5px;
	background: var(--ppa-cream-dark);
}

.ppa-step-total {
	font-size: 14px;
	color: var(--ppa-body-text);
	opacity: 0.5;
}

.ppa-step-label {
	position: absolute;
	top: 36px;
	right: 40px;
	z-index: 20;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 600;
	color: var(--ppa-orange);
}

/* ─── Nav dots ─── */
.ppa-step-nav {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	z-index: 20;
}

.ppa-step-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #E4DACE;
	transition: all 0.4s;
	cursor: pointer;
	border: none;
	padding: 0;
	margin: 0;
	min-width: 0;
	min-height: 0;
	line-height: 1;
	font-size: 0;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	text-transform: none;
	letter-spacing: 0;
}

.ppa-step-dot:focus-visible {
	outline: 2px solid var(--ppa-orange);
	outline-offset: 2px;
}

.ppa-step-dot.active {
	background: var(--ppa-orange);
	width: 36px;
	border-radius: 6px;
}

.ppa-step-dot:hover:not(.active) {
	background: #d4c4b4;
}

/* ─── Scroll hint ─── */
.ppa-scroll-hint {
	position: absolute;
	bottom: 48px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	transition: opacity 0.4s;
	opacity: 0;
	pointer-events: none;
}

.ppa-scroll-hint.visible {
	opacity: 1;
}

.ppa-scroll-hint-text {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--ppa-orange);
}

/* Mouse outline */
.ppa-scroll-mouse {
	width: 26px;
	height: 42px;
	border: 2px solid var(--ppa-orange);
	border-radius: 14px;
	position: relative;
	display: flex;
	justify-content: center;
}

/* Animated scroll dot */
.ppa-scroll-mouse::after {
	content: '';
	width: 4px;
	height: 8px;
	background: var(--ppa-orange);
	border-radius: 2px;
	position: absolute;
	top: 8px;
	animation: ppaMouseScroll 2s ease-in-out infinite;
}

@keyframes ppaMouseScroll {
	0%   { opacity: 1; transform: translateY(0); }
	50%  { opacity: 0.4; transform: translateY(12px); }
	100% { opacity: 1; transform: translateY(0); }
}

/* ─── Track ─── */
.ppa-hscroll-track {
	display: flex;
	width: calc(100vw * var(--ppa-total-steps));
	height: 100vh;
	will-change: transform;
}

/* ─── Panels ─── */
.ppa-panel {
	width: 100vw;
	height: 100vh;
	flex-shrink: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	position: relative;
	overflow: hidden;
}

.ppa-panel-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 80px 60px;
	position: relative;
	z-index: 2;
	max-width: 560px;
	margin: 0 auto;
}

/* Desktop: fade in text when step becomes active */
@media (min-width: 901px) {
	.ppa-panel-text > * {
		opacity: 0;
		transform: translateY(12px);
		transition: opacity 0.5s ease, transform 0.5s ease;
	}

	.ppa-panel.ppa-step-active .ppa-panel-text > * {
		opacity: 1;
		transform: translateY(0);
	}

	/* Stagger children – slight delay after slide starts moving */
	.ppa-panel.ppa-step-active .ppa-panel-text > *:nth-child(1) { transition-delay: 0.15s; }
	.ppa-panel.ppa-step-active .ppa-panel-text > *:nth-child(2) { transition-delay: 0.22s; }
	.ppa-panel.ppa-step-active .ppa-panel-text > *:nth-child(3) { transition-delay: 0.29s; }
	.ppa-panel.ppa-step-active .ppa-panel-text > *:nth-child(4) { transition-delay: 0.36s; }
}

.ppa-step-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(187, 116, 88, 0.08);
	padding: 6px 14px;
	border-radius: 20px;
	margin-bottom: 20px;
	width: fit-content;
	position: relative;
	transform: scale(1);
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scale up in stacked mode when panel enters */
.ppa-hscroll-outer--stacked .ppa-panel .ppa-step-badge {
	transform: scale(0.85);
	opacity: 0.6;
}

.ppa-hscroll-outer--stacked .ppa-panel.ppa-stacked-visible .ppa-step-badge {
	transform: scale(1.12);
	opacity: 1;
	transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s, opacity 0.4s ease 0.45s;
}


.ppa-step-num {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--ppa-step-accent, var(--ppa-orange));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
}

.ppa-step-badge > span:last-child {
	font-size: 11px;
	font-weight: 600;
	color: var(--ppa-step-accent, var(--ppa-orange));
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.ppa-panel-text h3 {
	font-family: 'Playfair Display', serif;
	font-size: 40px;
	font-weight: 500;
	line-height: 1.15;
	margin-bottom: 18px;
	color: var(--ppa-grey);
}

.ppa-panel-text h3 em {
	font-style: italic;
	color: var(--ppa-step-accent, var(--ppa-orange));
}

.ppa-panel-text p {
	font-size: 17px;
	line-height: 1.7;
	color: var(--ppa-body-text);
	max-width: 420px;
}

.ppa-micro-cta {
	margin-top: 24px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ppa-orange);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 0;
}

.ppa-micro-cta:hover {
	text-decoration: underline;
	color: var(--ppa-orange-hover);
}

/* ─── Visual panel ─── */
.ppa-panel-visual {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background-size: cover;
	background-position: center;
}

.ppa-panel-visual::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--ppa-grad1), var(--ppa-grad2));
	z-index: 1;
	pointer-events: none;
}

/* Parallax background layer (rendered by PHP, animated by JS on desktop) */
.ppa-panel-visual-bg {
	position: absolute;
	inset: -5%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	z-index: 0;
	will-change: transform;
	pointer-events: none;
	transform: scale(1.05);
}

.ppa-panel-visual--no-overlay::after {
	display: none;
}

.ppa-panel-visual > * {
	position: relative;
	z-index: 3;
}

/* Parallax bg must keep its absolute positioning */
.ppa-panel-visual > .ppa-panel-visual-bg {
	position: absolute;
	z-index: 0;
}

/* Float tags: above the gradient overlay (z:1), below the visual card (z:3) */
.ppa-panel-visual > .ppa-float-tag {
	z-index: 2;
}

/* Decorative circles behind everything */
.ppa-panel-visual > .ppa-float-circle {
	z-index: 0;
}

.ppa-visual-card {
	background: rgba(255, 255, 255, 0.65);
	border-radius: 16px;
	padding: 24px 28px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
	max-width: 540px;
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	display: flex;
	align-items: center;
	gap: 20px;
}

.ppa-visual-card-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ppa-visual-icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	padding: 14px;
	box-sizing: content-box;
	width: 1em;
	height: 1em;
	color: var(--ppa-icon-step-colour, var(--ppa-orange));
	background: rgba(187, 116, 88, 0.12);
}

.ppa-visual-icon i {
	font-size: inherit;
	color: inherit;
	line-height: 1;
}

/* SVG icon colour – apply to fills and strokes, but preserve explicit
   fill="none"/stroke="none" so outlined icons stay outlined. */
.ppa-visual-icon svg {
	width: 1em;
	height: 1em;
	color: inherit;
	fill: currentColor;
}

.ppa-visual-icon svg *:not([fill="none"]) {
	fill: currentColor;
}

.ppa-visual-icon svg [stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

/* No-background modifier: collapse the circle, keep only the icon glyph */
.ppa-visual-icon--no-bg {
	padding: 0 !important;
	background: transparent !important;
}

.ppa-visual-card h4 {
	font-family: 'Playfair Display', serif;
	font-size: 20px;
	font-weight: 500;
	margin: 0;
	color: var(--ppa-grey);
	line-height: 1.2;
}

.ppa-visual-card p {
	font-size: 14px;
	color: var(--ppa-body-text);
	line-height: 1.5;
	margin: 0;
}


/* ─── Floating elements ─── */
.ppa-float-tag {
	position: absolute;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 12px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ppa-green);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 1;
}

/* Float tags: JS drives transform for continuous random drift.
   Anchored top-left, transform moves them – GPU accelerated. */
.ppa-float-tag--animate {
	top: 0 !important;
	left: 0 !important;
	right: auto !important;
	bottom: auto !important;
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	.ppa-float-tag--animate {
		transition: none !important;
	}
}

.ppa-float-circle {
	position: absolute;
	border-radius: 50%;
	z-index: 0;
}

/* ─── Stacked layout ─── */
.ppa-hscroll-outer--stacked {
	height: auto !important;
}

.ppa-hscroll-outer--stacked .ppa-hscroll-sticky {
	height: auto !important;
	overflow: visible !important;
}

.ppa-hscroll-outer--stacked .ppa-hscroll-track {
	flex-direction: column;
	width: 100% !important;
	height: auto !important;
	transform: none !important;
}

.ppa-hscroll-outer--stacked .ppa-panel {
	width: 100% !important;
	height: auto !important;
	min-height: 100vh;
	max-height: 1000px;
}

.ppa-hscroll-outer--stacked .ppa-panel-visual {
	min-height: 100vh;
	max-height: 1000px;
}

/* Mobile: let the stacked panels size to their content */
@media (max-width: 900px) {
	.ppa-hscroll-outer--stacked .ppa-panel {
		min-height: auto;
		max-height: none;
	}

	.ppa-hscroll-outer--stacked .ppa-panel-visual {
		min-height: auto;
		max-height: none;
	}
}

.ppa-hscroll-outer--stacked .ppa-progress-bar,
.ppa-hscroll-outer--stacked .ppa-step-counter,
.ppa-hscroll-outer--stacked .ppa-step-label,
.ppa-hscroll-outer--stacked .ppa-step-nav,
.ppa-hscroll-outer--stacked .ppa-scroll-hint {
	display: none !important;
}

/* Stacked: text fades in per panel via IntersectionObserver */
@media (min-width: 901px) {
	.ppa-hscroll-outer--stacked .ppa-panel-text > * {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.6s ease, transform 0.6s ease;
	}

	.ppa-hscroll-outer--stacked .ppa-panel.ppa-stacked-visible .ppa-panel-text > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
	.ppa-hscroll-outer--stacked .ppa-panel.ppa-stacked-visible .ppa-panel-text > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
	.ppa-hscroll-outer--stacked .ppa-panel.ppa-stacked-visible .ppa-panel-text > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
	.ppa-hscroll-outer--stacked .ppa-panel.ppa-stacked-visible .ppa-panel-text > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
}

/* Mobile: no stacked text animation */
/* Mobile stacked layout: the generic mobile nudge (see @media block below)
   handles the reveal, so no override needed here. */

/* ─── Stacked: Alternate layout (desktop only) ─── */
@media (min-width: 901px) {
	.ppa-hscroll-outer--alternate .ppa-panel:nth-child(even) {
		direction: rtl;
	}

	.ppa-hscroll-outer--alternate .ppa-panel:nth-child(even) > * {
		direction: ltr;
	}
}

/* ─── Stacked: Scroll progress line (desktop only) ─── */
@media (min-width: 901px) {
	.ppa-hscroll-outer--scrollline .ppa-hscroll-track {
		position: relative;
	}

	/* Track line (background) */
	.ppa-hscroll-outer--scrollline .ppa-hscroll-track::before {
		content: '';
		position: absolute;
		top: 0;
		bottom: 0;
		left: 50%;
		transform: translateX(-50%);
		width: 2px;
		background: var(--ppa-cream-dark);
		z-index: 3;
		pointer-events: none;
	}

	/* Animated fill line */
	.ppa-hscroll-outer--scrollline .ppa-hscroll-track::after {
		content: '';
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		width: 2px;
		height: var(--ppa-stacked-line-h, 0%);
		background: var(--ppa-line-colour, var(--ppa-orange));
		z-index: 4;
		pointer-events: none;
		transition: height 0.1s linear;
	}
}

/* Hide line on mobile */
@media (max-width: 900px) {
	.ppa-hscroll-outer--scrollline .ppa-hscroll-track::before,
	.ppa-hscroll-outer--scrollline .ppa-hscroll-track::after {
		display: none;
	}

	.ppa-hscroll-outer--alternate .ppa-panel:nth-child(even) {
		direction: ltr;
	}
}

/* ─── prefers-reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
	.ppa-hscroll-outer {
		height: auto !important;
	}

	.ppa-hscroll-sticky {
		position: relative !important;
		height: auto !important;
		overflow: visible !important;
	}

	.ppa-hscroll-track {
		flex-direction: column;
		width: 100% !important;
		height: auto !important;
		transform: none !important;
	}

	.ppa-panel {
		width: 100% !important;
		height: auto !important;
		min-height: auto !important;
		grid-template-columns: 1fr !important;
	}

	.ppa-progress-bar,
	.ppa-step-counter,
	.ppa-step-label,
	.ppa-step-nav,
	.ppa-scroll-hint {
		display: none !important;
	}

	.ppa-panel-visual {
		height: 280px;
		border-radius: 14px;
	}

	.ppa-panel-text {
		padding: 40px 20px;
		max-width: 100% !important;
	}
}

/* ─── MOBILE: Vertical timeline (<= 900px) ─── */
@media (max-width: 900px) {
	.ppa-hscroll-outer {
		height: auto !important;
		padding: 0 20px 40px;
	}

	.ppa-hscroll-sticky {
		position: relative !important;
		height: auto !important;
		overflow: visible !important;
		background: transparent !important;
	}

	.ppa-hscroll-track {
		flex-direction: column;
		width: 100% !important;
		height: auto !important;
		transform: none !important;
		position: relative;
	}

	/* Desktop-only UI */
	.ppa-step-nav,
	.ppa-step-counter,
	.ppa-step-label,
	.ppa-progress-bar,
	.ppa-scroll-hint {
		display: none !important;
	}

	.ppa-panel {
		width: 100% !important;
		height: auto !important;
		min-height: auto !important;
		grid-template-columns: 1fr !important;
		position: relative;
		padding: 0 0 44px;
		overflow: visible !important;
	}

	/* Mobile scroll-in nudge: fade + slight translate when each panel
	   enters the viewport. JS adds .mob-active via IntersectionObserver. */
	.ppa-panel-text > *,
	.ppa-panel .ppa-panel-visual {
		opacity: 0;
		transform: translateY(14px);
		transition: opacity 0.55s ease, transform 0.55s ease;
	}

	.ppa-panel.mob-active .ppa-panel-text > *,
	.ppa-panel.mob-active .ppa-panel-visual {
		opacity: 1;
		transform: translateY(0);
	}

	.ppa-panel.mob-active .ppa-panel-text > *:nth-child(1) { transition-delay: 0.05s; }
	.ppa-panel.mob-active .ppa-panel-text > *:nth-child(2) { transition-delay: 0.12s; }
	.ppa-panel.mob-active .ppa-panel-text > *:nth-child(3) { transition-delay: 0.19s; }
	.ppa-panel.mob-active .ppa-panel-text > *:nth-child(4) { transition-delay: 0.26s; }
	.ppa-panel.mob-active .ppa-panel-visual { transition-delay: 0.3s; }

	@media (prefers-reduced-motion: reduce) {
		.ppa-panel-text > *,
		.ppa-panel .ppa-panel-visual {
			opacity: 1;
			transform: none;
			transition: none;
		}
	}

	.ppa-panel-text {
		padding: 0 0 12px;
		max-width: 100% !important;
		margin: 0 !important;
	}

	/* Step badge: slightly smaller on mobile */
	.ppa-step-badge {
		padding: 5px 11px;
		gap: 6px;
		margin-bottom: 14px;
	}

	.ppa-step-num {
		width: 22px;
		height: 22px;
		font-size: 11px;
	}

	.ppa-step-badge > span:last-child {
		font-size: 10px;
	}

	.ppa-panel-text h3 {
		font-size: 22px;
		margin-bottom: 10px;
		line-height: 1.25;
	}

	.ppa-panel-text p {
		font-size: 15px;
		line-height: 1.6;
	}

	.ppa-micro-cta {
		margin-top: 14px;
		font-size: 13px;
	}

	.ppa-panel-visual {
		height: 220px;
		border-radius: 14px;
		margin-top: 12px;
		overflow: hidden !important;
	}

	/* Disable parallax layer on mobile – use plain background */
	.ppa-panel-visual-bg {
		position: absolute;
		inset: 0;
		transform: none !important;
	}

	/* Hide floating tags on mobile – too cramped */
	.ppa-float-tag {
		display: none !important;
	}

	.ppa-visual-card {
		max-width: calc(100% - 24px) !important;
		padding: 14px 18px !important;
		gap: 12px !important;
	}

	.ppa-visual-icon {
		font-size: 18px !important;
		padding: 12px !important;
	}

	.ppa-visual-icon--no-bg {
		padding: 0 !important;
	}

	.ppa-visual-card h4 {
		font-size: 16px !important;
		margin: 0 !important;
	}

	.ppa-visual-card p {
		font-size: 13px !important;
		line-height: 1.5 !important;
	}
}
