/* Sanyer Recipes: hand-written token CSS, mobile-first, no framework.
   Palette and type per the Sanyer brand standard; layout mirrors the printed
   recipe card. */

:root {
  --ink: #1e3a5f;
  --ink-deep: #16304f;
  --muted: #51627a;
  --blue-hi: #add2ed;
  --blue-lo: #84b6da;
  --rose-hi: #edc8d2;
  --rose-lo: #d6a1b1;
  --near-white: #eaf2f9;
  --rule: #c3daee;
  --white: #fff;

  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --space: 1rem;
  --wrap: 44rem;
  --tap: 2.75rem; /* 44 px minimum tap target */
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-deep);
  background: var(--white);
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--ink-deep);
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--blue-lo);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--space);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---- Header: crest + SANYER, then the section label ---------------------- */
.site-header {
  border-bottom: 1px solid var(--ink);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  min-height: 3.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  height: 1.75rem;
  width: auto;
}
.section {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Type ----------------------------------------------------------------- */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
h1 {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  margin: 1.25rem 0 0.25rem;
}
h2 {
  font-size: 1.375rem;
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
}
h3 {
  font-size: 1rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.5rem 0 0.5rem;
}
.note {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0.5rem 0;
}
.lede {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* ---- Recipe head ---------------------------------------------------------- */
.credit {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 0.75rem;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.facts div {
  background: var(--near-white);
  border-left: 3px solid var(--ink);
  padding: 0.5rem 0.625rem;
  font-size: 0.9375rem;
}
.facts dt {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.facts dd {
  margin: 0;
}
.pdf {
  margin: 0.75rem 0 0;
}
.pdf a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.pdf a:hover {
  background: var(--near-white);
}
.pdf span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---- Checklists (tap-to-check) -------------------------------------------- */
.checklist {
  list-style: none;
  margin: 0.25rem 0;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.checklist input {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.7rem 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.checklist label {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 0.6rem 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: baseline;
}
.checklist .item {
  font-weight: 600;
  color: var(--ink);
}
.checklist .amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.checklist .inote {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  color: var(--muted);
}
.pack label {
  display: block;
}
.pack .item {
  font-weight: 400;
  color: var(--ink-deep);
}
.checklist input:checked + label .item,
.checklist input:checked + label .amount {
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.reset-row {
  margin: 0.75rem 0 0;
}
.reset {
  min-height: var(--tap);
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
}

/* ---- Method --------------------------------------------------------------- */
.key b {
  color: var(--ink);
  white-space: nowrap;
}
.timer {
  border: 1.5px solid var(--ink);
  padding: 0.75rem;
  margin: 1rem 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.timer[hidden] {
  display: none;
}
.timer label {
  font-weight: 700;
  color: var(--ink);
}
.timer input {
  font: inherit;
  font-size: 1.125rem;
  min-height: var(--tap);
  padding: 0.25rem 0.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  color: var(--ink-deep);
  background: var(--white);
  max-width: 100%;
}
.timer-help {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.step {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.when {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.offset {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-deep);
  background: var(--near-white);
  border-radius: 3px;
  padding: 0 0.25rem;
  justify-self: start;
  align-self: flex-start;
}
.clock:empty {
  display: none;
}
.body {
  display: flex;
  gap: 0.5rem;
}
.body .n {
  flex: none;
  color: var(--muted);
  min-width: 1.25rem;
}
.body p {
  margin: 0;
}
.cue {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0.25rem 0;
  padding-left: 0.625rem;
  border-left: 3px solid var(--blue-hi);
}

/* ---- Fixes ---------------------------------------------------------------- */
.fix {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.fix li {
  margin-bottom: 0.625rem;
}
.fix b {
  color: var(--ink);
}
.box-note {
  background: var(--near-white);
  border-left: 3px solid var(--rose-lo);
  padding: 0.625rem 0.75rem;
  margin: 1rem 0;
}

/* ---- Index ---------------------------------------------------------------- */
.recipe-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space);
}
.recipe-card {
  position: relative;
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  border-radius: 4px;
  padding: 1rem;
  background: var(--white);
}
.recipe-card:hover {
  background: var(--near-white);
}
.recipe-card h2 {
  margin: 0 0 0.25rem;
  border: 0;
  padding: 0;
  font-size: 1.375rem;
}
.recipe-card h2 a {
  text-decoration: none;
}
/* Stretched link: the whole card is the tap target. */
.recipe-card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.recipe-card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  font-size: 0.9375rem;
}
.card-facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.card-facts dd {
  margin: 0;
}

/* ---- Footer --------------------------------------------------------------- */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--ink);
  background: var(--near-white);
  padding: 1.25rem 0 1.5rem;
  font-size: 0.9375rem;
}
.site-footer p {
  margin: 0.25rem 0;
}
.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.footer-links a {
  display: inline-block;
  padding: 0.5rem 0;
}
.footer-fine,
.footer-credit {
  color: var(--muted);
}

/* ---- Wider screens -------------------------------------------------------- */
@media (min-width: 40rem) {
  :root {
    --space: 1.5rem;
  }
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .pack {
    columns: 2;
    column-gap: 2rem;
  }
  .pack li {
    break-inside: avoid;
  }
  .pdf span {
    display: inline;
    margin: 0 0 0 0.5rem;
  }
  .step {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }
}

/* ---- Print ---------------------------------------------------------------- */
@media print {
  @page {
    size: letter;
    margin: 0.6in 0.65in 0.7in;
  }
  body {
    font-size: 10.5pt;
    color: #000;
  }
  .skip,
  .timer,
  .pdf,
  .reset-row,
  .footer-links {
    display: none !important;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  .checklist input {
    /* keep checkboxes as boxes on paper */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: 11pt;
    height: 11pt;
    margin-top: 0.35rem;
  }
  .checklist label,
  .reset {
    min-height: 0;
    padding: 0.2rem 0;
  }
  .facts div,
  .box-note,
  .clock {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .stage,
  .fix li,
  .step,
  .checklist li {
    break-inside: avoid;
  }
  h2,
  h3 {
    break-after: avoid;
  }
  .site-footer {
    background: none;
    margin-top: 1.5rem;
  }
  .recipe-card h2 a::after {
    content: none;
  }
}
