/*
Theme Name: CFRC
Description: Lightweight theme for crackfoundationrepaircost.com. No page builder, no web fonts.
Version: 1.1.0
Requires PHP: 7.4
*/

:root {
	--ink: #16222b;
	--ink-soft: #51616d;
	--night: #0f1f2c;
	--slate: #1b3446;
	--slate-2: #27485f;
	--line: #dbe2e7;
	--paper: #ffffff;
	--wash: #f2f5f7;
	--accent: #f2a33a;
	--accent-deep: #b85f0c;
	--accent-hover: #944a06;
	--warn-bg: #fff6e5;
	--warn-line: #f2c46b;
	--radius: 14px;
	--wrap: 1120px;
	--shadow: 0 18px 40px -18px rgba(15, 31, 44, .35), 0 2px 6px rgba(15, 31, 44, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
	margin: 0;
	font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--ink);
	background: var(--paper);
}
img, svg { max-width: 100%; height: auto; }
a { color: #0b5c8a; text-underline-offset: 2px; }
a:hover { color: var(--night); }
h1, h2, h3 { line-height: 1.15; color: var(--night); margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2rem); font-weight: 800; margin-top: 1.8em; }
h3 { font-size: 1.15rem; margin-top: 1.4em; }
p, ul, ol, table { margin: 0 0 1.1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--night); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 600; line-height: 1.15; }
.brand:hover { color: #fff; }
.brand svg rect { fill: var(--slate-2); }
.brand b { color: var(--accent); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: #d5e0e8; text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: #fff; text-decoration: underline; }
.nav-phone { white-space: nowrap; }

/* Buttons */
.btn {
	display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
	background: var(--slate); color: #fff; font: inherit; font-weight: 700;
	padding: 14px 24px; text-decoration: none; text-align: center;
	transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--night); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--night); }
.btn-accent:hover { background: #ffb95a; color: var(--night); }
.btn-small { padding: 9px 16px; font-size: .95rem; white-space: nowrap; }
.btn[disabled] { opacity: .65; cursor: default; }

/* Hero */
.hero {
	color: #d5e0e8;
	padding: 58px 0 150px;
	background:
		linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 44px 44px,
		linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 44px 44px,
		radial-gradient(900px 420px at 85% -10%, rgba(242, 163, 58, .22), transparent 60%),
		linear-gradient(180deg, var(--night), var(--slate));
}
.hero h1 { color: #fff; max-width: 15em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 1.18rem; max-width: 40em; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .9em; }
.eyebrow-dark { color: var(--accent-deep); }
.chips { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 6px 14px 6px 34px; font-size: .92rem; color: #fff; position: relative; }
.chips li::before { content: ""; position: absolute; left: 13px; top: 50%; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-70%) rotate(-45deg); }

/* Calculator: inputs left, live result right */
.calc-stage { margin-top: -112px; position: relative; z-index: 2; }
.calc {
	display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	background: #fff; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden;
}
.calc-form { padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; align-content: start; }
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; color: var(--night); }
.optional { font-weight: 400; color: var(--ink-soft); }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], select, textarea {
	width: 100%; font: inherit; color: var(--ink); background: #fff;
	border: 1.5px solid #b3c1cb; border-radius: 10px; padding: 11px 12px; min-height: 48px;
}
input:focus, select:focus, textarea:focus { border-color: var(--slate-2); }
textarea { min-height: 84px; resize: vertical; }

.crack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.crack-card {
	position: relative; display: flex !important; flex-direction: column; align-items: flex-start; gap: 2px;
	border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0 !important;
	cursor: pointer; background: #fff; transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.crack-card:hover { border-color: #9fb0bc; }
.crack-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.crack-card svg { width: 72px; height: 48px; margin-bottom: 6px; }
.crack-name { font-weight: 700; color: var(--night); line-height: 1.2; }
.crack-sub { font-size: .82rem; font-weight: 400; color: var(--ink-soft); line-height: 1.3; }
.crack-card:has(input:checked) { border-color: var(--accent-deep); background: #fffaf2; box-shadow: 0 0 0 3px rgba(242, 163, 58, .28); }
.crack-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.crack-card:has(input:checked)::after {
	content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
	background: var(--accent-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}

.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin-bottom: 6px; color: var(--ink) !important; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--accent-deep); }

.calc-result { background: linear-gradient(180deg, var(--night), var(--slate)); color: #c9d6df; padding: 28px; display: flex; flex-direction: column; }
.calc-label { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.calc-range { font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 800; color: #fff; margin: 6px 0 12px; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.calc-how, .calc-context { margin-bottom: .8em; font-size: .97rem; }
.calc-context { padding-top: .8em; border-top: 1px solid rgba(255, 255, 255, .14); }
.calc-note { background: rgba(242, 163, 58, .14); border: 1px solid rgba(242, 163, 58, .5); color: #ffe6bf; border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.calc-disclaimer { font-size: .86rem; color: #a9bac6; }
.calc-disclaimer strong { color: #fff; }
.calc-cta { margin: auto 0 0; padding-top: 8px; }
.calc-cta .btn { display: block; }
.calc-mini { display: none; }
.sources { grid-column: 1 / -1; margin: 0; padding: 14px 28px; font-size: .92rem; color: var(--ink-soft); border-top: 1px solid var(--line); background: var(--wash); }
.sources summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.sources ul { padding-left: 1.2em; margin-top: .6em; }

/* Sections */
.section { padding: 64px 0; }
.section-wash { background: var(--wash); }
.section h2 { margin-top: 0; max-width: 22em; }
.src { font-size: .9rem; color: var(--ink-soft); }

.price-rows { list-style: none; padding: 0; margin: 26px 0 18px; display: grid; gap: 10px; }
.price-rows li { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--wash); border-radius: 16px; padding: 18px 24px; }
.price-rows strong { display: block; color: var(--night); font-size: 1.08rem; }
.price-rows span { color: var(--ink-soft); font-size: .95rem; }
.price-rows b { font-size: 1.3rem; font-weight: 800; color: var(--night); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.price-rows small { display: block; font-size: .8rem; font-weight: 500; color: var(--ink-soft); }

.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--night); color: var(--accent); font-weight: 800; margin-bottom: 12px; }
.steps h3 { margin: 0 0 .35em; }
.steps p { margin: 0; color: var(--ink-soft); }

/* Quote request */
.quote-stage { background: linear-gradient(180deg, var(--night), var(--slate)); color: #c9d6df; }
.quote-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 40px; align-items: start; }
.quote-side h2 { color: #fff; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; }
.ticks li { position: relative; padding-left: 30px; margin-bottom: 12px; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.quote { background: #fff; color: var(--ink); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.quote-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.quote .btn { width: 100%; }
.consent { font-size: .88rem; color: var(--ink-soft) !important; line-height: 1.45; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fineprint { font-size: .86rem; color: var(--ink-soft); margin: 0; }
.form-error { color: #a12020; font-weight: 600; margin: 10px 0 0; }
.quote-done { outline: 0; }
.quote-done h3 { margin-top: 0; }

.alert { background: var(--warn-bg); border: 1px solid var(--warn-line); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: 26px 28px; }
.alert h2 { font-size: 1.4rem; }
.alert p { margin: 0; max-width: 60em; }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 12px 14px; }

/* Articles */
.article { padding-top: 40px; padding-bottom: 52px; }
.article h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); max-width: 20em; }
.prose { max-width: 46em; }
.prose > .table-wrap { max-width: none; }
/* A calculator inside an article breaks out of the text column to the full page width. */
.prose > .calc { width: min(1076px, calc(100vw - 44px)); max-width: none; margin: 1.4em 0 2em; }
.prose li { margin-bottom: .35em; }
.table-wrap { overflow-x: auto; margin-bottom: 1.1em; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; margin: 0; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
thead th { background: var(--wash); color: var(--night); border-bottom: 1px solid #c3ced6; }
td:nth-child(2) { white-space: nowrap; font-weight: 700; color: var(--night); }
.cta-box { background: linear-gradient(180deg, var(--night), var(--slate)); color: #fff; border-radius: var(--radius); padding: 24px; margin: 1.8em 0; }
.cta-box h2, .cta-box h3 { color: #fff; margin-top: 0; }
.cta-box p { color: #c9d6df; }
.cta-box p:last-child { margin-bottom: 0; }

.article:has(+ .quote-stage) { padding-bottom: 36px; }
.more-guides { margin-top: 2.4em; padding-top: 1.6em; border-top: 1px solid var(--line); max-width: 46em; }
.more-guides h2 { font-size: 1.25rem; margin: 0 0 .6em; }
.more-guides ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.more-guides a, .guide-links a { display: inline-block; background: var(--wash); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; text-decoration: none; color: var(--night); font-weight: 600; }
.more-guides a:hover, .guide-links a:hover { border-color: var(--accent-deep); background: #fffaf2; }
.guide-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.price-rows strong a { color: var(--night); }

/* Footer */
.site-footer { background: var(--night); color: #a9bac6; padding: 34px 0; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 16px; }
.site-footer p { max-width: 60em; }

@media (max-width: 900px) {
	.calc { grid-template-columns: 1fr; overflow: visible; }
	.calc-result { border-radius: 0; }
	.sources { border-radius: 0 0 18px 18px; }
	.calc-mini {
		display: flex; align-items: center; gap: 10px; position: sticky; bottom: 12px; z-index: 3;
		background: var(--night); color: #fff; text-decoration: none; border-radius: 12px; padding: 12px 16px;
		box-shadow: 0 10px 24px -8px rgba(15, 31, 44, .55);
	}
	.calc-mini:hover { color: #fff; }
	.calc-mini span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; line-height: 1.2; max-width: 5em; }
	.calc-mini b { font-size: 1.15rem; font-weight: 800; flex: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
	.calc-mini i { font-style: normal; font-size: .85rem; color: #c9d6df; white-space: nowrap; }
	.quote-grid { grid-template-columns: 1fr; gap: 26px; }
	.steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	body { font-size: 16px; }
	.wrap { padding: 0 16px; }
	.hero { padding: 36px 0 132px; }
	.calc-form, .quote-form { grid-template-columns: 1fr; padding: 18px; }
	.quote-form { padding: 0; }
	.calc-result, .quote { padding: 20px; }
	.sources { padding: 14px 18px; }
	.crack-grid { grid-template-columns: repeat(2, 1fr); }
	.section { padding: 44px 0; }
	.nav { gap: 12px; }
	.nav a:not(.btn):not(.nav-phone) { display: none; }
	.brand span { font-size: .95rem; }
	.price-rows li { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px; }
	.price-rows b { text-align: left; }
	.price-rows small { display: inline; }
	table { min-width: 540px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn, .crack-card { transition: none; }
}
