/*
Theme Name: Townsmith
Theme URI: https://townsmithwp.com
Author: Stephen Evans
Author URI: https://townsmithwp.com
Description: The Townsmith brand site theme — polished product design keyed to the Local Pages Engine identity: warm canvas, confident indigo, Plus Jakarta Sans, soft elevated cards.
Version: 3.3.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: townsmith
Tags: block-themes, full-site-editing, custom-colors, custom-fonts, blog, business
*/

*,
*::before,
*::after {
	box-sizing: border-box;
}

img,
video {
	max-width: 100%;
	height: auto;
}

::selection {
	background: var(--wp--preset--color--green);
	color: #ffffff;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--green);
	outline-offset: 3px;
}

.wp-block-post-content a:not(.wp-element-button),
.wp-block-paragraph a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

/* ── Display headings ───────────────────────────────────────────────── */

.ts-display {
	letter-spacing: -0.03em;
}

/* ── Pill badge (annotation slots reuse this class) ─────────────────── */

.ts-annotation {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	width: fit-content;
	background: var(--wp--preset--color--brass);
	color: var(--wp--preset--color--green) !important;
	border-radius: 999px;
	padding: 0.45em 1.1em;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-transform: none;
}

/* Pills sitting on dark or indigo backgrounds. */
.ts-on-dark.ts-annotation {
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff !important;
}

/* ── Elevated cards ─────────────────────────────────────────────────── */

.ts-card {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(22, 22, 29, 0.06);
}

/* Legacy class from earlier revisions — render as a card. */
.ts-crop {
	background: var(--wp--preset--color--panel);
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(22, 22, 29, 0.06);
}

/* ── Video frame ────────────────────────────────────────────────────── */

.ts-frame {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 18px;
	padding: 10px;
	box-shadow: 0 24px 60px rgba(22, 22, 29, 0.12);
}

.ts-frame video {
	display: block;
	width: 100%;
	border-radius: 10px;
}

.ts-frame figure {
	margin: 0;
}

/* ── Product screenshots ────────────────────────────────────────────── */

.ts-shot {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	padding: 8px;
	box-shadow: 0 20px 50px rgba(22, 22, 29, 0.12);
}

.ts-shot img {
	display: block;
	border-radius: 8px;
}

.ts-shot figure {
	margin: 0;
}

/* Card hover lift. */
.ts-card {
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ts-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 20px 44px rgba(22, 22, 29, 0.1);
}

/* ── Refuses-to-do marquee ──────────────────────────────────────────── */

.ts-marquee {
	overflow: hidden;
	white-space: nowrap;
}

.ts-marquee p {
	display: inline-block;
	margin: 0;
	padding-left: 0;
	animation: ts-scroll 30s linear infinite;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.8125rem;
}

@keyframes ts-scroll {
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.ts-marquee p {
		animation: none;
		white-space: normal;
	}
}

/* ── Score bars ─────────────────────────────────────────────────────── */

.ts-bar {
	height: 10px;
	border-radius: 999px;
	background: #e7e6ef;
	overflow: hidden;
	margin-top: 0.75rem;
}

.ts-bar-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--wp--preset--color--green);
	animation: ts-grow 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.ts-bar-fill--45 { width: 45%; }
.ts-bar-fill--35 { width: 35%; }
.ts-bar-fill--20 { width: 20%; }

@keyframes ts-grow {
	from { width: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-bar-fill {
		animation: none;
	}
}

/* ── The bulk playbook, struck through ─────────────────────────────── */

.ts-strike li {
	text-decoration: line-through;
	text-decoration-color: rgba(94, 99, 112, 0.7);
	text-decoration-thickness: 1px;
	color: var(--wp--preset--color--stone);
}

/* ── Legacy helpers kept inert ─────────────────────────────────────── */

.ts-ghost {
	display: none;
}

.ts-spec-strip {
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--wp--preset--color--stone);
}

.ts-rule-heavy {
	border: none;
	border-top: 1px solid var(--wp--preset--color--line);
	margin: 0;
}

.ts-wordmark {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: clamp(2rem, 5vw, 3rem);
	letter-spacing: -0.02em;
	line-height: 1;
	margin: 0;
}

/* ── UI vignettes ───────────────────────────────────────────────────── */

.ts-vig {
	display: flex;
	align-items: stretch;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.ts-vig-card {
	flex: 1 1 240px;
	border-radius: 16px;
	padding: 1.75rem 2rem;
	min-width: 0;
}

.ts-vig-before {
	background: #faf1da;
	border: 1px solid #e7cd84;
}

.ts-vig-after {
	background: var(--wp--preset--color--green);
	color: #ffffff;
	animation: ts-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.ts-vig-score {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: clamp(3rem, 6vw, 4.25rem);
	line-height: 1;
	letter-spacing: -0.02em;
	margin: 0 0 0.5rem;
}

.ts-vig-before .ts-vig-score {
	color: #8a6116;
}

.ts-vig-status {
	font-weight: 700;
	font-size: 0.9375rem;
	margin: 0 0 0.9rem;
}

.ts-vig-before .ts-vig-status {
	color: #8a6116;
}

.ts-vig-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
	color: #6e5a23;
}

.ts-vig-list li {
	padding-left: 1.1rem;
	position: relative;
	margin-bottom: 0.35rem;
}

.ts-vig-list li::before {
	content: "—";
	position: absolute;
	left: 0;
}

.ts-vig-after .ts-vig-list {
	color: rgba(255, 255, 255, 0.85);
}

.ts-vig-after .ts-vig-list li::before {
	content: "✓";
}

.ts-vig-arrow {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	flex: 0 0 130px;
	text-align: center;
}

.ts-vig-arrow .ts-vig-glyph {
	font-size: 2rem;
	line-height: 1;
	color: var(--wp--preset--color--green);
}

.ts-vig-arrow .ts-vig-caption {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}

@keyframes ts-pop {
	from {
		transform: scale(0.96);
		opacity: 0;
	}
}

@media (max-width: 781px) {
	.ts-vig-arrow {
		flex-basis: 100%;
		transform: rotate(90deg);
		padding: 0.25rem 0;
	}

	.ts-vig-arrow .ts-vig-caption {
		transform: rotate(-90deg);
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ts-vig-after {
		animation: none;
	}
}

/* Mini-matrix vignette. */
.ts-mini {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	padding: 1.75rem;
	box-shadow: 0 20px 50px rgba(22, 22, 29, 0.1);
}

.ts-mini-grid {
	display: grid;
	grid-template-columns: 1.2fr 1fr 1fr;
	gap: 0.9rem 1rem;
	align-items: center;
}

.ts-mini-head {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}

.ts-mini-area {
	font-weight: 600;
	font-size: 0.9375rem;
}

.ts-mini-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	border-radius: 999px;
	padding: 0.45em 0.95em;
	font-size: 0.875rem;
	font-weight: 700;
	width: fit-content;
}

.ts-mini-chip--amber {
	background: #faf1da;
	color: #8a6116;
}

.ts-mini-chip--indigo {
	background: var(--wp--preset--color--brass);
	color: var(--wp--preset--color--green);
}

.ts-mini-cell {
	position: relative;
}

.ts-mini-cell--hero {
	padding-top: 1.5rem;
}

.ts-mini-cell--hero .ts-mini-chip {
	background: var(--wp--preset--color--green);
	color: #ffffff;
	box-shadow: 0 0 0 3px var(--wp--preset--color--brass);
}

.ts-mini-tag {
	position: absolute;
	top: 0;
	left: 0;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--wp--preset--color--green);
	white-space: nowrap;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.ts-footer {
	color: #f5f4f0;
}

.ts-footer .ts-wordmark {
	color: #ffffff;
}

.ts-dot {
	color: var(--wp--preset--color--green);
}

.ts-footer-muted {
	color: #a9aebc;
	max-width: 38ch;
}

.ts-footer-flag {
	color: #7c818f;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.75rem !important;
}

.ts-footer-heading {
	color: #ffffff;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 0.75rem !important;
	margin-bottom: 0.4rem;
}

.ts-footer-links {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.ts-footer-links li {
	margin: 0 0 0.7rem;
}

.ts-footer a {
	color: #c9cdd8;
	text-decoration: none;
	transition: color 0.15s ease;
}

.ts-footer a:hover {
	color: #ffffff;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.ts-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ts-footer-bottom p {
	max-width: none;
}

/* ── Quiet expanding FAQ rows ──────────────────────────────────────── */

details.wp-block-details {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	padding: 1.1rem 1.4rem;
	margin-bottom: 0.75rem;
}

details.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

details.wp-block-details summary::after {
	content: "+";
	float: right;
	color: var(--wp--preset--color--green);
	font-weight: 700;
}

details.wp-block-details[open] summary::after {
	content: "\2212";
}
