/* ==========================================================================
   ANSWER FIRST
   The page leads with the answer it already contains, and asks afterwards.

   Before this, every page opened with a headline and an eight-field form, and
   the sentence the visitor came for sat below the fold. Every city page's first
   sentence is already a direct answer ("Dumpster rental in Philadelphia
   typically costs between $300 and $600"), so the layout promotes it rather
   than inventing anything new.

   Five typographic families carry the 14 sites, set by data-family on the body,
   so a criminal defence page does not read like a dumpster page. The per-site
   accent hue continues to come from palettes.css.
   ========================================================================== */

body[data-family] {
	--an-paper: hsl(var(--dp-brand-hue), 8%, 92%);
	--an-paper-2: hsl(var(--dp-brand-hue), 10%, 96%);
	--an-ink: hsl(var(--dp-brand-hue), 14%, 11%);
	--an-ink-2: hsl(var(--dp-brand-hue), 8%, 34%);
	--an-ink-3: hsl(var(--dp-brand-hue), 7%, 50%);
	--an-rule: hsl(var(--dp-brand-hue), 10%, 82%);
	--an-accent: var(--dp-cta-500);
	--an-band: var(--dp-ground, hsl(var(--dp-brand-hue), 24%, 14%));

	--an-display: "Barlow Condensed", system-ui, sans-serif;
	--an-text: "Barlow", system-ui, sans-serif;
	--an-label: var(--an-text);

	--an-h1: clamp(2.5rem, 5.6vw, 4rem);
	--an-lead: clamp(1.2rem, 2.3vw, 1.55rem);

	background: var(--an-paper);
	color: var(--an-ink);
	font-family: var(--an-text);
	font-size: 17px;
	line-height: 1.62;
}

/* --- the five voices ----------------------------------------------------- */

body[data-family="trades"] {
	--an-display: "Barlow Condensed", system-ui, sans-serif;
	--an-text: "Barlow", system-ui, sans-serif;
}

body[data-family="legal"] {
	--an-display: "Faustina", Georgia, serif;
	--an-text: "Faustina", Georgia, serif;
	--an-label: "Archivo", system-ui, sans-serif;
	--an-h1: clamp(2.1rem, 4.4vw, 3.3rem);
	font-size: 18px;
	line-height: 1.66;
}

body[data-family="care"] {
	--an-display: "Fraunces", Georgia, serif;
	--an-text: "Karla", system-ui, sans-serif;
	--an-label: "Karla", system-ui, sans-serif;
	--an-h1: clamp(2.2rem, 4.6vw, 3.4rem);
}

body[data-family="money"] {
	--an-display: "Spectral", Georgia, serif;
	--an-text: "Spectral", Georgia, serif;
	--an-label: "IBM Plex Sans", system-ui, sans-serif;
	--an-h1: clamp(2.1rem, 4.3vw, 3.2rem);
	font-size: 18px;
}

body[data-family="pro"] {
	--an-display: "Bitter", Georgia, serif;
	--an-text: "Public Sans", system-ui, sans-serif;
	--an-label: "Public Sans", system-ui, sans-serif;
	--an-h1: clamp(2.2rem, 4.6vw, 3.4rem);
}

/* --- the directory theme's dark opener is replaced wholesale ------------- */

body[data-family] .dp-hero,
body[data-family] .dp-motif,
body[data-family] .dp-sticky,
body[data-family] .dp-steps {
	display: none;
}

body[data-family] .dp-header {
	background: var(--an-band);
	border-bottom: 0;
}

body[data-family] .dp-header__bar { min-height: 58px; }

body[data-family] .dp-brand__name {
	font-family: var(--an-display);
	font-size: 1.35rem;
	letter-spacing: 0.005em;
	color: #fff;
}

body[data-family="legal"] .dp-brand__name,
body[data-family="money"] .dp-brand__name { font-size: 1.2rem; }

body[data-family] .dp-brand__tag,
body[data-family] .dp-nav a,
body[data-family] .dp-header__phone {
	font-family: var(--an-label);
	color: hsla(0, 0%, 100%, 0.72);
}

body[data-family] .dp-nav a:hover { color: #fff; }
body[data-family] .dp-brand__mark { background: hsla(0, 0%, 100%, 0.14); border-radius: 3px; }

body[data-family] .dp-crumbs,
body[data-family] .dp-crumbs a {
	font-family: var(--an-label);
	color: var(--an-ink-3);
}

body[data-family] .dp-crumbs a:hover { color: var(--an-ink); }

/* --- the answer ---------------------------------------------------------- */

.dp-answer {
	max-width: var(--dp-page);
	margin: 0 auto;
	padding: 20px 24px 0;
}

.dp-answer h1 {
	font-family: var(--an-display);
	font-size: var(--an-h1);
	font-weight: 600;
	line-height: 1.04;
	letter-spacing: -0.015em;
	color: var(--an-ink);
	margin: 8px 0 0;
	max-width: 19ch;
	text-wrap: balance;
}

body[data-family="legal"] .dp-answer h1,
body[data-family="money"] .dp-answer h1 { font-weight: 500; max-width: 22ch; }

.dp-answer__lead {
	font-family: var(--an-text);
	font-size: var(--an-lead);
	line-height: 1.46;
	color: var(--an-ink);
	max-width: 44ch;
	margin: 22px 0 0;
	padding-left: 20px;
	border-left: 5px solid var(--an-accent);
}

.dp-answer__note {
	font-family: var(--an-text);
	font-size: 1rem;
	line-height: 1.55;
	color: var(--an-ink-2);
	max-width: 62ch;
	margin: 16px 0 0;
}

.dp-jump {
	max-width: var(--dp-page);
	margin: 32px auto 0;
	padding: 16px 24px 0;
	border-top: 1px solid var(--an-rule);
	display: flex;
	flex-wrap: wrap;
	gap: 10px 26px;
}

.dp-jump a {
	font-family: var(--an-label);
	font-size: 0.98rem;
	font-weight: 500;
	color: var(--an-ink-2);
	text-decoration: none;
	border-bottom: 2px solid var(--an-rule);
}

.dp-jump a:hover { color: var(--an-ink); border-bottom-color: var(--an-accent); }

/* --- reading column and rail -------------------------------------------- */

body[data-family] .dp-main { padding-block: 36px 0; }

body[data-family] .dp-cols { gap: 48px; }

@media (min-width: 1000px) {
	body[data-family] .dp-cols {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
	body[data-family] .dp-cols--single { grid-template-columns: minmax(0, 1fr); }
}

body[data-family] .dp-prose { max-width: 66ch; margin-inline: 0; }

body[data-family] .dp-prose p,
body[data-family] .entry-content p {
	font-family: var(--an-text);
	color: var(--an-ink);
	margin: 0 0 1.1em;
}

body[data-family] .dp-prose h2,
body[data-family] .entry-content h2 {
	font-family: var(--an-display);
	font-size: 1.85rem;
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.01em;
	color: var(--an-ink);
	margin: 2em 0 0.5em;
	padding-top: 0.5em;
	border-top: 1px solid var(--an-rule);
	max-width: 26ch;
}

body[data-family="legal"] .dp-prose h2,
body[data-family="money"] .dp-prose h2,
body[data-family="care"] .dp-prose h2,
body[data-family="pro"] .dp-prose h2 { font-weight: 500; }

body[data-family] .dp-prose h3,
body[data-family] .entry-content h3 {
	font-family: var(--an-label);
	font-size: 1.12rem;
	font-weight: 600;
	color: var(--an-ink-2);
	margin: 1.7em 0 0.4em;
}

body[data-family] .dp-prose section[data-section="intro"] > p:first-child,
body[data-family] .entry-content section[data-section="intro"] > p:first-child {
	font-size: inherit;
	border-left: 0;
	padding-left: 0;
	color: var(--an-ink);
}

/* --- the ask ------------------------------------------------------------- */

body[data-family] .dp-quote,
body[data-family] .dp-form-wrap {
	background: var(--an-band);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 22px;
	color: #fff;
}

body[data-family] .dp-quote h2,
body[data-family] .dp-form-wrap h2 {
	font-family: var(--an-display) !important;
	font-size: 1.5rem !important;
	font-weight: 600;
	color: #fff;
	border-top: 0;
	padding-top: 0;
	margin: 0 0 6px !important;
	max-width: none;
}

body[data-family] .dp-quote p,
body[data-family] .dp-form-wrap p {
	font-family: var(--an-label);
	font-size: 0.9rem;
	color: hsla(0, 0%, 100%, 0.72);
}

body[data-family] .dp-quote__proof { display: none; }

body[data-family] .dp-quote label,
body[data-family] .dp-form-wrap label,
body[data-family] .dp-form-wrap .ff-el-input--label label {
	font-family: var(--an-label);
	font-size: 0.8rem !important;
	letter-spacing: 0.01em;
	text-transform: none;
	color: hsla(0, 0%, 100%, 0.68);
}

body[data-family] .dp-quote input,
body[data-family] .dp-quote select,
body[data-family] .dp-form-wrap .ff-el-form-control {
	border-radius: 0;
	border-color: hsla(0, 0%, 100%, 0.24);
	box-shadow: none;
}

body[data-family] .dp-quote button[type="submit"],
body[data-family] .dp-form-wrap .ff-btn.ff-btn-submit,
body[data-family] .dp-form-wrap button.ff-btn-submit {
	font-family: var(--an-display) !important;
	font-size: 1.2rem !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background-color: var(--an-accent) !important;
}

body[data-family] .dp-quote__fine {
	font-family: var(--an-label);
	color: hsla(0, 0%, 100%, 0.55) !important;
	text-align: left;
}

/* --- lists of places and guides ----------------------------------------- */

body[data-family] .dp-silo-index a,
body[data-family] .dp-related a {
	font-family: var(--an-label);
	border-radius: 0;
	background: var(--an-paper-2);
	border-color: var(--an-rule);
	border-left: 3px solid var(--an-accent);
	color: var(--an-ink);
}

body[data-family] .dp-silo-index h2,
body[data-family] .dp-related h2 {
	font-family: var(--an-display) !important;
	font-weight: 600;
	color: var(--an-ink) !important;
}

body[data-family] .dp-related {
	background: transparent;
	border: 0;
	border-top: 1px solid var(--an-rule);
	border-radius: 0;
	padding: 22px 0 0;
}

body[data-family] .dp-related a {
	background: transparent;
	border: 0;
	padding-left: 16px;
}

body[data-family] .dp-related a::before { background: var(--an-accent); }

/* --- closing ask and footer --------------------------------------------- */

body[data-family] .dp-cta-band,
body[data-family] .dp-prose section[data-section="cta"],
body[data-family] .entry-content section[data-section="cta"] {
	background: var(--an-band);
	border-radius: 0;
}

body[data-family] .dp-footer {
	background: transparent;
	color: var(--an-ink-2);
	border-top: 1px solid var(--an-rule);
	margin-top: 72px;
}

body[data-family] .dp-footer h2,
body[data-family] .dp-footer a,
body[data-family] .dp-footer p {
	font-family: var(--an-label);
	color: var(--an-ink-2);
}

body[data-family] .dp-footer a:hover { color: var(--an-ink); }
body[data-family] .dp-footer__legal { border-top-color: var(--an-rule); }

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

@media (max-width: 760px) {
	.dp-answer h1 { font-size: 2.1rem; }
	.dp-answer__lead { font-size: 1.12rem; padding-left: 14px; }
	body[data-family] .dp-prose h2 { font-size: 1.5rem; }
	body[data-family] { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* The post date sits under the answer rather than above the title. */
body[data-family] .dp-post-meta {
	font-family: var(--an-label);
	font-size: 0.85rem;
	color: var(--an-ink-3);
	margin: 14px auto 0;
	max-width: var(--dp-page);
	padding: 0 24px;
	text-transform: none;
	letter-spacing: 0;
}

body[data-family] .dp-post-title { display: none; }

/* The jump links replace the in-content table of contents, so only one of them
   appears on a page. */
body[data-family] nav[data-section="toc"],
body[data-family] .dp-toc {
	display: none;
}

/* ==========================================================================
   THE OPENER AND THE SIGNATURE
   Eight sites carry their palette as a real dark band above the answer; seven
   sit on tinted paper with the motif beside the text. Every site then gets one
   module no other site has.
   ========================================================================== */

.dp-opener {
	position: relative;
	background:
		radial-gradient(110% 170% at 8% 110%, var(--dp-ground-2) 0%, transparent 62%),
		var(--an-band);
	overflow: hidden;
	padding: 34px 0 38px;
}

.dp-opener__inner {
	position: relative;
	z-index: 1;
	max-width: var(--dp-page);
	margin: 0 auto;
	padding: 0 24px;
}

.dp-opener__inner h1 {
	font-family: var(--an-display);
	font-size: var(--an-h1);
	font-weight: 600;
	line-height: 1.04;
	letter-spacing: -0.015em;
	color: #fff;
	margin: 0;
	max-width: 19ch;
	text-wrap: balance;
}

body[data-family="legal"] .dp-opener__inner h1,
body[data-family="money"] .dp-opener__inner h1 { font-weight: 500; max-width: 22ch; }

.dp-opener .dp-motif {
	display: block;
	position: absolute;
	right: max(24px, calc((100% - var(--dp-page)) / 2 + 24px));
	top: 50%;
	transform: translateY(-50%);
	width: 190px;
	height: 190px;
	color: #fff;
	opacity: 0.34;
	margin: 0;
}

.dp-answer--dark { padding-top: 26px; }
.dp-answer--dark h1 { display: none; }

/* On a light site the drawing sits beside the answer rather than behind it. */
body[data-family] .dp-answer > .dp-motif {
	display: none;
}

@media (min-width: 1080px) {
	body[data-family] .dp-answer {
		position: relative;
	}

	body[data-family] .dp-answer > .dp-motif {
		display: block;
		position: absolute;
		right: 24px;
		top: 6px;
		width: 200px;
		height: 200px;
		color: var(--an-accent);
		opacity: 0.22;
		margin: 0;
	}
}

.dp-signature {
	max-width: var(--dp-page);
	margin: 40px auto 0;
	padding: 26px 24px;
	background: var(--an-paper-2);
	border-top: 3px solid var(--an-accent);
}

.dp-signature h2 {
	font-family: var(--an-display);
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.15;
	color: var(--an-ink);
	margin: 0;
	max-width: 28ch;
}

.dp-signature__lead {
	font-family: var(--an-text);
	font-size: 1rem;
	color: var(--an-ink-2);
	margin: 8px 0 20px;
	max-width: 62ch;
}

.dp-signature__rows {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1px;
	background: var(--an-rule);
	border: 1px solid var(--an-rule);
	counter-reset: dp-sig;
}

.dp-signature__rows li {
	display: grid;
	gap: 2px 18px;
	align-items: baseline;
	background: var(--an-paper-2);
	padding: 13px 16px;
	margin: 0;
	counter-increment: dp-sig;
}

@media (min-width: 720px) {
	.dp-signature__rows li {
		grid-template-columns: 12.5rem minmax(0, 1fr) auto;
	}
}

.dp-signature__term {
	font-family: var(--an-label);
	font-weight: 600;
	color: var(--an-ink);
}

.dp-signature__detail {
	font-family: var(--an-text);
	color: var(--an-ink-2);
	font-size: 0.98rem;
}

.dp-signature__figure {
	font-family: var(--an-label);
	font-size: 0.85rem;
	color: var(--an-ink-3);
	white-space: nowrap;
}

/* Steps are a sequence, so they are numbered. The others are not. */
.dp-signature--steps .dp-signature__term::before {
	content: counter(dp-sig);
	display: inline-block;
	width: 1.5em;
	color: var(--an-accent);
	font-variant-numeric: tabular-nums;
}

.dp-signature--checks .dp-signature__term::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 10px;
	border: 2px solid var(--an-accent);
}

@media (max-width: 760px) {
	.dp-opener { height: 96px; }
	.dp-opener .dp-motif { width: 150px; height: 150px; top: -14px; }
	.dp-answer--dark { margin-top: -46px; }
	.dp-signature h2 { font-size: 1.35rem; }
}

/* --- links inside body copy ---------------------------------------------- */
/* Without this, page content falls through to the parent theme's blue, and a
   locations table renders as a wall of default blue and visited purple. */

body[data-family] .dp-prose a,
body[data-family] .entry-content a,
body[data-family] .dp-main table a {
	color: var(--an-ink);
	text-decoration: none;
	border-bottom: 1px solid var(--an-accent);
	padding-bottom: 1px;
}

body[data-family] .dp-prose a:hover,
body[data-family] .entry-content a:hover,
body[data-family] .dp-main table a:hover {
	color: var(--an-accent);
	border-bottom-color: currentColor;
}

body[data-family] .dp-prose a:visited,
body[data-family] .entry-content a:visited,
body[data-family] .dp-main table a:visited { color: var(--an-ink-2); }

/* --- tables in page content ---------------------------------------------- */

body[data-family] .dp-main table {
	width: 100%;
	border-collapse: collapse;
	background: var(--an-paper-2);
	border: 1px solid var(--an-rule);
	font-size: 0.95rem;
}

body[data-family] .dp-main table th {
	font-family: var(--an-text);
	font-weight: 600;
	font-size: 0.9rem;
	letter-spacing: 0;
	text-transform: none;
	color: var(--an-ink-2);
	text-align: left;
	border-bottom: 2px solid var(--an-rule);
}

body[data-family] .dp-main table th,
body[data-family] .dp-main table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--an-rule);
	vertical-align: top;
}

body[data-family] .dp-main table tr:last-child td { border-bottom: 0; }
