/* /en/basement/repair - Basement Repair L3 intersection page */
const BSR_TOP = [
  [
    "01",
    "how to fix a leaking basement wall",
    "110,000",
    "Intermediate",
    "1-2 days",
    "$45-$240",
    "https://images.unsplash.com/photo-1513694203232-719a280e022f?w=1500&q=84",
    "The basement repair query that matters most because water turns every other basement project into a liability. Start outside, read the crack, dry the wall, then choose the repair.",
    "Read the leaking wall guide",
    "/en/basement/repair/how-to-fix-a-leaking-basement-wall/"
  ],
  [
    "02",
    "how to repair a foundation crack",
    "90,500",
    "Intermediate",
    "3-5 hrs",
    "$35-$180",
    "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1500&q=84",
    "A hairline shrinkage crack, a stair-step masonry crack, and an active structural crack are not the same problem. The repair starts with diagnosis, not epoxy.",
    "Read the foundation crack guide",
    "/en/basement/repair/how-to-repair-a-foundation-crack/"
  ],
  [
    "03",
    "how to fix a sump pump that stopped working",
    "74,000",
    "Beginner",
    "45-90 min",
    "$0-$350",
    "https://images.unsplash.com/photo-1504307651254-35680f356dfd?w=1500&q=84",
    "Float switch, power, discharge line, check valve, pit debris. Most sump failures are small, but the consequence of ignoring them is not small.",
    "Read the sump pump repair guide",
    "/en/basement/repair/how-to-fix-a-sump-pump-that-stopped-working/"
  ],
  [
    "04",
    "how to stop basement floor drain backup",
    "60,500",
    "Intermediate",
    "1-3 hrs",
    "$10-$160",
    "https://images.unsplash.com/photo-1513694203232-719a280e022f?w=1500&q=84",
    "A backing-up floor drain can be a trap problem, a main-line problem, or a grading problem. The wrong fix only hides the smell for a week.",
    "Read the floor drain guide",
    "/en/basement/repair/how-to-stop-basement-floor-drain-backup/"
  ],
  [
    "05",
    "how to remove basement efflorescence and stop it returning",
    "49,500",
    "Beginner",
    "2 hrs",
    "$15-$60",
    "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1500&q=84",
    "White mineral bloom is a water map. Cleaning it is easy; understanding why it appeared is the repair that keeps the wall from blooming again.",
    "Read the efflorescence guide",
    "/en/basement/repair/how-to-remove-efflorescence/"
  ]
];
const BSR_TOOLS = [
  "Moisture meter",
  "Shop vacuum",
  "Hydraulic cement",
  "Epoxy injection kit",
  "Sump pump tester",
  "Drain auger",
  "Masonry brush",
  "Dehumidifier gauge"
];
const BSR_MATRIX = [
  "Leaking wall diagnosis",
  "Foundation crack repair",
  "Sump pump failure",
  "Floor drain backup",
  "Efflorescence removal",
  "Water heater leak cleanup",
  "Rim joist air leak",
  "Mold spot repair",
  "Stair tread repair",
  "Utility sink leak"
];
const BSR_MISTAKES = [
  "Sealing the inside wall before checking gutters and grading outside",
  "Calling every foundation crack cosmetic because it is thin",
  "Replacing the sump pump before checking the float switch",
  "Pouring chemical cleaner into a floor drain with a dry trap",
  "Painting over efflorescence and calling it waterproofing",
  "Starting drywall or flooring before the basement has stayed dry through rain"
];
const BSR_ESSAY = [
  "Basement repair is not glamorous, which is exactly why it matters. This is the room where problems get hidden by darkness, boxes, utility shelves, and the habit of only going downstairs when you need the holiday bin. By the time a basement problem looks dramatic, the water has usually been working quietly for months.",
  "The rule is simple: water first. Before framing, flooring, paint, shelves, or a finished ceiling, the basement has to prove it can stay dry. The best basement repair page starts there because everything else below grade depends on it.",
  "Repair work in a basement is part diagnosis, part discipline. You are reading stains, cracks, smells, pump cycles, mineral deposits, soft drywall, and the way the room feels after a storm. The fix is rarely one product. It is a chain: outside water control, inside drainage, dry materials, then finish."
];

const bsrBg = (url) => ({ backgroundImage: 'url("' + url + '")' });

const BasementRepairHero = () => (
  <section className="bsr-hero">
    <div className="img" style={bsrBg("https://images.unsplash.com/photo-1513694203232-719a280e022f?w=2400&q=85")} />
    <div className="bsr-mast">
      <span className="crumb"><a href="/">Home</a> / <a href="/en/basement/">Basement</a> / Repair</span>
      <span className="ctr">The Basement Repair Edition</span>
      <span className="right">No. 07 / Spring 2026</span>
    </div>
    <div className="bsr-cover">
      <div>
        <div className="eyebrow">Repair / Basement / Field Guide</div>
        <h1>Fix the room that fails quietly.</h1>
      </div>
      <div>
        <p className="deck">Leaks, cracks, sump pumps, floor drains, mineral bloom, musty air, and the water problems that decide whether the basement can ever become finished space.</p>
        <div className="meta">
          <div><span className="k">Section</span><span className="v">Basement / Repair</span></div>
          <div><span className="k">Guides</span><span className="v">24 total</span></div>
          <div><span className="k">First rule</span><span className="v">Water first</span></div>
          <div><span className="k">Updated</span><span className="v">May 2026</span></div>
        </div>
      </div>
    </div>
  </section>
);

const BasementRepairTop5 = () => (
  <section className="bsr-top5">
    <div className="bsr-wrap">
      <div className="section-folio"><span>The Charts / Top 5 Basement Repair Searches</span><span className="pg">PG. 02</span></div>
      <div className="bsr-head">
        <div>
          <h2>The five repairs that decide the whole basement.</h2>
          <p className="deck">Basement repair is not a cosmetic lane. These are the problems that decide whether finishing, flooring, storage, and decorating are even allowed to begin.</p>
        </div>
        <div className="legend">
          <span><i style={{ background: 'var(--bsrcopper)' }} /> Difficulty</span>
          <span><i style={{ background: 'var(--bsrblue)' }} /> Time</span>
          <span><i style={{ background: 'var(--bsrmoss)' }} /> Materials</span>
        </div>
      </div>
      <div className="bsr-top-list">
        {BSR_TOP.map((t) => (
          <article className="bsr-top-row" key={t[0]}>
            <div className="rank">No. {t[0]}</div>
            <a className="bsr-top-photo" href={t[9]} style={bsrBg(t[6])} aria-label={t[1]}></a>
            <div className="query">
              <h3>{t[1]}</h3>
              <p>{t[7]}</p>
              <a href={t[9]} className="read">{t[8]}</a>
            </div>
            <div className="stats">
              <div className="stat"><span className="k">Monthly searches</span><span className="v">{t[2]}</span></div>
              <div className="stat"><span className="k">Difficulty</span><span className="v">{t[3]}</span></div>
              <div className="stat"><span className="k">Time</span><span className="v">{t[4]}</span></div>
              <div className="stat"><span className="k">Materials</span><span className="v">{t[5]}</span></div>
            </div>
          </article>
        ))}
      </div>
    </div>
  </section>
);

const BasementRepairPhotoSpread = () => (
  <section className="bsr-photo-spread">
    <div className="bsr-wrap">
      <div className="section-folio"><span>Photo Spread / Below-Grade Repair Notes</span><span className="pg">PG. 07</span></div>
      <div className="bsr-photo-grid">
        {BSR_TOP.slice(0, 4).map((item, i) => (
          <article className={'bsr-photo-card c' + (i + 1)} key={item[0]}>
            <a className="photo" href={item[9]} style={bsrBg(item[6].replace('w=1500', 'w=1900'))} aria-label={item[1]}></a>
            <div className="copy">
              <span>{item[1]}</span>
              <h3>{item[8]}</h3>
              <p>{item[7]}</p>
            </div>
          </article>
        ))}
      </div>
    </div>
  </section>
);

const BasementRepairEssay = () => (
  <section className="bsr-essay">
    <div className="bsr-essay-wrap">
      <div className="section-folio"><span>Editor's Note / Basement, Repaired</span><span className="pg">PG. 08</span></div>
      <div className="bsr-essay-grid">
        <aside className="bsr-essay-side">
          <h2>Water first. Everything else after.</h2>
          <div className="by">By the Editors / 5 min read</div>
          <div className="stat-list">
            <div className="row"><span>Guides</span><strong>24</strong></div>
            <div className="row"><span>Most searched</span><strong>Leaking wall</strong></div>
            <div className="row"><span>Most urgent</span><strong>Sump failure</strong></div>
            <div className="row"><span>Do not cover</span><strong>Wet walls</strong></div>
          </div>
        </aside>
        <div className="bsr-essay-body">
          <p className="dropcap">{BSR_ESSAY[0]}</p>
          <p>{BSR_ESSAY[1]}</p>
          <div className="pull">A dry basement can become a room. A wet basement becomes a bill.</div>
          <p>{BSR_ESSAY[2]}</p>
        </div>
      </div>
    </div>
  </section>
);

const BasementRepairTools = () => (
  <section className="bsr-tools">
    <div className="bsr-wrap">
      <div className="section-folio"><span>The Kit / Moisture and masonry tools</span><span className="pg">PG. 10</span></div>
      <div className="bsr-tools-head">
        <h2>Eight tools that make basement repair less like guessing.</h2>
        <p>Basement repair is diagnosis-heavy. The right tool tells you whether the wall is wet, the pump is working, and the drain is actually clear.</p>
      </div>
      <div className="bsr-tools-grid">
        {BSR_TOOLS.map((tool, i) => (
          <div className="bsr-tool" key={tool}>
            <span>{String(i + 1).padStart(2, '0')}</span>
            <h3>{tool}</h3>
            <p>Useful because below-grade repairs fail when moisture gets hidden instead of measured, moved, or removed.</p>
          </div>
        ))}
      </div>
    </div>
  </section>
);

const BasementRepairMatrix = () => (
  <section className="bsr-matrix">
    <div className="bsr-wrap">
      <div className="section-folio"><span>The Menu / Ranked by urgency</span><span className="pg">PG. 12</span></div>
      <div className="bsr-matrix-head">
        <h2>Ten basement repairs, ranked by what they prevent.</h2>
        <p>The first jobs stop water. The next jobs restore the surfaces water already touched. The last jobs make the room ready for the next lane.</p>
      </div>
      <div className="bsr-matrix-table">
        <div className="bsr-matrix-row head"><span>Repair</span><span>Risk</span><span>Time</span><span>Payoff</span><span></span></div>
        {BSR_MATRIX.map((project, i) => (
          <div className="bsr-matrix-row" key={project}>
            <span className="proj"><b>{String(i + 1).padStart(2, '0')}</b>{project}</span>
            <span>{i < 3 ? 'High' : i < 7 ? 'Medium' : 'Low'}</span>
            <span>{i < 3 ? 'Today' : i < 7 ? 'Weekend' : 'Later'}</span>
            <span className="dots"><i></i><i></i><i></i><i className={i > 4 ? '' : 'off'}></i><i className={i > 7 ? '' : 'off'}></i></span>
            <span><a href="/en/repair/basement/">Open</a></span>
          </div>
        ))}
      </div>
    </div>
  </section>
);

const BasementRepairMistakes = () => (
  <section className="bsr-mistakes">
    <div className="bsr-wrap">
      <div className="section-folio"><span>Do Not Skip / Below-grade failures</span><span className="pg">PG. 14</span></div>
      <div className="bsr-mistakes-head">
        <h2>The mistakes that bury the real problem.</h2>
        <span>{BSR_MISTAKES.length}</span>
      </div>
      <div className="bsr-mistakes-grid">
        {BSR_MISTAKES.map((m, i) => (
          <article className="bsr-mistake" key={m}>
            <div className="n">{String(i + 1).padStart(2, '0')}</div>
            <h3>{m}</h3>
            <p>If the cause is still active, the repair is decoration. Below grade, decoration does not hold.</p>
          </article>
        ))}
      </div>
    </div>
  </section>
);

const BasementRepairRelated = () => (
  <section className="bsr-related">
    <div className="bsr-related-wrap">
      <div className="bsr-related-col">
        <h3>Other things to do in the basement.</h3>
        <div className="bsr-related-list">
          {[
            ['01', 'Repair the basement', '24 guides', '/en/basement/repair/', true],
            ['02', 'Install in the basement', '22 guides', '/en/basement/install/'],
            ['03', 'Build for the basement', '25 guides', '/en/basement/build/'],
            ['04', 'Clean the basement', '12 guides', '/en/basement/clean/'],
            ['05', 'Organize the basement', '18 guides', '/en/basement/organize/'],
            ['06', 'Decorate the basement', '8 guides', '/en/basement/decorate/'],
          ].map(r => <a href={r[3]} className={'row ' + (r[4] ? 'current' : '')} key={r[0]}><span className="n">{r[0]}</span><span className="t">{r[1]}</span><span className="ct">{r[2]}</span></a>)}
        </div>
      </div>
      <div className="bsr-related-col">
        <h3>Repair in other rooms.</h3>
        <div className="bsr-related-list">
          {['kitchen', 'bathroom', 'bedroom', 'living-room', 'garage'].map((room, i) => (
            <a href={'/en/repair/' + room + '/'} className="row" key={room}><span className="n">{String(i + 1).padStart(2, '0')}</span><span className="t">{room.replace('-', ' ')}</span><span className="ct">repair lane</span></a>
          ))}
        </div>
      </div>
    </div>
  </section>
);

const BasementRepairColophon = () => (
  <section className="bsr-colophon">
    <span>HowTo: Home Edition / Basement</span>
    <h2>24 ways to repair the room below everything.</h2>
    <p>Built as a static editorial L3 page with a full crawler body, visible photography, and a real repair menu.</p>
    <a href="/en/basement/" className="go">Back to Basement</a>
  </section>
);

window.BasementRepairHero = BasementRepairHero;
window.BasementRepairTop5 = BasementRepairTop5;
window.BasementRepairPhotoSpread = BasementRepairPhotoSpread;
window.BasementRepairEssay = BasementRepairEssay;
window.BasementRepairTools = BasementRepairTools;
window.BasementRepairMatrix = BasementRepairMatrix;
window.BasementRepairMistakes = BasementRepairMistakes;
window.BasementRepairRelated = BasementRepairRelated;
window.BasementRepairColophon = BasementRepairColophon;
