/* The printable 28-day chair plan (guides/28-day-chair-plan; chair_plan() in _build/build.py
   writes the grid, assets/chair-plan.js the ticks and the Print button). On screen it follows the
   reading pages (inner.css): dark cards, gold accents. In print it drops the header, footer,
   dark ground and app links: the grid fills page 1 and the written-out moves page 2, on A4
   and on US Letter (@page size auto, so the printer's paper decides). */

/* The grid on screen */
body.inner main .chair-plan { margin: var(--space-12) 0; }
body.inner main .wrap .chair-plan h2 { margin: 0 0 var(--space-4); }
body.inner .cp-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-8); }
body.inner .cp-actions .button { margin: 0; }
body.inner .cp-actions [hidden] { display: none; }
body.inner .cp-actions .ghost { background: none; cursor: pointer; font: inherit; font-weight: 600; font-size: 15px; }
body.inner main .chair-plan h3 { margin: var(--space-8) 0 var(--space-3); color: var(--gold-2); }
body.inner main .chair-plan .cp-week:first-child h3 { margin-top: 0; }

body.inner .cp-days {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-2);
  grid-template-columns: 3fr 1fr 3fr 1fr 3fr 1fr 1fr;
}
body.inner main .chair-plan .cp-days > li { margin: 0; }
body.inner .cp-day { border-radius: var(--radius-sm); padding: var(--space-3); min-width: 0; }
body.inner .cp-day.is-session {
  background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: 56px 1fr; column-gap: var(--space-3); align-content: start;
  grid-template-areas: "img num" "img name" "moves moves" "check check";
}
body.inner .cp-day.is-rest {
  border: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--space-1);
}
body.inner main .chair-plan .cp-day p { margin: 0; }
body.inner main .chair-plan .cp-daynum { grid-area: num; font-size: 13px; line-height: 1.3; color: var(--faint); align-self: end; }
body.inner main .chair-plan .cp-rest { font-size: 14px; line-height: 1.3; color: var(--muted); }
body.inner .cp-day img {
  grid-area: img; width: 56px; height: 56px; border-radius: 10px; background: #fff; object-fit: contain;
}
body.inner main .chair-plan .cp-name { grid-area: name; font-size: 16px; line-height: 1.25; font-weight: 650; color: var(--text); }
body.inner main .chair-plan .cp-name a { color: inherit; text-decoration: none; }
body.inner main .chair-plan .cp-name a:hover { text-decoration: underline; }
body.inner .cp-moves { grid-area: moves; list-style: none; margin: var(--space-3) 0 0; padding: 0; }
body.inner main .chair-plan .cp-moves li { font-size: 13.5px; line-height: 1.4; margin: 0 0 2px; color: var(--read); }
body.inner .cp-check {
  grid-area: check; display: inline-flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-3); font-size: 14px; color: var(--muted); cursor: pointer;
  min-height: 44px; /* the touch target, not the box */
}
body.inner .cp-check input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 22px; height: 22px; border: 2px solid var(--gold); border-radius: 6px; background: transparent; cursor: pointer;
}
body.inner .cp-check input:checked {
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230c0b09' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
body.inner .cp-check input:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
body.inner .cp-source { display: none; }

/* Narrower screens: each week becomes a list, rest days a slim row. */
@media (max-width: 860px) {
  body.inner .cp-days { grid-template-columns: 1fr; }
  body.inner .cp-day.is-rest { flex-direction: row; justify-content: space-between; padding: var(--space-2) var(--space-3); }
  body.inner main .chair-plan .cp-moves { columns: 2; column-gap: var(--space-4); }
}
@media (max-width: 520px) {
  body.inner main .chair-plan .cp-moves { columns: 1; }
}

/* Print: page 1 the grid, page 2 the moves. */
@page { size: auto; margin: 10mm 11mm; }
@media print {
  /* color-scheme: light, or Chrome paints the page margins in the site's dark canvas. */
  :root { color-scheme: light; }
  html, body, body.inner { background: #fff !important; color: #000; }
  body.inner::before, body.inner::after { display: none; }
  header.site, footer.site, .page-date, .cp-actions, .cta-egg,
  body.inner main .wrap > h1 + .page-date + p,
  #in-fitstreak, #in-fitstreak + p, #questions, #questions ~ h3, #questions ~ p,
  #more-guides, #more-guides + .links { display: none !important; }
  body.inner main { padding: 0; }
  body.inner main .wrap { max-width: none; padding: 0; }
  body.inner main * { color: #000 !important; box-shadow: none !important; }
  body.inner main a { text-decoration: none !important; }

  body.inner main h1 { font-size: 22pt; line-height: 1.1; margin: 0 0 2mm; }
  body.inner main .wrap > blockquote { margin: 0 0 3mm; padding: 0 0 0 3mm; border-left: 0.5mm solid #999; }
  body.inner main .wrap > blockquote p { font-size: 8.5pt; line-height: 1.35; margin: 0; font-style: normal; }

  body.inner main .chair-plan { margin: 0; break-after: page; }
  body.inner main .chair-plan h2 { display: none; }
  body.inner main .chair-plan h3 { font-family: var(--font); font-size: 9pt; font-weight: 700; margin: 2.5mm 0 1.2mm; }
  body.inner main .chair-plan .cp-week:first-child h3 { margin-top: 0; }
  body.inner .cp-week { break-inside: avoid; }
  body.inner .cp-days { grid-template-columns: 3fr 1fr 3fr 1fr 3fr 1fr 1fr; gap: 1.6mm; }
  body.inner .cp-day { border-radius: 2mm; padding: 2.2mm; }
  body.inner .cp-day.is-session {
    background: #fff; border: 0.3mm solid #777;
    grid-template-columns: 14mm 1fr; column-gap: 2mm;
    /* The name gets the full width on paper (no "Warm-" / "Up" split); the box sits by the image. */
    grid-template-areas: "img num" "img check" "name name" "moves moves";
  }
  body.inner .cp-day.is-rest { border: 0.3mm dashed #aaa; flex-direction: column; justify-content: center; padding: 1.5mm; }
  body.inner .cp-day img { width: 14mm; height: 14mm; border-radius: 1mm; border: 0.2mm solid #ccc; }
  body.inner main .chair-plan .cp-daynum { font-size: 7.5pt; line-height: 1.2; color: #444 !important; }
  body.inner main .chair-plan .cp-rest { font-size: 7.5pt; color: #555 !important; }
  body.inner main .chair-plan .cp-name { font-size: 9.5pt; line-height: 1.15; }
  body.inner .cp-moves { margin-top: 1.4mm; }
  body.inner main .chair-plan .cp-moves { columns: 1; }
  body.inner main .chair-plan .cp-moves li { font-size: 8pt; line-height: 1.35; margin: 0; }
  body.inner .cp-check { min-height: 0; margin-top: 0; align-self: center; font-size: 7.5pt; gap: 1.5mm; }
  body.inner main .chair-plan .cp-day p.cp-name { margin-top: 1.2mm; }
  body.inner .cp-check input { width: 3.6mm; height: 3.6mm; border: 0.35mm solid #000; border-radius: 0.8mm; background: #fff; }
  /* A ticked day prints as a black tick on white (backgrounds often do not print). */
  body.inner .cp-check input:checked {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  /* The "download the PDF" tip means nothing on paper. */
  body.inner .cp-notes li:has(a[href$=".pdf"]) { display: none; }
  body.inner main .chair-plan .cp-source { display: block; margin-top: 3mm; font-size: 7.5pt; color: #444 !important; }

  /* Page 2: how to use and the six workouts, in two columns. */
  body.inner .cp-notes { columns: 2; column-gap: 8mm; }
  body.inner main .cp-notes h2 { font-size: 13pt; line-height: 1.15; margin: 0 0 1.5mm; break-after: avoid; }
  body.inner main .cp-notes h2:not(:first-child) { margin-top: 3mm; }
  body.inner main .cp-notes h3 { font-size: 9.5pt; margin: 2.5mm 0 0.6mm; break-after: avoid; }
  body.inner main .cp-notes p, body.inner main .cp-notes li { font-size: 7.8pt; line-height: 1.32; }
  body.inner main .cp-notes p { margin: 0 0 1mm; }
  body.inner main .cp-notes ul { margin: 0; padding-left: 3.5mm; }
  body.inner main .cp-notes li { margin: 0 0 0.6mm; break-inside: avoid; }
}
