/* ============================================================
   DIYCosts — shared stylesheet
   Design: "running tally" — costs read like an itemised receipt.
   Palette: workshop off-white, ink, a single saw-blade yellow accent,
   and a pencil-graphite for structure. Deliberately NOT cream+terracotta.
   ============================================================ */

:root {
  --ink: #1c1d1a;
  --graphite: #4a4d47;
  --muted: #8a8d84;
  --line: #e2e0d6;
  --paper: #f7f6f1;
  --card: #ffffff;
  --accent: #f2b705;        /* saw-blade yellow */
  --accent-deep: #c8930a;
  --green: #2f7d4f;         /* totals / positive */
  --green-soft: #e8f2ec;
  --slot: #f0eee6;          /* ad slot fill */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28,29,26,.05), 0 6px 22px rgba(28,29,26,.06);
  --maxw: 1500px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 62px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo svg { display: block; }
.logo-text { font-weight: 800; font-size: 20px; color: #fff; letter-spacing: -.02em; }
.logo-text .co { color: var(--accent); }

.nav-toggle {
  margin-left: auto; display: none; background: none; border: 1px solid #3a3b38;
  color: #fff; border-radius: 7px; padding: 8px 12px; font-size: 15px; cursor: pointer;
}
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.main-nav a {
  color: #d9d8d1; font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: 7px; display: block;
}
.main-nav a:hover { background: #2c2d2a; color: #fff; text-decoration: none; }
.main-nav a.active { color: var(--ink); background: var(--accent); }

/* dropdown */
.has-drop { position: relative; }
.drop {
  position: absolute; top: 100%; left: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 260px; padding: 8px; display: none; z-index: 60;
  column-count: 1;
}
.has-drop:hover .drop, .has-drop:focus-within .drop { display: block; }
.drop a { color: var(--graphite); font-size: 14px; padding: 8px 10px; border-radius: 6px; }
.drop a:hover { background: var(--paper); color: var(--ink); text-decoration: none; }

/* ---------- Layout: content + ad rail ---------- */
.layout {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 300px; gap: 28px;
  padding: 28px 24px 40px;
  align-items: start;
}
.layout.wide-left { grid-template-columns: 160px 1fr 300px; }
@media (max-width: 1100px) {
  .layout, .layout.wide-left { grid-template-columns: 1fr; }
  .ad-rail, .ad-left { display: none; }
}

/* ---------- Ad slots ---------- */
.ad-slot {
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #b0ad9f; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  text-align: center;
}
/* Empty slots stay invisible; they only show a frame once an ad is dropped in.
   When you add ad code, the slot fills naturally. To reveal the reserved space
   visually again, add the .ad-slot--show class or give the slot a background. */
.ad-slot:empty { background: transparent; border: none; }
.ad-slot:not(:empty), .ad-slot--show {
  background: var(--slot);
  border: 1px dashed #cfccc0;
}
.ad-rail { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 20px; }
.ad-slot.mpu { width: 300px; height: 250px; }
.ad-slot.halfpage { width: 300px; height: 600px; }
.ad-slot.leaderboard { width: 100%; height: 90px; margin: 0 auto 8px; max-width: 970px; }
.ad-slot.inline { width: 100%; height: 100px; margin: 26px 0; }
.ad-left { position: sticky; top: 82px; }
.ad-slot.skyscraper { width: 160px; height: 600px; }

/* ---------- Tool page ---------- */
.tool-head { margin-bottom: 6px; }
.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 700; margin: 0 0 8px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -.015em;
  margin: 0 0 12px; max-width: 22ch;
}
.tool-intro { color: var(--graphite); font-size: 17px; max-width: 62ch; margin: 0 0 24px; }

.calc {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 26px;
}
@media (max-width: 680px) { .calc { grid-template-columns: 1fr; } }
.calc h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 16px; font-weight: 700;
}
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=number], input[type=text], select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; font-size: 16px; font-family: inherit; color: var(--ink);
  background: #fcfbf8; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(242,183,5,.18); background: #fff;
}
.money { position: relative; }
.money::before { content: "£"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money input { padding-left: 24px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238a8d84' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 32px; }

/* results as a receipt */
.receipt {
  background: var(--ink); color: #fff; border-radius: 12px; padding: 24px;
  display: flex; flex-direction: column;
}
.receipt h2 { color: #9a9c92; }
.rrow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14.5px; border-bottom: 1px dotted #3c3d39; }
.rrow .rk { color: #cfd0c8; }
.rrow .rv { font-variant-numeric: tabular-nums; font-weight: 600; }
.rrow.total { border-bottom: none; border-top: 2px solid var(--accent); margin-top: 10px; padding-top: 14px; font-size: 20px; }
.rrow.total .rk { color: #fff; font-weight: 700; }
.rrow.total .rv { color: var(--accent); font-weight: 800; font-family: Georgia, serif; }
.rrow.sub .rk { color: #9a9c92; font-size: 13px; }
.rrow.sub .rv { color: #9a9c92; font-size: 13px; font-weight: 500; }
.receipt-note { color: #8a8c82; font-size: 12px; margin-top: 14px; line-height: 1.5; }

/* ---------- Prose ---------- */
.prose { max-width: 760px; margin: 40px 0; }
.prose h2 { font-family: Georgia, serif; font-size: 25px; margin: 38px 0 12px; letter-spacing: -.01em; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--graphite); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 15px 30px 15px 2px;
  font-weight: 600; font-size: 16px; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 13px; font-size: 22px; color: var(--accent-deep); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 2px 15px; color: var(--graphite); font-size: 15px; }

/* ---------- Cards grid (home) ---------- */
.hero {
  background: var(--ink); color: #fff; border-bottom: 3px solid var(--accent);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 54px 24px 48px; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero p { color: #c9cabf; font-size: 18px; max-width: 60ch; margin: 6px 0 0; }
.hero .kbd { display: inline-block; background: #2c2d2a; border: 1px solid #3c3d39; border-radius: 6px; padding: 2px 8px; font-size: 14px; color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.tcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
  display: block; color: var(--ink);
}
.tcard:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(28,29,26,.1); text-decoration: none; }
.tcard .ic { width: 34px; height: 34px; margin-bottom: 12px; color: var(--accent-deep); }
.tcard h3 { margin: 0 0 5px; font-size: 17px; }
.tcard p { margin: 0; font-size: 13.5px; color: var(--muted); }
.section-label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 34px 0 14px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b7b8ae; margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer-inner h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 12px; }
.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner li { margin-bottom: 7px; }
.footer-inner a { color: #b7b8ae; font-size: 14px; }
.footer-inner a:hover { color: var(--accent); }
.footer-brand p { font-size: 13.5px; max-width: 40ch; color: #96978d; }
.footer-bottom { border-top: 1px solid #2c2d2a; padding: 16px 24px; font-size: 12.5px; color: #7d7e75; text-align: center; }
.footer-credit { margin-top: 6px; font-size: 11.5px; color: #6f7069; }
.footer-credit a { color: inherit; }
.footer-credit a:hover { color: var(--accent); }

.disclaimer { background: #fbf6e5; border: 1px solid #f0e2a8; border-radius: var(--radius); padding: 14px 16px; font-size: 13px; color: #6b5d16; margin: 24px 0; }

/* breadcrumb */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--muted); }

/* mobile nav */
@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--ink); padding: 10px 24px 20px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .drop { position: static; display: block; box-shadow: none; border: none; background: transparent; padding: 0 0 0 12px; }
  .drop a { color: #b7b8ae; }
}
