/* Meal planner, two sheets: the week's meals and the grocery list. Portrait
   Letter by default, A4 under html.a4 (the runtime swaps the @page rule).
   Days as rows, meals as columns, every cell ruled for a pen; the grocery
   sections as a grid of ruled boxes, or one long list. Colors only through
   --t-* so a theme is a set of variables; static font instances only. */

@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: block; }
@font-face { font-family: "Inter Tight"; src: url("/assets/fonts/intertight-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Inter Tight"; src: url("/assets/fonts/intertight-500.woff2") format("woff2"); font-weight: 500; font-display: block; }

@page { size: Letter; margin: 0; }

:root { --t-paper: #ffffff; --t-ink: #1a1a1a; --t-accent: #8f2d2d; --t-muted: #6b7078; }
html, body { margin: 0; padding: 0; background: #fff; }
[hidden] { display: none !important; }

.sheet {
  width: 8.5in; height: 11in; padding: 0.5in 0.55in 0.6in; box-sizing: border-box; position: relative; overflow: hidden;
  background: var(--t-paper); color: var(--t-ink);
  font: 400 10pt/1.4 "Inter Tight", system-ui, sans-serif;
  display: flex; flex-direction: column; gap: 0.18in;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  break-after: page; page-break-after: always;
  --line: color-mix(in srgb, var(--t-muted) 45%, transparent);
}
.sheet:last-of-type { break-after: auto; page-break-after: auto; }
html.a4 .sheet { width: 210mm; height: 297mm; }

/* Header, the same on both sheets: the title and which sheet at the left, the week at the right. */
.head { flex: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 0.3in; border-bottom: 1.5pt solid var(--t-accent); padding-bottom: 0.1in; min-height: 0.72in; }
.titles { min-width: 0; flex: 1; }
.titles h1 { margin: 0; font: 500 24pt/1.2 "Fraunces", Georgia, serif; letter-spacing: -0.005em; color: var(--t-ink); white-space: nowrap; overflow: hidden; height: 1.2em; }
.titles .sub { margin: 2pt 0 0; font: 500 8.5pt/1.4 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }
.when { flex: none; text-align: right; min-width: 2.4in; }
.when-label { display: block; font-size: 8pt; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); margin-bottom: 3pt; }
.when-dated { display: block; font: 500 11.5pt/1.2 "Fraunces", Georgia, serif; color: var(--t-accent); white-space: nowrap; }
.when-blank { display: block; width: 2.4in; margin-left: auto; height: 0.2in; border-bottom: 0.6pt solid var(--t-ink); }

/* Sheet one: the meal grid. Every row is the same flex shape, so the cells line up under the meal names. */
.grid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drow { display: flex; align-items: stretch; border-bottom: 0.5pt solid var(--line); }
.drow.mhead { flex: none; height: 0.26in; border-bottom: 1pt solid var(--t-accent); }
.days { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.days .drow { flex: 1 1 0; min-height: 0.8in; }
.dlabel { flex: none; width: 1.0in; display: flex; flex-direction: column; justify-content: flex-start; padding: 5pt 0.1in 0 0; }
.dname { display: block; font: 500 8pt/1.2 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-ink); }
.dnum { display: block; font: 500 15pt/1.1 "Fraunces", Georgia, serif; color: var(--t-accent); margin-top: 2pt; }
.cells { flex: 1; min-width: 0; display: flex; }
.cells .cell, .cells .mname { flex: 1 1 0; min-width: 0; border-left: 0.5pt solid var(--line); font-style: normal; }
.mname { display: flex; align-items: flex-end; padding: 0 0 4pt 0.08in; font: 500 7.5pt/1 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); white-space: nowrap; overflow: hidden; }
.cell { display: flex; flex-direction: column; padding: 0 0.08in; }
.cell i { display: block; flex: 1; border-bottom: 0.5pt solid var(--line); }
.cell i:last-child { border-bottom: 0; }

/* Sheet two: the grocery list, as sections in two columns or as one long ruled list. */
.secs { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); column-gap: 0.4in; row-gap: 0.22in; }
.sec { display: flex; flex-direction: column; min-height: 0; }
.slabel { flex: none; font: 500 8pt/1 "Inter Tight", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); padding-bottom: 4pt; border-bottom: 1pt solid var(--t-accent); white-space: nowrap; overflow: hidden; height: 1em; }
.srules { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.srules i { display: block; flex: 1; min-height: 0.28in; border-bottom: 0.5pt solid var(--line); }
.plain { flex: 1; min-height: 0; display: flex; gap: 0.4in; }
.plain .col { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.plain .col i { display: block; flex: 1; min-height: 0.3in; border-bottom: 0.5pt solid var(--line); }

/* The foot: the free version's credit line and the one-inch mark. */
.foot { position: absolute; left: 0.55in; right: 0.55in; bottom: 0.42in; font-size: 7.5pt; color: var(--t-muted); display: flex; justify-content: space-between; align-items: flex-end; }
.ruler { width: 1in; border-top: 0.5pt solid var(--t-muted); font-size: 6.5pt; color: var(--t-muted); text-align: center; line-height: 1.6; }
