/* readiness.gg
   Palette: chalk paper, slate-sea ink, Channel green, lichen yellow, granite.
   Type: Besley (display, a Clarendon in the manner of harbour notices) and
   Atkinson Hyperlegible (text). Both self-hosted, SIL OFL. */

@font-face {
  font-family: "Besley";
  src: url("/assets/fonts/besley-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbfcfa;
  --ink: #17313a;
  --sea: #2f6f6a;
  --sea-deep: #1f524e;
  --lichen: #e3b23c;
  --lichen-pale: #f7e9bf;
  --granite: #586064;
  --mist: #e6eeeb;
  --line: #c3cfcb;
  --display: "Besley", Georgia, "Times New Roman", serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
}

h1, h2 { font-family: var(--display); font-weight: 650; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 7.5vw, 4.6rem); letter-spacing: -0.015em; line-height: 1.02; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2rem); margin-bottom: 0.7rem; }
h3 { font-family: var(--text); font-weight: 700; font-size: 1.15rem; margin: 1.6rem 0 0.2rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin-bottom: 0.45rem; }

a { color: var(--sea-deep); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--lichen); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999rem; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header and footer */
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 2px solid var(--ink);
}
.wordmark { font-family: var(--display); font-weight: 750; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark span { font-weight: 450; }
.site-header ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 1.5rem; margin: 0; padding: 0; }
.site-header li { margin: 0; }
.site-header nav a { color: var(--ink); text-decoration: none; font-size: 1rem; padding: 0.2rem 0; border-bottom: 3px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--line); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--lichen); font-weight: 700; }

main { max-width: 70rem; margin: 0 auto; padding: 0 var(--gutter) 4rem; }
main > section { margin-top: clamp(2.5rem, 7vw, 4.5rem); }

.site-footer { border-top: 2px solid var(--ink); padding: 1.6rem var(--gutter) 2.5rem; font-size: 0.98rem; color: var(--granite); }
.site-footer p { max-width: var(--measure); }

/* Shared blocks */
.prose > *, .lede { max-width: var(--measure); }
.lede { font-size: clamp(1.2rem, 2.4vw, 1.4rem); line-height: 1.45; margin-top: 1.3rem; }
.hero { padding-top: clamp(1rem, 4vw, 3rem); }
.hero h1 { max-width: 11ch; }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.6rem; margin-top: 1.6rem; }
.button {
  display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  font-weight: 700; padding: 0.8rem 1.4rem; border-radius: 3px; border: 2px solid var(--ink);
}
.button:hover { background: var(--sea-deep); border-color: var(--sea-deep); color: var(--paper); }
.quiet { font-weight: 700; }

.two-up { display: grid; gap: 2rem 3.5rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.two-up p { margin-bottom: 0; }
@media (min-width: 46rem) { .two-up { grid-template-columns: 1fr 1fr; } }

.with-gauge { display: grid; gap: 2.5rem 4rem; align-items: start; }
@media (min-width: 56rem) { .with-gauge { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }

.aside-note { background: var(--mist); padding: clamp(1.4rem, 4vw, 2.4rem); border-left: 6px solid var(--sea); }
.aside-note p:last-child { margin-bottom: 0; }


/* Citations */
.cite { font-size: 0.68em; line-height: 0; vertical-align: super; margin-left: 0.12em; }
.cite a { text-decoration: none; font-weight: 700; padding: 0 0.1em; }
.cite a:hover { text-decoration: underline; }
.cite-next::before { content: ","; margin-right: 0.1em; }

/* The gauge: a tide board that counts days without a delivery */
.gauge { margin: 0; --u: 1.8rem; }
.gauge figcaption { font-weight: 700; margin-bottom: 1.2rem; }
.gauge-scale {
  list-style: none; margin: 0; padding: 0; position: relative;
  height: calc(30 * var(--u) + 3rem);
}
.gauge-scale::before {
  content: ""; position: absolute; left: 0; top: 0; width: 1.1rem; height: calc(30 * var(--u));
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(to bottom, var(--ink) 0 var(--u), var(--paper) var(--u) calc(2 * var(--u)));
}
.gauge .mark {
  position: absolute; left: 0; right: 0; top: calc(var(--day) * var(--u));
  margin: 0; padding-left: 2.9rem; font-size: 1rem; line-height: 1.3; transform: translateY(-0.65em);
}
.gauge .mark::before {
  content: ""; position: absolute; left: 1.1rem; top: 0.65em; width: 1.3rem; border-top: 2px solid var(--ink);
}
.gauge .mark strong { font-family: var(--display); font-weight: 700; font-size: 1.08rem; }
.gauge .mark[data-day="0"] { --day: 0; }
.gauge .mark[data-day="1.5"] { --day: 1.5; }
.gauge .mark[data-day="3"] { --day: 3; }
.gauge .mark[data-day="6"] { --day: 6; }
.gauge .mark[data-day="7"] { --day: 7; }
.gauge .mark[data-day="10"] { --day: 10; }
.gauge .mark[data-day="14"] { --day: 14; }
.gauge .mark[data-day="30"] { --day: 30; }
.gauge .mark.band::after {
  content: ""; position: absolute; left: 2px; top: 0.65em; width: calc(1.1rem - 4px); height: calc(2 * var(--u));
  background: var(--lichen); mix-blend-mode: multiply; opacity: 0.85;
}
.gauge .mark.goal::before, .gauge .mark.floor::before { border-top: 4px solid var(--lichen); top: calc(0.65em - 1px); }
.gauge .mark.floor span { font-weight: 700; }
.gauge .mark.goal span { background: var(--lichen-pale); box-shadow: 0.35rem 0 0 var(--lichen-pale), -0.35rem 0 0 var(--lichen-pale); padding: 0.1rem 0; }
.gauge-foot { font-size: 0.98rem; color: var(--granite); margin: 0; padding-left: 2.9rem; }

/* Home: the seven steps */
.step-list { list-style: none; counter-reset: step; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 46rem) { .step-list { grid-template-columns: 1fr 1fr; column-gap: 3.5rem; } }
.step-list li { counter-increment: step; margin: 0; border-bottom: 1px solid var(--line); }
.step-list a { display: grid; grid-template-columns: 2.6rem 1fr; align-items: baseline; padding: 0.9rem 0; text-decoration: none; color: var(--ink); }
.step-list a::before { content: counter(step); font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--sea); grid-row: span 2; }
.step-list .t { font-weight: 700; }
.step-list .m { grid-column: 2; font-size: 0.95rem; color: var(--granite); }
.step-list a:hover .t { text-decoration: underline; text-decoration-thickness: 0.12em; text-underline-offset: 0.18em; }

/* Comparison table */
.compare table { width: 100%; border-collapse: collapse; font-size: 1.02rem; line-height: 1.45; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--line); }
.compare thead th { font-family: var(--display); font-weight: 700; border-bottom: 2px solid var(--ink); }
.compare tbody th { width: 24%; font-weight: 700; }
.compare td:last-child { background: var(--mist); padding-left: 1rem; }
.compare thead th:last-child { padding-left: 1rem; }
@media (max-width: 45.99rem) {
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare table, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare tr { border-bottom: 2px solid var(--ink); padding: 1rem 0; }
  .compare tbody th { width: auto; border: 0; padding: 0 0 0.5rem; font-family: var(--display); font-size: 1.15rem; }
  .compare td { border: 0; padding: 0.5rem 0 0.6rem; }
  .compare td::before { display: block; font-size: 0.9rem; font-weight: 700; color: var(--granite); }
  .compare td:nth-of-type(1)::before { content: "UK mainland"; }
  .compare td:nth-of-type(2)::before { content: "Channel Islands"; }
  .compare td:last-child { padding: 0.7rem 0.9rem; }
}

/* The plan */
.progress { border: 2px solid var(--ink); padding: 1.1rem 1.3rem; max-width: 46rem; }
.progress p { margin: 0; }
#progress-text { font-weight: 700; }
.progress progress { display: block; width: 100%; height: 0.8rem; margin: 0.7rem 0; appearance: none; -webkit-appearance: none; border: 0; background: var(--mist); }
.progress progress::-webkit-progress-bar { background: var(--mist); }
.progress progress::-webkit-progress-value { background: var(--sea); }
.progress progress::-moz-progress-bar { background: var(--sea); }
.progress-tools { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; align-items: baseline; font-size: 0.95rem; color: var(--granite); }
.save-note { flex: 1 1 18rem; }
.link-button { font: inherit; color: var(--sea-deep); background: none; border: 0; padding: 0.2rem 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.link-button:hover { color: var(--ink); }

.step { display: grid; grid-template-columns: 1fr; gap: 0.6rem 2rem; border-top: 2px solid var(--ink); padding-top: 1.6rem; }
@media (min-width: 46rem) { .step { grid-template-columns: 5rem minmax(0, 46rem); } }
.step-num {
  font-family: var(--display); font-weight: 700; font-size: 3.4rem; line-height: 0.9; color: var(--sea);
  width: 4.2rem; height: 4.2rem; display: grid; place-items: center; border-radius: 50%;
}
.step.done .step-num { background: var(--sea); color: var(--paper); font-size: 2.4rem; }
.step-time { color: var(--granite); font-size: 0.98rem; margin-bottom: 0.9rem; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0; border-top: 1px solid var(--line); }
.checklist li { margin: 0; border-bottom: 1px solid var(--line); }
.checklist label { display: grid; grid-template-columns: 2.2rem 1fr; align-items: start; padding: 0.8rem 0; cursor: pointer; }
.checklist input { width: 1.35rem; height: 1.35rem; margin: 0.2rem 0 0; accent-color: var(--sea); }
.checklist input:checked + span { color: var(--granite); }
.island-note { background: var(--mist); border-left: 6px solid var(--lichen); padding: 0.9rem 1.1rem; margin: 0; }

/* Sources */
.source-list { padding-left: 2rem; max-width: 52rem; font-size: 1rem; line-height: 1.45; }
.source-list li { margin-bottom: 1rem; padding-left: 0.3rem; }
.source-list li:target { background: var(--lichen-pale); box-shadow: 0 0 0 0.5rem var(--lichen-pale); }
.source-list .pub { color: var(--granite); }
.source-list .supports { display: block; }

@media print {
  body { font-size: 11pt; background: #fff; }
  .site-header nav, .site-footer, .actions, .progress-tools, .skip, .cite { display: none; }
  .site-header { border-bottom: 1px solid #000; padding-inline: 0; }
  main { padding: 0; max-width: none; }
  .step { break-inside: avoid; grid-template-columns: 3rem 1fr; }
  .step-num { font-size: 2rem; width: auto; height: auto; }
  .island-note { border: 1px solid #000; background: none; }
  a { color: #000; text-decoration: none; }
}

/* Household panel on the plan page */
.household { background: var(--mist); border-left: 6px solid var(--sea); padding: clamp(1.2rem, 4vw, 2rem); max-width: 46rem; }
.household > p { max-width: var(--measure); }
.household .fields { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; margin: 1.2rem 0; }
.household .fields label { display: grid; gap: 0.3rem; font-weight: 700; }
.household input[type="number"], .household select {
  font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 3px;
  padding: 0.45rem 0.6rem; min-height: 2.8rem;
}
.household input[type="number"] { width: 5.5rem; }
.household fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.household legend { font-weight: 700; padding: 0; margin-bottom: 0.4rem; }
.household fieldset label { display: grid; grid-template-columns: 2.2rem 1fr; align-items: start; padding: 0.45rem 0; cursor: pointer; }
.household fieldset input { width: 1.35rem; height: 1.35rem; margin: 0.2rem 0 0; accent-color: var(--sea); }
.household-summary:not(:empty) { border-top: 2px solid var(--ink); padding-top: 1rem; margin-top: 0.4rem; }
.household-summary p { margin: 0 0 0.4rem; }
.household-summary p:first-child { font-family: var(--display); font-weight: 650; font-size: 1.3rem; line-height: 1.25; }
.household-tools { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; align-items: baseline; margin: 1rem 0 0; }
.fill:not(:empty) { background: var(--lichen-pale); box-shadow: 0.25rem 0 0 var(--lichen-pale), -0.25rem 0 0 var(--lichen-pale); font-weight: 700; }

/* Backup notes inside a step */
.backup { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.backup h3 { margin-top: 0; font-family: var(--display); font-weight: 650; font-size: 1.3rem; }
.backup li { margin-bottom: 0.8rem; }

/* Household sheet */
.sheet { border: 2px solid var(--ink); padding: clamp(1.2rem, 4vw, 2.2rem); max-width: 50rem; background: #fff; }
.sheet-title { font-size: 1.7rem; margin-bottom: 1rem; }
.sheet h3 { margin: 1.5rem 0 0.5rem; font-family: var(--display); font-weight: 650; font-size: 1.15rem; }
.sheet-facts { margin: 0; display: grid; gap: 0.7rem 2rem; }
.sheet-facts.two { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.sheet-facts div { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; align-items: end; gap: 0.8rem; }
.sheet-facts.two div { grid-template-columns: auto 1fr; }
.sheet-facts dt { font-weight: 700; font-size: 0.98rem; }
.sheet-facts dd { margin: 0; }
.rule { border-bottom: 1px solid var(--granite); min-height: 1.7rem; }
.rule.filled { border-bottom-color: transparent; }
.rule.tall { min-height: 3.6rem; margin: 0; }
.sheet-lines { width: 100%; border-collapse: collapse; }
.sheet-lines th { text-align: left; font-size: 0.9rem; color: var(--granite); font-weight: 700; padding: 0 0 0.2rem; }
.sheet-lines td { border-bottom: 1px solid var(--granite); height: 2.1rem; width: 50%; font-size: 0.95rem; color: var(--granite); vertical-align: bottom; padding: 0 0.6rem 0.15rem 0; }
.sheet-foot { margin: 1.6rem 0 0; font-size: 0.9rem; color: var(--granite); }

@media print {
  .household, .sheet-intro { display: none; }
  .backup { break-inside: avoid; }
  .checklist li[hidden] { display: none; }
  .page-sheet .site-header { display: none; }
  .page-sheet main > section { margin-top: 0; }
  .sheet { border: 0; padding: 0; max-width: none; }
  .sheet-facts div { break-inside: avoid; }
  .page-sheet body, .page-sheet { font-size: 10pt; }
  .sheet-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
  .sheet h3 { margin: 0.8rem 0 0.3rem; font-size: 1rem; }
  .sheet-facts { gap: 0.35rem 1.5rem; }
  .rule { min-height: 1.35rem; }
  .rule.tall { min-height: 2.4rem; }
  .sheet-lines td { height: 1.6rem; }
  .sheet-foot { margin-top: 0.8rem; }
  .fill:not(:empty) { background: none; box-shadow: none; }
}

/* Pantry table */
.pantry table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.4; }
.pantry th, .pantry td { text-align: left; vertical-align: top; padding: 0.8rem 0.9rem 0.8rem 0; border-bottom: 1px solid var(--line); }
.pantry thead th { font-family: var(--display); font-weight: 700; border-bottom: 2px solid var(--ink); }
.pantry tbody th { font-weight: 700; width: 46%; }
.pantry tbody td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pantry .eg { display: block; font-weight: 400; font-size: 0.95rem; margin-top: 0.3rem; }
.pantry .eg.island { color: var(--granite); }
.pantry .personal-col { display: none; }
.pantry table.personal .personal-col { display: table-cell; background: var(--lichen-pale); padding-left: 0.6rem; font-weight: 700; }
@media (max-width: 45.99rem) {
  .pantry thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pantry table, .pantry tbody, .pantry tr, .pantry th, .pantry td { display: block; width: auto; }
  .pantry tr { border-bottom: 2px solid var(--ink); padding: 0.9rem 0; }
  .pantry tbody th { width: auto; border: 0; padding: 0 0 0.4rem; }
  .pantry tbody td { border: 0; padding: 0.15rem 0; white-space: normal; }
  .pantry td::before { font-size: 0.9rem; font-weight: 400; color: var(--granite); margin-right: 0.4rem; }
  .pantry td:nth-of-type(1)::before { content: "One person, two weeks:"; }
  .pantry td:nth-of-type(2)::before { content: "One person, a month:"; }
  .pantry table.personal td[data-col="floor"]::before { content: "Your household, two weeks:"; }
  .pantry table.personal td[data-col="target"]::before { content: "Your household, a month:"; }
  .pantry table.personal .personal-col { display: block; background: none; padding-left: 0; }
}

/* Kit page */
.kit { list-style: none; padding: 0; margin: 1rem 0 0; }
.kit li { border-top: 1px solid var(--line); padding: 1.1rem 0 0.4rem; }
.kit h3 { margin: 0 0 0.3rem; font-size: 1.15rem; }
.kit p { margin: 0 0 0.6rem; }
.kit .caution { border-left: 3px solid var(--ink); padding-left: 0.8rem; }
.kit .where { color: var(--granite); font-size: 0.95rem; }
.kit .online { display: inline-block; margin-left: 0.4rem; }
.funding { background: var(--lichen-pale); padding: 1rem 1.2rem; margin: 1.2rem 0; border-radius: 4px; }
.funding h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.funding p { margin: 0; font-size: 0.95rem; }

/* Admin counter page */
.admin form { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: end; margin-bottom: 1rem; }
.admin form label { display: grid; gap: 0.3rem; font-weight: 700; }
.admin input, .admin select { font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; padding: 0.45rem 0.6rem; min-height: 2.8rem; }
.admin form #admin-signout { background: none; border: 0; font: inherit; color: var(--sea); cursor: pointer; padding: 0.6rem 0; }
.admin table { border-collapse: collapse; margin: 0.6rem 0 1.6rem; min-width: 20rem; }
.admin th, .admin td { text-align: left; padding: 0.4rem 1.2rem 0.4rem 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.admin thead th { border-bottom: 2px solid var(--ink); }
.admin td:not(:first-child), .admin th:not(:first-child) { text-align: right; }
