/* printed.css: the printed answer tables and lists on the calendar pages; the markup is written by
   tools/printed-answers.js. Linked only from pages that carry a .dd-printed section, after
   almanac.css. Every colour is a token. A table wider than a phone scrolls inside its own wrapper,
   so the page itself never scrolls sideways; the tools' print sheet leaves these sections out with
   the rest of the prose. */

.dd-printed .table-wrap { container-type: inline-size; }
.dd-printed table { min-width: 0; }
/* Values stay on one line; a header, a holiday's name and the roomier tables may wrap. */
.dd-printed td { white-space: nowrap; }
.dd-printed .dd-wrap td { white-space: normal; }
.dd-printed .dd-nb { white-space: nowrap; }
.dd-printed th[scope="rowgroup"] { background: var(--accent-soft); letter-spacing: .08em; }

/* The caption wraps at the width of the wrapper, not of a table wider than it, and stays in view
   while the table scrolls sideways. */
.dd-printed caption {
  caption-side: top;
  position: sticky;
  left: 0;
  max-width: calc(100vw - 3rem);
  max-width: 100cqw;
  padding: .55rem .7rem;
  text-align: left;
  font-style: italic;
  color: var(--ink-soft);
}

/* A short row header (a year, a week, a day number) stays in view while its row scrolls sideways.
   Cells own their borders in these tables, so a pinned cell carries its rules with it. */
.dd-printed .dd-pin { border-collapse: separate; border-spacing: 0; }
.dd-printed .dd-pin tbody th, .dd-printed .dd-pin thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: nowrap;
  background: var(--panel);
  border-right: 1px solid var(--line-strong);
}
.dd-printed .dd-num { font-variant-numeric: lining-nums tabular-nums; }
.dd-printed .dd-num th, .dd-printed .dd-num td { text-align: right; }

/* Year and month blocks fold; the summary is a full tap target. */
.dd-printed details { border-top: 1px dotted var(--line-strong); }
.dd-printed details:last-of-type { border-bottom: 1px dotted var(--line-strong); }
.dd-printed summary { cursor: pointer; min-height: var(--tap); padding: .62rem 0 .5rem; font-weight: 700; }
.dd-printed summary::marker { color: var(--fail); }
.dd-printed details .table-wrap { margin-top: .2rem; }
.dd-printed ul { margin: .2rem 0 1rem; padding-left: 1.3rem; }
.dd-printed li { margin: .3rem 0; }

@media (max-width: 560px) {
  .dd-printed th, .dd-printed td { padding: .42rem .3rem; }
  .dd-printed thead th { letter-spacing: .04em; }
  .dd-printed caption { padding: .5rem .3rem; }
}
