/* ============================================================================
   Base Foundation Repair — Main Stylesheet
   Production CSS extracted from _strategy/components.html
   ============================================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  --color-bg: #FAF7F2;
  --color-white: #FFFFFF;
  --color-slate: #1F2A37;
  --color-brick: #B85C3D;
  --color-brick-dark: #9a4c34;
  --color-forest: #3F5B3D;
  --color-text: #2A2D33;
  --color-muted: #5C6470;
  --color-border: #E5DFD3;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --content-max: 1200px;
  --reading-max: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--color-slate); }
p { margin-bottom: 18px; }
a { color: var(--color-brick); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--color-slate); }
img { max-width: 100%; height: auto; display: block; }

.bfr-skip-link { position: absolute; left: -9999px; top: 0; background: var(--color-slate); color: white; padding: 12px 20px; z-index: 999; }
.bfr-skip-link:focus { left: 0; }

/* ---------- 1. STICKY HEADER ---------- */
.bfr-header { position: sticky; top: 0; background: var(--color-white); border-bottom: 1px solid var(--color-border); padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; z-index: 50; }
.bfr-logo { font-family: var(--serif); display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; color: var(--color-slate); text-decoration: none; line-height: 1; }
.bfr-logo-word { font-size: 22px; font-weight: 600; color: var(--color-slate); }
.bfr-logo-dot { color: var(--color-brick); }
.bfr-logo-tail { font-family: var(--sans); font-size: 10px; font-weight: 600; color: var(--color-muted); letter-spacing: 0.18em; text-transform: uppercase; }
/* legacy fallback for plain <span> inside .bfr-logo */
.bfr-logo > span:not([class]) { color: var(--color-brick); }
.bfr-nav { display: flex; gap: 32px; }
.bfr-nav a { color: var(--color-text); text-decoration: none; font-weight: 500; font-size: 15px; }
.bfr-nav a:hover { color: var(--color-brick); }
.bfr-header-cta { background: var(--color-brick); color: white !important; padding: 10px 20px; text-decoration: none !important; border-radius: 2px; font-weight: 600; font-size: 15px; }
.bfr-header-cta:hover { background: var(--color-brick-dark); }

/* Mobile menu toggle (CSS-only, no JS) — desktop hides both */
.bfr-menu-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.bfr-menu-button { display: none; flex-direction: column; justify-content: space-between; width: 28px; height: 22px; cursor: pointer; padding: 0; background: transparent; border: 0; }
.bfr-menu-bar { display: block; width: 100%; height: 3px; background: var(--color-slate); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }

/* ---------- PERSISTENT MOBILE CTA BAR ---------- */
.bfr-mobile-cta { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: var(--color-slate); border-top: 1px solid rgba(255,255,255,0.08); box-shadow: 0 -2px 12px rgba(0,0,0,0.18); }
.bfr-mobile-cta-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 12px; font-family: var(--sans); font-weight: 600; font-size: 15px; text-decoration: none !important; color: var(--color-white) !important; text-align: center; border-right: 1px solid rgba(255,255,255,0.12); transition: background 0.15s ease; }
.bfr-mobile-cta-btn:last-child { border-right: none; }
.bfr-mobile-cta-btn--phone { background: var(--color-brick); }
.bfr-mobile-cta-btn--phone:hover { background: var(--color-brick-dark); }
.bfr-mobile-cta-btn--quote { background: var(--color-slate); }
.bfr-mobile-cta-btn--quote:hover { background: #15202b; }
.bfr-mobile-cta-btn svg { flex-shrink: 0; }

/* ---------- 2. HERO ---------- */
.bfr-hero { padding: 96px 32px 80px; background: var(--color-bg); }
.bfr-hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; max-width: var(--content-max); margin: 0 auto; }
.bfr-hero-grid--text-only { grid-template-columns: 1fr; max-width: var(--reading-max); }
.bfr-eyebrow { font-family: var(--sans); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); margin-bottom: 16px; }
.bfr-hero h1 { font-size: 52px; letter-spacing: -0.01em; margin-bottom: 24px; }
.bfr-hero .lede { font-size: 22px; line-height: 1.5; color: var(--color-muted); margin-bottom: 36px; }
.bfr-cta-pair { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.bfr-trust-strip { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--color-muted); }
.bfr-trust-strip span:before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--color-brick); margin-right: 10px; vertical-align: middle; }
.bfr-hero-image { aspect-ratio: 4/3; background: linear-gradient(135deg, #2a3a4a 0%, #1F2A37 100%); border-radius: 4px; overflow: hidden; }
.bfr-hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- BUTTONS ---------- */
.bfr-btn { display: inline-block; padding: 16px 32px; font-weight: 600; font-size: 16px; text-decoration: none; border-radius: 2px; transition: all 0.15s; cursor: pointer; font-family: var(--sans); border: 2px solid transparent; }
.bfr-btn-primary { background: var(--color-brick); color: var(--color-white); border-color: var(--color-brick); }
.bfr-btn-primary:hover { background: var(--color-brick-dark); border-color: var(--color-brick-dark); color: var(--color-white); }
.bfr-btn-secondary { background: transparent; color: var(--color-slate); border-color: var(--color-slate); }
.bfr-btn-secondary:hover { background: var(--color-slate); color: var(--color-white); }

/* ---------- 3. SECTION ---------- */
.bfr-section { padding: 96px 32px; }
.bfr-section--alt { background: var(--color-white); }
.bfr-section .reading { max-width: var(--reading-max); margin: 0 auto; }
.bfr-section .container { max-width: var(--content-max); margin: 0 auto; }
.bfr-section h2 { font-size: 36px; letter-spacing: -0.005em; margin-bottom: 24px; }
.bfr-section-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
.bfr-section-split--left { grid-template-columns: 1fr 1.2fr; }
.bfr-section-split--left .bfr-section-image { order: -1; }
.bfr-section-image { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: #e8e2d6; max-width: 480px; justify-self: end; }
.bfr-section-split--left .bfr-section-image { justify-self: start; }
.bfr-section-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bfr-map { aspect-ratio: 16 / 9; max-width: 900px; margin: 0 auto; border-radius: 4px; overflow: hidden; border: 1px solid var(--color-border); background: #e8e2d6; }
.bfr-map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Language switcher in footer-bottom */
.bfr-lang-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.08em; }
.bfr-lang-switch a { color: rgba(255,255,255,0.8); text-decoration: none; }
.bfr-lang-switch a:hover { color: var(--color-white); text-decoration: underline; }
.bfr-lang-switch [aria-current="true"] { color: var(--color-white); font-weight: 600; }
.bfr-lang-switch [aria-hidden="true"] { color: rgba(255,255,255,0.4); }
.bfr-pull-quote { font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1.4; color: var(--color-slate); padding: 32px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin: 48px 0 0; }
.bfr-pull-quote-attr { display: block; font-style: normal; font-size: 16px; color: var(--color-muted); margin-top: 16px; font-family: var(--sans); }

/* ---------- 4. CARD GRID ---------- */
.bfr-card-grid { display: grid; gap: 24px; max-width: var(--content-max); margin: 48px auto 0; padding: 0 32px; }
.bfr-card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.bfr-card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.bfr-card-grid--4 { grid-template-columns: repeat(4, 1fr); }
.bfr-card { background: var(--color-bg); border: 1px solid var(--color-border); text-decoration: none; color: var(--color-text); display: block; overflow: hidden; transition: border-color 0.2s ease; }
.bfr-card--white { background: var(--color-white); }
.bfr-card:hover { border-color: var(--color-brick); color: var(--color-text); }
.bfr-card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #e8e2d6; }
.bfr-card > h3, .bfr-card > p, .bfr-card > .read-more, .bfr-card > span.read-more { padding: 0 32px; }
.bfr-card > .bfr-card-image + h3 { padding-top: 24px; }
.bfr-card > h3:first-child { padding-top: 32px; }
.bfr-card > *:last-child { padding-bottom: 32px; }
.bfr-card h3 { color: var(--color-slate); font-size: 22px; margin-bottom: 12px; }

/* ---------- 5. PRICING TABLE ---------- */
.bfr-pricing { padding: 64px 32px; max-width: var(--content-max); margin: 0 auto; }
.bfr-pricing h2 { font-size: 28px; margin-bottom: 16px; }
.bfr-pricing-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.bfr-pricing-table th { text-align: left; padding: 12px 16px; background: var(--color-slate); color: var(--color-white); font-family: var(--sans); font-weight: 600; font-size: 14px; }
.bfr-pricing-table td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); font-size: 15px; }
.bfr-pricing-table tr:last-child td { border-bottom: none; }
.bfr-pricing-variables { font-size: 14px; color: var(--color-muted); margin-top: 12px; }
.bfr-pricing-variables strong { color: var(--color-slate); }

/* ---------- 6. TESTIMONIAL STRIP ---------- */
.bfr-testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: var(--content-max); margin: 48px auto 0; padding: 0 32px; }
.bfr-testimonial { padding: 32px; background: var(--color-bg); border-left: 3px solid var(--color-brick); }
.bfr-testimonial p { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.5; color: var(--color-text); margin-bottom: 24px; }
.bfr-testimonial-attr { font-size: 14px; color: var(--color-muted); font-weight: 600; }

/* ---------- 7. FAQ ACCORDION ---------- */
.bfr-faq { max-width: var(--reading-max); margin: 32px auto; padding: 0 32px; }
.bfr-faq-item { border-bottom: 1px solid var(--color-border); }
.bfr-faq-item summary { padding: 24px 0; cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--color-slate); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.bfr-faq-item summary::after { content: "+"; font-size: 28px; font-weight: 400; color: var(--color-brick); transition: transform 0.2s; }
.bfr-faq-item[open] summary::after { transform: rotate(45deg); }
.bfr-faq-item summary::-webkit-details-marker { display: none; }
.bfr-faq-answer { padding: 0 0 24px; color: var(--color-text); font-size: 16px; line-height: 1.6; }

/* ---------- 8. CTA BAR ---------- */
.bfr-cta-bar { background: var(--color-slate); color: var(--color-white); padding: 96px 32px; text-align: center; }
.bfr-cta-bar--mid-page { background: var(--color-brick); padding: 56px 32px; }
.bfr-cta-bar--mid-page p { color: rgba(255,255,255,0.95); }
.bfr-cta-bar h2 { color: var(--color-white); font-size: 32px; margin-bottom: 16px; }
.bfr-cta-bar p { font-size: 20px; color: rgba(255,255,255,0.85); max-width: 600px; margin: 0 auto 32px; line-height: 1.5; }
.bfr-cta-bar .bfr-cta-pair { justify-content: center; }
.bfr-cta-bar .bfr-btn-secondary { color: var(--color-white); border-color: var(--color-white); }
.bfr-cta-bar .bfr-btn-secondary:hover { background: var(--color-white); color: var(--color-slate); }

/* ---------- 9. CONTACT FORM ---------- */
.bfr-form-section { background: var(--color-bg); padding: 96px 32px; }
.bfr-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; max-width: var(--content-max); margin: 0 auto; }
.bfr-form { background: var(--color-white); padding: 40px; border: 1px solid var(--color-border); }
.bfr-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--color-slate); font-family: var(--sans); }
.bfr-form input, .bfr-form textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 2px; font-family: var(--sans); font-size: 16px; margin-bottom: 20px; background: var(--color-bg); color: var(--color-text); }
.bfr-form textarea { resize: vertical; }
.bfr-form input:focus, .bfr-form textarea:focus { outline: 2px solid var(--color-brick); outline-offset: 2px; }
.bfr-form .bfr-btn { width: 100%; border: none; }

/* ---------- 10. FOOTER ---------- */
.bfr-footer { background: var(--color-slate); color: rgba(255,255,255,0.7); padding: 64px 32px 32px; }
.bfr-footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; max-width: var(--content-max); margin: 0 auto; }
.bfr-footer .bfr-logo { color: white; }
.bfr-footer p { margin-top: 16px; font-size: 14px; line-height: 1.6; }
.bfr-footer h4 { color: var(--color-white); font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; font-weight: 600; }
.bfr-footer ul { list-style: none; }
.bfr-footer li { margin-bottom: 8px; }
.bfr-footer a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; }
.bfr-footer a:hover { color: var(--color-brick); }
.bfr-footer-bottom { max-width: var(--content-max); margin: 48px auto 0; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: rgba(255,255,255,0.5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- 11. ARTICLE BLOCK ---------- */
.bfr-article { max-width: var(--reading-max); margin: 0 auto; padding: 64px 32px; }
.bfr-article-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--color-muted); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.bfr-article-meta .category { background: var(--color-brick); color: var(--color-white); padding: 2px 10px; border-radius: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.bfr-article h1 { font-size: 44px; margin-bottom: 16px; }
.bfr-article-feature { aspect-ratio: 16/9; background: linear-gradient(135deg, #2a3a4a 0%, #1F2A37 100%); border-radius: 4px; margin: 24px 0 32px; overflow: hidden; }
.bfr-article-body p, .bfr-article-body ul, .bfr-article-body ol { margin-bottom: 24px; }
.bfr-article-body h2 { font-size: 28px; margin: 48px 0 16px; }
.bfr-article-body h3 { font-size: 20px; margin: 32px 0 12px; }
.bfr-related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--color-border); }
.bfr-related h3 { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); margin-bottom: 16px; }
.bfr-related-list { list-style: none; }
.bfr-related-list li { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.bfr-related-list a { font-family: var(--serif); font-size: 18px; color: var(--color-slate); }

/* ---------- 12. DIAGNOSIS CARD ---------- */
.bfr-diagnosis { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 32px; background: var(--color-white); border: 1px solid var(--color-border); margin: 0 auto 24px; max-width: var(--reading-max); }
.bfr-diagnosis-image { aspect-ratio: 1/1; background: var(--color-bg); border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--color-muted); font-size: 13px; font-style: italic; padding: 16px; text-align: center; }
.bfr-diagnosis-image img { width: 100%; height: 100%; object-fit: cover; }
.bfr-diagnosis h3 { font-size: 22px; margin-bottom: 12px; }
.bfr-diagnosis dl { margin-bottom: 12px; }
.bfr-diagnosis dt { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); margin-top: 12px; font-weight: 600; }
.bfr-diagnosis dd { font-size: 15px; line-height: 1.5; color: var(--color-text); }
.bfr-severity { font-size: 16px; letter-spacing: 2px; color: var(--color-brick); }
.bfr-severity-label { font-size: 14px; color: var(--color-text); margin-left: 8px; }

/* ---------- MOBILE ---------- */
@media (max-width: 800px) {
  .bfr-hero-grid, .bfr-form-grid, .bfr-card-grid--2, .bfr-card-grid--3, .bfr-card-grid--4, .bfr-testimonials, .bfr-footer-grid, .bfr-diagnosis, .bfr-section-split, .bfr-section-split--left { grid-template-columns: 1fr; }
  .bfr-section-split--left .bfr-section-image { order: 0; }
  .bfr-hero h1 { font-size: 36px; }
  .bfr-section h2 { font-size: 28px; }
  .bfr-cta-pair { flex-direction: column; align-items: stretch; }
  .bfr-btn { text-align: center; }
  .bfr-footer-bottom { flex-direction: column; }

  /* Mobile header layout: logo + hamburger + call CTA on row 1; nav drops below when toggled */
  .bfr-header { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .bfr-logo { flex: 0 0 auto; }
  .bfr-header-cta { padding: 8px 14px; font-size: 14px; order: 2; margin-left: auto; }
  .bfr-menu-button { display: flex; order: 3; margin-left: 8px; }
  .bfr-nav { display: none; flex-direction: column; width: 100%; gap: 0; order: 4; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-border); }
  .bfr-menu-toggle:checked ~ .bfr-nav { display: flex; }
  .bfr-nav a { padding: 14px 4px; border-bottom: 1px solid var(--color-border); font-size: 17px; }
  .bfr-nav a:last-child { border-bottom: none; }

  /* Hamburger morphs to X when checked */
  .bfr-menu-toggle:checked ~ .bfr-menu-button .bfr-menu-bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
  .bfr-menu-toggle:checked ~ .bfr-menu-button .bfr-menu-bar:nth-child(2) { opacity: 0; }
  .bfr-menu-toggle:checked ~ .bfr-menu-button .bfr-menu-bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

  /* Show persistent bottom CTA, lift body so content isn't covered */
  .bfr-mobile-cta { display: flex; }
  body { padding-bottom: 60px; }
}
