/* All My Recipes: the category-standard recipe page, with hot pink outlined titles. */
:root {
  --bg: #fffbfc;
  --ink: #1d1519;
  --muted: #6a5a62;
  --rule: #eedfe6;
  --soft: #fcedf4;
  --pink: #ff6fb5;
  --deep: #b8135f;
  --gold: #f2a60f;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
  accent-color: var(--deep);
  scrollbar-color: #d9c3ce var(--bg);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  font-feature-settings: "kern", "liga";
  caret-color: var(--deep);
  -webkit-font-smoothing: antialiased;
}
::selection { background: #ffc6e1; color: var(--ink); }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--deep); }
:focus-visible { outline: 2.5px solid var(--deep); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* The signature: hot pink letters with a black outline. */
.pop {
  font-weight: 900;
  letter-spacing: -.015em;
  line-height: 1.06;
  color: var(--pink);
  -webkit-text-stroke: .075em var(--ink);
  paint-order: stroke fill;
}
.star { width: .5em; height: .5em; fill: var(--gold); margin-left: .18em; vertical-align: .1em; flex: none; -webkit-text-stroke: 0; }
.badge {
  display: inline-block; margin-left: var(--s2); padding: 1px 8px 2px; border-radius: 99px;
  background: var(--soft); color: var(--deep); font-size: 12px; font-weight: 700; vertical-align: .2em;
}

/* ---------- Home ---------- */
.masthead { max-width: var(--wrap); margin: 0 auto; padding: var(--s8) var(--gutter) var(--s5); }
.masthead .pop { font-size: clamp(52px, 13vw, 96px); }
.lede { margin: var(--s4) 0 0; color: var(--muted); font-size: 18px; max-width: 46ch; }
.search {
  position: relative; display: block; max-width: 560px; margin-top: var(--s6);
}
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 54px; padding: 0 var(--s4) 0 48px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: #fff; border: 1.5px solid #e2cfd8; border-radius: 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input::placeholder { color: #76666e; }
.search input:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 4px #fbd9e9; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s4);
  border: 1.5px solid #e2cfd8; border-radius: 99px; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--ink);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .star { width: 15px; height: 15px; margin: 0; }

/* Flex gap (not sibling margins) so hidden sections leave no extra space when filtering. */
.index { max-width: var(--wrap); margin: 0 auto; padding: var(--s5) var(--gutter) var(--s8); display: flex; flex-direction: column; gap: var(--s7); }
.cat h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; padding-bottom: var(--s3); border-bottom: 2px solid var(--ink); }
.count { color: var(--muted); font-weight: 600; font-size: 16px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); column-gap: var(--s7); }
.list li { border-bottom: 1px solid var(--rule); }
.list a { display: flex; flex-direction: column; gap: 2px; padding: var(--s4) 0; text-decoration: none; }
.list .name { font-size: 20px; font-weight: 700; line-height: 1.25; }
.list a:hover .name { color: var(--deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.list .meta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.none { color: var(--muted); font-size: 18px; padding: var(--s6) 0; }

/* ---------- Recipe ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s2) var(--gutter); padding-top: max(var(--s2), env(safe-area-inset-top));
  background: rgba(255, 251, 252, .94);
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
}
.back { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; text-decoration: none; margin-left: -4px; }
.recipe { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.head { padding: var(--s5) 0; }
.head .pop { font-size: clamp(42px, 10.5vw, 96px); max-width: 15ch; }
.head .pop.long { font-size: clamp(36px, 8.5vw, 68px); max-width: 20ch; }
.subtitle { margin: var(--s2) 0 0; font-size: 19px; font-style: italic; color: var(--muted); }
.intro { max-width: 62ch; }
.intro p { margin: var(--s4) 0 0; font-size: 19px; }
.facts {
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); margin: var(--s5) 0 0; padding: var(--s4) 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.facts div { min-width: 0; }
.facts dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }

.cols { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: var(--s8); align-items: start; padding-bottom: var(--s7); }
.cols h2 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.ingredients { position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow-y: auto; padding-right: var(--s2); scrollbar-width: thin; }
.group { font-size: 15px; font-weight: 800; color: var(--deep); margin: var(--s5) 0 var(--s1); }
.ingredients > h2 + .ing-list { margin-top: var(--s3); }
/* First group or part sits close to its section heading. */
.ingredients > h2 + .group, .directions > h2 + .part { margin-top: var(--s2); }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { padding: 11px 0; line-height: 1.4; }
.ing-list li + li { border-top: 1px solid var(--rule); }
.qty { font-weight: 800; }

.directions { max-width: 68ch; }
.part { font-size: 21px; font-weight: 800; margin: var(--s6) 0 var(--s1); color: var(--deep); }
.steps { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; }
.step + .step { border-top: 1px solid var(--rule); }
.step .n {
  width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.step-title { font-size: 20px; font-weight: 800; margin-top: 9px; }
.step-body p { margin: var(--s2) 0 0; }
.step-body > p:first-child { margin-top: 10px; }
.step ul { margin: var(--s2) 0 0; padding-left: 1.1em; }
.step li { margin-top: 6px; padding-left: 2px; }
.step li::marker { color: var(--deep); }
.step ul ul { margin-top: 4px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); padding: var(--s6) 0; border-top: 2px solid var(--ink); }
.pager a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.pager .next { text-align: right; align-items: flex-end; }
.dir { font-size: 14px; font-weight: 600; color: var(--muted); }
.to { font-size: 20px; font-weight: 800; line-height: 1.2; }
.pager a:hover .to { color: var(--deep); }
.empty { color: var(--muted); }

.foot { max-width: var(--wrap); margin: 0 auto; padding: var(--s6) var(--gutter) var(--s7); color: var(--muted); font-size: 15px; }
.foot code { font-size: 14px; background: var(--soft); padding: 2px 6px; border-radius: 6px; color: var(--ink); }

/* Recipe pages are read from across the counter: bigger type throughout. */
.recipe-page { font-size: 20px; }
.recipe-page .step-title { font-size: 24px; }
.recipe-page .ing-list li { font-size: 20px; }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; gap: var(--s6); }
  .ingredients { position: static; max-height: none; overflow: visible; padding: 0; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .masthead { padding-top: var(--s7); }
  .head { padding: var(--s3) 0 var(--s2); }
  .facts { gap: var(--s3) var(--s5); margin-top: var(--s3); padding: var(--s3) 0; }
  .cols { gap: 28px; }
  .ingredients > h2 + .ing-list, .steps { margin-top: var(--s1); }
  /* Compact ingredient list so most of it fits on one screen. */
  .recipe-page .ing-list li { font-size: 17px; line-height: 1.3; padding: 5px 0; }
  .group { font-size: 14px; margin: var(--s3) 0 0; }
  .facts .wide-only { display: none; }  /* least useful while cooking; saves a line */
  .step { grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); }
  .step .n { width: 40px; height: 40px; font-size: 18px; }
  .step-title { margin-top: 7px; }
  .to { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
@media print {
  .bar, .pager, .foot, .badge { display: none !important; }
  body { font-size: 11.5pt; background: #fff; }
  .head { padding: 0 0 12pt; }
  .head .pop { font-size: 34pt; }
  .cols { grid-template-columns: 34% 1fr; gap: 24pt; }
  .ingredients { position: static; max-height: none; overflow: visible; }
  .step { break-inside: avoid; padding: 6pt 0; }
}
