/* Shared styles for /recipe pages: same type and themes as the home page, on recipe-card paper */
:root {
  --bg: #ffffff;
  --ink: #1c1813;
  --muted: #7a6e61;
  --rule-line: rgba(170, 132, 90, 0.16);
  --mark: rgba(242, 228, 164, 0.6);
  --mark-hover: rgba(255, 229, 116, 0.9);
  --rule: rgba(28, 24, 19, 0.12);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #1b1611;
  --ink: #f3eee6;
  --muted: rgba(227, 220, 210, 0.62);
  --rule-line: rgba(243, 238, 230, 0.05);
  --mark: rgba(242, 228, 164, 0.2);
  --mark-hover: rgba(255, 229, 116, 0.34);
  --rule: rgba(243, 238, 230, 0.14);
}

:root[data-holiday] {
  --mark: rgba(232, 140, 130, 0.4);
  --mark-hover: rgba(232, 120, 110, 0.6);
}

:root[data-holiday][data-theme='dark'] {
  --mark: rgba(232, 140, 130, 0.22);
  --mark-hover: rgba(232, 120, 110, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 56px 24px 96px;
  background-color: var(--bg);
  /* recipe-card paper: warm stock with faint ruled lines */
  background-image: linear-gradient(transparent 27px, var(--rule-line) 27px);
  background-size: 100% 28px;
  color: var(--ink);
  font: 16px/1.65 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 88% / 100% 0.5em;
  transition: background-size 0.25s ease;
}

a:hover,
a:focus-visible {
  background-image: linear-gradient(var(--mark-hover), var(--mark-hover));
  background-size: 100% 1.1em;
  outline: none;
}

.back {
  display: inline-block;
  margin-bottom: 40px;
  font-size: 14px;
}

h1 {
  margin: 0 0 10px;
  font: 400 clamp(30px, 6vw, 40px)/1.12 'DM Serif Display', Georgia, 'Songti TC', serif;
  text-wrap: balance;
}

h2 {
  margin: 44px 0 14px;
  font: 400 24px/1.2 'DM Serif Display', Georgia, 'Songti TC', serif;
}

h3 {
  margin: 22px 0 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

p {
  margin: 0 0 12px;
}

.subtitle {
  margin-bottom: 22px;
  color: var(--muted);
  text-wrap: balance;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}

.facts b {
  color: var(--ink);
  font-weight: 500;
}

ul,
ol {
  margin: 0;
  padding-left: 1.2em;
}

li {
  margin-bottom: 6px;
}

.notes li::marker {
  content: '✻  ';
  color: var(--muted);
}

/* Ingredients you can tick off while cooking */
.ingredients {
  padding: 0;
  list-style: none;
}

.ingredients li {
  margin: 0;
  border-bottom: 1px dashed var(--rule);
}

.ingredients label {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  cursor: pointer;
}

.ingredients input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 5px 0 0;
  accent-color: var(--ink);
}

.ingredients input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.steps {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  margin-bottom: 22px;
  padding-left: 44px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: -4px;
  left: 0;
  font: 400 28px/1 'DM Serif Display', Georgia, serif;
}

.steps h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
}

.steps ul {
  padding-left: 1.1em;
}

.cue {
  margin-top: 8px;
  padding: 2px 6px;
  background: var(--mark);
}

/* Recipe index */
.recipe-list {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.recipe-list li {
  margin-bottom: 20px;
}

.recipe-list a {
  font: 400 24px/1.25 'DM Serif Display', Georgia, serif;
}

.recipe-list p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 480px) {
  body {
    padding-left: 34px;
  }
}

@media print {
  body {
    background: none;
    padding: 0;
  }

  .back,
  .ingredients input {
    display: none;
  }
}

/* Bake log: plain dated lines at the top, like a log file */
.bake-log {
  margin: 0 0 36px;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
}

.bake-log h2 {
  margin: 0 0 4px;
  font: 700 12px/1.4 'Courier New', ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.bake-log ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bake-log li {
  margin: 0;
}

.bake-log time {
  color: var(--ink);
}

.bake-log .note::before {
  content: '— ';
}

/* English and Chinese interleaved section by section */
main {
  max-width: 1180px;
}

.pair .zh {
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px dashed var(--rule);
  font-family: 'Manrope', 'PingFang TC', 'Noto Sans TC', system-ui, sans-serif;
}

.pair .zh h1 {
  font-size: clamp(26px, 5vw, 34px);
}

.pair + .pair {
  margin-top: 8px;
}

@media (max-width: 959px) {
  main {
    max-width: 640px;
  }
}

@media (min-width: 960px) {
  .pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 64px;
  }

  .pair .zh {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .pair > div > h2:first-child,
  .pair > div > h1:first-child {
    margin-top: 44px;
  }

  .pair:first-of-type > div > h1:first-child {
    margin-top: 0;
  }

}
