/* Sam's article — How to Hang Something Heavy Without Asking Anyone for Help
 * Renders into #render-target. Source content: scripts/insert-sam-post.ts.
 * Format: Sam editorial (patchhole.jsx) — Hero, Lede, WhatYouNeed, Steps, HotTakes, Redo, Comments, Signoff.
 */

const { useState } = React;

const SamSays = ({ children }) => (
  <div className="sa-step-says">
    <span className="who">— Sam</span>
    <p>{children}</p>
  </div>
);

/* ============ CRUMBS ============ */
const Crumbs = () => (
  <nav className="sa-crumbs" aria-label="Breadcrumb">
    <div className="l">
      <a href="/">Home</a>
      <span>/</span>
      <a href="/en/contributors/sam/">Sam</a>
      <span>/</span>
      <span>How-to</span>
      <span>/</span>
      <span style={{ color: "#EFE5CF" }}>Hang something heavy</span>
    </div>
    <div className="r">
      <span>Issue 04 · Spring '26</span>
      <span className="by">written by Sam ✦</span>
    </div>
  </nav>
);

/* ============ HERO ============ */
const Hero = () => (
  <section className="sa-hero">
    <div
      className="img"
      style={{
        backgroundImage:
          "url('https://images.unsplash.com/photo-1581244277943-fe4a9c777189?w=2000&q=80')",
      }}
    />
    <div className="sa-hero-wrap">
      <div>
        <div className="sa-hero-kicker">
          <span>How-to</span>
          <span className="dot">●</span>
          <span>No. 02</span>
          <span className="dot">●</span>
          <span className="sig">written by Sam</span>
        </div>
        <h1>
          How to hang <em>something heavy</em> without asking anyone for help
        </h1>
        <p className="standfirst">
          The wall is not going to win. Stud finder, the right anchor, a level, a pre-drilled pilot hole, and the discipline to step back before you decide it's crooked. Six steps, 45 minutes, no second person required.
        </p>
      </div>
      <div className="sa-hero-side">
        <div className="row">
          <span>Time</span>
          <span className="v">~45 min <span style={{opacity:0.5}}>+ patching, if</span></span>
        </div>
        <div className="row">
          <span>Cost</span>
          <span className="v">$8–$15</span>
        </div>
        <div className="row">
          <span>Skill</span>
          <span className="v">Stubbornly doable</span>
        </div>
        <div className="row">
          <span>Mess factor</span>
          <span className="v warn">●○○ Dust</span>
        </div>
        <div className="row">
          <span>Updated</span>
          <span className="v">Spring '26</span>
        </div>
      </div>
    </div>
    <div className="sa-hero-scribble">
      no second person. <u>promise</u>.
      <svg viewBox="0 0 60 30" fill="none">
        <path d="M2 22 C 12 8, 28 4, 56 12" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
        <path d="M48 6 L 56 12 L 50 20" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" fill="none" />
      </svg>
    </div>
  </section>
);

/* ============ LEDE ============ */
const Lede = () => (
  <section className="sa-lede">
    <div className="sa-lede-wrap">
      <aside className="sa-lede-side">
        <div className="marker">In this one</div>
        <ul>
          <li>The mirror has been moving</li>
          <li>What you actually need</li>
          <li>The 6 steps</li>
          <li>Hot takes</li>
          <li>What I'd do differently</li>
        </ul>
      </aside>

      <div className="sa-lede-body">
        <p className="dropcap">
          You've been moving that mirror from room to room for three weeks because you can't decide where it goes. You've decided. <em>It goes there.</em> On that wall. Today.
        </p>

        <p>
          And you're not asking anyone to help you do it. You don't need a second person. You need a stud finder, the right anchor, a level, and the discipline to <strong>step back before you decide it's crooked.</strong> The whole project takes forty-five minutes if you do it right and two hours if you have to patch a hole — and we're going to do it right.
        </p>

        <div className="sa-pullquote">
          <p>
            Drywall alone won't hold a screw under any real load. The wall is gypsum and paper. The studs are wood. Find the wood, or use a real anchor.
          </p>
        </div>

        <p>
          That sentence is the whole article. The rest is just how to find the wood, what counts as a real anchor, and why you should buy a four-dollar level instead of trusting your eyes.
        </p>
      </div>

      <aside className="sa-margin">
        <span className="lab">Sam's note</span>
        <h4>Before you drill anywhere</h4>
        <p>
          If your house was built before 1980, the wall might be plaster and lath, not drywall. <em>Different anchors.</em> Different rules. If knocking sounds dull-thud-dull-thud all the way across, that's plaster — stop and look up plaster anchors.
        </p>
      </aside>
    </div>
  </section>
);

/* ============ WHAT YOU NEED ============ */
const WhatYouNeed = () => (
  <section className="sa-need">
    <div className="sa-need-wrap">
      <div>
        <div className="sa-need-head">§ 01 / Tools</div>
        <h2>
          What you <em>actually</em> need
        </h2>
        <p className="body">
          Total budget: <strong>$8–$15</strong> in materials. Most of the cost is the level — and the level is the thing you'll use on every project for the rest of your life. <strong>Buy the four-dollar level.</strong>
        </p>

        <div className="sa-need-dont">
          <span className="lab">Don't bother with</span>
          <ul>
            <li>
              The plastic anchors that came in the box
              <span className="why">Decorative at best. Toggle bolts are the move.</span>
            </li>
            <li>
              Eyeballing the level
              <span className="why">You will know. Every day. For years.</span>
            </li>
            <li>
              Hammering a nail and hoping
              <span className="why">For a frame under two pounds, fine. For anything heavy, no.</span>
            </li>
          </ul>
        </div>
      </div>

      <ul className="sa-need-list">
        <li>
          <span className="item">
            Stud finder (or your knuckle)
            <span className="why">$8–15 for the cheapest. Or use the knuckle test for free.</span>
          </span>
          <span className="qty">×1</span>
        </li>
        <li>
          <span className="item">
            Drill (cordless, any size)
            <span className="why">Borrow if you don't own one. Don't buy a $300 one for hanging a mirror.</span>
          </span>
          <span className="qty">×1</span>
        </li>
        <li>
          <span className="item">
            Bubble level (24" or longer)
            <span className="why">$4 at any hardware store. Best four bucks you'll spend on this project.</span>
          </span>
          <span className="qty">×1</span>
        </li>
        <li>
          <span className="item">
            Toggle bolts OR threaded drywall anchors
            <span className="why">Rated for double the weight you're hanging. Read the label.</span>
          </span>
          <span className="qty">×2–4</span>
        </li>
        <li>
          <span className="item">
            One good screw, length matched to your anchor
            <span className="why">Comes with the anchor packet usually.</span>
          </span>
          <span className="qty">×1</span>
        </li>
        <li>
          <span className="item">
            Pencil
            <span className="why">For marking studs and the spot. Not a Sharpie. Pencil.</span>
          </span>
          <span className="qty">×1</span>
        </li>
        <li>
          <span className="item">
            Coffee
            <span className="why">Non-negotiable.</span>
          </span>
          <span className="qty">×1 mug</span>
        </li>
      </ul>
    </div>
  </section>
);

/* ============ STEPS ============ */
const STEPS = [
  {
    n: "01",
    phase: "Find · 5 min",
    title: "Find the stud first. Always.",
    flip: false,
    body: (
      <>
        <p>
          Knock along the wall with your knuckle until the sound changes from <em>hollow</em> to <em>solid</em>. That's the stud. That's your best friend right now. A stud finder works too — but honestly your knuckle is free and already attached to you.
        </p>
        <p>
          Studs are typically <strong>sixteen inches apart on center.</strong> Once you find one, you can usually find the next without checking. Mark each one in pencil so you don't lose track when you start drilling.
        </p>
      </>
    ),
    tip: { lab: "Knuckle vs stud finder", text: "The knuckle test is faster and free, but stud finders are more reliable in plaster walls and walls with insulation. If you're new to this, buy the $10 stud finder. It pays for itself the first time it saves you a hole." },
    fig: {
      img: "https://images.unsplash.com/photo-1503602642458-232111445657?w=1200&q=80",
      tag: "Fig 01 · The stud",
      cap: "wood, behind the gypsum.",
    },
    says: "Mark every stud you find, not just the one you're using. You'll need them next time.",
  },
  {
    n: "02",
    phase: "Anchor · 5 min",
    title: "If there's no stud where you need it, use the right anchor.",
    flip: true,
    body: (
      <>
        <p>
          Not all wall anchors are the same. The little plastic ones that come in the box with the thing you bought are usually <em>garbage</em>. Get a toggle bolt or a threaded drywall anchor rated for more weight than whatever you're hanging.
        </p>
        <p>
          <strong>Double it.</strong> Trust nothing. The label on the anchor tells you the rated load — read it before you buy. A heavy mirror weighs more than you think. A mirror plus a kid pulling on it weighs more still.
        </p>
      </>
    ),
    warn: { lab: "Heads up", text: "If you're hanging a coat hook that will hold real coats, go into a stud. No anchor. Coat hooks fail dramatically — they get more weight than you ever expect, and the failure mode is the hook ripping a chunk of wall out." },
    fig: {
      img: "https://images.unsplash.com/photo-1581244277943-fe4a9c777189?w=1200&q=80",
      tag: "Fig 02 · The anchor",
      cap: "metal, threaded, rated.",
    },
  },
  {
    n: "03",
    phase: "Level · 1 min",
    title: "Use a level.",
    flip: false,
    body: (
      <>
        <p>
          I know you think you can eyeball it. <em>You cannot.</em> Nobody can. <strong>Use the level.</strong> Spend the extra forty seconds. You will stare at that thing every single day and you will know if it's a half-degree off.
        </p>
        <p>
          The level is four bucks at any hardware store. It is the single best four dollars you can spend on this project. If you don't own one yet, buy one before you do anything else on this article.
        </p>
      </>
    ),
    tip: { lab: "Phone level apps", text: "They work, but they're slower than a real bubble level and they require you to hold the phone steady. The bubble level is faster, more accurate, and doesn't need a charge. Get the bubble level." },
    fig: {
      img: "https://images.unsplash.com/photo-1503602642458-232111445657?w=1200&q=80",
      tag: "Fig 03 · The level",
      cap: "the cheapest insurance you'll ever buy.",
    },
    says: "Hold the level on top of the mirror frame, not on the wall. The mirror is what people will see. The wall is what people will not.",
  },
  {
    n: "04",
    phase: "Drill · 2 min",
    title: "Pre-drill the pilot hole.",
    flip: true,
    body: (
      <>
        <p>
          Don't force the screw straight into drywall. Pre-drill a pilot hole slightly smaller than your screw. <em>It goes in cleaner. It holds better. The wall respects it more.</em>
        </p>
        <p>
          If you're using an anchor, the anchor box tells you what drill bit to use — match it exactly. If you're going into a stud, a 1/16-inch pilot hole is plenty.
        </p>
      </>
    ),
    warn: { lab: "If you hit something hard", text: "Stop. Immediately. That's either a pipe or a wire and neither of those is your friend today. Pull out, move over by four inches, try again. The wall has stuff inside it and the stuff inside it is more important than the mirror." },
    fig: {
      img: "https://images.unsplash.com/photo-1572297870735-d68a30c0e603?w=1200&q=80",
      tag: "Fig 04 · The pilot",
      cap: "small, deliberate, on purpose.",
    },
  },
  {
    n: "05",
    phase: "Hang · 5 min",
    title: "Hang it. Step back. Don't touch it.",
    flip: false,
    body: (
      <>
        <p>
          Hang the thing. Step back. <em>Look at it for ten seconds before you decide it's crooked.</em>
        </p>
        <p>
          It is probably not crooked. You are just not used to it being there yet. If it's still bothering you after ten seconds and a level confirms a tilt, then adjust. <strong>If you adjusted because it "felt" off and the level says it's fine, you've made it actually crooked.</strong> Trust the level over your eyes.
        </p>
      </>
    ),
    tip: { lab: "Take a photo", text: "From across the room, with flash on. The camera will see what your eyes can't — slight tilts, parallax illusions, dust. Adjust based on the photo, not the in-person view. The photo is what people will see when they walk in." },
    fig: {
      img: "https://images.unsplash.com/photo-1556909114-f6e7ad7d3136?w=1200&q=80",
      tag: "Fig 05 · The hang",
      cap: "ten-second rule. always.",
    },
    says: "If you adjust three times, stop. Walk away. Make coffee. Come back in five minutes. Your eyes recalibrate.",
  },
  {
    n: "06",
    phase: "Done",
    title: "The victory moment.",
    flip: true,
    body: (
      <>
        <p>
          It's up. It's level. Nothing fell. <em>You did not ask anyone for help and you didn't need to.</em>
        </p>
        <p>
          <strong>That's the whole thing.</strong> Take a photo. Send it to whoever doubted you. Move on with your life. There is something specifically satisfying about hanging a heavy thing alone — bigger than the project, smaller than a religious experience. Sit with it for a second.
        </p>
      </>
    ),
    fig: {
      img: "https://images.unsplash.com/photo-1600585154526-990dced4db0d?w=1200&q=80",
      tag: "Fig 06 · The victory",
      cap: "the wall did not win.",
    },
    says: "If it's a mirror, the first thing you see in it is your face after hanging a mirror by yourself. That's a good face.",
  },
];

const Step = ({ data }) => (
  <article className={`sa-step ${data.flip ? "flip" : ""}`}>
    <div className="sa-step-text">
      <div className="sa-step-meta">
        <span className="sa-step-num">{data.n}</span>
        <span className="sa-step-phase">{data.phase}</span>
      </div>
      <h3>{data.title}</h3>
      <div className="sa-step-body">{data.body}</div>
      {data.tip && (
        <div className="sa-step-tip">
          <span className="lab">{data.tip.lab}</span>
          <p>{data.tip.text}</p>
        </div>
      )}
      {data.warn && (
        <div className="sa-step-warn">
          <span className="lab">{data.warn.lab}</span>
          <p>{data.warn.text}</p>
        </div>
      )}
    </div>
    <figure className="sa-step-fig">
      <div className="frame">
        <span className="tag">{data.fig.tag}</span>
        <img src={data.fig.img} alt="" loading="lazy" />
      </div>
      <figcaption>{data.fig.cap}</figcaption>
      {data.says && <SamSays>{data.says}</SamSays>}
    </figure>
  </article>
);

const Steps = () => (
  <section className="sa-steps">
    <div className="sa-steps-wrap">
      <header className="sa-steps-head">
        <h2>
          The <em>six</em> steps
        </h2>
        <span className="count">06 STEPS · ≈45 MIN ACTIVE</span>
      </header>
      {STEPS.map((s) => (
        <Step key={s.n} data={s} />
      ))}
    </div>
  </section>
);

/* ============ HOT TAKES ============ */
const HotTakes = () => (
  <section className="sa-hottakes">
    <div className="sa-hottakes-wrap">
      <header className="sa-hottakes-head">
        <span className="lab">Sam's hot takes</span>
        <h2>
          Things I'm <em>tired</em> of seeing
        </h2>
      </header>
      <div className="sa-hottakes-list">
        <div className="sa-take">
          <div className="num">i.</div>
          <h3>Trusting the plastic anchor in the box</h3>
          <p>
            They came free with the thing you bought. They are free for a reason. Toggle bolts are two dollars. The mirror is more than two dollars. Math.
          </p>
        </div>
        <div className="sa-take">
          <div className="num">ii.</div>
          <h3>Hanging without finding the stud first</h3>
          <p>
            Even if you end up using an anchor, knowing where the studs are tells you where the <em>not</em>-studs are. Drilling into a pipe because you skipped the stud check is a thousand-dollar mistake.
          </p>
        </div>
        <div className="sa-take">
          <div className="num">iii.</div>
          <h3>"I'll just use a nail"</h3>
          <p>
            For a postcard, fine. For anything that breaks if it falls, no. Nails pull straight out under load. Screws thread. Threading is the whole point.
          </p>
        </div>
        <div className="sa-take">
          <div className="num">iv.</div>
          <h3>Asking someone to "hold this for a sec"</h3>
          <p>
            They can't read a level from your angle. They get tired in eight seconds. They want to be doing literally anything else. <em>Hang it yourself.</em> That's what this article is about.
          </p>
        </div>
      </div>
    </div>
  </section>
);

/* ============ WHAT I'D DO DIFFERENTLY ============ */
const Redo = () => (
  <section className="sa-redo">
    <div className="sa-redo-wrap">
      <aside className="sa-redo-side">
        what I'd do
        <br />
        <em style={{ color: "#D97A4F" }}>differently</em>
        <svg viewBox="0 0 80 60" fill="none">
          <path d="M5 12 C 25 6, 55 14, 70 38" stroke="#91A86C" strokeWidth="2" strokeLinecap="round" />
          <path d="M64 30 L 70 38 L 60 42" stroke="#91A86C" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" fill="none" />
        </svg>
      </aside>
      <div>
        <h2>
          What I'd do <em>differently</em> next time
        </h2>
        <p>
          The first heavy thing I hung alone, I used the plastic anchors that came in the box. Within a month the mirror was tilting. Within two months it was on the floor. <strong>The plastic anchors that came in the box are decorative.</strong> They are not load-bearing. Use a real anchor.
        </p>
        <p>
          What I'd tell <strong>past me</strong>: buy a longer level than you think you need. The 24-inch level is the minimum. The 48-inch is better. You'll use it on every shelf, every gallery wall, every curtain rod for the rest of your life. The longer the level, the more accurate the read.
        </p>
        <p>
          And I'd put the photo step in front of the adjust step. Once you've adjusted by hand twice, your eyes lie to you. The photo doesn't lie. <em>Trust the photo.</em>
        </p>
      </div>
    </div>
  </section>
);

/* ============ COMMENTS ============ */
const Comments = () => (
  <section className="sa-comments">
    <div className="sa-comments-wrap">
      <header className="sa-comments-head">
        <h2>
          From the <em>readers</em>
        </h2>
        <span className="meta">19 LETTERS · MIRRORS, MOSTLY</span>
      </header>

      <div className="sa-comment">
        <div className="who">
          <span className="n">James T.</span>
          <span>Brooklyn, NY</span>
          <span className="when">1 week ago</span>
        </div>
        <div className="body">
          <p>
            I'm 47 and I have never owned a drill. Your "just buy the cheapest one" essay convinced me to try, and I hung shelves in my daughter's room. She thinks I'm a wizard now.
          </p>
          <div className="sa-reply">
            <span className="lab">Sam replied</span>
            <p>
              James you ARE a wizard. Don't tell her the trick.
              <span className="sig">— S</span>
            </p>
          </div>
        </div>
      </div>

      <div className="sa-comment">
        <div className="who">
          <span className="n">Priya K.</span>
          <span>Toronto, ON</span>
          <span className="when">2 weeks ago</span>
        </div>
        <div className="body">
          <p>
            Question — I followed this guide but my walls are plaster and lath, not drywall. Different anchors? Or is the whole approach wrong?
          </p>
          <div className="sa-reply">
            <span className="lab">Sam replied</span>
            <p>
              plaster gets its own guide — coming next month. Hold off, you're right to be cautious. Plaster anchors are a different animal.
              <span className="sig">— S</span>
            </p>
          </div>
        </div>
      </div>

      <div className="sa-comment">
        <div className="who">
          <span className="n">Reggie B.</span>
          <span>Atlanta, GA</span>
          <span className="when">3 weeks ago</span>
        </div>
        <div className="body">
          <p>
            Hung a 40-pound mirror over the entryway console alone. Toggle bolts, two of them, into the drywall above the door frame. Solid. Wife came home and assumed I'd gotten help. I had not.
          </p>
        </div>
      </div>

      <div className="sa-comment">
        <div className="who">
          <span className="n">Sara M.</span>
          <span>Seattle, WA</span>
          <span className="when">1 month ago</span>
        </div>
        <div className="body">
          <p>
            Drilled into a wire on my first attempt. The breaker tripped, no fire, no injury, but I had to call an electrician for $180 to fix the inside of the wall. Lesson: the "if you hit something hard, stop" rule is not a suggestion.
          </p>
        </div>
      </div>
    </div>
  </section>
);

/* ============ SIGNOFF ============ */
const Signoff = () => (
  <section className="sa-signoff">
    <div className="sa-signoff-wrap">
      <div>
        <h2>
          That's it. <em>Hang the thing.</em>
        </h2>
        <p>
          If you finished — or you're stuck halfway through holding a drill and second-guessing — send a photo. I read everything that comes in. Triumph photos preferred. Failure photos also welcome.
        </p>
        <div className="sig">— Sam</div>
        <div className="ctas" style={{ marginTop: 28 }}>
          <a href="/contact/" className="btn primary">
            Send a photo →
          </a>
          <a href="/en/contributors/sam/" className="btn ghost">
            More from Sam
          </a>
        </div>
      </div>
      <div className="sa-readnext">
        <span className="lab">Read next</span>
        <a href="/en/contributors/sam/how-to-refinish-a-thrifted-chair/">
          <span>Refinish a thrifted chair</span>
          <span className="m">3 HRS</span>
        </a>
        <a href="/en/install/living-room/">
          <span>Install × Living Room — mounts and hangs</span>
          <span className="m">HUB</span>
        </a>
        <a href="/en/install/bedroom/">
          <span>Install × Bedroom — shelves, frames, lights</span>
          <span className="m">HUB</span>
        </a>
        <a href="/en/contributors/sam/">
          <span>All of Sam's guides</span>
          <span className="m">PROFILE</span>
        </a>
      </div>
    </div>
  </section>
);

/* ============ ROOT ============ */
const Article = () => (
  <div className="sa">
    <Crumbs />
    <Hero />
    <Lede />
    <WhatYouNeed />
    <Steps />
    <HotTakes />
    <Redo />
    <Comments />
    <Signoff />
  </div>
);

ReactDOM.createRoot(document.getElementById("render-target")).render(<Article />);
