/* Potter Family Recipes — weekly meal-plan pages (the fridge sheet + its hub).
   Loaded alongside site.css; reuses its palette, fonts, .mono and .masthead.
   Adds a few cool/warm semantic accents for the planning tags. */

:root {
  --chain: #7e3c12;          /* leftover-chain tag (warm, on-brand) */
  --chain-wash: #f3e7d6;
  --prep: #8a6d0f;           /* prep-ahead tag (amber) */
  --prep-wash: #f4ecd2;
  --frost: #3a5f78;          /* freezer / thaw tag (cool — reads as cold) */
  --frost-wash: #e4edf2;
  --weekend-wash: #f1ece0;
}

/* ---- Shared: sub-line under a masthead, back link ---- */
.week-note {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-style: italic;
  color: var(--muted-2);
  max-width: 60ch;
}
.week-back { margin-top: 10px; }

/* ---- The weekly hub (/week/) ---- */
.hub-current {
  margin-top: 14px;
  border: 2px solid var(--rule-strong);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--row-hover);
}
.hub-current .hub-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
}
.hub-current h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hub-current .hub-days {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--muted-2);
  font-style: italic;
}
.hub-btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  white-space: nowrap;
}
.hub-btn:hover { background: var(--rust); border-color: var(--rust); color: #fff; text-decoration: none; }

.hub-past-head {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 3px;
  margin: 22px 0 2px;
}
.hub-past { display: grid; margin-top: 2px; }
.hub-past a {
  color: var(--ink);
  padding: 5px 0;
  border-bottom: 1px solid var(--rule-light);
  font-size: 14.5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.hub-past a:hover { color: var(--rust); text-decoration: none; }
.hub-past .hub-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.hub-empty { margin-top: 6px; font-style: italic; color: var(--muted); font-size: 13.5px; }

/* ---- The week sheet: the plan grid ---- */
.plan-actions {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 10px 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.print-btn {
  background: none;
  border: 1px solid var(--ink);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  cursor: pointer;
}
.print-btn:hover { background: var(--ink); color: var(--bg); }

.wk-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted-2);
  margin: 6px 0 12px;
}
.wk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wk-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.wk-dot.chain { background: var(--chain); }
.wk-dot.prep { background: var(--prep); }
.wk-dot.thaw { background: var(--frost); }

.plan-wrap { overflow-x: auto; }
table.plan { width: 100%; border-collapse: collapse; }
table.plan th, table.plan td {
  text-align: left;
  vertical-align: top;
  padding: 8px 8px;
  border-bottom: 1px solid var(--rule);
}
table.plan thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--rule-strong);
}
table.plan td.wk-day { white-space: nowrap; width: 52px; }
table.plan td.wk-day b { font-size: 15px; font-weight: 600; }
table.plan td.wk-day small { display: block; font-size: 10.5px; color: var(--muted); }
tr.weekend td { background: var(--weekend-wash); }

.wcell { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; min-width: 168px; }
.wcell-text { flex: 1 1 auto; min-width: 0; }
.wmeal { font-weight: 600; font-size: 14.5px; }
a.wmeal { color: var(--ink); }
a.wmeal:hover { color: var(--rust); text-decoration: none; }
.wtime {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--rust);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.wnote { display: block; font-size: 12px; color: var(--muted-2); font-style: italic; margin-top: 1px; }
.wtag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 3px;
  margin-top: 4px;
  margin-right: 4px;
}
.wtag.chain { background: var(--chain-wash); color: var(--chain); }
.wtag.prep { background: var(--prep-wash); color: var(--prep); }
.wtag.thaw { background: var(--frost-wash); color: var(--frost); }
img.qr {
  flex: none;
  width: 46px;
  height: 46px;
  background: #fff;
  padding: 2px;
  box-sizing: border-box;
  border: 1px solid var(--rule);
}

/* ---- Prep checklist ---- */
.wk-h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 3px;
  margin: 26px 0 4px;
}
.wk-sub { color: var(--muted-2); font-size: 13px; font-style: italic; margin: 0 0 10px; }
ul.preplist { list-style: none; margin: 0; padding: 0; }
ul.preplist li {
  position: relative;
  padding: 5px 0 5px 24px;
  border-bottom: 1px solid var(--rule-light);
  font-size: 13.5px;
  line-height: 1.4;
}
ul.preplist li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  width: 9px;
  height: 9px;
  background: var(--prep);
  border-radius: 2px;
}
ul.preplist li.frost::before { background: var(--frost); }

/* ---- Grocery list ---- */
.grocery-cols { columns: 3; column-width: 220px; column-gap: 26px; margin-top: 2px; }
.dept { break-inside: avoid; margin-bottom: 16px; }
.dept h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  margin: 0 0 5px;
}
.dept ul { list-style: none; margin: 0; padding: 0; }
.dept li { position: relative; padding: 2px 0 2px 19px; font-size: 13px; line-height: 1.3; }
.dept li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--muted);
  border-radius: 2px;
}
.dept .qty { color: var(--muted); }
.dept .freeze { color: var(--frost); font-weight: 600; }

/* ---- Print: the whole reason this page exists ---- */
@media print {
  @page { margin: 11mm; }
  body { background: #fff; padding: 0; font-size: 11px; }
  .topbar, .plan-actions, .week-back, .colophon { display: none; }
  a { color: inherit !important; text-decoration: none !important; }

  /* Tighten the top matter so all seven days fit on page one, even with the
     browser's own header/footer eating into the margin. */
  .masthead { margin-top: 0; padding-bottom: 3px; }
  h1 { font-size: 18px; }
  .masthead .tagline { display: none; }        /* redundant with the title in print */
  .week-note { font-size: 10px; margin-top: 3px; line-height: 1.3; max-width: none; }
  .wk-legend { font-size: 9.5px; gap: 6px 14px; margin: 4px 0 6px; }

  .wtime { color: var(--muted-2); }
  tr.weekend td { background: #f1ece0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wtag, .dept .freeze, .wk-dot, ul.preplist li::before, img.qr {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .wtag { border: 1px solid currentColor; }

  /* Denser grid rows: smaller QR, tighter padding, slightly smaller text. */
  img.qr { width: 14mm; height: 14mm; }
  table.plan td { padding: 3px 6px; }
  table.plan td.wk-day b { font-size: 13px; }
  .wcell { min-width: 0; }
  .wmeal { font-size: 12.5px; }
  .wnote { font-size: 10.5px; line-height: 1.25; }
  .wtag { margin-top: 3px; }

  ul.preplist li { padding: 3px 0 3px 24px; font-size: 12px; line-height: 1.3; }
  ul.preplist li::before { top: 8px; }

  .grocery-cols { columns: 3; }
  .wk-h2 { margin-top: 16px; }
  .wk-sub { margin-bottom: 6px; font-size: 11px; }
  .wk-h2.break { break-before: page; }
}
