/* DIYRenoCost — shared stylesheet. No frameworks, system fonts, mobile-first. */
:root {
  --navy: #1f3a5f;
  --navy-dark: #16293f;
  --amber: #e8a33d;
  --amber-dark: #c98420;
  --ink: #22303c;
  --muted: #5b6b7a;
  --line: #dfe6ec;
  --bg: #ffffff;
  --bg-soft: #f4f7f9;
  --green: #1e7d4f;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}
a { color: var(--navy); }
a:hover { color: var(--amber-dark); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; margin-top: 2.2em; }
h3 { font-size: 1.15rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: .35em; }
img, svg { max-width: 100%; height: auto; }
section { margin-bottom: 2.2rem; }

/* Header / nav — sticky, two rows: brand row + clustered tool nav */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(22, 41, 63, .25); }
.site-header .wrap { max-width: 1080px; }
.header-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; padding: .6rem 0; flex-shrink: 0; }
.brand img { width: 40px; height: 40px; }
.brand-name { display: block; font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.brand-name em { font-style: normal; color: var(--amber); }
.brand-tag { display: block; font-size: .8rem; font-weight: 400; color: #aebfd2; }
.header-links { margin-left: auto; display: flex; gap: .2rem; flex-wrap: wrap; }
.header-links a { color: #dbe6f0; text-decoration: none; padding: .5rem .65rem; border-radius: 6px; font-size: .93rem; font-weight: 600; }
.header-links a:hover, .header-links a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
.site-nav { background: var(--navy-dark); border-top: 1px solid rgba(255,255,255,.12); }
.nav-clusters { display: flex; gap: .4rem 1.5rem; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
.nav-cluster { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.nav-label { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); white-space: nowrap; }
.site-nav a { color: #dbe6f0; text-decoration: none; padding: .3rem .45rem; border-radius: 6px; font-size: .92rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }

/* Layout */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
main { padding: 1.8rem 0 2.5rem; }
.hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 2.4rem 0 2rem; }
.hero h1 { margin-bottom: .3em; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 640px; }
.updated { font-size: .88rem; color: var(--muted); }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: .8rem; }
.breadcrumb a { color: var(--muted); }

/* Homepage hero with visual */
.hero-home .wrap { display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-items: center; }
.hero-home .lede { color: var(--ink); }
.hero-home figure { margin: 0; }
.hero-home figure svg { display: block; border-radius: var(--radius); }
.hero-home figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .5rem; }
@media (min-width: 640px) { .hero-home .wrap { grid-template-columns: 1.2fr .8fr; } }

/* Tool-page hero band */
.hero-tool { background: var(--navy); color: #fff; padding: 2.2rem 0 1.8rem; margin: 0 0 1.8rem; border-bottom: 4px solid var(--amber); }
.hero-tool h1 { color: #fff; margin-bottom: .35em; }
.hero-tool .lede { color: #dbe6f0; font-size: 1.12rem; }
.hero-tool .byline { font-size: .9rem; color: #aebfd2; margin-bottom: .9rem; }
.hero-tool .trust li { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.hero-tool .trust li::before { color: var(--amber); }

/* Hero jump links (tool pages) */
.hero-links { margin: .9rem 0 0; font-size: .95rem; }
.hero-links a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.hero-links a:hover { color: var(--amber); }

/* Trust chips */
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.trust li { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--navy); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; margin: 0; }
.trust li::before { content: "\2713"; color: var(--green); font-weight: 800; }

/* Tool cards (homepage) */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
.tool-card { border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: #fff; transition: transform .15s ease, box-shadow .15s ease; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(31, 58, 95, .14); }
.tool-card h3 { margin: 0 0 .3em; }
.tool-card h3 a { text-decoration: none; }
.tool-card p { margin: 0; color: var(--muted); }
.tool-card .tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--amber-dark); margin-bottom: .35rem; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: 1fr 1fr; } }

/* Guide cards reuse the tool-card treatment */
.guide-card { border-top-color: var(--navy); }
.guide-card:hover { box-shadow: 0 8px 20px rgba(31, 58, 95, .14); }

/* Reference tables */
table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .97rem; }
caption { caption-side: top; text-align: left; font-weight: 700; color: var(--navy); margin-bottom: .4rem; }
thead th { background: var(--navy); color: #fff; text-align: left; font-weight: 700; }
th, td { padding: .55rem .7rem; border: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--bg-soft); }
tbody tr:hover { background: #eaf1f6; }
td:last-child, th:last-child { text-align: left; }

/* Figures and diagrams */
figure { margin: 1.6rem 0; }
figure svg { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: .5rem; }
figure img { border: 1px solid var(--line); border-radius: var(--radius); }

/* Calculator */
.calc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); padding: 1.2rem; margin: 1.2rem 0; }
.calc fieldset { border: 0; margin: 0; padding: 0; }
.calc legend { font-weight: 700; color: var(--navy); padding: 0; margin-bottom: .6rem; }
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field .hint { font-size: .88rem; color: var(--muted); font-weight: 400; }
.field input, .field select { width: 100%; max-width: 340px; padding: .55rem .65rem; font-size: 1rem; border: 1px solid #b9c6d2; border-radius: 6px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--amber); border-color: var(--amber-dark); }
.calc button { background: var(--amber); color: #231a05; border: 0; border-radius: 6px; padding: .7rem 1.4rem; font-size: 1rem; font-weight: 700; cursor: pointer; }
.calc button:hover { background: var(--amber-dark); color: #fff; }
.result { display: none; margin-top: 1rem; border: 2px solid var(--green); background: #eef8f1; border-radius: var(--radius); padding: 1rem 1.1rem; }
.result.show { display: block; }
.result .big { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.result .sub { color: var(--muted); }
.result-actions { display: flex; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }
.result-actions button { cursor: pointer; border-radius: var(--radius); padding: .55rem 1rem; font-size: .95rem; font-weight: 700; }
.btn-copy { background: var(--navy); color: #fff; border: 2px solid var(--navy); }
.btn-share { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.result-actions button:disabled { opacity: .7; cursor: default; }
.result table { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .97rem; }
.result table th, .result table td { border: 0; padding: .3rem 0; border-top: 1px solid #cfe3d6; }
.result td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.note { font-size: .9rem; color: var(--muted); }

/* Worked example box */
.example { background: #fff8e8; border-left: 4px solid var(--amber); border-radius: 0 8px 8px 0; padding: .9rem 1.1rem; margin: 1.2rem 0; }
.example h3 { margin-top: 0; }
.example p:last-child { margin-bottom: 0; }

/* FAQ — prominent card section */
.faq-section { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin: 2.4rem 0; }
.faq-section > h2 { margin-top: 0; }
.faq-item { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 8px; padding: .9rem 1.1rem; margin-bottom: .8rem; }
.faq-item:last-child { margin-bottom: 0; }
.faq dt { font-weight: 700; color: var(--navy); margin: 0 0 .3em; font-size: 1.05rem; }
.faq dd { margin: 0; }

/* Related tools */
.related { border-top: 1px solid var(--line); margin-top: 2.2rem; padding-top: 1rem; }
.related ul { columns: 2; }
@media (max-width: 560px) { .related ul { columns: 1; } }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.2rem 0; }
.related-grid a { display: block; border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: var(--radius); padding: 1rem 1.1rem; background: #fff; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.related-grid a:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(31, 58, 95, .14); }
.related-grid a strong { display: block; color: var(--navy); margin-bottom: .25rem; }
.related-grid a span { color: var(--muted); font-size: .95rem; }
@media (min-width: 640px) { .related-grid { grid-template-columns: 1fr 1fr; } }

/* Footer */
.site-footer { background: var(--navy-dark); color: #c7d3de; padding: 2rem 0 1.6rem; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer .wrap { max-width: 1080px; display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
.site-footer .foot-note { grid-column: 1 / -1; margin: 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.15); }
.foot-group { color: var(--amber); font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin: 0 0 .3rem; }
.foot-col ul { margin-bottom: .9rem; }
.foot-col ul:last-child { margin-bottom: 0; }
@media (min-width: 640px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .site-footer .wrap { grid-template-columns: 1.35fr 1fr .65fr .8fr; } }

/* Mobile header: keep it slim (2 Dec 2026 fix). On phones the nav clusters
   wrapped into many lines and the sticky header covered half the screen.
   Now the top row is compact and the calculator nav is one swipeable row. */
@media (max-width: 640px) {
  .header-top { gap: .5rem; flex-wrap: nowrap; }
  .brand { padding: .45rem 0; gap: .5rem; }
  .brand img { width: 32px; height: 32px; }
  .brand-name { font-size: 1.1rem; }
  .brand-tag { display: none; }
  .header-links { gap: 0; }
  .header-links a { padding: .4rem .45rem; font-size: .86rem; }
  .nav-clusters { flex-wrap: nowrap; overflow-x: auto; gap: .4rem 1rem; padding-top: .4rem; padding-bottom: .4rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-clusters::-webkit-scrollbar { display: none; }
  .nav-cluster { flex-wrap: nowrap; }
  .nav-label { display: none; }
  .site-nav a { padding: .25rem .4rem; font-size: .88rem; }
}
@media (max-width: 400px) {
  .header-links a { padding: .4rem .35rem; font-size: .82rem; }
  .brand-name { font-size: 1rem; }
}
