/* Mirrors the InDesign master (Master_2027.indd): one typeface, one ink, cream paper.
   Print scale: body 7.5/9 pt → web 16 px. Ratios below are the calendar's own.
   Sabon LT Pro is used when available (locally activated Adobe font, or an Adobe Fonts
   web project kit); Crimson Pro stands in otherwise (EB Garamond draws a broken ī). */
:root {
  --paper: #fdfbf2;           /* swatch #fdfbf2: 55% from white toward #fcf7e8, same as the calendar masters */
  --ink: #1e1e1e;             /* swatch #1e1e1e */
  --grey: #b3b1ad;            /* swatch dates_extra, other-month dates */
  --hair: rgba(30, 30, 30, 0.28);
  --serif: "Sabon LT Pro", "sabon-lt-pro", "Crimson Pro", Georgia, serif;   /* brand: titles and short subheads */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;                   /* everything else */
  --muted: #6f6a63;
  --max: 1120px;
  --m: clamp(16px, 3.4vw, 40px);      /* 10 mm of a 297 mm page */
  --fs: 16px;                          /* recipe body 7.5 pt */
  --fs-title: 1.333em;                 /* recipe title 10 pt */
  --fs-year: clamp(24px, 2.7vw, 34px); /* year 16 pt */
  --fs-month: clamp(40px, 5vw, 64px);  /* month 30 pt */
  --fs-date: 34px;                     /* dates 16 pt */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1.5;
  font-feature-settings: "liga", "kern", "cv11";
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p, h1, h2, ul, ol { margin: 0; }
main { flex: 1 0 auto; width: 100%; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--m); padding-right: var(--m); }

/* top bar */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: calc(var(--m) * 0.6); }
.brand { display: block; line-height: 0; flex: none; }
.brand img { height: 32px; width: auto; display: block; }
.lang { display: inline-flex; gap: 2px; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; align-self: center; }
.lang a { font-size: 0.8125em; font-weight: 500; letter-spacing: 0.06em; padding: 6px 13px; border-radius: 999px; color: var(--muted); line-height: 1.2; }
.lang a.is-active { background: var(--ink); color: var(--paper); }
.lang .slash { display: none; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.head-submit .short { display: none; }
@media (max-width: 345px) { .head-submit { display: none; } }

/* calendar page header: year italic, month roman, centred */
.month-head { text-align: center; padding: clamp(40px, 6vw, 80px) 0 clamp(24px, 4vw, 48px); }
.year { font-family: var(--serif); font-style: italic; font-size: var(--fs-year); line-height: 1.1; }
.month { font-family: var(--serif); font-weight: 400; font-size: var(--fs-month); line-height: 1.05; letter-spacing: -0.005em; text-wrap: balance; }
.lede { font-family: var(--serif); font-style: italic; font-size: 1.2em; margin-top: 0.8em; }

/* visual frame 277 × 147.5 mm, square corners */
.visual { margin: 0; width: 100%; aspect-ratio: 277 / 147.5; overflow: hidden; }
.visual img { width: 100%; height: 100%; object-fit: cover; }
.visual--empty { border: 0.5px solid var(--hair); display: grid; place-items: center; font-size: var(--fs-date); color: var(--grey); line-height: 1; }

/* recipe band under the visual: three columns like the printed band */
.band { display: grid; grid-template-columns: 1fr; gap: calc(var(--m) * 1.2) 48px; padding: calc(var(--m) * 0.9) 0 clamp(40px, 6vw, 80px); align-items: start; }
.band .col-1 { max-width: 62ch; }
@media (min-width: 860px) {
  .band { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
  .band .col-1 { position: sticky; top: 24px; }
  .band--plain { grid-template-columns: 1fr; }
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 0.3em; }
.section-head .head { margin-bottom: 0; }
.section-head--spaced { margin-top: 1.6em; }

.recipe-title { font-family: var(--serif); font-weight: 700; font-size: 1.6em; line-height: 1.15; margin-bottom: 0.25em; text-wrap: balance; }
.credit { font-size: 0.875em; color: var(--muted); margin-bottom: 1em; }
.body { max-width: 56ch; }
.body p + p { margin-top: 0.7em; }
.head { font-family: var(--serif); font-weight: 700; font-size: 1.25em; line-height: 1.3; margin-bottom: 0.2em; }
.head--spaced { margin-top: 1.2em; }                                                                                             /* sb 3.175 mm */
.group { font-weight: 600; font-size: 0.875em; margin-top: 0.6em; margin-bottom: 0.1em; list-style: none; }

.ingredients { list-style: none; padding: 0; margin: 0; max-width: 48ch; }
.ingredients li + li:not(.group) { border-top: 0.5px solid var(--hair); }
.ingredients li.group { margin-left: 0; margin-top: 0.8em; }
.ingredients label { display: flex; align-items: flex-start; gap: 0.75em; padding: 0.5em 0; cursor: pointer; position: relative; }
.ingredients input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ingredients .box { flex: none; width: 20px; height: 20px; border: 1px solid var(--ink); border-radius: 6px; position: relative; top: 0.1em; transition: background 0.15s; }
.ingredients .box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--paper); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg); opacity: 0; }
.ingredients input:checked ~ .box { background: var(--ink); }
.ingredients input:checked ~ .box::after { opacity: 1; }
.ingredients input:focus-visible ~ .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.ingredients input:checked ~ .txt { color: var(--grey); text-decoration: line-through; text-decoration-thickness: 0.5px; }
.ingredients .txt { flex: 1; }

.steps { list-style: none; padding: 0; margin: 0; max-width: 58ch; }
.steps li { display: flex; gap: 0.75em; padding: 0.6em 0; cursor: pointer; border-top: 0.5px solid var(--hair); }
.steps li:first-child { border-top: 0; }
.steps li.group { display: block; cursor: default; }
.steps li.group + li { border-top: 0; }
.steps li:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.steps .num { flex: 0 0 1.7em; height: 1.7em; display: inline-grid; place-items: center; border: 1px solid var(--hair); border-radius: 999px; font-size: 0.8125em; font-weight: 500; line-height: 1; margin-top: 0.2em; transition: background 0.15s; }
.steps li.is-done { color: var(--grey); }
.steps li.is-done .num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.reset { margin-top: 1em; }

.tip { font-style: italic; margin-top: 0.4em; max-width: 58ch; }
.tip + .tip { margin-top: 0.6em; }
.tip a { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 2px; }
.see-also { margin-top: 1em; }
.see-also a { display: inline-block; font-family: var(--serif); font-size: 1.1em; }
.see-also .nav-label { display: block; font-family: var(--sans); font-size: 0.8em; color: var(--muted); }
.cookbook { border-top: 0.5px solid var(--hair); }
.cookbook-head { text-align: center; padding: clamp(40px, 6vw, 72px) 0 0; }
.cookbook-title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 4vw, 40px); }
.cookbook-cta { margin: 1.2em 0 clamp(16px, 3vw, 32px); }
.tips { margin-top: 0.8em; }

/* controls: text, hairline, square — nothing the calendar would not print */
.btn { font: inherit; font-size: 0.875em; font-weight: 500; color: var(--ink); background: none; border: 1px solid var(--ink); border-radius: 999px; padding: 0.5em 1.2em; cursor: pointer; line-height: 1.3; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.btn:disabled { color: var(--grey); border-color: var(--hair); background: none; cursor: default; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--text { border: 0; padding: 0; border-radius: 0; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mult { display: inline-flex; gap: 2px; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; }
.mult button { font: inherit; font-size: 0.8125em; font-weight: 500; background: none; border: 0; border-radius: 999px; padding: 5px 11px; color: var(--muted); cursor: pointer; line-height: 1.2; }
.mult button.is-active { background: var(--ink); color: var(--paper); }
.mult button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mult-custom { display: inline-flex; align-items: center; gap: 0.15em; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 0 11px 0 6px; font-size: 0.8125em; font-weight: 500; line-height: 1.2; }
.mult-custom[hidden] { display: none; }
.mult-custom input { font: inherit; width: 3.4em; padding: 5px 0 5px 6px; margin: 0; border: 0; background: none; color: var(--paper); text-align: right; outline: none; }
.mult-custom input::-webkit-outer-spin-button, .mult-custom input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mult-custom input::selection { background: var(--paper); color: var(--ink); }

.actions { margin-top: 1.2em; display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn.is-done { background: var(--ink); color: var(--paper); }

/* add to calendar dialog */
.cal { border: 1px solid var(--hair); border-radius: 16px; background: var(--paper); color: var(--ink); max-width: 440px; margin-top: 14px; }
.cal[hidden] { display: none; }
.cal-form { padding: 20px 20px 18px; }
.cal-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0.6em 0 1em; }
.chip { font: inherit; font-size: 0.8125em; font-weight: 500; color: var(--ink); background: none; border: 1px solid var(--hair); border-radius: 999px; padding: 0.4em 0.9em; cursor: pointer; line-height: 1.3; }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cal-fields { display: grid; gap: 12px; }
.cal-fields label { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: 12px; font-size: 0.9375em; }
.cal-fields label > span:first-child { color: var(--muted); }
.cal-fields input { font: inherit; color: var(--ink); background: none; border: 1px solid var(--hair); border-radius: 10px; padding: 0.5em 0.75em; width: 100%; min-width: 0; }
.cal-fields input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.cal-fields input[type="date"], .cal-fields input[type="time"] { -webkit-appearance: none; appearance: none; }
.cal-dur { display: flex; align-items: center; gap: 0.5em; }
.cal-dur input { width: 5em; text-align: right; }
.cal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.cal-actions [data-cal-close] { margin-left: auto; }

/* cooking mode: one step at a time */
.cook { position: fixed; inset: 0; background: var(--paper); color: var(--ink); display: none; flex-direction: column; z-index: 10; }
.cook.is-open { display: flex; }
body.is-cooking { overflow: hidden; }
.cook-bar { height: 3px; background: var(--hair); flex: none; }
.cook-progress { display: block; height: 3px; background: var(--ink); width: 0; transition: width 0.3s; border-radius: 0 2px 2px 0; }
.cook-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: calc(var(--m) * 0.8); flex: none; font-size: 0.875em; color: var(--muted); }
.cook-title { font-family: var(--serif); font-size: 1.15em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-body { flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column; justify-content: center; padding-top: 24px; padding-bottom: 24px; }
.cook-step { font-family: var(--serif); font-style: italic; font-size: var(--fs-year); line-height: 1.1; margin-bottom: 0.5em; }
.cook-text { font-size: clamp(22px, 2.8vw, 32px); line-height: 1.35; max-width: 34ch; text-wrap: pretty; letter-spacing: -0.005em; }
.cook-text .amt { color: var(--muted); font-size: 0.72em; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.cook-timer { margin-top: 1.2em; }
.cook-timer .btn.is-running { font-variant-numeric: tabular-nums; min-width: 6em; text-align: center; }
.cook-timer .btn.is-done { background: var(--ink); color: var(--paper); }
.cook-foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: calc(var(--m) * 0.8 + env(safe-area-inset-bottom)); flex: none; }
.cook-foot .btn { min-width: 8em; text-align: center; padding: 0.6em 1.4em; }

/* home grid: one cell per month, band typography */
.grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 56px) 24px; padding: calc(var(--m) * 0.6) 0 clamp(48px, 7vw, 96px); }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card { display: block; }
.card .visual { margin-bottom: 0.75em; }
.card .visual img { transition: opacity 0.3s; }
.card .month-line { font-size: 0.875em; color: var(--muted); margin-bottom: 0.2em; }
.card .recipe-title { font-size: 1.35em; margin-bottom: 0.2em; }
.card .credit { margin-bottom: 0; font-size: 0.875em; }
.card--coming .recipe-title { color: var(--grey); }

/* month to month */
.month-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-top: 0.5px solid var(--hair); padding: 1.2em 0 0; }
.month-nav a { display: block; }
.month-nav .nav-label { display: block; font-size: 0.875em; color: var(--muted); margin-bottom: 0.15em; }
.month-nav .nav-title { display: block; font-family: var(--serif); font-size: 1.2em; }
.month-nav a.next { text-align: right; }
.all-link { padding: 1.6em 0 clamp(48px, 7vw, 96px); font-size: 0.9375em; }

/* foot */
.site-foot { text-align: center; padding: 0 0 calc(var(--m) * 0.8); font-size: 0.8125em; color: var(--muted); }
.site-foot .site-foot-line { border-top: 0.5px solid var(--hair); padding-top: 1.2em; display: flex; align-items: center; justify-content: center; gap: 14px; }
.foot-logo { display: block; line-height: 0; opacity: 0.8; }
.foot-logo img { height: 18px; width: auto; display: block; }

/* 404 */
.notfound { text-align: center; padding: clamp(48px, 10vw, 120px) 0; }
.notfound .month { font-size: var(--fs-year); font-style: normal; }
.notfound .lede { font-family: var(--sans); font-style: normal; font-size: 1em; }

@media (max-width: 560px) {
  .head-submit { padding: 0.5em 0.95em; }
  .head-submit .long { display: none; }
  .head-submit .short { display: inline; }
  :root { --fs-date: 28px; }
  .section-head { flex-wrap: wrap; }
  .ingredients .box { width: 22px; height: 22px; }
  .ingredients .box::after { left: 7px; top: 3px; width: 5px; height: 11px; }
  .month-nav { grid-template-columns: 1fr; }
  .month-nav a.next { text-align: left; }
}


/* hover only where a pointer can hover: touch screens keep :hover stuck after a tap */
@media (hover: hover) {
  .lang a:not(.is-active):hover { color: var(--ink); }
  .btn:hover { background: var(--ink); color: var(--paper); }
  .btn--primary:hover { background: #000; color: var(--paper); }
  .btn--text:hover { background: none; color: var(--ink); text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 0.12em; }
  .mult button:not(.is-active):hover { color: var(--ink); }
  .chip:hover { border-color: var(--ink); }
  .steps li:hover .num { border-color: var(--ink); }
  .card:hover .visual img { opacity: 0.92; }
  .card:hover .recipe-title { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 0.12em; }
  .month-nav a:hover .nav-title { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 0.12em; }
  .all-link a:hover { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 0.12em; }
  .foot-logo:hover { opacity: 1; }
  .notfound .lede a:hover { text-decoration: underline; }
}

@media print {
  .site-head, .site-foot, .month-nav, .all-link { display: none; }
  body { background: #fff; }
}
