/*
  styles.css — look and layout for the calculator page.
  Colors follow the Garrison Brothers PowerPoint theme so the page and the slide match.
*/

:root {
  --page: #f4efe2;
  --card: #fcf8f0;
  --line: #e3d9c6;
  --ink: #33291f;
  --brown: #5a2a12;
  --orange: #dd5c31;
  --orange-dark: #bc5433;
  --taupe: #8a7a66;
  --good: #5c7a3f;
  --font: "Calibri", "Carlito", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
}

main, .site-header, .site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header { display: flex; align-items: center; gap: 16px; padding-top: 28px; padding-bottom: 8px; }
.site-logo { width: 96px; height: auto; }
.eyebrow { margin: 0; color: var(--orange); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px; }
h1 { margin: 0; color: var(--brown); font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
h2 { color: var(--brown); font-size: 20px; margin: 24px 0 10px; }
.hint { color: var(--taupe); font-size: 14px; font-weight: 400; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-top: 20px; border-bottom: 2px solid var(--line); }
.tabs button {
  font: inherit; font-weight: 700; color: var(--taupe); background: none; border: 0;
  padding: 10px 18px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs button[aria-selected="true"] { color: var(--orange); border-bottom-color: var(--orange); }
.tabs button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.mode-intro { color: var(--taupe); margin: 10px 0 18px; }

/* Two columns on wide screens, stacked on phones */
.layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
/* minmax(0, …) lets the wide ingredient table scroll inside its box instead of widening the page */
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.panel > h2:first-child { margin-top: 0; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; color: var(--brown); }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field.grow { flex: 1 1 220px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
input, select {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }

/* Ingredient table */
/* position: relative keeps the hidden screen-reader label inside the scroll box */
.table-wrap { overflow-x: auto; position: relative; }
.ingredients { width: 100%; border-collapse: collapse; min-width: 560px; }
.ingredients th { text-align: left; font-size: 13px; color: var(--taupe); font-weight: 700; padding: 4px 6px; }
.ingredients td { padding: 4px 6px; vertical-align: middle; }
.ingredients td:first-child { width: 40%; }
.ingredients input { padding: 6px 8px; }
.num { text-align: right; white-space: nowrap; }
.remove-button { background: none; border: 0; color: var(--taupe); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; }
.remove-button:hover { color: var(--orange); }

/* Buttons */
.link-button { background: none; border: 0; color: var(--orange-dark); font: inherit; font-weight: 700; cursor: pointer; padding: 8px 0; }
.link-button:hover { text-decoration: underline; }
.button {
  font: inherit; font-weight: 700; background: var(--orange); color: #fff; border: 0;
  border-radius: 8px; padding: 10px 18px; cursor: pointer;
}
.button:hover { background: var(--orange-dark); }
.button.secondary { background: none; color: var(--orange-dark); border: 2px solid var(--orange); }

/* Results */
.results h2 { margin-top: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--taupe); }
.stat-value { font-size: 32px; font-weight: 700; color: var(--orange); line-height: 1.15; }
.stat-sub { font-size: 14px; }
.rating-Excellent, .rating-Good { color: var(--good); font-weight: 700; }
.rating-Fair { color: var(--orange-dark); font-weight: 700; }
.rating-High { color: #a3271a; font-weight: 700; }
.detail-list { margin: 14px 0 0; padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.batch-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.batch-table th, .batch-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.batch-table th { color: var(--taupe); font-size: 13px; }

/* Slide preview */
.slide-section { margin: 32px auto 0; }
.slide-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.slide-header h2 { margin: 0; }
.slide-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.slide-canvas { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); }

.site-footer { padding-top: 24px; padding-bottom: 40px; color: var(--taupe); font-size: 14px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .tabs button { padding: 10px 10px; }
}
