/**
 * Answer Page Styles
 *
 * Shared layout for standalone answer pages (gutter cost, gutters overflowing,
 * and future ones). Regular pages on the default template: page-common.css
 * provides the 720px reading column; this file adds the byline, the price
 * table, and the numbered cause list.
 *
 * Classes:
 *   .answer-page    - wrapper group around the page content
 *   .answer-byline  - author + updated line under the page title
 *   .cause-title    - H3 of a numbered cause
 *   .cause-num      - the number circle inside a cause title
 */

/* ==========================================================================
   Byline
   ========================================================================== */

.answer-byline {
	text-align: center;
	font-size: 0.875rem;
	color: var(--wp--preset--color--text);
	margin-bottom: 2.5rem;
}

.answer-byline strong {
	color: var(--wp--preset--color--contrast);
}

/* ==========================================================================
   Price Table
   Styles the core table block inside answer pages.
   ========================================================================== */

.answer-page .wp-block-table {
	margin: 1.5rem 0 2rem;
}

.answer-page .wp-block-table table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--card-radius);
	overflow: hidden;
	font-size: 1rem;
}

.answer-page .wp-block-table th {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-weight: 700;
	text-align: left;
	padding: 0.875rem 1rem;
	border: none;
}

.answer-page .wp-block-table td {
	padding: 0.875rem 1rem;
	border: none;
	border-top: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text);
}

.answer-page .wp-block-table tr td:first-child {
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
}

.answer-page .wp-block-table tbody tr:nth-child(even) {
	background: var(--wp--preset--color--neutral);
}

@media (max-width: 767px) {
	.answer-page .wp-block-table table {
		font-size: 0.9375rem;
	}

	.answer-page .wp-block-table th,
	.answer-page .wp-block-table td {
		padding: 0.75rem 0.75rem;
	}
}

/* ==========================================================================
   Numbered Cause List
   H3 headings with a red number circle, used for diagnostic answer pages.
   ========================================================================== */

.cause-title {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.cause-num {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-size: 0.9375rem;
	font-weight: 700;
}

/* ==========================================================================
   Images
   ========================================================================== */

.answer-page .wp-block-image img {
	border-radius: var(--card-radius);
	box-shadow: var(--card-shadow);
}

.answer-page .wp-block-image figcaption {
	text-align: center;
	font-size: 0.875rem;
	color: var(--wp--preset--color--text);
	margin-top: 0.75rem;
}

/* ==========================================================================
   FAQ fit on the default page template
   page-common's heading margins outspecify faq.css inside <summary>,
   pushing the question text below the +/- icon. Re-zero at higher
   specificity, and give the FAQ list the same breathing room under its
   heading that service pages get from .faq-section.
   ========================================================================== */

.page-template-default:not(.home) .entry-content .faq-list summary h3 {
	margin: 0;
	padding: 0;
}

.answer-page .faq-list {
	margin-top: 1.5rem;
}

/* ==========================================================================
   Byline: name line + reviews line
   page-common.css sets .entry-content p margins at a higher specificity than
   a bare class, so these rules carry the same prefix to win. No negative
   margins: the name line's own bottom margin is tightened instead, which
   holds up when the name line wraps to two lines.
   ========================================================================== */

.page-template-default:not(.home) .entry-content .answer-byline:has(+ .answer-byline--reviews) {
	margin-bottom: 0.4rem;
}

/* Balance the credential line so the date does not orphan on its own row,
   matching the treatment on .page-hero h1. */
.answer-byline {
	text-wrap: balance;
	max-width: 46ch;
	margin-left: auto;
	margin-right: auto;
}

.answer-byline--reviews {
	max-width: none;
}

.page-template-default:not(.home) .entry-content .answer-byline--reviews {
	margin-top: 0;
	margin-bottom: 2.5rem;
}

.answer-byline--reviews .star-rating {
	font-size: 1rem;
	vertical-align: -1px;
}

/* ==========================================================================
   Symptom Triage Table
   "Which one do you have?" — symptom, likely cause, typical fix.
   Mirrors the price-table treatment so it reads as the same design system.
   Stacks via a CONTAINER query, because the content column is narrower than
   the viewport on this template; media query kept as a fallback.
   ========================================================================== */

.st-triage {
	container-type: inline-size;
	container-name: triage;
	margin: 1.5rem 0 2rem;
}

.st-triage__table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--card-radius);
	overflow: hidden;
	font-size: 1rem;
}

.st-triage__caption {
	caption-side: bottom;
	margin-top: 0.75rem;
	font-size: 0.875rem;
	color: var(--wp--preset--color--text);
	text-align: left;
}

.st-triage__table th[scope="col"] {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-weight: 700;
	text-align: left;
	padding: 0.875rem 1rem;
	border: none;
}

.st-triage__table th[scope="row"],
.st-triage__table td {
	padding: 0.875rem 1rem;
	border: none;
	border-top: 1px solid var(--wp--preset--color--border);
	vertical-align: top;
	text-align: left;
}

.st-triage__table th[scope="row"] {
	font-weight: 400;
	color: var(--wp--preset--color--text);
	width: 42%;
}

.st-triage__table tbody tr:nth-child(even) {
	background: var(--wp--preset--color--neutral);
}

.st-triage__table .st-cause a {
	font-weight: 700;
}

.st-triage__table .st-fix {
	color: var(--wp--preset--color--text);
}

/* ---- Stacked view ---- */
@container triage (max-width: 620px) {
	.st-triage__table {
		border: 0;
		border-radius: 0;
	}

	.st-triage__table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	.st-triage__table tbody tr,
	.st-triage__table tbody tr:nth-child(even) {
		display: block;
		background: var(--wp--preset--color--base);
		border: 1px solid var(--wp--preset--color--border);
		border-radius: var(--card-radius);
		margin-bottom: 0.625rem;
		padding: 0.875rem 1rem;
	}

	.st-triage__table th[scope="row"],
	.st-triage__table td {
		display: block;
		width: auto;
		padding: 0;
		border-top: 0;
	}

	.st-triage__table th[scope="row"] {
		margin-bottom: 0.35rem;
	}

	.st-triage__table .st-cause {
		margin-bottom: 0.2rem;
	}

	.st-triage__table .st-fix {
		font-size: 0.9375rem;
	}
}

/* Fallback where container queries are unavailable */
@supports not (container-type: inline-size) {
	@media (max-width: 767px) {
		.st-triage__table {
			border: 0;
			border-radius: 0;
		}

		.st-triage__table thead {
			position: absolute;
			width: 1px;
			height: 1px;
			overflow: hidden;
			clip-path: inset(50%);
		}

		.st-triage__table tbody tr,
		.st-triage__table tbody tr:nth-child(even) {
			display: block;
			background: var(--wp--preset--color--base);
			border: 1px solid var(--wp--preset--color--border);
			border-radius: var(--card-radius);
			margin-bottom: 0.625rem;
			padding: 0.875rem 1rem;
		}

		.st-triage__table th[scope="row"],
		.st-triage__table td {
			display: block;
			width: auto;
			padding: 0;
			border-top: 0;
		}

		.st-triage__table th[scope="row"] {
			margin-bottom: 0.35rem;
		}
	}
}

/* Anchor offset so linked cause headings clear the sticky header.
   Desktop header bottom sits at ~126px; mobile chrome is taller. */
.answer-page .cause-title[id] {
	scroll-margin-top: 9.5rem;
}

@media (max-width: 767px) {
	.answer-page .cause-title[id] {
		scroll-margin-top: 11rem;
	}
}

/* ==========================================================================
   Case Study
   A real job, set apart from the numbered cause list as a lifted card so it
   does not read as another numbered cause.
   ========================================================================== */

.answer-page .case-study {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--card-radius);
	box-shadow: var(--card-shadow);
	padding: 1.75rem 2rem;
	margin: 2.5rem 0;
}

.answer-page .case-study__title {
	margin-top: 0;
}

@media (max-width: 767px) {
	.answer-page .case-study {
		padding: 1.25rem 1.25rem;
	}
}

/* ==========================================================================
   Trust Badges
   Row of linked third-party accreditation badges (BBB, Best Pick, Five Star
   Rated, Houzz, Nextdoor). Text-styled placeholders in the site design
   system until official badge artwork is supplied; each links to the real
   Sparkle profile on that platform.
   ========================================================================== */

.trust-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	gap: 0.75rem;
	margin: 0 0 2.5rem;
	padding: 1.5rem;
	background: var(--wp--preset--color--neutral);
	border-radius: var(--card-radius);
}

.answer-page .trust-badges a.trust-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 128px;
	min-height: 56px;
	padding: 0.625rem 1rem;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	text-decoration: none;
	text-align: center;
	transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.answer-page .trust-badges a.trust-badge:hover {
	transform: var(--lift-hover);
	box-shadow: var(--card-shadow-hover);
	border-bottom-color: var(--wp--preset--color--border);
}

.trust-badges__label {
	text-align: center;
	font-size: 0.875rem;
	color: var(--wp--preset--color--text);
	margin-top: 2.5rem;
	margin-bottom: 0.75rem;
}

/* Logo badges: let the artwork sit on white, sized to a common optical height */
.answer-page .trust-badges a.trust-badge--logo {
	padding: 0.5rem 0.875rem;
}

.trust-badge--logo img {
	display: block;
	width: auto;
	height: 34px;
	max-width: 150px;
	object-fit: contain;
}

/* Brand-mark badges: official platform glyph beside the platform name, for
   marks that are not self-labelling on their own (Houzz). */
.answer-page .trust-badges a.trust-badge--mark {
	flex-direction: row;
	gap: 0.45rem;
	color: var(--wp--preset--color--contrast);
}

.trust-badge__mark {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.trust-badge__name {
	font-weight: 700;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--contrast);
	line-height: 1.3;
}

.trust-badge__sub {
	font-size: 0.75rem;
	color: var(--wp--preset--color--text);
	line-height: 1.3;
}

@media (prefers-reduced-motion: reduce) {
	.answer-page .trust-badges a.trust-badge:hover {
		transform: none;
	}
}

@media (max-width: 767px) {
	.trust-badges {
		gap: 0.5rem;
		padding: 1rem;
	}

	.answer-page .trust-badges a.trust-badge {
		min-width: calc(50% - 0.5rem);
		min-height: 48px;
	}
}
