/*
 * Breadcrumb strip, cost panel and permits guide.
 *
 * Plugin sheets load before the child theme, so anything that has to win
 * against a theme rule is written with two classes. The sticky columns are
 * opt-out on narrow screens: a sticky element inside a one-column stack just
 * pins a block of text to the top of the screen for no gain.
 */

/* ---- breadcrumb ------------------------------------------------------ */

.pi-crumbs {
	padding-block: 12px;
	background: #fff;
}
.pi-crumbs--cream { background: var(--pi-cream, #f5f1eb); }

.pi-crumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	max-width: var(--pi-shell, 1280px);
	margin: 0 auto;
	padding: 0 var(--pi-gutter, 40px);
	list-style: none;
	font-family: var(--pi-font-body, inherit);
	font-size: .8125rem;
	line-height: 1.55;
	color: var(--pi-muted, #4e574f);
}
.pi-crumbs__list li { margin: 0; }
.pi-crumbs__step a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.pi-crumbs__step a:hover,
.pi-crumbs__step a:focus-visible { border-bottom-color: currentColor; }
.pi-crumbs__sep { opacity: .7; }
.pi-crumbs__current {
	color: var(--pi-ink, #1e1b16);
	font-weight: 600;
}

/* ---- cost panel ------------------------------------------------------ */

.pi-blk .pi-cost {
	display: grid;
	grid-template-columns: 480px minmax(0, 1fr);
	gap: 64px;
	align-items: start;
}

.pi-cost__aside { position: sticky; top: 96px; }
.pi-cost__aside .pi-blk__title { margin-bottom: .75rem; }
.pi-cost__aside .pi-blk__lede { margin-bottom: 0; }

.pi-cost__listhead {
	margin: 1.5rem 0 .75rem;
	font-family: var(--pi-font-display, inherit);
	font-size: 1.1875rem;
	line-height: 1.26;
	color: var(--pi-ink, #1e1b16);
}

.pi-cost__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}
.pi-cost__list li {
	position: relative;
	padding-left: 18px;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pi-muted, #4e574f);
}
.pi-cost__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--pi-red, #e20e20);
}

.pi-cost__tiers { display: grid; gap: 16px; }

.pi-cost__tier {
	background: #fff;
	border-radius: var(--pi-r-card, 16px);
	padding: 25px;
}
.pi-cost__top {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}
.pi-cost__n {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: var(--pi-red, #e20e20);
	color: #fff;
	font-size: .8125rem;
	font-weight: 700;
}
.pi-cost__headline {
	margin: 0;
	font-family: var(--pi-font-display, inherit);
	font-size: 1.375rem;
	line-height: 1.26;
	color: var(--pi-ink, #1e1b16);
}
.pi-cost__note {
	margin: 0 0 16px;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pi-muted, #4e574f);
}
.pi-cost__price {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid var(--pi-line, #e0d6c4);
}
.pi-cost__pricelabel {
	font-size: .8125rem;
	color: var(--pi-muted, #4e574f);
}
.pi-cost__pill {
	padding: 8px 15px;
	border: 1px solid var(--pi-line, #e0d6c4);
	border-radius: 999px;
	font-size: .8125rem;
	line-height: 1.55;
	color: var(--pi-muted, #4e574f);
}
.pi-cost__fine {
	margin: 8px 0 0;
	font-size: .9375rem;
	line-height: 1.5;
	color: var(--pi-muted, #4e574f);
}
.pi-cost__cta { margin: 8px 0 0; }

/* ---- permits guide --------------------------------------------------- */

.pi-blk .pi-guide {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 64px;
	align-items: start;
}

.pi-guide__nav {
	position: sticky;
	top: 96px;
	background: #fff;
	border-radius: var(--pi-r-card, 16px);
	padding: 25px;
}
.pi-guide__navhead {
	margin: 0 0 12px;
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--pi-muted, #4e574f);
}
.pi-guide__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}
.pi-guide__nav a {
	display: block;
	/* 44px of touch target even when the label is one line. */
	min-height: 44px;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: .9375rem;
	line-height: 1.4;
	color: var(--pi-ink, #1e1b16);
	text-decoration: none;
	transition: background .2s var(--pi-ease, ease);
}
.pi-guide__nav a:hover,
.pi-guide__nav a:focus-visible { background: var(--pi-cream, #f5f1eb); }
.pi-guide__nav a[aria-current="true"] {
	background: var(--pi-cream, #f5f1eb);
	font-weight: 600;
}

.pi-guide__body { display: grid; gap: 56px; }

.pi-guide__block {
	/* The sticky site header must not sit over a heading that was jumped to. */
	scroll-margin-top: 110px;
}
.pi-guide__title {
	margin: 0 0 .75rem;
	font-family: var(--pi-font-display, inherit);
	font-size: 1.375rem;
	line-height: 1.26;
	color: var(--pi-ink, #1e1b16);
}
.pi-guide__text {
	margin: 0 0 1rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pi-muted, #4e574f);
}
.pi-guide__text:last-child { margin-bottom: 0; }

.pi-guide .pi-blk__scroll { margin: 1.25rem 0; }
.pi-guide .pi-blk__table caption {
	caption-side: top;
	text-align: left;
	padding: 0 0 8px;
	font-size: .8125rem;
	color: var(--pi-muted, #4e574f);
}

.pi-guide__callout {
	margin-top: 1.25rem;
	padding: 20px 24px;
	background: #fff;
	border-left: 3px solid var(--pi-red, #e20e20);
	border-radius: 0 var(--pi-r-card, 16px) var(--pi-r-card, 16px) 0;
}
.pi-guide__calloutText {
	margin: 0 0 .5rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pi-ink, #1e1b16);
}
.pi-guide__calloutSrc {
	margin: 0 0 .75rem;
	font-size: .8125rem;
	color: var(--pi-muted, #4e574f);
}
.pi-guide__callout p:last-child { margin-bottom: 0; }

/* ---- tablet ---------------------------------------------------------- */

@media (max-width: 1024px) {
	/* minmax(0, 1fr) rather than 1fr: a column that sizes itself to its
	   content lets the swipe rail below widen the page instead of scrolling. */
	.pi-blk .pi-cost  { grid-template-columns: minmax(0, 1fr); gap: 40px; }
	.pi-blk .pi-guide { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.pi-guide__nav    { min-width: 0; }

	/* Sticky has nothing to sit beside once the columns stack. */
	.pi-cost__aside,
	.pi-guide__nav { position: static; }

	.pi-guide__nav ul {
		grid-auto-flow: column;
		grid-auto-columns: max-content;
		overflow-x: auto;
		/* The rail is swiped, so the native bar would only add noise. */
		scrollbar-width: none;
	}
	.pi-guide__nav ul::-webkit-scrollbar { display: none; }
	.pi-guide__body { gap: 44px; }
}

/* ---- phone ----------------------------------------------------------- */

@media (max-width: 767px) {
	.pi-cost__tier { padding: 20px; }
	.pi-cost__top { gap: 12px; }
	.pi-cost__headline { font-size: 1.25rem; }
	.pi-cost__list li,
	.pi-guide__text,
	.pi-guide__calloutText { font-size: .9375rem; }

	.pi-cost__price { flex-wrap: wrap; }
	.pi-guide__callout { padding: 16px 18px; }

	/* A table that cannot fit becomes a stack of labelled rows. */
	.pi-guide .pi-blk__scroll { overflow-x: visible; }
	.pi-guide .pi-blk__table,
	.pi-guide .pi-blk__table tbody,
	.pi-guide .pi-blk__table tr { display: block; min-width: 0; }
	.pi-guide .pi-blk__table thead { display: none; }
	/* The caption keeps display:table-caption once the table is no longer a
	   table box, which squeezes it to one word per line. */
	.pi-guide .pi-blk__table caption {
		display: block;
		width: auto;
	}
	.pi-guide .pi-blk__table tr {
		background: #fff;
		border-radius: 12px;
		padding: 14px 16px;
		margin-bottom: 12px;
	}
	.pi-guide .pi-blk__table tbody th,
	.pi-guide .pi-blk__table td {
		display: block;
		padding: 0;
		background: none;
		border: 0;
	}
	.pi-guide .pi-blk__table tbody th {
		font-size: 1rem;
		margin-bottom: 4px;
	}
	.pi-guide .pi-blk__table td {
		font-size: .9375rem;
		color: var(--pi-muted, #4e574f);
	}
}

/* ---- guide with its heading in the side column ----------------------- */

.pi-blk .pi-guide--head { grid-template-columns: 380px minmax(0, 1fr); }

.pi-guide__aside {
	position: sticky;
	top: 96px;
}
.pi-guide__aside .pi-blk__title { margin-bottom: .75rem; }
.pi-guide__aside .pi-blk__lede  { margin-bottom: 1.25rem; }

.pi-guide__aside .pi-guide__photo {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--pi-r-card, 16px);
}

@media (max-width: 1024px) {
	.pi-blk .pi-guide--head { grid-template-columns: 1fr; }
	.pi-guide__aside { position: static; }
	.pi-guide__aside .pi-guide__photo { max-height: 320px; object-fit: cover; }
}

.pi-cost__range {
	font-size: .9375rem;
	font-weight: 600;
	color: var(--pi-ink, #1e1b16);
	margin-right: auto;
}

.pi-guide__list {
	margin: 0 0 1rem;
	padding-left: 1.4em;
	display: grid;
	gap: 8px;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--pi-muted, #4e574f);
}
.pi-guide__list li { padding-left: .2em; }
.pi-guide__list li::marker { color: var(--pi-red, #e20e20); font-weight: 700; }

/* A grid item is min-width:auto by default, so a long list or table inside a
   block widens the column instead of wrapping. Clamp every level. */
.pi-guide__body,
.pi-guide__block,
.pi-guide__list,
.pi-cost__tiers,
.pi-cost__tier { min-width: 0; }
.pi-guide__list li,
.pi-guide__text { overflow-wrap: anywhere; }

/* A long label must wrap rather than push the callout past the screen. */
.pi-guide__callout .pi-btn {
	max-width: 100%;
	white-space: normal;
	text-align: left;
}
