/* ==========================================================================
   Practice page — Autotelic Objects
   Builds on assets/front-page.css (stories, captions, ▸ links, tiles), so
   the page reads as part of the front page. Only additions live here:
     .ao-pbar      sticky bar: page title left, section links right
     .ao-text      text row: title in the left third, copy in the right two
                   thirds — the same split as the 1/3 + 2/3 image rows
     .ao-media--four  four images across (two on phones)
     .ao-steps     the process, three across (sideways scroll on phones)
   ========================================================================== */

.ao-practice {
	--ao-read: 16px;          /* body copy: longer reading than the front page */
	--ao-bar-h: 72px;         /* same height as the menu bar */
}

html:has(.ao-practice) { scroll-behavior: smooth; }

/* Sections land just under the sticky bar */
.ao-practice [id] {
	scroll-margin-top: calc(var(--ao-bar-h) + var(--wp-admin--admin-bar--height, 0px));
}

/* ---------- Section bar ---------- */

.ao-practice .ao-pbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: var(--ao-bar-h);
	padding: 0 var(--ao-gutter);
	margin-bottom: 0 !important;
}
.ao-practice .ao-pbar h1 {
	font-family: inherit;
	font-size: var(--ao-title);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
}
.ao-practice .ao-pnav {
	display: flex;
	gap: 24px;
	list-style: none;
	padding: 0;
	white-space: nowrap;
}
.ao-practice .ao-pnav li { margin: 0 !important; }
.ao-practice .ao-pnav a { position: relative; display: inline-block; }
.ao-practice .ao-pnav a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.15s cubic-bezier(0, 0, 0.58, 1);
}
.ao-practice .ao-pnav a:hover::after,
.ao-practice .ao-pnav a[aria-current]::after { transform: scaleX(1); }

/* ---------- Hero ---------- */

.ao-practice .ao-media--full .wp-block-image img { aspect-ratio: 16 / 10; }

/* ---------- Text row ---------- */

.ao-practice .ao-text {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	padding: 24px var(--ao-gutter) 0;
}
.ao-practice .ao-text__body p {
	max-width: 36rem;
	font-size: var(--ao-read);
	line-height: 1.5;
}
.ao-practice .ao-text__body p + p { margin-top: 0.9em !important; }
.ao-practice .ao-text__body .ao-links { margin-top: 20px !important; }

/* A short opening statement, larger and light */
.ao-practice .ao-text__body p.ao-lead {
	max-width: 32rem;
	margin-bottom: 1.1em !important;
	font-size: 28px;
	font-weight: 300;
	line-height: 1.25;
}

/* A section that is text only: room above it */
.ao-practice .ao-story--text { padding-top: 24px; }

/* ---------- Four across (inspirations) ---------- */

.ao-practice .ao-media--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ao-practice .ao-tile__label { padding-right: 12px; }
.ao-practice .ao-tile__label + .ao-tile__label { margin-top: 2px !important; color: #565656; }

/* ---------- Process steps ---------- */

.ao-practice .ao-steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	row-gap: 48px;
	padding: 24px var(--ao-gutter) 0;
}
.ao-practice .ao-step > p { padding-right: 16px; }
.ao-practice .ao-step__n { margin-top: 12px !important; color: #565656; }
.ao-practice .ao-step__title { margin-top: 2px !important; font-size: var(--ao-read); }
.ao-practice .ao-step__text { margin-top: 6px !important; max-width: 24rem; }

/* =========================================================================
   Desktop
   ========================================================================= */

@media (min-width: 1024px) {
	.ao-practice .ao-text {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		gap: 0;
		padding-top: 32px;
	}
	.ao-practice .ao-media--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* =========================================================================
   Phones and tablets — same breakpoint as the header
   ========================================================================= */

@media (max-width: 1023px) {
	.ao-practice {
		--ao-read: 15px;
		--ao-bar-h: 56px;
	}

	.ao-practice .ao-media--full .wp-block-image img { aspect-ratio: 4 / 5; }

	/* Section links scroll sideways under the title */
	.ao-practice .ao-pbar {
		gap: 16px;
		overflow: hidden;
	}
	.ao-practice .ao-pnav {
		gap: 16px;
		overflow-x: auto;
		scrollbar-width: none;
		font-size: 13px;
		padding: 8px 0;
	}
	.ao-practice .ao-pnav::-webkit-scrollbar { display: none; }

	.ao-practice .ao-text { padding-top: 18px; }
	.ao-practice .ao-text__body p.ao-lead { font-size: 22px; }

	.ao-practice .ao-tile__label { padding-left: 16px; }

	/* Steps swipe sideways, a bit more than one in view */
	.ao-practice .ao-steps {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 72%;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--ao-gutter);
		scrollbar-width: none;
		padding-top: 18px;
	}
	.ao-practice .ao-steps::-webkit-scrollbar { display: none; }
	.ao-practice .ao-step { scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
	html:has(.ao-practice) { scroll-behavior: auto; }
	.ao-practice .ao-pnav a::after { transition: none; }
}
