/* Movable Feast. A sheet of paper on a ground that follows the colour scheme.
   The sheet keeps its own light inks in both schemes; only the ground changes. */

* { box-sizing: border-box; transition: none; animation: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 24px 16px 48px;
  background: var(--bg);
  font-family: var(--font-body);
}

.sheet {
  color-scheme: light;
  --ink: #1A1A1A;
  --ink-soft: #5B5B5B;
  --rule: rgba(26, 26, 26, 0.25);
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 48px 32px;
  background: var(--c-cream);
  color: var(--ink);
  border: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.45;
}
.sheet p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { margin: 0 0 6px; color: var(--c-earth); font-size: 2.125rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.lede { max-width: 40rem; margin-bottom: 24px !important; }

/* ---- the form ---- */
select, input, button {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--c-cream);
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 34px;
  padding: 4px 8px;
  margin: 0;
}
select:disabled { color: var(--ink-soft); border-color: var(--rule); }
input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; width: 18px; height: 18px; min-height: 0; padding: 0; cursor: pointer; vertical-align: top; }
input[type="checkbox"]:checked { background: var(--ink); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--c-cream); border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type="checkbox"]:disabled { border-color: var(--rule); cursor: default; }
button { cursor: pointer; padding: 6px 14px; }
button:hover { background: var(--ink); color: var(--c-cream); }

.form { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 0 32px; align-items: start; }
.frow { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--rule); }
.frow:last-child { border-bottom: 1px solid var(--rule); }
.flabel, .field label { font-size: 0.8125rem; color: var(--ink-soft); }
.fctl { display: flex; flex-wrap: wrap; gap: 6px; }
.side { display: grid; gap: 10px; padding-top: 9px; border-top: 1px solid var(--rule); }
.field { display: grid; gap: 2px; }
.field select, .field input { width: 100%; }

.rule { margin-top: 28px !important; font-size: 1.375rem; line-height: 1.3; max-width: 44rem; }
.number { margin-top: 4px !important; font-size: 0.8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.next { margin-top: 18px !important; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- the table of movable feasts ---- */
#feasts { width: 100%; margin-top: 18px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding-bottom: 12px; }
.captext { display: block; font-weight: 500; }
.legend { display: block; font-size: 0.8125rem; color: var(--ink-soft); max-width: 46rem; }
#feasts thead th { text-align: left; font-size: 0.8125rem; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--ink); vertical-align: bottom; }
#feasts tbody tr + tr > * { border-top: 1px solid var(--rule); }
#feasts td, #feasts tbody th { padding: 10px 8px; vertical-align: top; text-align: left; }
#feasts tbody th { font-weight: 500; }
.feast { background: var(--c-lavlt); }
.d { display: block; font-size: 1rem; white-space: nowrap; }
.feast .d { font-size: 1.125rem; font-weight: 700; }
.state, .anchor { display: block; font-size: 0.75rem; color: var(--ink-soft); }
@media (min-width: 960px) { .anchor { white-space: nowrap; } }
.kept .d, .kept .state { color: var(--c-copper); }
.obs input[type="date"] { display: block; margin-top: 8px; font-size: 0.8125rem; min-height: 30px; padding: 2px 4px; }
.margin { font-size: 0.8125rem; min-width: 12rem; }
.margin .line { display: block; }
.margin .line + .line { margin-top: 4px; }
.store { margin-top: 10px !important; font-size: 0.875rem; }

.actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ink); }
.field.inline { display: inline-grid; margin-left: auto; min-width: 13rem; }

/* ---- the card, at real size ---- */
.preview { margin-top: 18px; overflow-x: auto; padding-bottom: 6px; }
.card {
  width: 190mm; height: 126mm; padding: 8mm;
  border: 0.3mm solid #1A1A1A; border-radius: 0;
  display: flex; flex-direction: column;
  color: #1A1A1A; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.card p { margin: 0; }
.c-name { font-size: 14pt; font-weight: 700; color: var(--c-earth); overflow-wrap: anywhere; }
.c-rule { font-size: 10pt; margin-top: 1.5mm !important; }
.c-no { font-size: 7pt; color: var(--ink-soft); margin-top: 0.6mm !important; }
.c-zone { font-size: 8pt; color: var(--ink-soft); margin-top: 1.2mm !important; }
.c-cols { display: flex; gap: 6mm; margin-top: 2.5mm; }
.c-col { flex: 1 1 0; min-width: 0; border-collapse: collapse; }
.c-col th { font-size: 7pt; font-weight: 400; color: var(--ink-soft); text-align: left; padding: 0 2mm 0.8mm 0; border-bottom: 0.2mm solid #1A1A1A; }
.c-col td { height: 6mm; padding: 0 2mm 0 0; vertical-align: middle; border-bottom: 0.15mm solid rgba(26, 26, 26, 0.25); }
.c-year, .c-date { font-size: 9pt; white-space: nowrap; }
.c-year { width: 1%; }
.c-date { width: 1%; }
.c-obs { padding-right: 0 !important; }
.c-box { display: block; width: 24mm; height: 4.4mm; border: 0.2mm solid #1A1A1A; }
.c-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.5mm; line-height: 1; }
.c-kept { font-size: 9pt; color: var(--c-copper); white-space: nowrap; }
.c-diff { font-size: 6.5pt; color: var(--ink-soft); white-space: nowrap; }
.c-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; font-size: 8pt; color: var(--ink-soft); }
.c-foot img { width: 22mm; height: auto; display: block; flex: none; }

/* ---- the check ---- */
.check { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--ink); }
.check h2 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.checkline { font-variant-numeric: tabular-nums; }
.check details { margin-top: 10px; }
.check summary { cursor: pointer; font-size: 0.875rem; }
.scroll { overflow-x: auto; }
.times { margin-top: 8px; border-collapse: collapse; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.times th { text-align: left; font-weight: 500; padding: 4px 16px 4px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.times td { padding: 3px 16px 3px 0; border-top: 1px solid var(--rule); white-space: nowrap; }
.times .num { text-align: right; }
.times tr.fail td { color: var(--c-copper); }
.source { margin-top: 10px !important; font-size: 0.8125rem; color: var(--ink-soft); }

.colophon { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; font-size: 0.8125rem; color: var(--ink-soft); }
.colophon p { max-width: 34rem; }
.colophon img { width: 112px; height: auto; flex: none; }

/* ---- narrow: the table becomes one block per year ---- */
@media (max-width: 719px) {
  body { padding: 16px 16px 32px; }
  .sheet { padding: 24px 16px 24px; }
  h1 { font-size: 1.875rem; }
  .lede { margin-bottom: 18px !important; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .frow { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; padding: 7px 0; }
  .frow select { max-width: 100%; }
  .side { grid-template-columns: 1fr 1fr; gap: 8px 10px; border-top: 0; padding-top: 10px; }
  .side .field:first-child { grid-column: 1 / -1; }
  .rule { margin-top: 20px !important; font-size: 1.1875rem; }
  #feasts, #feasts tbody, #feasts tr, #feasts td, #feasts tbody th, #feasts caption { display: block; }
  #feasts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #feasts tbody tr { border-top: 1px solid var(--ink); padding: 8px 0; }
  #feasts tbody tr + tr > * { border-top: 0; }
  #feasts tbody th { padding: 0 0 4px; font-size: 1rem; }
  #feasts td { position: relative; padding: 5px 6px 5px 7.25rem; }
  #feasts td::before { content: attr(data-label); position: absolute; left: 6px; top: 7px; width: 6.5rem; font-size: 0.75rem; color: var(--ink-soft); line-height: 1.3; }
  #feasts td.margin:empty { display: none; }
  .margin { min-width: 0; }
  .field.inline { margin-left: 0; width: 100%; }
  .colophon { flex-direction: column; align-items: flex-start; }
}

/* ---- print: the card alone, at 100 percent, centred on a card-sized page ---- */
@media print {
  html, body { background: none; margin: 0; padding: 0; }
  .sheet { max-width: none; margin: 0; padding: 0; border: 0; background: none; }
  .sheet > :not(.preview) { display: none !important; }
  .preview { margin: 0; padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
  .card { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
}
