/* Homepage services — Prime Ortho style tiles + flip CTA (2 large cards) */

/* Full listing (/service/ page + CPT archive) */
.ph-services-archive {
	padding-top: 48px;
	padding-bottom: 72px;
}

.ph-services-archive__head {
	margin-bottom: 40px;
	text-align: center;
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

.ph-services-archive__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

@media (max-width: 767px) {
	.ph-services-archive__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

@media (min-width: 1200px) {
	.ph-services-archive__grid {
		gap: 24px;
	}
}

.ph-services {
	padding: 88px 0 64px;
	background: var(--ph-home-cool);
	position: relative;
	overflow: hidden;
}

.ph-services::before {
	content: "";
	position: absolute;
	width: 480px;
	height: 480px;
	right: -140px;
	top: -100px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(247, 127, 0, 0.14), transparent 70%);
	pointer-events: none;
}

.ph-services::after {
	content: "";
	position: absolute;
	width: 360px;
	height: 360px;
	left: -120px;
	bottom: -80px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(17, 29, 106, 0.12), transparent 70%);
	pointer-events: none;
}

.ph-services .ph-container {
	position: relative;
	z-index: 1;
}

.ph-services__slider {
	position: relative;
	padding: 0 56px;
}

.ph-services__viewport {
	overflow: hidden;
	width: 100%;
	padding: 12px 4px 20px;
	margin: -12px -4px -20px;
}

.ph-services__track {
	display: flex;
	align-items: stretch;
	gap: 0;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

/* One slide = 2×2 grid of 4 cards */
.ph-services__page.ph-services__slide {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: 20px;
	box-sizing: border-box;
	width: 100%;
	min-width: 100%;
	max-width: 100%;
	align-self: stretch;
	flex: 0 0 100%;
}

.ph-services__nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ph-navy, #111d6a);
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 10px 28px rgba(17, 29, 106, 0.28);
	transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.ph-services__nav:hover:not(:disabled) {
	background: var(--ph-accent, #f77f00);
	transform: translateY(-50%) scale(1.06);
}

.ph-services__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.ph-services__nav--prev {
	left: 0;
}

.ph-services__nav--next {
	right: 0;
}

.ph-services__dots {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 32px;
}

.ph-services__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 29, 106, 0.2);
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.ph-services__dot.is-active,
.ph-services__dot:hover {
	background: var(--ph-accent, #f77f00);
	transform: scale(1.15);
}

/* Image tiles inside 2×2 */
.ph-service-card {
	position: relative;
	width: 100%;
	min-height: 260px;
	height: 280px;
	perspective: 1400px;
	cursor: pointer;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.ph-service-card__flip {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ph-service-card:hover .ph-service-card__flip,
.ph-service-card.is-flipped .ph-service-card__flip,
.ph-service-card:focus-within .ph-service-card__flip {
	transform: rotateY(180deg);
}

.ph-service-card__face {
	position: absolute;
	inset: 0;
	border-radius: 14px;
	overflow: hidden;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	box-shadow: 0 16px 40px rgba(17, 29, 106, 0.12);
}

.ph-service-card__face--front {
	background: #1a2340;
}

.ph-service-card__face--back {
	display: flex;
	align-items: stretch;
	justify-content: stretch;
	background:
		radial-gradient(ellipse 90% 70% at 0% 100%, rgba(247, 127, 0, 0.32), transparent 50%),
		linear-gradient(155deg, #15206a 0%, #0a123f 55%, #070d2a 100%);
	transform: rotateY(180deg);
	color: #fff;
	border: 1px solid rgba(255, 201, 120, 0.18);
}

.ph-service-card__image-bg {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	background-color: #1a2340;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	transform: scale(1.01);
	transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.ph-service-card:hover .ph-service-card__face--front .ph-service-card__image-bg {
	transform: scale(1.08);
}

/* Even dark wash like Prime Ortho */
.ph-service-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(10, 16, 40, 0.55);
	pointer-events: none;
	transition: background 0.35s ease;
}

.ph-service-card:hover .ph-service-card__overlay {
	background: rgba(10, 16, 40, 0.62);
}

.ph-service-card__shine {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: linear-gradient(
		115deg,
		transparent 38%,
		rgba(255, 255, 255, 0.14) 50%,
		transparent 62%
	);
	transform: translateX(-130%) skewX(-12deg);
	pointer-events: none;
}

.ph-service-card:hover .ph-service-card__shine {
	animation: ph-service-shine 1s ease forwards;
}

@keyframes ph-service-shine {
	to {
		transform: translateX(130%) skewX(-12deg);
	}
}

/* Centered title + description (Prime Ortho form) */
.ph-service-card__front-content {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 28px 24px;
	text-align: center;
	pointer-events: none;
	box-sizing: border-box;
}

.ph-service-card__front-title {
	margin: 0;
	max-width: 14em;
	color: #fff;
	font-family: "Poppins", sans-serif;
	font-size: clamp(20px, 2vw, 28px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.ph-service-card__front-text {
	margin: 0;
	max-width: 28em;
	color: rgba(255, 255, 255, 0.92);
	font-family: "Poppins", sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.65;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

/* Back — CTA */
.ph-service-card__back-glow {
	position: absolute;
	width: 240px;
	height: 240px;
	top: -70px;
	right: -50px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(247, 127, 0, 0.4), transparent 70%);
	pointer-events: none;
}

.ph-service-card__back-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px 22px;
	height: 100%;
	box-sizing: border-box;
	text-align: center;
}

.ph-service-card__back-name {
	margin: 0;
	color: #fff;
	font-family: "Poppins", sans-serif;
	font-size: clamp(18px, 1.8vw, 24px);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.ph-service-card__back-rule {
	display: block;
	width: 48px;
	height: 3px;
	border-radius: 999px;
	background: linear-gradient(90deg, transparent, var(--ph-accent, #f77f00), transparent);
}

.ph-service-card__back-bio {
	margin: 0;
	max-width: 34em;
	color: rgba(255, 255, 255, 0.88);
	font-family: "Poppins", sans-serif;
	font-size: 13px;
	line-height: 1.65;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
}

.ph-service-card__back-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
	min-height: 42px;
	padding: 10px 18px;
	background: var(--ph-accent, #f77f00);
	border-radius: 999px;
	color: #fff !important;
	font-family: "Poppins", sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	box-shadow: 0 10px 28px rgba(247, 127, 0, 0.4);
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ph-service-card__back-cta:hover {
	background: #fff;
	color: var(--ph-navy, #111d6a) !important;
	transform: translateY(-2px);
}

.ph-service-card__back-cta span {
	transition: transform 0.25s ease;
}

.ph-service-card__back-cta:hover span {
	transform: translateX(3px);
}

@media (max-width: 900px) {
	.ph-services {
		padding: 56px 0 44px;
	}

	.ph-services__slider {
		padding: 0 42px;
	}

	.ph-services__page.ph-services__slide {
		gap: 14px;
	}

	.ph-service-card {
		min-height: 200px;
		height: 220px;
	}

	.ph-services__nav {
		width: 40px;
		height: 40px;
	}

	.ph-service-card__front-content,
	.ph-service-card__back-inner {
		padding: 16px 14px;
	}

	.ph-service-card__front-title {
		font-size: 17px;
	}

	.ph-service-card__front-text {
		font-size: 12px;
		-webkit-line-clamp: 2;
	}
}

@media (min-width: 1200px) {
	.ph-service-card {
		min-height: 300px;
		height: 320px;
	}

	.ph-services__page.ph-services__slide {
		gap: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ph-services__track,
	.ph-service-card__flip,
	.ph-service-card__image-bg,
	.ph-service-card__back-cta {
		transition: none;
	}

	.ph-service-card:hover .ph-service-card__shine {
		animation: none;
	}

	.ph-service-card:hover .ph-service-card__flip,
	.ph-service-card.is-flipped .ph-service-card__flip,
	.ph-service-card:focus-within .ph-service-card__flip {
		transform: none;
	}

	.ph-service-card__face--back {
		opacity: 0;
	}

	.ph-service-card:hover .ph-service-card__face--back,
	.ph-service-card.is-flipped .ph-service-card__face--back {
		opacity: 1;
		z-index: 2;
	}
}
