/**
 * PI money-page performance + conversion (non–med mal scope in PHP).
 * Loaded only when body has .pp-pi-money (see functions.php).
 *
 * Goals: larger tap targets for tel/consult, slightly reduced layout thrash on
 * long hubs, respect reduced-motion. Does not change homepage hero rules.
 *
 * Colors: var(--pp-brand-*) from pp-brand-tokens.css (sitewide).
 */

/* ── Tap targets: phone + primary CTAs (mobile-first) ─────────────────── */
@media screen and (max-width: 639px) {
	.pp-pi-money a[href^="tel:"],
	.pp-pi-money a[href^="sms:"] {
		display: inline-flex;
		align-items: center;
		min-height: 48px;
		padding: 0.35em 0.5em;
		box-sizing: border-box;
	}

	.pp-pi-money .cta a,
	.pp-pi-money a.cta,
	.pp-pi-money .button,
	.pp-pi-money input[type="submit"],
	.pp-pi-money button[type="submit"] {
		min-height: 48px;
		padding-top: 0.65em;
		padding-bottom: 0.65em;
		box-sizing: border-box;
	}
}

/* ── Long-form hubs: isolate layout for major content column (Chromium) ─ */
@media screen and (min-width: 640px) {
	.pp-pi-money main .content,
	.pp-pi-money main .entry-content {
		contain: layout style;
	}
}

/* ── Media: avoid oversized inline figures blowing horizontal scroll ───── */
.pp-pi-money .content img,
.pp-pi-money .entry-content img,
.pp-pi-money iframe {
	max-width: 100%;
	height: auto;
}

.pp-pi-money iframe {
	display: block;
}

/* ── Motion: do not animate for users who prefer reduced motion ───────── */
@media (prefers-reduced-motion: reduce) {
	.pp-pi-money *,
	.pp-pi-money *::before,
	.pp-pi-money *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ── In-page anchors: offset fixed/sticky headers (PI hubs + blog) ─────── */
body.pp-pi-money .content h2[id],
body.pp-pi-money .entry-content h2[id] {
	scroll-margin-top: 5.5rem;
}

/* ── Auto TOC (`.pp-auto-toc`) — scrolls with page; brand greens ───────── */
.pp-auto-toc {
	background: var(--pp-brand-cream);
	border: 1px solid var(--pp-brand-hairline);
	border-left: 4px solid var(--pp-brand-green-mid);
	padding: 1.1rem 1.25rem 1.15rem;
	margin: 1.5rem 0 2rem;
	border-radius: 0 6px 6px 0;
	position: relative;
	z-index: 1;
}

/* Sticky TOC removed 2026-05-15: on PI hubs with 10+ H2s the box pinned to the
   viewport and covered most of the article while scrolling. */

.pp-auto-toc__title {
	margin: 0 0 0.65rem;
	font-weight: 700;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--pp-brand-green-mid);
}

.pp-auto-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pp-auto-toc__item {
	margin: 0 0 0.35rem;
	padding-left: 0.65rem;
	border-left: 2px solid var(--pp-brand-hairline);
}

.pp-auto-toc__link {
	color: var(--pp-brand-green);
	text-decoration: none;
	display: inline-block;
	padding: 0.15rem 0;
	line-height: 1.45;
}

.pp-auto-toc__link:hover,
.pp-auto-toc__link:focus-visible {
	color: var(--pp-brand-green-light);
	text-decoration: underline;
}

/* ── Skip link (keyboard) ─────────────────────────────────────────────── */
.pp-skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 10000;
}

.pp-skip-link:focus {
	position: fixed;
	left: 0.5rem;
	top: 0.5rem;
	width: auto;
	height: auto;
	padding: 0.65rem 1rem;
	background: #0f4f32;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pp-skip-link:focus-visible {
	outline: 3px solid #c89b3c;
	outline-offset: 2px;
}

.pp-skip-target {
	display: block;
	scroll-margin-top: 5.5rem;
}

.pp-skip-target:focus {
	outline: none;
}

/* ── Mobile quick contact (tel + schedule) ───────────────────────────── */
.pp-pi-mobile-cta-bar {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9980;
	padding: 0.55rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
	background: rgba(0, 61, 33, 0.96);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
	gap: 0.5rem;
	justify-content: center;
	align-items: stretch;
	flex-wrap: wrap;
}

@media screen and (max-width: 781px) {
	body.pp-pi-money {
		padding-bottom: 5.5rem;
	}

	body.pp-pi-money .pp-pi-mobile-cta-bar {
		display: flex;
	}
}

.pp-pi-mobile-cta-bar__call,
.pp-pi-mobile-cta-bar__text,
.pp-pi-mobile-cta-bar__sched {
	flex: 1 1 30%;
	text-align: center;
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.35rem;
	font-weight: 600;
	text-decoration: none;
	box-sizing: border-box;
	border-radius: 3px;
	font-size: 0.95rem;
}

.pp-pi-mobile-cta-bar__call {
	background: #fff;
	color: var(--pp-brand-green);
}

.pp-pi-mobile-cta-bar__text {
	background: var(--pp-brand-cream);
	color: var(--pp-brand-green);
	border: 1px solid var(--pp-brand-hairline);
}

.pp-pi-mobile-cta-bar__sched {
	background: var(--pp-brand-green-mid);
	color: #fff;
}

.pp-pi-mobile-cta-bar a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -5px;
}
