/**
 * AskHole standing content + legal pages (.ah-doc namespace).
 *
 * Loaded only on pages holding a content-page shortcode (see content-pages.php).
 * Reuses the brand CSS variables defined site-wide in askhole-feed.css.
 */

/* Astra puts a 60px top/bottom margin on #primary at >=1200px; drop it on content pages so the hero band
   sits flush at the top and there's no dead space at the bottom. !important beats Astra's higher-specificity
   .ast-plain-container.ast-no-sidebar #primary rule. */
body.ah-doc-page #primary {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.ah-doc {
	max-width: 1140px; /* match Browse requests (.ah-browse) so the page frame lines up */
	margin: 0 auto;
	padding: 8px 20px 0; /* no bottom padding — content sits flush; footer supplies its own top spacing */
	color: var(--ah-ink);
	font-family: 'Inter', system-ui, sans-serif;
	line-height: 1.65;
}
/* On wide screens the frame spans the full 1140 edge-to-edge, exactly like Browse. */
@media (min-width: 1181px) { .ah-doc { padding-left: 0; padding-right: 0; } }
/* Text content sits within a 9-of-12-column reading measure (855px of the 1140 frame), left-aligned, so
   lines don't run the full width. How it works (.ah-doc.ah-howto) keeps its full-width cards — only its
   hero is excluded from the cap here; the body cap never applies to it since it has no .ah-doc-body. */
.ah-doc-body { max-width: 855px; }
.ah-doc:not(.ah-howto) .ah-doc-hero { max-width: 855px; }

/* Hero */
.ah-doc-hero {
	padding: 0 0 8px;
	border-bottom: 1px solid var(--ah-line);
	margin-bottom: 28px;
}
.ah-doc-eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ah-purple);
	margin-bottom: 10px;
}
.ah-doc-title {
	/* Match the site's page-hero H1 token (.ah-db-h1 / detail-page title ~32px) rather than an
	   oversized 44px. */
	font-size: clamp(28px, 4vw, 34px);
	font-weight: 800;
	line-height: 1.1;
	/* #14 — match the Browse H1's tightening ratio (-.02em) so every branded page title reads as one
	   family; the previous -.01em left the 34px content/detail titles looking loose next to Browse. */
	letter-spacing: -.02em;
	margin: 0 0 14px;
	color: var(--ah-ink);
}
.ah-doc-sub {
	font-size: clamp(17px, 2.4vw, 20px);
	line-height: 1.55;
	color: #3f4550;
	margin: 0 0 6px;
	max-width: 68ch;
}
.ah-doc-sub a { color: var(--ah-purple); font-weight: 600; }

/* Body rhythm */
.ah-doc-body > * { margin-top: 0; }
/* No leading top / trailing bottom margin on the primary content block — it sits flush under the hero and
   against the page's bottom padding. */
.ah-doc-body > *:first-child { margin-top: 0 !important; }
.ah-doc-body > *:last-child { margin-bottom: 0 !important; }
.ah-doc-h {
	/* Match the site's section-heading token (.ah-home-title): 26px / 500 / -.5px. */
	font-size: 26px;
	font-weight: 500;
	letter-spacing: -.5px;
	line-height: 1.25;
	margin: 40px 0 12px;
	color: var(--ah-ink);
}
.ah-doc-h + .ah-doc-h { margin-top: 22px; } /* a sub-heading right under a heading */
/* Sub-heading (H3) — a step below .ah-doc-h, used inside a For posters / For pros section. */
.ah-doc-h3 {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -.3px;
	line-height: 1.3;
	margin: 28px 0 10px;
	color: var(--ah-ink);
}
.ah-doc-h + .ah-doc-h3 { margin-top: 16px; } /* an H3 straight under its section H2 */
.ah-doc-p, .ah-doc-lead {
	font-size: 16.5px;
	margin: 0 0 16px;
	color: #2b2f38;
}
.ah-doc-lead { font-size: 18px; color: #3f4550; }
.ah-doc a { color: var(--ah-purple); font-weight: 600; text-decoration: none; }
.ah-doc a:hover { text-decoration: underline; }

/* Lists */
.ah-doc-list {
	margin: 0 0 18px;
	padding-left: 1.25em;
}
/* Indent body-level lists so they read as nested under the prose. Scoped to direct children of the body (not
   the do/avoid columns) and high enough specificity to beat Astra's .entry-content ul/ol margins. */
.ah-doc-body > ul.ah-doc-list,
.ah-doc-body > ol.ah-doc-list { margin-left: 1.75em; }
.ah-doc-list li {
	margin: 0 0 9px;
	font-size: 16.5px;
	color: #2b2f38;
}
ol.ah-doc-list li { padding-left: 4px; }

/* Numbered step cards */
.ah-doc-steps {
	list-style: none;
	counter-reset: ah-step;
	margin: 4px 0 24px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr); /* two-up on desktop to use the wider frame */
	gap: 14px;
}
.ah-doc-step {
	counter-increment: ah-step;
	position: relative;
	background: #fff;
	border: 1px solid var(--ah-line);
	border-radius: 14px;
	padding: 18px 20px 18px 66px;
}
.ah-doc-step::before {
	content: counter(ah-step);
	position: absolute;
	left: 18px;
	top: 18px;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--ah-purple);
	color: #fff;
	font-weight: 800;
	font-size: 16px;
	border-radius: 10px;
}
.ah-doc-step-t { font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--ah-ink); }
.ah-doc-step-d { font-size: 15.5px; margin: 0; color: #3f4550; }

/* Two-column mini lists (do / avoid, poster / pro) */
.ah-doc-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 6px 0 24px;
}
.ah-doc-col {
	background: #faf9ff;
	border: 1px solid var(--ah-tint-border);
	border-radius: 14px;
	padding: 18px 20px;
}
.ah-doc-col-t { font-size: 16px; font-weight: 800; margin: 0 0 10px; color: var(--ah-tint-ink); }
.ah-doc-col .ah-doc-list { margin: 0; }
.ah-doc-col .ah-doc-list li { font-size: 15.5px; }

/* Callout note */
.ah-doc-note {
	background: var(--ah-tint);
	border: 1px solid var(--ah-tint-border);
	border-radius: 14px;
	padding: 16px 20px;
	margin: 8px 0 24px;
}
.ah-doc-note p { margin: 0; font-size: 15.5px; color: var(--ah-tint-ink); font-weight: 500; }
.ah-doc-note a { color: var(--ah-purple); text-decoration: underline; }

/* FAQ / details */
.ah-doc-faq { margin: 4px 0 24px; display: grid; gap: 10px; }
.ah-doc-qa {
	border: 1px solid var(--ah-line);
	border-radius: 14px;
	background: #fff;
	overflow: hidden;
}
.ah-doc-q {
	cursor: pointer;
	list-style: none;
	padding: 15px 46px 15px 18px;
	font-weight: 700;
	font-size: 16px;
	color: var(--ah-ink);
	position: relative;
}
.ah-doc-q::-webkit-details-marker { display: none; }
.ah-doc-q::after {
	content: "";
	position: absolute;
	right: 20px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid #9aa0ab;
	border-bottom: 2px solid #9aa0ab;
	transform: translateY(-65%) rotate(45deg);
	transition: transform .18s ease;
}
.ah-doc-qa[open] .ah-doc-q::after { transform: translateY(-35%) rotate(225deg); }
.ah-doc-qa[open] .ah-doc-q { color: var(--ah-purple); }
.ah-doc-a { padding: 0 18px 16px; }
.ah-doc-a p { margin: 0; font-size: 15.5px; color: #3f4550; }

/* CTA — secondary / outline button (matches the site-wide .ah-btn-outline). Content pages use the secondary
   style, never a filled primary button. */
.ah-doc-cta-row { margin: 8px 0 28px; }
.ah-doc-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--ah-h-cta);
	padding: 0 26px;
	background: #fff;
	color: var(--ah-ink) !important;
	font-weight: 700;
	font-size: 16px;
	border: 1.5px solid #e0e2e8;
	border-radius: var(--ah-r-btn);
	text-decoration: none !important;
	transition: border-color .14s ease;
}
.ah-doc-cta:hover { border-color: #c7cbd4; }

/* Plain text-link CTA (third level) — matches How it works' arrow links: purple text, no underline until
   rollover, trailing arrow. */
.ah-doc-link-row { margin: 8px 0 28px; }
.ah-doc-link {
	display: inline-block;
	font-size: 15px;
	font-weight: 700;
	color: var(--ah-purple, #783FF2);
	text-decoration: none;
}
.ah-doc-link:hover { text-decoration: underline; }
.ah-doc-link-arrow { font-weight: 700; }

/* Below the desktop frame, step cards and columns stack to one column. */
@media (max-width: 860px) {
	.ah-doc-steps { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
	.ah-doc { padding: 4px 16px 0; }
	.ah-doc-hero { padding-top: 20px; } /* desktop drops the hero top padding; keep a little on mobile */
	.ah-doc-cols { grid-template-columns: 1fr; }
	.ah-doc-step { padding: 16px 16px 16px 60px; }
	.ah-doc-step::before { left: 14px; top: 16px; }
	/* Full-width CTAs on mobile. */
	.ah-doc-cta { display: flex; width: 100%; box-sizing: border-box; }
}

/* ============================================================
 * How it works — bespoke icon-led layout (.ah-howto)
 * ============================================================ */
.ah-howto .ah-doc-hero { margin-bottom: 6px; }
/* No bottom padding on How it works (the info cards end the page). Higher specificity than .ah-doc so it
   wins on desktop and mobile. */
.ah-doc.ah-howto { padding-bottom: 0; }

/* A journey block: icon-led lead, numbered step cards, a CTA. */
.ah-howto-journey { border-top: 1px solid var(--ah-line); margin-top: 22px; padding-top: 30px; }
.ah-howto-journey:first-of-type { border-top: 0; margin-top: 10px; padding-top: 18px; }

.ah-howto-lead { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 26px; }
.ah-howto-lead-ic {
	flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
	background: var(--ah-purple, #783FF2); color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
}
.ah-howto-lead-ic .ah-ic { width: 24px; height: 24px; }
.ah-howto-lead-t { font-size: 22px; font-weight: 700; letter-spacing: -.2px; margin: 3px 0 4px; color: var(--ah-ink); }
.ah-howto-lead-d { font-size: 16px; line-height: 1.55; color: #3f4550; margin: 0; max-width: 620px; }

/* Step cards: 4-up on desktop with dashed connectors between the number badges. */
.ah-howto-steps {
	list-style: none; margin: 0 0 22px; padding: 8px 0 0;
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.ah-howto-step { position: relative; padding-top: 44px; }
.ah-howto-step-num {
	position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
	width: 30px; height: 30px; border-radius: 50%; box-sizing: border-box;
	background: #f2f2f5; color: #2b2f38; border: 1px solid #d7d9e0;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 14px; font-weight: 800;
}
.ah-howto-step::before {
	/* Connector runs between the centred badges: from this column's centre to the next column's centre. */
	content: ""; position: absolute; top: 15px; left: 50%; right: calc(-50% - 16px);
	border-top: 2px dashed #dcdce4; z-index: 0;
}
.ah-howto-step:last-child::before { display: none; }
.ah-howto-step-card {
	background: #fff; border: 1px solid var(--ah-line); border-radius: 16px;
	padding: 22px 20px; text-align: center; height: 100%;
}
.ah-howto-step-ic {
	flex: 0 0 auto; /* keep the circle round when the card becomes a flex row on mobile */
	display: inline-flex; align-items: center; justify-content: center;
	width: 56px; height: 56px; border-radius: 50%;
	background: var(--ah-tint, #f4f2fd); color: var(--ah-purple, #783FF2);
	margin: 0 auto 14px;
}
.ah-howto-step-ic .ah-ic { width: 27px; height: 27px; }
.ah-howto-step-t { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: var(--ah-ink); }
.ah-howto-step-d { font-size: 14.5px; line-height: 1.5; color: #3f4550; margin: 0; }

.ah-howto-cta-row { margin: 2px 0 6px; max-width: none; }

/* Info cards: three across, each a horizontal icon + text, joined by dividers. */
.ah-howto-info {
	display: grid; grid-template-columns: repeat(3, 1fr);
	border: 1px solid var(--ah-line); border-radius: 16px;
	background: #faf9fd; margin-top: 36px; overflow: hidden;
}
.ah-howto-info-card { display: flex; gap: 14px; align-items: flex-start; padding: 22px; }
.ah-howto-info-card + .ah-howto-info-card { border-left: 1px solid var(--ah-line); }
.ah-howto-info-ic {
	flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
	background: var(--ah-tint, #f4f2fd); color: var(--ah-purple, #783FF2);
	display: inline-flex; align-items: center; justify-content: center;
}
.ah-howto-info-ic .ah-ic { width: 23px; height: 23px; }
.ah-howto-info-t { font-size: 16px; font-weight: 700; margin: 2px 0 6px; color: var(--ah-ink); }
.ah-howto-info-d { font-size: 14.5px; line-height: 1.5; color: #3f4550; margin: 0 0 8px; }
.ah-howto-info-d:last-child { margin-bottom: 0; }
.ah-howto-info-d a { color: var(--ah-purple, #783FF2); font-weight: 600; }
.ah-howto-info-link { display: inline-block; font-size: 14.5px; font-weight: 700; color: var(--ah-purple, #783FF2); text-decoration: none; }
.ah-howto-info-link:hover { text-decoration: underline; }

/* Tablet: steps go two-up (drop the horizontal connectors, which don't survive wrapping); info stacks. */
@media (max-width: 900px) {
	.ah-howto-steps { grid-template-columns: repeat(2, 1fr); }
	.ah-howto-step::before { display: none; }
	.ah-howto-info { grid-template-columns: 1fr; }
	.ah-howto-info-card + .ah-howto-info-card { border-left: 0; border-top: 1px solid var(--ah-line); }
}

/* Mobile: single column. Number moves to the left with a vertical dashed connector; card goes horizontal. */
@media (max-width: 620px) {
	.ah-howto-steps { grid-template-columns: 1fr; gap: 14px; }
	.ah-howto-step { padding-top: 0; padding-left: 42px; }
	.ah-howto-step-num { top: 8px; left: 0; transform: none; }
	.ah-howto-step::before {
		display: block; top: 34px; bottom: -14px; left: 14px; right: auto;
		border-top: 0; border-left: 2px dashed var(--ah-tint-border, #e6ddfd);
	}
	.ah-howto-step:last-child::before { display: none; }
	.ah-howto-step-card { display: flex; gap: 14px; text-align: left; padding: 16px; }
	.ah-howto-step-ic { margin: 0; width: 46px; height: 46px; }
	.ah-howto-step-ic .ah-ic { width: 23px; height: 23px; }
	.ah-howto-lead-t { font-size: 20px; }
}

/* Hide the theme's own page-title header on our content pages. Each content shortcode renders its own hero
   title (.ah-doc-title), so the theme's .entry-title is a duplicate and sits at a wider width than the
   content — which reads as a broken page width. Scoped to the .ah-doc-page body class we add on these
   pages, and this stylesheet only loads on those pages. */
body.ah-doc-page .entry-header,
body.ah-doc-page .entry-title,
body.ah-doc-page .ast-single-entry-title { display: none !important; }
