/* ---------- 2026-08 refresh: tablet & mobile (per Figma responsive frames) ---------- */
@media (max-width: 1023px) {
	/* header overlays the dark hero (Figma): transparent bar, logo + hamburger only */
	header.site-header {
		top: 0;
		z-index: 40;
		position: fixed;
		left: 0;
		right: 0;
	}
	body.admin-bar header.site-header {
		top: 46px;
	}
	header.site-header > .wp-block-group {
		background: transparent;
		border-bottom: 0;
		box-shadow: none;
		backdrop-filter: none;
	}
	header.site-header .wp-block-buttons,
	header.site-header .mcdp-header-linkedin img,
	header.site-header a[aria-label="Motor City Dental Partners on LinkedIn"] img {
		display: none;
	}
	header.site-header > .wp-block-group > .wp-block-group {
		grid-template-columns: 88px minmax(0, 1fr) 28px;
	}
	.site-header .wp-block-navigation {
		justify-self: end;
	}
	.site-header .wp-block-navigation__responsive-container-open {
		color: #fff;
	}
	/* hero fills the viewport under the overlaid header */
	body.home .mcdp-hero-home {
		min-height: 100vh !important;
		min-height: 100svh !important;
		--mcdp-inline-min-height: 100svh;
	}
	/* Philosophy: Figma order — eyebrow, heading, rule, image, mission, accordion, button */
	.mcdp-philosophy > .wp-block-columns {
		display: flex;
		flex-direction: column;
		gap: 28px;
	}
	.mcdp-philosophy__lead {
		display: contents;
	}
	.mcdp-philosophy__lead > .wp-block-buttons {
		order: 99;
	}
}

@media (max-width: 1023px) and (max-height: 600px) {
	/* Let short screens scroll instead of squeezing copy behind the logo. */
	body.home .mcdp-hero-home {
		padding-top: var(--mcdp-anchor-offset);
		padding-bottom: 56px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.mcdp-hero-home h1:not(.mcdp-heading-fill) {
		animation: mcdp-hero-title-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
	}
}

@media (min-width: 600px) and (max-width: 1199px) {
	body.home .mcdp-hero-home h1 {
		max-width: 10.5em;
	}
}

@media (max-width: 599px) {
	body.home .mcdp-hero-home h1 {
		max-width: 100%;
		font-size: 34px;
		line-height: 1.08;
		letter-spacing: -.34px;
	}
}

@media (max-width: 782px) {
	body.admin-bar header.site-header {
		top: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mcdp-hero-home h1 {
		animation: none;
	}
}

/* stats + timeline keep a horizontal reading on tablet (Figma 768) */
.mcdp-stat-stack {
	display: flex;
	flex-direction: column;
	gap: 28px;
}
.mcdp-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.mcdp-stat > p {
	margin: 0;
}
.mcdp-label-Who-We-Are .mcdp-stat > p:first-child {
	color: var(--wp--preset--color--primary, #2995d2) !important;
}
@media (min-width: 600px) and (max-width: 1023px) {
	.mcdp-label-Who-We-Are .mcdp-stat-stack {
		flex-direction: row;
		gap: 24px;
	}
	.mcdp-label-Who-We-Are .mcdp-stat {
		flex: 1 1 0;
	}
	.mcdp-timeline > .wp-block-columns {
		display: flex;
		flex-wrap: nowrap !important;
		gap: 16px;
	}
	.mcdp-timeline .wp-block-column {
		flex: 1 1 0 !important;
	}
	.mcdp-timeline::before {
		left: calc((100% - 48px) / 8);
		right: calc((100% - 48px) / 8);
	}
}

@media (max-width: 599px) {
	/* Figma mobile: timeline becomes a left vertical rail */
	.mcdp-timeline {
		margin-left: 0;
	}
	.mcdp-timeline::before {
		display: none;
	}
	.mcdp-timeline > .wp-block-columns {
		display: flex;
		flex-direction: column;
		gap: 28px;
	}
	.mcdp-timeline .wp-block-column {
		flex: 1 1 auto !important;
		text-align: left;
		padding-left: 36px;
	}
	.mcdp-timeline .wp-block-column::before {
		left: 0;
		top: 8px;
		margin-left: 0;
		z-index: 1;
	}
	.mcdp-timeline .wp-block-column:not(:last-child)::after {
		content: "";
		position: absolute;
		left: 6px;
		top: 14.5px;
		width: 2px;
		height: calc(100% + 28px);
		background: var(--wp--preset--color--border-dark, #3a5266);
		transform-origin: top center;
	}
	/* Keep the component present, then advance milestones one at a time. */
	.mcdp-motion-ready .mcdp-timeline.is-armed,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview {
		opacity: 1;
		transform: none;
		transition: none;
		will-change: auto;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column:not(.is-step-inview) {
		opacity: 0;
		backface-visibility: hidden;
		transform: translate3d(0, 12px, 0);
		transition: none;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column.is-step-inview,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column.is-step-inview {
		opacity: 1;
		transform: translate3d(0, 0, 0);
		transition: opacity 0.34s ease-out,
			transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
		transition-delay: 0s;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column::before {
		opacity: 0;
		transform: scale(0.55);
		transform-origin: center;
		transition: none;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column:not(:last-child)::after {
		opacity: 0;
		transform: scaleY(0);
		transition: none;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column.is-step-inview::before {
		opacity: 1;
		transform: scale(1);
		transition: opacity 0.24s ease-out, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
		transition-delay: 0s;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column.is-step-inview:not(:last-child)::after {
		opacity: 1;
		transform: scaleY(1);
		transition: opacity 0.22s ease-out, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
		transition-delay: 0s;
	}
	.mcdp-timeline h3,
	.mcdp-timeline h4 {
		margin: 0 0 6px;
	}
	/* Figma mobile: footprint stats stay two-up */
	.mcdp-label-Our-Footprint .wp-block-column > .wp-block-group.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 20px;
	}
	.mcdp-label-Our-Footprint .is-layout-grid > .wp-block-group:nth-child(n/**/+3) {
		border-top: 1px solid #d7dee3;
		padding-top: 24px;
	}
}

@media (max-width: 599px) and (prefers-reduced-motion: reduce) {
	.mcdp-motion-ready .mcdp-timeline.is-armed,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview,
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column,
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column::before,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column::before,
	.mcdp-motion-ready .mcdp-timeline.is-armed .wp-block-column:not(:last-child)::after,
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column:not(:last-child)::after {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

@media (min-width: 600px) and (prefers-reduced-motion: no-preference) {
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column {
		transition-duration: 420ms, 560ms;
	}
	.mcdp-motion-ready .mcdp-timeline.is-armed.is-inview .wp-block-column::before {
		transition-duration: 360ms;
	}
}
