/* 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; } }

/* ---- slot markers ----
   No photographs: a stock photo of someone else's dinner above a recipe reads
   as "this is what you are making", and it is not. Colour and a glyph do the
   real job -- telling Tuesday from Thursday at a glance -- and are never wrong. */
.s-oily-fish  { --slot: #2F6F8F; }
.s-legume     { --slot: #5C7A33; }
.s-poultry    { --slot: #C8791F; }
.s-white-fish { --slot: #3E9A92; }
.s-flex       { --slot: #B5452B; }
.s-bowl       { --slot: #8A7355; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }

.picker button { position: relative; padding-left: 15px; display: grid;
                 grid-template-columns: auto 1fr; gap: 0 7px; align-items: center; }
.picker button::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0;
                         width: 6px; background: var(--slot, var(--rule));
                         border-radius: 9px 0 0 9px; }
.picker button .ico { color: var(--slot, var(--soft)); grid-row: span 2; }
.picker button b { font-weight: 700; }
.picker button span { grid-column: 2; }
.picker button.on::before { background: var(--paper); }
.picker button.on .ico { color: var(--paper); }

.panel.meal { border-top: none; border-left: 6px solid var(--slot, var(--rule));
              padding-left: 16px; margin-top: 16px; }
.panel.meal .label { display: flex; align-items: center; gap: 7px; }
.panel.meal .label .ico { color: var(--slot); }

/* sauces carry the cuisine they belong to, the one split that decides a plate */
.c-med   { --slot: #5C7A33; }
.c-asian { --slot: #B5452B; }
.sauce { border-left: 6px solid var(--slot, var(--rule)); padding-left: 16px; }
.chip { display: inline-block; background: var(--slot); color: var(--paper);
        font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
        padding: 2px 8px; border-radius: 999px; margin-right: 6px; }

/* ---- plate composition ----
   Palette validated with the dataviz validator against the card surface
   (#FFF8E7): lightness band, chroma floor, CVD separation, normal-vision floor
   and contrast all pass. Tritan separation sits at 7.7, which is legal only
   with secondary encoding -- hence the 2px gaps and the direct labels below. */
.plate { margin: 14px 0 16px; }
.plate { max-width: 540px; }
.plate .bar { position: relative; display: flex; gap: 2px; height: 14px;
              background: var(--card); }
.plate .seg { display: block; min-width: 3px; }
.plate .seg.v { background: #5F8C2A; }
.plate .seg.p { background: #1E6FA8; }
.plate .seg.g { background: #D2791A; }
/* round the ends of the bar, whichever buckets happen to be present */
.plate .seg:first-of-type { border-radius: 4px 0 0 4px; }
.plate .seg:last-of-type  { border-radius: 0 4px 4px 0; }
.plate .key.none { opacity: .55; }
.plate .key.none::before { background: none; box-shadow: inset 0 0 0 2px var(--rule); }
.plate .tick { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px;
               background: var(--ink); opacity: .55; }
.plate figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px;
                    margin-top: 9px; font-size: 14px; color: var(--soft); }
.plate .key { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.plate .key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.plate .key.v::before { background: #5F8C2A; }
.plate .key.p::before { background: #1E6FA8; }
.plate .key.g::before { background: #D2791A; }

.balance .bgrid { display: grid; gap: 20px; }
@media (min-width: 760px) { .balance .bgrid { grid-template-columns: 1fr 1fr; } }
.balance .plate, .balance .meter { max-width: none; margin: 0; }
.meter .track { position: relative; height: 14px; background: var(--rule); border-radius: 4px; }
.meter .fill { display: block; height: 100%; background: #1E6FA8; border-radius: 4px; }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px;
               background: var(--ink); opacity: .55; }
.meter figcaption { margin-top: 9px; font-size: 14px; color: var(--soft);
                    display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.meter figcaption strong { font-size: 19px; color: var(--ink); }
.ok  { color: #5F8C2A; font-weight: 700; }
.bad { color: var(--terra); font-weight: 700; }
.nextweek { margin-top: -10px; }

.shot { margin: 0 0 12px; }
.shot img { display: block; width: 100%; height: auto; border: 2px solid var(--ink);
            border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; }
.shot figcaption { margin-top: 5px; font-size: 12px; color: var(--soft); }
.shot figcaption a { color: var(--soft); }

.dishhead { display: flex; align-items: center; gap: 14px; }
.dish { width: 112px; height: 78px; flex: 0 0 auto; }
@media (max-width: 479px) { .dish { width: 88px; height: 62px; } }
