/**
 * Town pages — Phase 4
 * .tp namespace, .vp parent. Loaded only on /help/{slug}/ routes.
 *
 * Depends on:
 *   - css/vp-system.css (tokens, .vp-btn, .vp-kicker, .vp-lead, .vp-muted, .vp-small)
 *   - css/helper-card.css (licence_blue_tick--compact for inline DL badges)
 *
 * Tokens used: forest #1c3a2a, primary #2f7d4d, kicker #3b7f59, mint #95d5b2,
 *              border #dfe8e1 / #e5eae6, body text #2f2f2f, muted #5f6b63.
 */

/* ─── Page shell — central container, breathing room ─── */
.vp.tp {
	max-width: 1060px !important;
	margin: 0 auto !important;
	padding: 32px 24px 48px !important;
	box-sizing: border-box;
	color: #2f2f2f;
}
@media (max-width: 600px) {
	.vp.tp {
		padding: 16px 14px 32px !important;
	}
}

/* Defensive — wpautop ghosts on Classic Editor pages, harmless here but cheap to bust. */
.vp.tp > p:empty,
.vp.tp > br {
	display: none !important;
}

/* ─── Hero ─── */
.vp.tp .tp-hero {
	text-align: center;
	max-width: 720px;
	margin: 0 auto 32px;
}
.vp.tp .tp-h1 {
	font-size: clamp(28px, 4vw, 44px);
	line-height: 1.15;
	margin: 8px 0 12px;
	color: #1c3a2a;
}
.vp.tp .tp-h1 em {
	color: #2f7d4d;
	font-style: normal;
}
.vp.tp .vp-kicker {
	color: #3b7f59;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-size: 0.85em;
	margin: 0;
}
.vp.tp .vp-lead {
	color: #48534c;
	font-size: 1.05em;
	line-height: 1.55;
	margin: 0 auto;
	max-width: 640px;
}

/* ─── Steward attribution (Phase 4b) ─── */
.vp.tp .tp-steward {
	background: #eef6f0;
	border: 1px solid #dce9df;
	border-left: 4px solid #2f7d4d;
	border-radius: 10px;
	padding: 18px 22px;
	margin: 0 auto 32px;
	max-width: 640px;
	box-sizing: border-box;
	text-align: center;
}
.vp.tp .tp-steward .vp-kicker {
	margin-bottom: 4px;
}
.vp.tp .tp-steward-name {
	font-size: 1.4em;
	color: #1c3a2a;
	margin: 0 0 6px;
}
.vp.tp .tp-steward-blurb {
	color: #48534c;
	margin: 0 0 14px;
	font-size: 0.95em;
}

/* ─── Stats row (3 columns desktop, stacked mobile) ─── */
.vp.tp .tp-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 0 0 40px;
}
/* .vp-card carries background/border/border-radius/box-shadow/transition + hover.
   Only layout-specific tweaks live here. */
.vp.tp .tp-stat {
	padding: 22px 18px !important;
	text-align: center;
}
.vp.tp .tp-stat-value {
	display: block;
	font-size: 2.2em;
	color: #1c3a2a;
	line-height: 1.1;
	font-weight: 700;
}
.vp.tp .tp-stat-label {
	display: block;
	color: #5f6b63;
	font-size: 0.9em;
	margin-top: 4px;
	line-height: 1.3;
}
@media (max-width: 720px) {
	.vp.tp .tp-stats {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	.vp.tp .tp-stat {
		padding: 16px 14px !important;
	}
	.vp.tp .tp-stat-value {
		font-size: 1.8em;
	}
}

/* ─── Section title (shared) ─── */
.vp.tp .tp-section-title {
	font-size: 1.5em;
	color: #1c3a2a;
	margin: 0 0 16px;
	text-align: center;
}

/* ─── Map section (Phase 4.6) ─── */
.vp.tp .tp-map-section {
	margin: 0 0 40px;
}
.vp.tp .tp-map {
	height: 360px;
	border-radius: 10px;
	border: 1px solid #dfe8e1;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
	margin: 0 0 12px;
}
.vp.tp .tp-map-disclaimer {
	text-align: center;
	color: #5f6b63;
	font-size: 0.9em;
	line-height: 1.5;
	margin: 0;
}
@media (max-width: 600px) {
	.vp.tp .tp-map {
		height: 260px;
	}
}

/* ─── Volunteer grid ─── */
.vp.tp .tp-volunteers {
	margin: 0 0 40px;
}
.vp.tp .tp-volunteer-grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
}
.vp.tp .tp-v-card {
	margin: 0;
}
/* .vp-card carries the card chrome; .tp-v-link adds layout + anchor reset. */
.vp.tp .tp-v-link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px !important;
	text-decoration: none;
	color: #1c3a2a;
}
.vp.tp .tp-v-link:hover,
.vp.tp .tp-v-link:focus-visible {
	border-color: #95d5b2 !important;
}
.vp.tp .tp-v-name {
	font-weight: 600;
	font-size: 1.05em;
	line-height: 1.3;
	display: inline-flex;
	align-items: center;
}
.vp.tp .tp-v-name .licence_blue_tick {
	margin-left: 4px;
}
.vp.tp .tp-v-town {
	color: #5f6b63;
	font-size: 0.85em;
}
.vp.tp .tp-volunteers-more {
	text-align: center;
	color: #5f6b63;
	margin: 16px 0 0;
	font-size: 0.95em;
}

/* ─── CTA row (2 columns desktop, stacked mobile) ─── */
.vp.tp .tp-ctas {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 0 0 40px;
}
/* .vp-card carries the card chrome; .tp-cta adds layout-specific tweaks. */
.vp.tp .tp-cta {
	padding: 24px 22px !important;
	text-align: center;
}
.vp.tp .tp-cta h3 {
	color: #1c3a2a;
	margin: 0 0 8px;
	font-size: 1.2em;
}
.vp.tp .tp-cta p {
	color: #48534c;
	margin: 0 0 16px;
	font-size: 0.95em;
	line-height: 1.5;
}
@media (max-width: 720px) {
	.vp.tp .tp-ctas {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	.vp.tp .tp-cta {
		padding: 20px 18px !important;
	}
}

/* ─── Footer ─── */
.vp.tp .tp-footer {
	border-top: 1px solid #e5eae6;
	padding-top: 24px;
	text-align: center;
}
.vp.tp .tp-footer .vp-muted {
	color: #5f6b63;
	margin: 0 0 6px;
	font-size: 0.95em;
	line-height: 1.55;
}
.vp.tp .tp-footer .vp-small {
	font-size: 0.85em;
}

/* ─── Buttons (defensive — vp-system.css carries the base; this is a fallback) ─── */
.vp.tp .vp-btn {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	border: 1px solid transparent;
}
.vp.tp .vp-btn--primary {
	background: #2f7d4d;
	color: #fff;
}
.vp.tp .vp-btn--primary:hover,
.vp.tp .vp-btn--primary:focus-visible {
	background: #276741;
}
.vp.tp .vp-btn--secondary {
	background: #fff;
	color: #2f7d4d;
	border-color: #2f7d4d;
}
.vp.tp .vp-btn--secondary:hover,
.vp.tp .vp-btn--secondary:focus-visible {
	background: #eef6f0;
}

/* ─── 320px sanity ─── */
@media (max-width: 360px) {
	.vp.tp .tp-h1 {
		font-size: 24px;
	}
	.vp.tp .tp-volunteer-grid {
		grid-template-columns: 1fr;
	}
}

/* ════════════════════════════════════════════════════════════════════════
   Phase 4b — Neighbor Care Captain (recruitment CTA + apply page)
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Recruitment CTA on the town page (renders when no approved captain) ─── */
.vp.tp .tp-captain-cta {
	max-width: 720px;
	margin: 40px auto 0;
}
.vp.tp .tp-captain-cta .vp-card {
	text-align: center;
	padding: 24px 28px;
	border-left: 4px solid #2f7d4d;
}
.vp.tp .tp-captain-cta h3 {
	color: #1c3a2a;
	margin: 6px 0 10px;
	font-size: 1.25em;
}
.vp.tp .tp-captain-cta p {
	color: #48534c;
	margin: 0 0 16px;
}

/* ─── Apply page (/help/{slug}/become-captain/) ─── */
.vp.ts-apply .ts-apply-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 0 0 16px;
}
@media (max-width: 900px) {
	.vp.ts-apply .ts-apply-grid {
		grid-template-columns: 1fr;
	}
}
.vp.ts-apply .ts-apply-grid h3 {
	color: #1c3a2a;
	margin: 0 0 8px;
	font-size: 1.05em;
}
.vp.ts-apply .ts-apply-grid p {
	color: #48534c;
	margin: 0;
	font-size: 0.95em;
	line-height: 1.55;
}
.vp.ts-apply .ts-apply-honest {
	max-width: 720px;
	margin: 0 auto 8px;
	text-align: center;
	font-size: 0.9em;
}
.vp.ts-apply .ts-apply-ladder {
	max-width: 640px;
	margin: 32px auto;
}
.vp.ts-apply .ts-ladder {
	margin: 12px 0 0;
	padding-left: 22px;
	color: #2f2f2f;
	line-height: 1.9;
}
.vp.ts-apply .ts-apply-form-wrap {
	max-width: 640px;
	margin: 32px auto 0;
}
.vp.ts-apply .ts-apply-form {
	padding: 24px 28px;
	text-align: left;
}
.vp.ts-apply .ts-field {
	margin: 0 0 16px;
}
.vp.ts-apply .ts-field label {
	display: block;
	font-weight: 600;
	color: #1c3a2a;
	margin: 0 0 6px;
	font-size: 0.95em;
}
.vp.ts-apply .ts-field input[type="text"],
.vp.ts-apply .ts-field input[type="email"],
.vp.ts-apply .ts-field input[type="tel"],
.vp.ts-apply .ts-field textarea {
	width: 100%;
	box-sizing: border-box;
	background: #f7faf8;
	border: 1px solid #d8e7dc;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 15px;
	font-family: inherit;
	color: #2f2f2f;
}
.vp.ts-apply .ts-field input:focus,
.vp.ts-apply .ts-field textarea:focus {
	outline: none;
	border-color: #2f7d4d;
}
.vp.ts-apply .ts-field--ack label {
	font-weight: 400;
	color: #48534c;
	line-height: 1.55;
}
.vp.ts-apply .ts-field--ack input {
	margin-right: 8px;
}
.vp.ts-apply .ts-field--submit {
	margin-bottom: 12px;
}
.vp.ts-apply .ts-req {
	color: #2f7d4d;
}
.vp.ts-apply .ts-opt {
	color: #5f6b63;
	font-weight: 400;
	font-size: 0.85em;
}
/* Honeypot — visually removed, still in the DOM for bots. */
.vp.ts-apply .ts-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.vp.ts-apply .ts-apply-success,
.vp.ts-apply .ts-apply-error,
.vp.ts-apply .ts-apply-note {
	max-width: 640px;
	margin: 0 auto 24px;
	padding: 20px 24px;
	text-align: center;
}
.vp.ts-apply .ts-apply-error {
	border-left: 4px solid #b56b00;
	background: #fffaf0;
}
.vp.ts-apply .ts-apply-success {
	border-left: 4px solid #2f7d4d;
	background: #eef6f0;
}

/* ════════════════════════════════════════════════════════════════════════
   Phase 4b — /become-a-captain/ sitewide recruitment landing
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Find-your-town finder ─── */
.vp.ts-landing .ts-finder {
	max-width: 720px;
	margin: 0 auto 40px;
}
.vp.ts-landing .ts-finder-form {
	padding: 24px 28px;
	text-align: center;
}
.vp.ts-landing .ts-finder-form h2 {
	margin: 0 0 6px;
	color: #1c3a2a;
}
.vp.ts-landing .ts-finder-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
	align-items: stretch;
}
.vp.ts-landing .ts-finder-row input[type="text"] {
	flex: 2 1 220px;
	min-width: 0;
	background: #f7faf8;
	border: 1px solid #d8e7dc;
	border-radius: 6px;
	padding: 11px 13px;
	font-size: 15px;
	font-family: inherit;
	color: #2f2f2f;
}
.vp.ts-landing .ts-finder-row select {
	flex: 1 1 130px;
	background: #f7faf8;
	border: 1px solid #d8e7dc;
	border-radius: 6px;
	padding: 11px 13px;
	font-size: 15px;
	font-family: inherit;
	color: #2f2f2f;
}
.vp.ts-landing .ts-finder-row input:focus,
.vp.ts-landing .ts-finder-row select:focus {
	outline: none;
	border-color: #2f7d4d;
}
.vp.ts-landing .ts-finder-row .vp-btn {
	flex: 1 1 auto;
	white-space: nowrap;
}
@media (max-width: 600px) {
	.vp.ts-landing .ts-finder-row .vp-btn {
		flex-basis: 100%;
	}
}

/* ─── Scale proof row ─── */
.vp.ts-landing .ts-scale {
	max-width: 720px;
	margin: 0 auto 40px;
	text-align: center;
}
.vp.ts-landing .ts-scale-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}
.vp.ts-landing .ts-scale-stat {
	padding: 18px 12px;
	text-align: center;
}
.vp.ts-landing .ts-scale-n {
	display: block;
	font-size: 2em;
	font-weight: 800;
	color: #2f7d4d;
	line-height: 1.1;
}
.vp.ts-landing .ts-scale-stat span {
	font-size: 0.85em;
	color: #5f6b63;
}
.vp.ts-landing .ts-scale-note {
	margin-top: 14px;
	font-size: 0.92em;
}
@media (max-width: 480px) {
	.vp.ts-landing .ts-scale-grid { grid-template-columns: 1fr; }
}

/* ─── Resolved-town context card (tier-tinted) ─── */
.vp.ts-landing .ts-resolved {
	max-width: 640px;
	margin: 0 auto 24px;
	padding: 22px 26px;
	border-left: 4px solid #2f7d4d;
	text-align: center;
}
.vp.ts-landing .ts-tier-roots    { border-left-color: #3b7f59; background: #f4f9f5; }
.vp.ts-landing .ts-tier-frontier { border-left-color: #b56b00; background: #fffaf0; }
.vp.ts-landing .ts-tier-live     { border-left-color: #2f7d4d; background: #eef6f0; }
.vp.ts-landing .ts-tier-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #2f7d4d;
	margin-bottom: 6px;
}
.vp.ts-landing .ts-tier-frontier .ts-tier-badge { color: #b56b00; }
.vp.ts-landing .ts-resolved-town {
	font-size: 1.5em;
	color: #1c3a2a;
	margin: 0 0 8px;
}
.vp.ts-landing .ts-resolved-line {
	color: #2f2f2f;
	margin: 0 0 6px;
}
.vp.ts-landing .ts-resolved-extra {
	color: #48534c;
	margin: 0 0 8px;
	font-size: 0.98em;
}
.vp.ts-landing .ts-change-town {
	margin-left: 12px;
	font-size: 0.9em;
	color: #5f6b63;
	text-decoration: underline;
}
