/* bath.builders — homeowner cost guides
   Light editorial system. No webfonts, no external requests: fast on a phone
   over cell data, which is where most of this traffic reads.
   Semantic colors match the price decks downstream (green = fair, red =
   overpriced) so the experience stays continuous from article to quote. */

:root {
  --paper: #fbfaf8;
  --card: #ffffff;
  --ink: #161d2b;
  --ink-soft: #4a5568;
  --ink-mute: #6b7688;
  --rule: #e4e1db;
  --rule-soft: #eeebe5;
  --fair: #0e7a4e;
  --fair-bg: #edf7f1;
  --over: #b0402e;
  --over-bg: #fdf1ee;
  --warn: #8a6d1f;
  --warn-bg: #fdf7e7;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.masthead-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark span { color: var(--fair); }
.masthead-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ── Article shell ──────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

article { padding: 40px 0 8px; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fair);
  margin: 0 0 14px;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 6.4vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 18px;
}

.standfirst {
  font-size: clamp(19px, 3.4vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.meta {
  font-size: 14px;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin-bottom: 34px;
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
}

article h2 {
  font-family: var(--serif);
  font-size: clamp(23px, 4.4vw, 29px);
  line-height: 1.24;
  letter-spacing: -0.015em;
  margin: 42px 0 14px;
}
article h3 {
  font-size: 19px;
  line-height: 1.35;
  margin: 30px 0 10px;
  font-weight: 700;
}
article p { margin: 0 0 20px; }
article strong { font-weight: 700; }
article a { color: var(--fair); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }

article ul, article ol { margin: 0 0 22px; padding-left: 22px; }
article li { margin-bottom: 10px; }

/* ── Pull statement ─────────────────────────────────────────────────── */
.pull {
  font-family: var(--serif);
  font-size: clamp(21px, 4vw, 26px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  border-left: 3px solid var(--fair);
  padding: 4px 0 4px 20px;
  margin: 32px 0;
  color: var(--ink);
}

/* ── Callouts ───────────────────────────────────────────────────────── */
.note {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  padding: 18px 20px;
  margin: 28px 0;
  font-size: 17px;
}
.note-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--ink-mute);
}
.note p:last-child { margin-bottom: 0; }
.note.fair { background: var(--fair-bg); border-color: #cfe6da; }
.note.fair .note-label { color: var(--fair); }
.note.over { background: var(--over-bg); border-color: #f0d3cc; }
.note.over .note-label { color: var(--over); }
.note.warn { background: var(--warn-bg); border-color: #ecdfb8; }
.note.warn .note-label { color: var(--warn); }

/* ── Cost table ─────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; margin: 26px 0; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  /* Two-column cost tables must fit a 375px phone without sideways scrolling —
     the data IS the article. Cells wrap; the scroll container stays as a
     safety net for anything wider. */
  min-width: 0;
  border-collapse: collapse;
  font-size: 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
caption {
  caption-side: top;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-bottom: 10px;
}
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--rule-soft); }
th {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: #f7f5f1;
}
td:last-child, th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tfoot td {
  font-weight: 700;
  background: #f7f5f1;
  border-top: 1px solid var(--rule);
}

/* Phones: force the two columns to fit. A cost table the reader has to
   scroll sideways is a cost table they don't read — and the data is the
   whole argument of these pieces. */
@media (max-width: 620px) {
  table { table-layout: fixed; font-size: 15px; }
  th, td { padding: 11px 10px; }
  th:first-child, td:first-child { width: 58%; }
  th:last-child, td:last-child { width: 42%; white-space: normal; }
}

/* ── Market ladder ──────────────────────────────────────────────────── */
.ladder { margin: 30px 0; display: grid; gap: 10px; }
.band {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--card);
}
.band-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.band-name { font-weight: 700; font-size: 16px; }
.band-range {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.band-note { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.band.low { border-color: #f0d3cc; background: var(--over-bg); }
.band.low .band-range { color: var(--over); }
.band.mid { border-color: var(--fair); background: var(--fair-bg); border-width: 2px; }
.band.mid .band-range { color: var(--fair); }
.band.high { border-color: #f0d3cc; background: var(--over-bg); }
.band.high .band-range { color: var(--over); }

/* ── CTA ────────────────────────────────────────────────────────────── */
.cta {
  border: 2px solid var(--fair);
  border-radius: 16px;
  background: var(--fair-bg);
  padding: 26px 24px;
  margin: 40px 0;
}
.cta h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 4.2vw, 27px);
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}
.cta p { font-size: 17px; color: var(--ink-soft); margin: 0 0 18px; }
.btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--fair);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn:active { transform: scale(0.99); }
.cta-sub { font-size: 14px; color: var(--ink-mute); margin: 12px 0 0; text-align: center; }

/* ── Related ────────────────────────────────────────────────────────── */
.related { border-top: 1px solid var(--rule); margin-top: 44px; padding-top: 26px; }
.related h2 { font-size: 20px; margin: 0 0 16px; font-family: var(--sans); font-weight: 700; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 12px; }
.related a { font-weight: 600; text-decoration: none; color: var(--ink); }
.related a:hover { color: var(--fair); }
.related span { display: block; font-size: 15px; color: var(--ink-mute); font-weight: 400; }

/* ── Index ──────────────────────────────────────────────────────────── */
.hero { padding: 46px 0 30px; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: clamp(32px, 7vw, 46px); margin-bottom: 16px; }
.hero p { font-size: clamp(18px, 3.4vw, 20px); color: var(--ink-soft); margin: 0 0 8px; max-width: 34em; }

.cards { display: grid; gap: 14px; padding: 30px 0 10px; }
.card {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--fair); }
.card-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fair);
  margin-bottom: 8px;
}
.card h2 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.28;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.card p { font-size: 16px; color: var(--ink-soft); margin: 0; }

/* ── Footer + disclosure ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  margin-top: 50px;
  padding: 26px 0 44px;
  font-size: 14px;
  color: var(--ink-mute);
}
footer p { margin: 0 0 10px; }
.disclosure {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.55;
}

@media (min-width: 640px) {
  .btn { display: inline-block; width: auto; min-width: 320px; }
  .cta-sub { text-align: left; }
}

/* ── Site navigation ─────────────────────────────────────────────────
   The guides are meant to be fallen into, not landed on once. Nav +
   category hubs + prev/next + inline cross-links do that work. */
.sitenav {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}
.sitenav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  white-space: nowrap;
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--fair); border-bottom-color: var(--fair); }
.nav-cta {
  flex: none;
  background: var(--fair);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 15px;
  border-radius: 9px;
  margin: 7px 0;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────── */
.crumbs {
  font-size: 14px;
  color: var(--ink-mute);
  padding-top: 20px;
}
.crumbs a { color: var(--ink-mute); text-decoration: none; }
.crumbs a:hover { color: var(--fair); text-decoration: underline; }
.crumbs span { margin: 0 4px; }

/* ── Prev / next ─────────────────────────────────────────────────── */
.prevnext {
  display: grid;
  gap: 10px;
  margin: 36px 0 0;
  grid-template-columns: 1fr;
}
.pn-item {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
}
.pn-item:hover { border-color: var(--fair); }
.pn-item span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 5px;
}
.pn-next { text-align: right; }

/* ── Home groups + start line ────────────────────────────────────── */
.group { padding: 26px 0 6px; border-top: 1px solid var(--rule); margin-top: 26px; }
.group:first-of-type { border-top: none; margin-top: 0; }
.group-head h2 {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.group-head h2 a { color: var(--ink); text-decoration: none; }
.group-head h2 a:hover { color: var(--fair); }
.group-head p { color: var(--ink-soft); font-size: 16px; margin: 0; }
.group .cards { padding-top: 16px; }

.startline {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
  align-items: baseline;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--fair);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 24px 0 4px;
  font-size: 16px;
}
.startline-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.startline a { color: var(--fair); font-weight: 600; text-decoration: none; }
.startline a:hover { text-decoration: underline; }

.related .cards { padding-top: 0; }

@media (min-width: 640px) {
  .prevnext { grid-template-columns: 1fr 1fr; }
}

/* Small phones: every category must be visible without sideways scrolling —
   a nav item you can't see is a section of the site that doesn't exist. */
@media (max-width: 430px) {
  .nav-link { padding: 13px 8px; font-size: 14.5px; }
  .nav-cta { padding: 8px 12px; font-size: 13.5px; }
  .sitenav-inner { padding: 0 16px; gap: 8px; }
}

/* ── Article art ──────────────────────────────────────────────────────
   Editorial illustration, not photography: the guides are a publication,
   and no people means no install-scene or anatomy problems. Dimensions are
   set on the img so nothing shifts while it loads. */
.hero-art {
  margin: 0 0 32px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--rule);
}
.hero-art img { display: block; width: 100%; height: auto; }

.card { padding: 0; overflow: hidden; }
.card-art { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--rule-soft); }
.card-body { padding: 18px 20px 20px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-card { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 24px 22px; margin: 26px 0; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.field .hint { display: block; font-size: 14px; color: var(--ink-mute); font-weight: 400; margin-top: 2px; }
input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%; font-family: inherit; font-size: 17px; padding: 14px 15px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink);
}
input:focus-visible { outline: 2px solid var(--fair); outline-offset: 1px; border-color: var(--fair); }
.choices { display: grid; gap: 9px; }
.choice {
  display: flex; align-items: center; gap: 11px; border: 1px solid var(--rule);
  border-radius: 11px; padding: 14px 15px; background: var(--paper); cursor: pointer; font-size: 16px;
}
.choice input { accent-color: var(--fair); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--fair); border-width: 2px; background: var(--fair-bg); font-weight: 600; }
.steps { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 8px; }
/* Honeypot — off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error {
  margin: 12px 0 0; font-size: 15px; font-weight: 600; color: var(--over);
  background: var(--over-bg); border: 1px solid #f0d3cc; border-radius: 10px; padding: 10px 13px;
}
.form-ok { margin: 12px 0 0; font-size: 16px; font-weight: 600; color: var(--fair); }
.waitlist { display: grid; gap: 10px; margin-top: 14px; }
.field-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* ══════════════════════════════════════════════════════════════════════
   DESKTOP — the reading column stays narrow (that's correct for prose),
   but everything around it should use the room: a two-up card grid, art
   that breathes wider than the text, and a bigger typographic scale.
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  body { font-size: 19px; }

  .masthead-inner,
  .sitenav-inner { max-width: 1040px; }

  /* Cards go two-up and the home page stops being a single long ribbon. */
  .cards { grid-template-columns: 1fr 1fr; gap: 22px; }
  main.wrap:has(.cards) { max-width: 1040px; }
  .hero,
  .group-head,
  .crumbs,
  main.wrap > .cta { max-width: 1040px; }

  .hero h1 { font-size: 54px; letter-spacing: -0.025em; }
  .hero p { font-size: 21px; }
  .group-head h2 { font-size: 30px; }

  /* Article art breaks a little wider than the prose — an editorial bleed
     that signals "publication" without hurting readability. */
  .hero-art {
    width: calc(100% + 120px);
    margin-left: -60px;
    margin-bottom: 40px;
    border-radius: 18px;
  }

  article h1 { font-size: 50px; }
  article h2 { margin-top: 52px; }
  .pull { font-size: 29px; margin: 40px 0; }

  /* Related grid sits two-up under the article. */
  .related .cards { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1180px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  main.wrap:has(.cards),
  .masthead-inner,
  .sitenav-inner,
  .hero,
  .group-head,
  .crumbs,
  main.wrap > .cta { max-width: 1160px; }
  .related .cards { grid-template-columns: repeat(3, 1fr); }
}

/* The reading column itself never widens — 720px is the readable measure. */
main.wrap > article,
main.wrap > .related,
main.wrap > .prevnext { max-width: 720px; margin-left: auto; margin-right: auto; }

/* Contractor link — present but never competing with the homeowner CTA. */
.nav-partner {
  display: none;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 13px 12px;
}
.nav-partner:hover, .nav-partner.is-active { color: var(--fair); }
@media (min-width: 760px) { .nav-partner { display: inline-block; } }
article ol { margin: 0 0 22px; padding-left: 22px; }
article ol li { margin-bottom: 12px; }

/* Four categories plus a CTA is tight at 375px — shorten the button rather
   than hiding a whole section of the site behind a scroll. */
.cta-short { display: none; }
@media (max-width: 480px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
  .nav-link { padding: 13px 7px; font-size: 14px; }
  .nav-cta { padding: 8px 11px; font-size: 13px; }
}
