/* meal — suns' palette, tuned for reading at a stove. */
:root {
  --paper: #FCEFD2;
  --card:  #FFF8E7;
  --wall:  #F7D896;
  --ink:   #2A2320;
  --soft:  #6E5B45;
  --terra: #D4502A;
  --teal:  #3E9A92;
  --rule:  #E7CFA0;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; scroll-padding-top: 74px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Nunito", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400; font-size: 19px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 32px) 64px; }

h1, h2, h3 { font-family: "Baloo 2", ui-sans-serif, system-ui, sans-serif; font-weight: 700;
             line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 7vw, 44px); }
h2 { font-size: 27px; margin-bottom: 14px; }
h3 { font-size: 22px; margin: 18px 0 8px; }
.label { font-weight: 600; font-size: 12px; letter-spacing: .22em;
         text-transform: uppercase; color: var(--soft); margin: 0 0 6px; }
.muted { color: var(--soft); margin: 6px 0 0; }
.note  { color: var(--terra); font-style: italic; margin: 10px 0 0; }

.masthead { margin-bottom: 18px; }

/* sticky anchor bar — no JS */
.jump {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 0 22px; padding: 10px 0;
  background: var(--paper); border-bottom: 2px solid var(--ink);
}
.jump a {
  flex: 0 0 auto; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 15px; padding: 7px 13px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--wall);
}
.jump a:active { background: var(--terra); color: var(--paper); }

.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
  padding: 20px clamp(16px, 3vw, 24px); margin: 0 0 20px;
  box-shadow: 3px 3px 0 var(--rule);
}
.day { margin: 0 0 30px; }
.day > h2 { padding-top: 6px; border-top: 2px dashed var(--rule); padding-bottom: 2px; }
.day .meal { margin-bottom: 14px; }

ul, ol { margin: 0; padding-left: 1.25em; }
li { margin: 5px 0; }

/* shopping + prep: thumb-sized targets, struck through when done */
.checklist { list-style: none; padding: 0; }
.checklist li { margin: 0; border-bottom: 1px solid var(--rule); }
.checklist label { display: flex; gap: 12px; align-items: flex-start;
                   padding: 11px 2px; cursor: pointer; }
.checklist input { flex: 0 0 auto; width: 26px; height: 26px; margin: 0; accent-color: var(--teal); }
.checklist input:checked ~ * { opacity: .4; text-decoration: line-through; }
.checklist .it { flex: 1 1 auto; min-width: 0; }
.qty { font-weight: 600; color: var(--terra); min-width: 4.4em; display: inline-block; }
/* the note belongs under the item, not beside it -- inline notes crush the
   item name into a two-line column, which is unreadable one-handed in a shop */
.checklist .note { display: block; margin: 2px 0 0; font-size: 16px; }

.ing { color: var(--soft); }
.steps { font-size: 21px; line-height: 1.55; }
.steps li { margin: 11px 0; padding-left: 4px; }
.build li { font-size: 20px; }

.sauce + .sauce { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); }

.weeklist { list-style: none; padding: 0; }
.weeklist li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.weeklist a { color: var(--ink); }
.backlink { margin-top: 28px; }
.backlink a, .weeklist a { color: var(--teal); font-weight: 600; }
code { background: var(--wall); padding: 2px 6px; border-radius: 5px; font-size: .9em; }

/* candidate review — local only */
.candidate { background: var(--terra); color: var(--paper); font-weight: 700;
             margin: 0 0 16px; padding: 9px 14px; border-radius: 10px; font-size: 15px; }
.why { color: var(--teal); font-weight: 600; margin: 8px 0 0; }
.cand + .cand { margin-top: 26px; padding-top: 20px; border-top: 2px dashed var(--rule); }
.cmp { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 17px; }
.cmp td { padding: 7px 4px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp .d { font-weight: 700; width: 3.4em; }
.cmp .n { text-align: right; color: var(--soft); white-space: nowrap; width: 4em; }
.cmp tfoot td { border-bottom: none; border-top: 2px solid var(--ink); font-weight: 700; color: var(--ink); }
.price { color: var(--terra); font-style: normal; font-weight: 700; margin-left: 6px; }

/* candidate comparison matrix — the only element allowed to scroll sideways */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0; }
.matrix { border-collapse: collapse; font-size: 16px; min-width: 100%; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--rule);
                         text-align: left; vertical-align: top; min-width: 7.5em; }
.matrix thead th { border-bottom: 2px solid var(--ink); font-family: "Baloo 2", sans-serif; }
.matrix thead a { color: var(--ink); text-decoration: none; font-weight: 700; }
.matrix thead span { display: block; font-family: "Nunito", sans-serif; font-weight: 400;
                     font-size: 13px; color: var(--soft); }
.matrix .d { font-weight: 700; min-width: 4.6em; white-space: nowrap; }
.matrix tfoot td { border-top: 2px solid var(--ink); border-bottom: none;
                   color: var(--soft); white-space: nowrap; }
.matrix tfoot .hi td { color: var(--terra); font-weight: 700; }
h3 .sub { color: var(--terra); font-family: "Nunito", sans-serif; font-size: 16px; font-weight: 700; }
.total { margin: 14px 0 0; font-size: 18px; }
.total strong { color: var(--terra); }

.wkhead { margin: 28px 0 10px; font-size: 20px; color: var(--soft);
          border-bottom: 2px solid var(--ink); padding-bottom: 5px; }
.matrix tr.wk td { border-top: 2px solid var(--ink); }
.jump sup { font-size: 10px; margin-left: 1px; }

/* The review page is planned on a laptop, so it gets the width. The week pages
   stay narrow on purpose -- those are read at a stove, on a phone. */
.wrap.wide { max-width: min(1500px, 96vw); }
@media (min-width: 900px) {
  .matrix { font-size: 17px; }
  .matrix th, .matrix td { min-width: 13em; padding: 10px 14px; }
  .matrix .d { min-width: 6em; }
  .matrix thead span { font-size: 14px; }
}
@media (min-width: 1200px) {
  .matrix th, .matrix td { min-width: 16em; }
}

/* Laptop layout for a week page. The width buys COLUMNS, not longer lines:
   a measure past ~65ch is harder to read, not easier, and these are recipe
   steps followed one at a time. Below 900px nothing here applies and the page
   is the single narrow column it has always been at the stove. */
@media (min-width: 900px) {
  .day { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .day > h2 { grid-column: 1 / -1; }
  .day .meal { margin-bottom: 0; }
  .steps, .ing, .build { max-width: 62ch; }
  #shop .checklist { columns: 2; column-gap: 34px; }
  #shop .checklist li { break-inside: avoid; }
  #prep .checklist { columns: 2; column-gap: 34px; }
  #prep .checklist li { break-inside: avoid; }
  #sauces { columns: 2; column-gap: 32px; }
  #sauces h2, #sauces .sauce h3 { column-span: none; }
  .sauce { break-inside: avoid; }
  .sauce + .sauce { margin-top: 0; padding-top: 16px; }
}
@media (min-width: 1300px) {
  #sauces { columns: 3; }
  #shop .checklist, #prep .checklist { columns: 3; }
}

/* ---- sectioned week page ---- */
.picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.picker button {
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  color: var(--ink); background: var(--wall); cursor: pointer;
  border: 2px solid var(--ink); border-radius: 12px; padding: 9px 13px;
  text-align: left; min-height: 48px;
}
.picker button span { display: block; font-weight: 400; font-size: 12px; color: var(--soft); }
.picker button.on { background: var(--terra); color: var(--paper); box-shadow: 2px 2px 0 var(--ink); }
.picker button.on span { color: var(--paper); opacity: .85; }
.picker button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.panel { border-top: 2px dashed var(--rule); padding-top: 16px; }
.panel > h3 { margin-top: 4px; }
.biglinks { display: grid; gap: 12px; }
.biglinks a {
  display: block; text-decoration: none; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 14px; padding: 16px 18px;
  background: var(--wall); font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 21px;
}
.biglinks a span { display: block; font-family: "Nunito", sans-serif; font-weight: 400;
                   font-size: 15px; color: var(--soft); margin-top: 2px; }
.biglinks a:active { background: var(--terra); color: var(--paper); }

@media (min-width: 900px) {
  .biglinks { grid-template-columns: 1fr 1fr; }
  .recipe { display: grid; grid-template-columns: minmax(14em, 20em) 1fr; gap: 26px; align-items: start; }
  .panel .checklist, #shop .panel .checklist { columns: 2; }
}
@media (min-width: 1300px) {
  .panel .checklist, #shop .panel .checklist { columns: 3; }
}

@media (min-width: 640px)  { .biglinks.shops { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .biglinks.shops { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .biglinks.shops { grid-template-columns: repeat(5, 1fr); } }
.biglinks.shops a { font-size: 19px; padding: 14px 16px; }

.storelinks { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.storelinks a {
  display: inline-block; text-decoration: none; color: var(--ink);
  background: var(--wall); border: 2px solid var(--ink); border-radius: 999px;
  padding: 7px 14px; font-weight: 600; font-size: 15px;
}
.storelinks a span { font-weight: 400; color: var(--soft); }
.storelinks a:active { background: var(--teal); color: var(--paper); }

.est { color: var(--soft); font-style: normal; font-weight: 600; margin-left: 6px; }

/* prep and sauces are two links, not two billboards: size them to their text
   instead of letting a two-column grid stretch them across the page */
.biglinks.small { grid-template-columns: none; grid-auto-flow: column;
                  grid-auto-columns: max-content; justify-content: start; gap: 10px; }
.biglinks.small a { font-size: 17px; padding: 10px 16px; border-radius: 12px; }
.biglinks.small a span { font-size: 13px; }
@media (max-width: 479px) {
  .biglinks.small { grid-auto-flow: row; grid-auto-columns: auto; }
}
@media (min-width: 900px) { .biglinks.small { grid-template-columns: none; } }
