/* ColoringBuds Tools — base styles. Mobile-first, no framework. */
:root {
  --green: #3f7d6e;
  --green-d: #2c5a4f;
  --green-l: #e7f1ee;
  --accent: #e98a4b;
  --ink: #20262b;
  --muted: #5b6770;
  --line: #dfe4e2;
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --warn-bg: #fff4e5;
  --warn-line: #f0c089;
  --info-bg: #eef4fb;
  --info-line: #bcd3ee;
  --radius: 12px;
  --radius-s: 8px;
  --maxw: 880px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--green-d); }
a:hover { color: var(--green); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.sr-only,
.skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; width: auto; height: auto;
  padding: 10px 16px; background: var(--green-d); color: #fff;
  border-radius: var(--radius-s); z-index: 100; clip: auto;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--accent); font-size: 1.4em; line-height: 1; }
.brand-name { font-size: 1.15rem; letter-spacing: -.01em; }
.brand-sub { color: var(--green); margin-left: 4px; font-weight: 700; }
.site-nav { display: flex; align-items: center; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-s); cursor: pointer;
}
.nav-bars, .nav-bars::before, .nav-bars::after {
  display: block; width: 20px; height: 2px; background: var(--ink); position: relative;
}
.nav-bars::before, .nav-bars::after { content: ""; position: absolute; left: 0; }
.nav-bars::before { top: -6px; } .nav-bars::after { top: 6px; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 600; border-radius: var(--radius-s); }
.nav-list a:hover { background: var(--green-l); }

@media (max-width: 760px) {
  .nav-list {
    position: absolute; top: 60px; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none; padding: 8px;
  }
  .nav-list.open { display: block; }
  .nav-list li { border-bottom: 1px solid var(--bg-soft); }
}
@media (min-width: 761px) {
  .nav-toggle { display: none; }
  .nav-list { display: flex; gap: 2px; }
}

/* ---------- Layout sections ---------- */
main { display: block; }
.tool-page, .page { padding: 22px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; font-weight: 700; color: var(--green); margin: 0 0 6px; }
h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.6rem); margin: 1.8em 0 .5em; letter-spacing: -.01em; }
h3 { font-size: 1.12rem; margin: 1.1em 0 .3em; }
.lede { font-size: 1.08rem; color: #333; margin: 0 0 .6em; }
.updated { font-size: .85rem; color: var(--muted); margin: 0; }

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: .85rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--green); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink); }

/* ---------- Callouts ---------- */
.callout { border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; border: 1px solid var(--line); }
.callout--warning { background: var(--warn-bg); border-color: var(--warn-line); }
.callout--info { background: var(--info-bg); border-color: var(--info-line); }
.callout p { margin: 0; }
.callout p + p { margin-top: .5em; }
.disclaimer { font-size: .92rem; color: #3c4750; }

/* ---------- Calculator ---------- */
.calculator-shell {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 20px 0 8px;
}
.calculator-shell > h2 { margin-top: 0; }
.fields { display: grid; gap: 14px; }
@media (min-width: 620px) { .fields { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; }
.field label { font-weight: 600; margin-bottom: 5px; font-size: .95rem; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row input { flex: 1 1 auto; min-width: 0; }
input[type="number"], select {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink);
}
input:focus, select:focus { border-color: var(--green); }
.unit-select { width: auto; flex: 0 0 auto; min-width: 72px; }
.unit-suffix { display: inline-flex; align-items: center; padding: 0 10px; background: #eef2f0; border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--muted); font-size: .9rem; }
.field-help { font-size: .82rem; color: var(--muted); margin: 5px 0 0; }
.field-error { font-size: .85rem; color: #b3261e; margin: 5px 0 0; font-weight: 600; }
.field--invalid input, .field--invalid select { border-color: #b3261e; background: #fdeceb; }

.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--radius-s);
  padding: 12px 18px; border: 1px solid transparent; min-height: 46px;
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-d); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--green-l); border-color: var(--green); }

.result { margin-top: 18px; }
.result-placeholder { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius-s); padding: 16px; margin: 0; }
.result-card { background: #fff; border: 1px solid var(--green); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.result-headline { background: var(--green); color: #fff; padding: 16px 18px; font-size: 1.25rem; font-weight: 800; }
.result-headline small { display: block; font-weight: 600; font-size: .8rem; opacity: .9; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.result-body { padding: 14px 18px; }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bg-soft); }
.breakdown li:last-child { border-bottom: 0; }
.breakdown .bd-label { color: var(--muted); }
.breakdown .bd-value { font-weight: 700; text-align: right; }
.result-message { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--green-l); font-size: .95rem; }
.result-message--warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.result-note { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- Prose ---------- */
.prose { margin-top: 6px; }
.prose p, .prose li { max-width: 70ch; }
.formula-list, .howto { padding-left: 1.2em; }
.formula-list li, .howto li { margin: .35em 0; }
.example { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 16px; margin: 12px 0; }
.example h3 { margin-top: .2em; }

.table-scroll { overflow-x: auto; }
.ref-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.ref-table caption { text-align: left; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.ref-table th, .ref-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ref-table thead th { background: var(--green-l); border-bottom: 2px solid var(--green); }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-s); margin: 8px 0; background: #fff; }
.faq-item summary { cursor: pointer; padding: 12px 16px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { display: inline; margin: 0; font-size: 1rem; }
.faq-item summary::after { content: "+"; float: right; color: var(--green); font-weight: 700; font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-a { padding: 0 16px 14px; }
.faq-a p { margin: 0; }

/* ---------- Cards / related ---------- */
.related { margin-top: 24px; }
.card-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.tool-card {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--green); transform: translateY(-2px); }
.tool-card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--green); font-weight: 700; }
.tool-card-title { font-weight: 700; font-size: 1.02rem; }
.tool-card-desc { font-size: .88rem; color: var(--muted); }

/* ---------- Home ---------- */
.hero-home { text-align: center; padding: 30px 0 10px; }
.hero-home .lede { max-width: 60ch; margin: 0 auto .4em; }
.cat-section { margin-top: 30px; scroll-margin-top: 76px; }
.cat-head h2 { margin: 0 0 .2em; }
.cat-head p { color: var(--muted); margin: 0 0 14px; max-width: 65ch; }

/* ---------- Footer ---------- */
.site-footer { background: #20322d; color: #d7e3df; margin-top: 50px; padding: 36px 0 22px; font-size: .94rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr 2fr; } }
.brand--footer { color: #fff; } .brand--footer .brand-name { color: #fff; } .brand--footer .brand-sub { color: #9fd3c4; }
.footer-about p { color: #b9c8c3; }
.footer-cols { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (min-width: 600px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: #9fd3c4; margin: 0 0 8px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 5px 0; }
.footer-col a { color: #cdded8; text-decoration: none; font-size: .9rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { margin-top: 26px; border-top: 1px solid #34473f; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; align-items: center; }
.footer-legal { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; }
.footer-legal a { color: #cdded8; text-decoration: none; }
.footer-copy { color: #94a8a2; margin: 0; font-size: .82rem; }
.lang-switch { display: flex; gap: 12px; }
.lang-switch a { color: #cdded8; text-decoration: none; font-size: .85rem; }
.lang-switch a[aria-current] { color: #fff; font-weight: 700; text-decoration: underline; }

@media print { .site-header, .site-footer, .calc-actions, .nav-toggle { display: none; } }
