/* Weekly planner, the sheet. Landscape Letter by default, A4 under html.a4
   (the runtime swaps the @page rule). One week in seven equal columns, the
   weekend as wide as a Tuesday, and the sections a person turns on or off
   under it. Colors only through --t-* so a theme is a set of variables and
   the light-ink theme is rules and one accent. Static font instances only
   (DESIGN.md section 6). */

@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 landscape; 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: 11in; height: 8.5in; padding: 0.5in 0.5in 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.16in;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  /* The writing rules: the muted color thinned. Each rule is an element's
     border, so it prints as a line, not as a picture of one. */
  --line: color-mix(in srgb, var(--t-muted) 45%, transparent);
}
html.a4 .sheet { width: 297mm; height: 210mm; }

/* Header: the title and name 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.7in; }
.titles { min-width: 0; flex: 1; }
/* Fraunces' ascent and descent run past a tight line box; 1.2 holds them, and the guard measures the box. */
.titles h1 { margin: 0; font: 500 26pt/1.2 "Fraunces", Georgia, serif; letter-spacing: -0.005em; color: var(--t-ink); white-space: nowrap; overflow: hidden; height: 1.2em; }
.titles .name { margin: 3pt 0 0; color: var(--t-muted); font-size: 10.5pt; white-space: nowrap; overflow: hidden; height: 1.4em; }
.when { flex: none; text-align: right; min-width: 2.6in; }
.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 12.5pt/1.2 "Fraunces", Georgia, serif; color: var(--t-accent); white-space: nowrap; }
.when-blank { display: block; width: 2.6in; margin-left: auto; height: 0.2in; border-bottom: 0.6pt solid var(--t-ink); }

/* The seven days, equal columns, ruled for handwriting. */
.days { flex: 1; min-height: 1.6in; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { min-width: 0; display: flex; flex-direction: column; border-left: 0.5pt solid var(--line); padding: 0 0.08in; }
.day:first-child { border-left: 0; padding-left: 0; }
.day:last-child { padding-right: 0; }
.day-head { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: 4pt; border-bottom: 1pt solid var(--t-accent); padding-bottom: 3pt; margin-bottom: 0.04in; }
.day-name { font-size: 8pt; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-ink); white-space: nowrap; overflow: hidden; }
.day-date { font: 500 14pt/1 "Fraunces", Georgia, serif; color: var(--t-accent); }
.day-lines { flex: 1; display: flex; flex-direction: column; }
.day-lines i, .notes .ruled i { display: block; flex: 1; border-bottom: 0.5pt solid var(--line); }

/* Meals: one short row under the days, in the same seven columns. */
.meals { flex: none; height: 0.62in; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative; border-top: 1pt solid var(--t-accent); border-bottom: 0.5pt solid var(--line); }
.meals i { display: block; border-left: 0.5pt solid var(--line); }
.meals i:first-child { border-left: 0; }
.strip-label { position: absolute; top: 3pt; left: 0; font-size: 7pt; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }

/* The bottom row: top three, habits, notes, each on its own switch. */
.bottom { flex: none; height: 1.7in; display: flex; gap: 0.3in; }
.box { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.label { flex: none; font-size: 8pt; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); border-bottom: 1pt solid var(--t-accent); padding-bottom: 3pt; margin-bottom: 0.04in; }
.priorities ol { margin: 0; padding: 0; list-style: none; counter-reset: p; }
.priorities li { counter-increment: p; display: flex; align-items: flex-end; gap: 6pt; height: 0.42in; border-bottom: 0.5pt solid var(--line); }
.priorities li::before { content: counter(p); font: 500 13pt/1 "Fraunces", Georgia, serif; color: var(--t-accent); padding-bottom: 4pt; }
.notes .ruled { flex: 1; display: flex; flex-direction: column; }
.habits .hhead, .habits .hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 0.1in; }
.habits .hhead { height: 0.2in; }
.habits .hrow { height: 0.36in; }
.habits .hinit, .habits .hcells { display: grid; grid-template-columns: repeat(7, 0.22in); gap: 3pt; }
.habits .hinit i { font-style: normal; font-size: 7.5pt; font-weight: 500; color: var(--t-muted); text-align: center; }
.habits .hcells i { display: block; width: 0.22in; height: 0.22in; box-sizing: border-box; border: 0.6pt solid var(--t-muted); border-radius: 2pt; }
.habits .hline { display: block; height: 0.22in; 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.5in; right: 0.5in; 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; }
