/* ==========================================================================
   Whip It Up — static pages (recipe / category / index)

   Same 1994 kitchen as the toy, but no tin and no animation. This file is
   deliberately standalone rather than an add-on to style.css: the toy's CSS
   is mostly tin and card-draw machinery these pages never use, and keeping
   them separate means an edit to the toy can't quietly break 271 pages.

   CONTRAST RULE — 4.5:1 minimum against the background for anything under
   18.66px. That is nearly everything here. Two colours from the toy fail it
   at label size, so this file carries darkened text-only variants:
     --orange  #C4643A  3.64:1  ->  --orange-tx  #A75531  4.77:1
     --avocado #7C9350  3.17:1  ->  --avocado-tx #637640  4.65:1
   The originals stay for borders, rules and large type, where 3:1 applies.
   ========================================================================== */

:root {
  --ink:        #34241A;
  --ink-soft:   #6B5442;

  --tile:       #F0E6D2;
  --grout:      #DCCCB0;

  --edge:       #8E6039;
  --edge-tx:    #835834;

  --gold:       #E0A32E;
  --gold-light: #F0BE55;

  --avocado:    #7C9350;
  --avocado-tx: #637640;
  --orange:     #C4643A;
  --orange-tx:  #A75531;
  --aqua:       #5FA9A0;

  --card:       #FBF3E2;
  --note-bg:    #FDF6E6;
  --rule:       #BFD3DE;
  --rule-red:   #D8776C;

  --st1: var(--gold);
  --st2: var(--orange);

  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--tile);
  background-image:
    linear-gradient(var(--grout) 2px, transparent 2px),
    linear-gradient(90deg, var(--grout) 2px, transparent 2px);
  background-size: 58px 58px;
  background-position: -1px -1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 48px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a:focus-visible,
button:focus-visible { outline: 4px solid var(--aqua); outline-offset: 3px; }

/* ------------------------------------------------------------- top strip */
.topbar {
  width: 100%;
  max-width: 720px;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
}

.wordmark {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-size: 1.35rem;
  color: var(--orange-tx);
  text-decoration: none;
  letter-spacing: .02em;
  text-shadow: 2px 2px 0 var(--ink);
}
.wordmark:hover { color: var(--ink); }

.crumbs {
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.crumbs a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--gold); }
.crumbs a:hover { color: var(--orange-tx); }
.crumbs span { padding: 0 4px; }

/* ------------------------------------------------------------ the sheet */
.sheet {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* --------------------------------------------------------- the big head */
.pagehead {
  margin: 26px 0 0;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 26px 20px;
  box-shadow: 6px 6px 0 rgba(52, 36, 26, .22);
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.pagehead h1 {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-size: clamp(1.9rem, 6.5vw, 2.7rem);
  line-height: 1;
  margin: 0;
  color: var(--ink);
}

.pagehead-body { flex: 1 1 auto; min-width: 0; }

.pagehead-count {
  margin: 10px 0 0;
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--edge-tx);
}

.pagehead-blurb {
  margin: 8px 0 0;
  font-size: .98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* -------------------------------------------------------- the index card */
.card {
  margin: 26px 0 0;
  padding: 0 0 24px;
  background-color: var(--card);
  background-image: repeating-linear-gradient(
    var(--card) 0 29px,
    var(--rule) 29px 30px
  );
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 8px 0 rgba(52, 36, 26, .28);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 3px solid var(--rule-red);
}

.sticker { flex: 0 0 auto; width: 66px; height: 66px; }
.sticker .sf1 { fill: var(--st1); stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: round; }
.sticker .sf2 { fill: var(--st2); stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: round; }
.sticker .sl  { fill: none;       stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; }

.sticker-sm { width: 44px; height: 44px; }

.card-kind {
  margin: 0 0 3px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.card-kind a { color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid var(--gold); }
.card-kind a:hover { color: var(--orange-tx); }

.card-name {
  font-family: "Lilita One", sans-serif;
  font-size: clamp(1.55rem, 5.5vw, 2.15rem);
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

.card-block { padding: 16px 24px 0; }

.card-label {
  margin: 0 0 8px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--orange-tx);
}

.ings {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ings li {
  background: var(--tile);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: .93rem;
  font-weight: 700;
}

.pantry {
  margin: 10px 0 0;
  font-size: .82rem;
  font-style: italic;
  color: var(--ink-soft);
}

.how, .feel { margin: 0; font-size: 1rem; line-height: 30px; }
.feel { color: var(--ink-soft); }

.card-note {
  margin: 22px 24px 0;
  padding: 14px 18px 16px;
  background: var(--note-bg);
  border: 3px dashed var(--avocado);
  border-radius: 8px;
}

.card-label-note { color: var(--avocado-tx); }

.note {
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.35;
  color: #2F4A22;
}

/* ------------------------------------------------------------ the call */
.cta {
  margin: 30px 0 0;
  text-align: center;
}

.btn {
  display: inline-block;
  font-family: "Lilita One", sans-serif;
  font-size: 1.05rem;
  letter-spacing: .03em;
  padding: 12px 22px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover  { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 var(--ink); color: var(--ink); }
.btn:active { transform: translate(2px, 3px);  box-shadow: 1px 1px 0 var(--ink); }

.cta-sub {
  margin: 10px 0 0;
  font-size: .86rem;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- lists */
.section-head {
  margin: 38px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-head h2 {
  font-family: "Lilita One", sans-serif;
  font-size: 1.45rem;
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}
.section-head h2 a { color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--gold); }
.section-head h2 a:hover { color: var(--orange-tx); }

.section-count {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.grid a {
  display: block;
  height: 100%;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 12px 14px 13px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 3px 4px 0 rgba(52, 36, 26, .22);
  transition: transform .1s ease, box-shadow .1s ease;
}
.grid a:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 5px 0 rgba(52, 36, 26, .3);
  background: #FFF9EC;
}

.grid b {
  display: block;
  font-family: "Lilita One", sans-serif;
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: .01em;
}

.grid small {
  display: block;
  margin-top: 5px;
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

/* ---------------------------------------------------------------- pager */
.pager {
  margin: 30px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.pager a {
  flex: 1 1 220px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 10px 14px 11px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 3px 4px 0 rgba(52, 36, 26, .22);
}
.pager a:hover { background: #FFF9EC; }
.pager small {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 3px;
}
.pager b {
  font-family: "Lilita One", sans-serif;
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.15;
}
.pager .next { text-align: right; }

/* ------------------------------------------------------------------ foot */
.foot {
  width: 100%;
  max-width: 720px;
  margin-top: 44px;
  text-align: center;
  font-size: .88rem;
  color: var(--ink-soft);
}

.foot-count {
  margin: 0 0 10px;
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--edge-tx);
}

.foot-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.foot-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 1px;
}
.foot-links a:hover { color: var(--orange-tx); }

.foot-fine { margin: 0 auto; font-size: .78rem; max-width: 480px; }

/* ----------------------------------------------------------------- small */
@media (max-width: 480px) {
  .pagehead { padding: 18px 16px 16px; gap: 12px; }
  .card-top { gap: 12px; padding: 14px 16px 12px; }
  .sticker { width: 54px; height: 54px; }
  .card-block { padding: 14px 16px 0; }
  .card-note { margin: 18px 16px 0; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
