/* Pea Gravel Calculator — Shared Styles */
/* === FONT SETUP === */

@font-face {
  font-family: 'Bricolage';
  src: url('/assets/fonts/bricolage-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bricolage';
  src: url('/assets/fonts/bricolage-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --green-900: #1f3f2b;
  --green-800: #2d5a3d;
  --green-700: #3d7250;
  --green-100: #e7efe9;
  --green-50: #f3f7f4;
  --sand-700: #8a7050;
  --sand-500: #c8a77a;
  --sand-300: #e0c8a0;
  --sand-100: #f5ecdc;
  --ink: #1a1a1a;
  --ink-2: #3a3a3a;
  --muted: #6b7280;
  --line: #e3e0d6;
  --bg: #fafaf7;
  --card: #ffffff;
  --shadow: 0 2px 10px rgba(40,40,30,0.06);
  --radius: 10px;
    --font-body:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;

  --font-ui:
    'Bricolage',
    system-ui,
    sans-serif;

  --font-mono:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
 font-family: var(--font-ui);
  font-weight: 700;
  color: var(--green-900);
  line-height: 1.2;
  margin: 1.8em 0 0.6em;
}
h1 { font-size: 2.4rem; margin-top: 0; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0.8em 0; text-wrap: pretty; }
a { color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--sand-700); }

ul, ol { padding-left: 1.4em; }
li { margin: 0.35em 0; }

code, .num {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

/* Layout */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; }
.brand-text { display: none; }

nav.primary { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav.primary a {
  font-family: 'Bricolage', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 6px;
  position: relative;
}
nav.primary a:hover { background: var(--green-50); color: var(--green-800); }
nav.primary a.cta {
  background: var(--green-800); color: white; margin-left: 6px;
}
nav.primary a.cta:hover { background: var(--green-900); color: white; }

.menu-toggle { display: none; background: none; border: 1px solid var(--line); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-family: inherit; }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: 100%; left: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px; min-width: 240px;
  display: none; z-index: 10;
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 0.92rem; }

@media (max-width: 820px) {
  .menu-toggle { display: inline-block; }
  nav.primary { display: none; position: absolute; top: 100%; right: 24px; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 220px; box-shadow: var(--shadow); }
  nav.primary.open { display: flex; }
  .has-dropdown .dropdown { position: static; box-shadow: none; border: none; padding: 0 0 0 10px; }
}

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--green-50) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 48px;
}
.hero h1 { font-size: 2.8rem; max-width: 760px; }
.hero .lead { font-size: 1.18rem; color: var(--ink-2); max-width: 700px; }
.hero .badge {
  display: inline-block; background: var(--sand-100); color: #5c4a2a;
  font-family: var(--font-ui); font-weight: 600;
  font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px; margin-bottom: 12px;
}

/* Calculator card */
.calc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin: 24px 0 32px;
}
.calc-card h2 { margin-top: 0; }
.calc-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-ui);
  font-weight: 600; font-size: 0.88rem; color: var(--ink-2);
}
.field input, .field select {
  font-family: var(--font-mono);
  font-size: 1rem; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: white; color: var(--ink);
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--green-800);
}
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; }
.field-row select { width: 90px; }

.result-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line);
}
.result {
  background: var(--green-50); border-radius: 10px; padding: 14px 16px;
}
.result .label {
  font-family: var(--font-ui);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: #2a5238;
}
.result .value {
  font-family: var(--font-ui);
  font-size: 1.6rem; font-weight: 700; color: var(--green-900);
  margin-top: 2px;
}
.result.accent { background: var(--sand-100); }
.result.accent .label { color: #5c4a2a; }
.result.accent .value { color: var(--green-900); }

.btn {
  display: inline-block;
  font-family: var(--font-ui); font-weight: 600;
  background: var(--green-800); color: white; text-decoration: none;
  padding: 11px 22px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--green-900); color: white; }
.btn-secondary { background: white; color: var(--green-800); border: 1.5px solid var(--green-800); }
.btn-secondary:hover { background: var(--green-50); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Cards / clusters */
.cluster {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 24px 0;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; text-decoration: none; color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.card h3 { margin: 0; font-size: 1.15rem; color: var(--green-900); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .tag {
  font-family: var(--font-ui);
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #5c4a2a; font-weight: 600;
}

/* Article */
article { padding: 40px 0 60px; }
article p, article ul, article ol { font-size: 1.05rem; }
article .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px;
  font-family: var(--font-ui); }
article blockquote {
  border-left: 4px solid var(--sand-500); margin: 1.4em 0; padding: 8px 18px;
  background: var(--sand-100); border-radius: 0 8px 8px 0; font-style: italic;
}
article table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.95rem; }
article th, article td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
article th { background: var(--green-50); font-family: var(--font-ui); }
article tr:nth-child(even) td { background: #fbfaf6; }

/* TOC */
.toc {
  background: var(--green-50); border-radius: 10px; padding: 18px 22px;
  margin: 24px 0; border-left: 3px solid var(--green-800);
}
.toc h4 { margin: 0 0 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: #1f4a3a; }
.toc ol { margin: 0; }
.toc a { color: var(--green-800); }

/* Callout */
.callout {
  background: var(--sand-100); border-radius: 10px; padding: 16px 20px;
  border-left: 3px solid var(--sand-500); margin: 1.2em 0;
}
.callout strong { color: #5c4a2a; font-family: var(--font-ui); }

/* FAQ */
.faq details {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 18px; margin: 10px 0; background: var(--card);
}
.faq summary {
  font-family: var(--font-ui); font-weight: 600;
  cursor: pointer; color: var(--green-900); font-size: 1.02rem;
}
.faq details[open] summary { margin-bottom: 8px; }

/* Breadcrumb */
.crumb {
  font-family: var(--font-ui); font-size: 0.85rem;
  color: #4a5568; padding: 14px 0 0;
}
.crumb a { color: #4a5568; }
.crumb a:hover { color: var(--green-800); }
.crumb span { margin: 0 6px; }

/* Section heading */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 40px 0 8px;
}
.section-head h2 { margin: 0; }
.section-head .more { font-family: var(--font-ui); font-size: 0.9rem; font-weight: 600; }

/* Footer */
.site-footer {
  background: var(--green-900); color: #d9e3dc;
  padding: 50px 0 24px; margin-top: 60px;
  font-size: 0.95rem;
}
.site-footer h4 {
  color: white; font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.08em; margin: 0 0 14px;
}
.foot-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}
.site-footer a { color: #d9e3dc; text-decoration: none; display: block; padding: 3px 0; font-size: 0.92rem; }
.site-footer a:hover { color: var(--sand-300); }
.site-footer .tagline { color: #a8bcae; max-width: 320px; font-size: 0.92rem; margin-top: 8px; }
.foot-bottom {
  border-top: 1px solid #2d4636; margin-top: 36px; padding-top: 18px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: #a8bcae; font-size: 0.86rem;
}

@media (max-width: 720px) {
  h1 { font-size: 1.9rem; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 2rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .calc-card { padding: 20px; }
}

/* Ad slot placeholder (for AdSense) */
.ad-slot {
  background: #f3f1eb;
  border: 1px dashed #d5cfba;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  color: #5c5235;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 28px 0;
}

/* Stats row */
.stats {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 24px 0;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; text-align: left;
}
.stat .n {
  font-family: var(--font-ui);
  font-size: 1.9rem; font-weight: 700; color: var(--green-800);
  display: block; line-height: 1;
}
.stat .l { color: #4a5568; font-size: 0.88rem; margin-top: 6px; }

/* Form (contact) */
.form-field { margin: 14px 0; }
.form-field label { display: block; font-family: var(--font-ui); font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 1rem;
}
.form-field textarea { min-height: 130px; resize: vertical; }


/* Author card (About page) */
.author-card {
  display: grid; grid-template-columns: 220px 1fr; gap: 30px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; margin: 24px 0; box-shadow: var(--shadow);
}
.author-photo { width: 220px; height: 220px; border-radius: 12px; object-fit: cover; background: var(--green-50); }
.author-meta { color: var(--muted); font-family: var(--font-ui); font-weight: 600; margin-top: -8px; }
.author-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ab { display: inline-block; background: var(--green-50); color: var(--green-800); border: 1px solid #cfdbd1;
  padding: 5px 12px; border-radius: 99px; font-size: 0.82rem;
  font-family: var(--font-ui); font-weight: 600; }
@media (max-width: 640px) { .author-card { grid-template-columns: 1fr; } .author-photo { width: 160px; height: 160px; margin: 0 auto; } }

/* Byline (article header) */
.byline { display: flex; align-items: center; gap: 12px; margin: 18px 0 28px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--green-50); }
.byline-text { display: flex; flex-direction: column; }
.byline-name { font-family: var(--font-ui); font-weight: 700; color: var(--green-900); font-size: 1.02rem; }
.byline-name a { color: var(--green-900); text-decoration: none; }
.byline-name a:hover { color: var(--green-700); }
.byline-meta { font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); }

/* Verified badge */
.verified-badge { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #ecf4ee 0%, #f5ecdc 100%); border: 1px solid #c2d5c8; border-radius: 12px; padding: 14px 20px; margin: 20px 0; }
.vb-tick { font-size: 1.8rem; color: var(--green-700); font-weight: 700; line-height: 1; }
.vb-text { font-size: 0.93rem; color: var(--ink-2); font-family: var(--font-ui); }
.vb-text strong { color: var(--green-900); }
.vb-text a { color: var(--green-800); }

/* TLDR box */
.tldr { background: var(--green-50); border-left: 4px solid var(--green-700); border-radius: 0 10px 10px 0; padding: 16px 22px; margin: 20px 0; }
.tldr-label { display: inline-block; background: var(--green-700); color: white; font-family: var(--font-ui); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px; border-radius: 4px; margin-right: 8px; vertical-align: 2px; }

/* What people get wrong box */
.wpgw { background: #fbf2e6; border-left: 4px solid #c8762a; border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 24px 0; }
.wpgw h3 { color: #8a4d10; margin-top: 0; font-size: 1.1rem; }
.wpgw h3:before { content: "⚠ "; }

/* Sources box */
.sources { background: #f6f4ef; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 24px 0; font-size: 0.92rem; }
.sources h4 { margin: 0 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.sources ul { margin: 0; padding-left: 18px; }
.sources li { margin: 4px 0; }

/* Dropdown polish */
.has-dropdown .dropdown { left: 0; }

/* Footer verified line */
.verified-line { color: var(--sand-300); font-size: 0.85rem; margin-top: 6px; }


/* === Responsive + overflow fixes === */
* { min-width: 0; }
body { overflow-x: hidden; }
.calc-card { overflow: hidden; }
.calc-card input, .calc-card select { min-width: 0; width: 100%; }
.field-row { flex-wrap: wrap; }
.field-row select { width: auto; min-width: 90px; max-width: 100%; }
.field { min-width: 0; }
.hero h1, h1, h2, h3 { word-break: break-word; }
img { max-width: 100%; height: auto; }
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; min-width: 540px; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1.5px solid var(--line); }
.table-wrap th { background: linear-gradient(180deg, #f6f4ef 0%, #efece4 100%); color: #1f4a3a; font-family: var(--font-ui); font-weight: 600; font-size: 0.95rem; text-align: left; padding: 14px 18px; border-bottom: 2px solid var(--line); }
.table-wrap td { padding: 14px 18px; border-bottom: 1px solid #efece4; font-size: 0.95rem; vertical-align: top; line-height: 1.55; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:nth-child(even) td { background: #fafaf6; }
.table-wrap td:first-child { font-weight: 600; color: #1f4a3a; }
.table-wrap td:nth-child(2) { color: #7c5a16; font-weight: 600; white-space: nowrap; }
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .calc-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .field-row { flex-direction: column; }
  .field-row select { width: 100%; }
  nav.primary { right: 16px; }
}
@media (max-width: 480px) {
  .result-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  .author-photo { width: 140px !important; height: 140px !important; }
}

/* ── Footer logo: dark logo inverted to white on dark green footer ── */
.site-footer .foot-brand-logo {
  height: 90px;
  width: 200;
  display: block;
  margin-bottom: 2px;
  filter: brightness(0) invert(1);
}
