/* 247caloriecheck.com — main.css
   Mobile-first. Green health theme. Fast: system fonts, no webfonts. */

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-bg: #f0fdf4;
  --text: #1a1a1a;
  --muted: #556;
  --line: #dbe7db;
  --white: #ffffff;
  --radius: 10px;
  --maxw: 760px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 17px;
}

a { color: var(--green-dark); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 58px; gap: 12px;
}
.brand { font-weight: 800; font-size: 20px; color: var(--green-dark); text-decoration: none; letter-spacing: -0.3px; }
.brand span { color: var(--green); }
.nav a { color: var(--text); text-decoration: none; font-size: 15px; margin-left: 16px; white-space: nowrap; }
.nav a:hover { color: var(--green-dark); }
@media (max-width: 560px) { .nav { display: none; } }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: 13px; color: var(--muted); padding: 12px 0 0; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---------- Sample build ribbon ---------- */
.sample-ribbon {
  background: #b91c1c; color: #fff; text-align: center;
  font-size: 13px; font-weight: 700; padding: 7px 12px;
}

/* ---------- H1 ---------- */
h1 { font-size: 27px; line-height: 1.25; margin: 16px 0 14px; letter-spacing: -0.4px; }

/* ---------- Calorie hero ---------- */
.calorie-hero {
  background: var(--green-bg);
  border: 1px solid #cdeccd;
  border-radius: var(--radius);
  text-align: center;
  padding: 26px 18px 22px;
  margin: 0 0 18px;
}
.calorie-number {
  font-size: 72px; line-height: 1; font-weight: 800;
  color: var(--green-dark); letter-spacing: -2px;
}
.calorie-per { font-size: 16px; color: var(--muted); margin-top: 6px; }
.calorie-serving { font-size: 15px; color: var(--text); margin-top: 10px; font-weight: 600; }

/* ---------- Macro strip ---------- */
.macro-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 20px; }
.macro {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px; text-align: center;
}
.macro-val { display: block; font-size: 19px; font-weight: 800; color: var(--green-dark); }
.macro-label { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Serving calculator ---------- */
.serving-calc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 22px;
}
.serving-calc > label { display: block; font-weight: 700; margin-bottom: 10px; }
.serving-calc .row { display: flex; align-items: center; gap: 8px; }
.serving-calc input[type="number"] {
  font-size: 22px; font-weight: 700; width: 120px; padding: 10px 12px;
  border: 2px solid var(--green); border-radius: 8px; text-align: center;
}
.serving-calc .unit { font-size: 16px; color: var(--muted); }
#calc-results { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
#calc-results .c { text-align: center; background: var(--green-bg); border-radius: 8px; padding: 8px 4px; }
#calc-results .c b { display: block; font-size: 16px; color: var(--green-dark); }
#calc-results .c small { color: var(--muted); font-size: 11px; }

/* ---------- Prose ---------- */
.lead { font-size: 17px; margin: 0 0 22px; }

/* ---------- Nutrition table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 24px; }
.nutrition-table { width: 100%; border-collapse: collapse; min-width: 340px; font-size: 15px; }
.nutrition-table th, .nutrition-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.nutrition-table thead th { background: var(--green-dark); color: #fff; font-size: 13px; }
.nutrition-table td:first-child { font-weight: 600; }
.nutrition-table tr:nth-child(even) td { background: #fafefa; }

/* ---------- Sections ---------- */
h2 { font-size: 21px; margin: 28px 0 12px; letter-spacing: -0.3px; }
h3 { font-size: 17px; margin: 16px 0 6px; }

.faq-item { border-bottom: 1px solid var(--line); padding: 6px 0 12px; }
.faq-item h3 { margin: 10px 0 4px; }
.faq-item p { margin: 0; color: #222; }

/* ---------- Similar foods / links ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 24px; }
.chip {
  display: inline-block; background: var(--green-bg); border: 1px solid #cdeccd;
  border-radius: 999px; padding: 7px 14px; font-size: 14px; color: var(--green-dark);
  text-decoration: none; font-weight: 600;
}
.chip:hover { background: #dcfce7; }

/* ---------- Affiliate ---------- */
.affiliate-block { background: var(--green-bg); border: 1px solid #cdeccd; border-radius: var(--radius); padding: 16px; margin: 8px 0 24px; }
.affiliate-block h3 { margin-top: 0; }
.affiliate-item { padding: 8px 0; border-top: 1px solid #cdeccd; }
.affiliate-item:first-of-type { border-top: none; }
.amz-link {
  display: inline-block; margin-top: 4px; background: var(--green); color: #fff;
  text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px;
}
.amz-link:hover { background: var(--green-dark); }

/* ---------- Compare grid ---------- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 24px; }
.compare-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.compare-card .big { font-size: 40px; font-weight: 800; color: var(--green-dark); line-height: 1; }
.compare-card .name { font-weight: 700; margin-bottom: 8px; }

/* ---------- Category / homepage lists ---------- */
.food-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 26px; }
.food-list a {
  display: flex; justify-content: space-between; align-items: baseline;
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px;
  text-decoration: none; color: var(--text);
}
.food-list a:hover { border-color: var(--green); background: var(--green-bg); }
.food-list .kcal { color: var(--green-dark); font-weight: 800; }

.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 26px; }
.hub-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); }
.hub-card:hover { border-color: var(--green); }
.hub-card b { color: var(--green-dark); }

/* ---------- Homepage search ---------- */
.home-hero { text-align: center; padding: 26px 0 8px; }
.home-hero h1 { font-size: 30px; }
.home-hero p { color: var(--muted); font-size: 17px; margin-top: 4px; }
.searchbox { margin: 18px auto 0; max-width: 520px; }
.searchbox input {
  width: 100%; font-size: 17px; padding: 14px 16px; border: 2px solid var(--green);
  border-radius: 10px;
}
.search-results { margin-top: 12px; text-align: left; }

/* ---------- Data source note / footer ---------- */
.data-source { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; }
.disclosure { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

.site-footer { background: var(--green-bg); border-top: 1px solid #cdeccd; margin-top: 34px; padding: 22px 0; font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.site-footer a { color: var(--green-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .fine { width: 100%; text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }

/* ---------- Support pages ---------- */
.support-body { margin-bottom: 30px; }
.support-body p { margin: 0 0 14px; }
.support-body label { display: block; margin: 0 0 12px; font-weight: 600; }
.support-body input, .support-body textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-family: inherit; margin-top: 4px; }
.support-body button { background: var(--green); color: #fff; border: none; padding: 11px 20px; border-radius: 8px; font-weight: 700; font-size: 16px; cursor: pointer; }

/* ---------- Desktop bumps ---------- */
@media (min-width: 620px) {
  h1 { font-size: 32px; }
  .calorie-number { font-size: 84px; }
  .food-list, .hub-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Cross-links / freshness / ad slots ---------- */
.pet-note { font-size: 14px; color: var(--muted); background: var(--green-bg); border-left: 3px solid var(--green); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 0 0 22px; }
.last-updated { font-size: 12px; color: var(--muted); margin: 20px 0 0; }
.ad-slot { min-height: 0; }
.related-resources { width: 100%; text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid #cdeccd; }
.related-resources h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.related-resources a { margin: 0 9px; font-size: 13px; }
