/* Sam's article - How to Paint Exposed Attic Rafters
 * Format: Sam editorial - Hero, Lede, WhatYouNeed, Steps, HotTakes, Redo, Signoff.
 */

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

const heroImage = "https://images.pexels.com/photos/5691630/pexels-photo-5691630.jpeg?auto=compress&cs=tinysrgb&w=2000";

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" }}>Paint exposed attic rafters</span>
    </div>
    <div className="r">
      <span>Issue 04 | Spring '26</span>
      <span className="by">written by Sam</span>
    </div>
  </nav>
);

const Hero = () => (
  <section className="sa-hero">
    <div className="img" style={{ backgroundImage: `url('${heroImage}')` }} />
    <div className="sa-hero-wrap">
      <div>
        <div className="sa-hero-kicker">
          <span>How-to</span>
          <span className="dot">*</span>
          <span>No. 03</span>
          <span className="dot">*</span>
          <span className="sig">written by Sam</span>
        </div>
        <h1>
          How to paint <em>exposed attic rafters</em>
        </h1>
        <p className="standfirst">
          The ceiling you've been ignoring is actually the best design move in the room. Prep the wood, seal the knots, point the roller the right way, and let the rafters look like a decision.
        </p>
      </div>
      <div className="sa-hero-side">
        <div className="row">
          <span>Time</span>
          <span className="v">2 days</span>
        </div>
        <div className="row">
          <span>Cost</span>
          <span className="v">$80-$220</span>
        </div>
        <div className="row">
          <span>Skill</span>
          <span className="v">Awkward but doable</span>
        </div>
        <div className="row">
          <span>Mess factor</span>
          <span className="v warn">Overhead paint</span>
        </div>
        <div className="row">
          <span>Updated</span>
          <span className="v">Spring '26</span>
        </div>
      </div>
    </div>
    <div className="sa-hero-scribble">
      look up. <u>that's the room.</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>
);

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>Why rafters are worth painting</li>
          <li>What to check before buying paint</li>
          <li>Prep, shellac, masking</li>
          <li>Brush first, roller second</li>
          <li>The two-day truth</li>
        </ul>
      </aside>

      <div className="sa-lede-body">
        <p className="dropcap">
          There's a version of this project where you spend a weekend up a ladder, end up with paint in your hair, and wonder why you started.
        </p>
        <p>
          There's another version where you step back on Sunday afternoon and genuinely think your attic looks better than your living room. The difference is almost entirely prep. And knowing which direction to point the roller.
        </p>
        <div className="sa-pullquote">
          <p>
            Painted rafters make the architecture look like a choice. That is the whole magic trick.
          </p>
        </div>
        <p>
          Exposed rafters are the bones of the room. Dark paint can make them feel intentional and draw the eye up. White or cream can bounce light and clean the whole ceiling up. What does not work is pretending they are not there.
        </p>
      </div>

      <aside className="sa-margin">
        <span className="lab">Sam's note</span>
        <h4>Check moisture first</h4>
        <p>
          Water stains, soft wood, or an active leak make this a repair job before it becomes a paint job. Paint over moisture and you'll be back up there in eighteen months.
        </p>
      </aside>
    </div>
  </section>
);

const WhatYouNeed = () => (
  <section className="sa-need">
    <div className="sa-need-wrap">
      <div>
        <div className="sa-need-head">01 / Before the ladder</div>
        <h2>
          What you <em>actually</em> need
        </h2>
        <p className="body">
          Get this all in one trip. Nothing ruins momentum like standing halfway up a ladder and realizing the painter's tape is still in the car.
        </p>

        <div className="sa-need-dont">
          <span className="lab">Don't bother with</span>
          <ul>
            <li>
              Water-based primer for knots
              <span className="why">Shellac seals stains and knots. Water-based primer usually does not.</span>
            </li>
            <li>
              Shiny paint
              <span className="why">Flat or eggshell. Rafters do not need to glare at you.</span>
            </li>
            <li>
              Mid-gray
              <span className="why">It reads like a mistake. Go dark, or go light.</span>
            </li>
          </ul>
        </div>
      </div>

      <ul className="sa-need-list">
        <li>
          <span className="item">
            TSP cleaner or degreasing wood cleaner
            <span className="why">Attic grime is real, and paint does not stick to grime.</span>
          </span>
          <span className="qty">1</span>
        </li>
        <li>
          <span className="item">
            Stiff-bristle brush
            <span className="why">For dust, cobwebs, rough wood, and old residue.</span>
          </span>
          <span className="qty">1</span>
        </li>
        <li>
          <span className="item">
            80-grit sandpaper
            <span className="why">For knots, rough patches, and old drips.</span>
          </span>
          <span className="qty">Pack</span>
        </li>
        <li>
          <span className="item">
            Shellac-based primer
            <span className="why">This is the step people skip and regret.</span>
          </span>
          <span className="qty">1 gal</span>
        </li>
        <li>
          <span className="item">
            Drop cloths and painter's tape
            <span className="why">More than you think. The ceiling is directly above everything.</span>
          </span>
          <span className="qty">A lot</span>
        </li>
        <li>
          <span className="item">
            Brush, small roller, and extension pole
            <span className="why">Brush the corners. Roll the faces. Save your shoulders.</span>
          </span>
          <span className="qty">Set</span>
        </li>
        <li>
          <span className="item">
            Respirator
            <span className="why">Not just a dust mask. You are working overhead in an enclosed space.</span>
          </span>
          <span className="qty">1</span>
        </li>
      </ul>
    </div>
  </section>
);

const STEPS = [
  {
    n: "01",
    phase: "Inspect | 20 min",
    title: "Go up there with a flashlight first.",
    flip: false,
    body: (
      <>
        <p>
          Rafters are raw wood. That means porous, dusty, possibly oily from age, and almost certainly not primed. Knots bleed. Dust lifts. Old sealer causes adhesion problems you will not see until the paint starts peeling in strips.
        </p>
        <p>
          Also look between the rafters. Insulation batts, old wiring, HVAC runs, and loose blown-in insulation all affect how you mask and how careful you need to be.
        </p>
      </>
    ),
    warn: { lab: "Stop for moisture", text: "Water stains, soft wood, or evidence of a leak come first. Fix the moisture, then paint." },
    fig: { img: heroImage, tag: "Fig 01 | Look first", cap: "the ceiling tells you what kind of project this is." },
    says: "Do not admire it yet. Inspect it. Admiring comes after the second coat."
  },
  {
    n: "02",
    phase: "Clean + sand | 2-3 hrs",
    title: "Clean everything, then sand the trouble.",
    flip: true,
    body: (
      <>
        <p>
          Mix TSP with water according to the label, scrub the rafters down with a stiff brush, and let them dry completely. Dust, cobwebs, and years of attic grime need to come off before paint gets anywhere near this room.
        </p>
        <p>
          Sand knots, rough patches, old drips, and anything that will create a bump or bleed-through. You do not need to sand every inch. You do need to sand the problem spots.
        </p>
      </>
    ),
    tip: { lab: "Nail heads", text: "Check for protruding nails while you sand. Set them or pull them before they tear your roller." },
    fig: { img: "https://images.unsplash.com/photo-1589939705384-5185137a7f0f?w=1200&q=80", tag: "Fig 02 | Prep", cap: "boring work, visible result." }
  },
  {
    n: "03",
    phase: "Prime | 1-2 hrs",
    title: "Prime with shellac.",
    flip: false,
    body: (
      <>
        <p>
          Roll or brush shellac-based primer over every surface you are painting. This is the step people skip and regret. Shellac seals knots so they do not bleed yellow through your topcoat.
        </p>
        <p>
          It also gives the paint something to grip on old or porous wood. One coat is usually enough, and shellac dries fast, often under an hour.
        </p>
      </>
    ),
    warn: { lab: "Not water-based", text: "Water-based primer has its place. This is not that place. Shellac is doing the sealing job." },
    fig: { img: "https://images.unsplash.com/photo-1562259949-e8e7689d7828?w=1200&q=80", tag: "Fig 03 | Seal", cap: "primer is not optional here." },
    says: "The topcoat is the outfit. Primer is the tailoring. Nobody sees it, but everyone sees it."
  },
  {
    n: "04",
    phase: "Mask | 45 min",
    title: "Mask everything you are not painting.",
    flip: true,
    body: (
      <>
        <p>
          Tape off surfaces that meet the rafters: subfloor, drywall, trim, and anything else with a clean edge. If there are fixtures, pull them down or bag them.
        </p>
        <p>
          Do this before you open the topcoat. Once paint is open, your patience gets worse. Mask while you still care.
        </p>
      </>
    ),
    tip: { lab: "Loose insulation", text: "If blown-in insulation is sitting between rafters, this project needs a respirator and a plan for keeping insulation in place while you work over it." },
    fig: { img: "https://images.unsplash.com/photo-1604762524889-3e2fcc145683?w=1200&q=80", tag: "Fig 04 | Boundaries", cap: "good tape is future cleanup you do not have to do." }
  },
  {
    n: "05",
    phase: "Paint | 2 coats",
    title: "Brush tight spots first. Roll flat faces second.",
    flip: false,
    body: (
      <>
        <p>
          Get into all the corners with a brush: where rafters meet the ridge beam, where they meet wall plates, anywhere a roller cannot reach. Then roll the flat faces with a small roller and an extension pole.
        </p>
        <p>
          Work in sections. Start with the ridge beam, then work down and outward. Wet paint drips, so go top to bottom. Plan for two coats. The first coat will look patchy. It always does.
        </p>
      </>
    ),
    tip: { lab: "Color", text: "If you are going dark, go dark. Black, deep navy, forest green, or near-black brown. If the attic has almost no light, soft white or cream is the better move." },
    fig: { img: "https://images.unsplash.com/photo-1595814433015-e6f5ce69614e?w=1200&q=80", tag: "Fig 05 | Finish", cap: "second coat is where it comes together." },
    says: "Overhead painting is a full-contact sport. Wear the shirt you already hate."
  }
];

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>five</em> moves
        </h2>
        <span className="count">05 MOVES | 2 DAYS TOTAL</span>
      </header>
      {STEPS.map((s) => (
        <Step key={s.n} data={s} />
      ))}
    </div>
  </section>
);

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>Skipping primer because "it's just attic wood"</h3>
          <p>
            Raw attic wood is exactly why you need primer. Knots and old stains are very committed to ruining your topcoat.
          </p>
        </div>
        <div className="sa-take">
          <div className="num">ii.</div>
          <h3>Choosing mid-gray</h3>
          <p>
            Mid-gray always looks like a mistake up there. Go dark enough that it feels intentional, or go light enough that the room brightens.
          </p>
        </div>
        <div className="sa-take">
          <div className="num">iii.</div>
          <h3>Using shiny paint overhead</h3>
          <p>
            Rafters already have shadow and shape. They do not need to reflect every lamp in the room.
          </p>
        </div>
        <div className="sa-take">
          <div className="num">iv.</div>
          <h3>Trying to finish in one day</h3>
          <p>
            You will skip the dry time or skip the primer. Both choices show up later, and neither is cute.
          </p>
        </div>
      </div>
    </div>
  </section>
);

const Redo = () => (
  <section className="sa-redo">
    <div className="sa-redo-wrap">
      <aside className="sa-redo-side">
        what nobody
        <br />
        <em style={{ color: "#D97A4F" }}>mentions</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>
          Budget <em>two days</em>
        </h2>
        <p>
          It takes longer than you think. Not because it is hard, but because you are painting in three dimensions in an awkward space, and everything takes more time when you have to reposition a ladder every few feet.
        </p>
        <p>
          One day for prep and prime. One day for your two finish coats. If you rush it into a single day, you will either skip the prime or rush the dry time between coats, and both of those show up later.
        </p>
        <p>
          Also: wear old clothes. Overhead painting is a full-contact sport.
        </p>
      </div>
    </div>
  </section>
);

const Signoff = () => (
  <section className="sa-signoff">
    <div className="sa-signoff-wrap">
      <div>
        <h2>
          When it's done, <em>the room changes.</em>
        </h2>
        <p>
          Painted rafters make an attic feel like a room instead of an afterthought. Give the paint a few days to fully cure before putting furniture back or hanging anything. Then step back and let yourself feel good about it. You earned it.
        </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">SAM</span>
        </a>
        <a href="/en/contributors/sam/how-to-hang-something-heavy-without-asking-anyone-for-help/">
          <span>Hang something heavy without help</span>
          <span className="m">SAM</span>
        </a>
        <a href="/en/decorate/attic/">
          <span>Decorate attic hub</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>
);

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

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