/*
Theme Name: Basement Finishing Chaska
Theme URI: https://basementfinishingchaska.com/
Author: Basement Finishing Chaska
Description: Custom, dependency-free HTML5 theme for basementfinishingchaska.com. Hub-and-spoke silo layout, Rank Math integration, FAQ schema from core Details blocks, accessible navigation and a built-in estimate form. Includes a one-click content installer under Appearance > Site Setup.
Version: 1.1.1
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bfc
*/

/* ---------- Tokens ---------- */
@font-face {
	font-family: "Fraunces";
	src: url("assets/fonts/fraunces-var.woff2") format("woff2");
	font-weight: 300 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--ink: #16202e;
	--ink-2: #24344a;
	--ink-soft: #3d4a5c;
	--muted: #5a6575;
	--paper: #fffdf9;
	--cream: #f6f1e9;
	--sand: #ece3d5;
	--line: #e3d9ca;
	--accent: #b9531a;
	--accent-hover: #9c4413;
	--accent-soft: #e8803c;
	--link: #1d4f86;
	--ok: #2f6b45;
	--radius: 10px;
	--radius-lg: 18px;
	--shadow: 0 1px 2px rgba(22, 32, 46, .06), 0 8px 24px rgba(22, 32, 46, .07);
	--shadow-lg: 0 18px 50px rgba(22, 32, 46, .16);
	--wrap: 1180px;
	--gutter: clamp(16px, 4vw, 32px);
	--font-head: "Fraunces", Georgia, "Times New Roman", serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.7 var(--font-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 {
	font-family: var(--font-head);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--ink);
	margin: 0 0 .5em;
	font-variation-settings: "opsz" 72;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 650; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.25em; }
.container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 12px; top: -60px; z-index: 1000;
	background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 48px; padding: .7em 1.35em;
	border: 2px solid transparent; border-radius: 999px;
	font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 42px; padding: .5em 1.05em; font-size: .94rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-call { background: var(--ink); color: #fff; }
.btn-call:hover { background: var(--ink-2); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; background: transparent; }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-ghost-dark { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost-dark:hover { background: var(--ink); color: #fff; }
.icon { flex: none; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 253, 249, .96);
	border-bottom: 1px solid var(--line);
	backdrop-filter: saturate(140%) blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-head); font-weight: 650; font-size: 1.15rem; }
.brand__place { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-top: 3px; }
.primary-nav { margin-left: auto; }
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-menu a {
	display: flex; align-items: center; gap: 6px;
	padding: 10px 12px; border-radius: 8px;
	color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.nav-menu a:hover, .nav-menu .current-menu-item > a, .nav-menu .current-menu-ancestor > a, .nav-menu .current_page_item > a { color: var(--accent); background: var(--cream); }
.nav-menu li { position: relative; }
.nav-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.nav-menu .sub-menu, .nav-menu .children {
	list-style: none; margin: 0; padding: 8px;
	position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px;
	background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-menu li:hover > .sub-menu, .nav-menu li:focus-within > .sub-menu,
.nav-menu li:hover > .children, .nav-menu li:focus-within > .children { opacity: 1; visibility: visible; transform: none; }
.nav-menu .sub-menu a, .nav-menu .children a { font-weight: 500; padding: 9px 12px; }
.header-actions { display: flex; gap: 8px; flex: none; }
.menu-toggle {
	display: none; align-items: center; gap: 8px;
	min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
	background: #fff; color: var(--ink); font: 600 .95rem var(--font-body); cursor: pointer;
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s ease;
}
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.page-hero {
	background:
		radial-gradient(1200px 400px at 85% -10%, rgba(232, 128, 60, .14), transparent 60%),
		linear-gradient(180deg, var(--cream), var(--paper));
	border-bottom: 1px solid var(--line);
	padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 6vw, 72px);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-grid--simple { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.page-hero--home .hero-copy h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-points { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-soft); font-size: .95rem; font-weight: 600; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before {
	content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
	background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat;
}
.hero-media { margin: 0; position: relative; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.page-hero--home .hero-media img { aspect-ratio: 5 / 4; }
.hero-media figcaption {
	position: absolute; left: 14px; bottom: 14px;
	background: rgba(22, 32, 46, .78); color: #fff; font-size: .75rem; letter-spacing: .03em;
	padding: 5px 10px; border-radius: 999px;
}
.hero-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(20px, 3vw, 32px); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .88rem; color: var(--muted); }
.breadcrumbs li { display: flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before { content: "\203A"; color: var(--accent); font-weight: 700; padding-right: 2px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Spoke cards ---------- */
.spokes { padding: clamp(40px, 6vw, 72px) 0 8px; }
.section-heading { text-align: left; max-width: 26ch; }
.card-grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
	position: relative; display: flex; flex-direction: column;
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
	padding: 24px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent-soft); }
.card__title { font-size: 1.2rem; margin-bottom: .45em; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card p { color: var(--muted); font-size: .97rem; margin-bottom: 1em; }
.card__more { margin-top: auto; color: var(--accent); font-weight: 700; font-size: .92rem; }

/* ---------- Content layout ---------- */
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 64px); padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 88px); align-items: start; }
.page-layout--narrow { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.prose { max-width: 74ch; }
.prose > * + h2 { margin-top: 2.1em; }
.prose > * + h3 { margin-top: 1.6em; }
.prose h2 { padding-top: .2em; }
.prose h2::before { content: ""; display: block; width: 44px; height: 3px; background: var(--accent-soft); border-radius: 2px; margin-bottom: 14px; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose ol { counter-reset: none; }
.prose strong { color: var(--ink); }
.prose .wp-block-table, .prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .97rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--cream); font-weight: 700; }

/* FAQ (core Details blocks) */
.wp-block-details {
	border: 1px solid var(--line); border-radius: 12px; background: #fff;
	margin: 0 0 12px; padding: 0; overflow: hidden;
}
.wp-block-details summary {
	cursor: pointer; list-style: none; position: relative;
	padding: 16px 52px 16px 20px; font-weight: 700; color: var(--ink); line-height: 1.4;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
	width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
	background: var(--cream); color: var(--accent); font-size: 1.2rem; font-weight: 700;
}
.wp-block-details[open] summary::after { content: "\2212"; }
.wp-block-details[open] summary { border-bottom: 1px solid var(--line); }
.wp-block-details > p { padding: 14px 20px 4px; margin: 0 0 .8em; color: var(--ink-soft); }

/* Sidebar */
.sidebar { position: sticky; top: 100px; display: grid; gap: 18px; }
.side-card { background: var(--ink); color: #dfe5ee; border-radius: var(--radius-lg); padding: 24px; display: grid; gap: 10px; }
.side-card p { margin: 0; font-size: .97rem; }
.side-card__title { font-family: var(--font-head); font-size: 1.35rem; color: #fff; font-weight: 600; }
.side-card .btn-call { background: transparent; border-color: rgba(255, 255, 255, .45); }
.side-card .btn-call:hover { background: #fff; color: var(--ink); }
.silo-nav { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; background: #fff; }
.silo-nav__title { font-weight: 700; margin: 0 0 8px; }
.silo-nav__title a { color: var(--ink); }
.silo-nav ul { list-style: none; margin: 0; padding: 0; }
.silo-nav li a { display: block; padding: 7px 0; border-top: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; font-size: .96rem; }
.silo-nav li a:hover, .silo-nav a[aria-current="page"] { color: var(--accent); }
.silo-nav a[aria-current="page"] { font-weight: 700; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: #dfe5ee; padding: clamp(40px, 6vw, 64px) 0; }
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0; max-width: 62ch; }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-band .btn-call { background: transparent; border-color: rgba(255, 255, 255, .55); }
.cta-band .btn-call:hover { background: #fff; color: var(--ink); }

/* ---------- Forms ---------- */
.lead-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-weight: 600; font-size: .93rem; }
.req { color: var(--accent); }
.field input, .field select, .field textarea {
	width: 100%; min-height: 48px; padding: 11px 13px;
	border: 1px solid #cfc3b1; border-radius: 10px; background: #fff;
	font: inherit; font-size: 1rem; color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 128, 60, .25); }
.form-note { font-size: .85rem; color: var(--muted); margin: 0; }
.form-notice { padding: 12px 14px; border-radius: 10px; margin: 0; font-weight: 600; }
.form-notice--error { background: #fbeae2; color: #7a2e0b; border: 1px solid #f0c3ad; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: #101823; color: #b9c3d0; font-size: .95rem; }
.site-footer a { color: #dfe5ee; text-decoration: none; }
.site-footer a:hover { color: var(--accent-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-top: 56px; padding-bottom: 40px; }
.footer-brand__name { font-family: var(--font-head); font-size: 1.35rem; color: #fff; margin-bottom: .4em; }
.footer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.footer-actions .btn-call { background: transparent; border-color: rgba(255, 255, 255, .4); }
.footer-col__title { color: #fff; font-weight: 700; margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 0; font-size: .85rem; }
.footer-bottom__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-bottom p { margin: 0; }
.legal-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.mobile-bar { display: none; }

/* ---------- Trust, reviews, projects ---------- */
.trust, .projects { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.trust-facts { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.trust-facts li { background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .95rem; }
.reviews { list-style: none; margin: 24px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.review blockquote { margin: 0; font-family: var(--font-head); font-size: 1.1rem; line-height: 1.5; }
.review__by { margin: 12px 0 0; color: var(--muted); font-size: .92rem; }
.card--project { padding: 0; overflow: hidden; }
.card--project .card__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card--project .card__title, .card--project p { padding: 0 20px; }
.card--project .card__title { margin-top: 16px; }
.archive-item { margin-bottom: 2.4em; }
.archive-item img { border-radius: var(--radius); margin-bottom: 12px; }

.card--media { padding: 0; overflow: hidden; }
.card--media .card__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card--media .card__title, .card--media p, .card--media .card__more { margin-left: 20px; margin-right: 20px; }
.card--media .card__title { margin-top: 16px; }
.card--media .card__more { margin-bottom: 20px; }

/* ---------- Block alignment helpers ---------- */
.aligncenter { margin-inline: auto; }
.wp-block-image { margin: 0 0 1.4em; }
.wp-block-image img { border-radius: var(--radius); }
.wp-element-caption, figcaption { font-size: .85rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.header-actions .header-estimate { display: none; }
	.nav-menu a { padding: 10px 9px; font-size: .92rem; }
}
@media (max-width: 960px) {
	.menu-toggle { display: inline-flex; }
	.primary-nav { position: static; }
	.nav-menu {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 0;
		background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
		padding: 10px var(--gutter) 18px; max-height: calc(100vh - 76px); overflow-y: auto;
	}
	.nav-menu.is-open { display: flex; }
	.nav-menu a { padding: 13px 6px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
	.nav-menu .sub-menu, .nav-menu .children { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; background: transparent; }
	.nav-caret { display: none; }
	.header-actions { margin-left: 0; }
	.header-actions .btn-call span { display: none; }
	.header-actions .btn-call { width: 44px; padding: 0; }
	.hero-grid { grid-template-columns: minmax(0, 1fr); }
	.page-layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar { position: static; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	body { font-size: 1rem; padding-bottom: 72px; }
	.header-inner { min-height: 66px; gap: 10px; }
	.brand__mark { width: 34px; height: 34px; }
	.brand__name { font-size: 1rem; }
	.menu-toggle__label { display: none; }
	.field-row { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.hero-actions .btn { flex: 1 1 auto; }
	.mobile-bar {
		display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
		background: rgba(255, 253, 249, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(22, 32, 46, .1);
	}
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .mobile-bar, .sidebar, .cta-band, .site-footer, .hero-actions { display: none !important; }
}
