/* Segment stylesheet: recipes. Owned by the recipes segment; shared tokens and components live in /static/gw.css.
   Colours only via var(--gw-*) tokens. Every rule is scoped to a recipes-only class: this file loads on every page. */

/* ---- library: filter row, count, pack rail ------------------------------------------------- */
.gw-rfilters{margin-bottom:12px}
.gw-rfilters+script+.gw-filter-note{margin:0 0 16px}

.gw-packrail{list-style:none;margin:0 0 20px;padding:0;display:flex;flex-direction:column;gap:8px}
.gw-packrow{display:flex;align-items:center;gap:12px;min-height:76px;padding:12px 12px 12px 12px;border:1px solid var(--gw-line);border-radius:var(--gw-r-box);background:var(--gw-hero-sand);color:var(--gw-ink)!important;text-decoration:none;-webkit-tap-highlight-color:transparent;transition:transform .12s var(--gw-ease)}
.gw-packrow:active{transform:scale(.985)}
.gw-packrow>.gw-thumb{border-radius:var(--gw-r-chip);background:var(--gw-bg-deep)}
.gw-packrow-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.gw-packrow-title{display:flex;align-items:center;gap:6px;font-size:16px;line-height:21px;font-weight:700}
.gw-packrow-title>.gw-icon{flex:none;width:14px;height:14px;color:var(--gw-muted)}
.gw-packrow-blurb{font-size:13px;line-height:18px;color:var(--gw-subtle);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-wrap:pretty}
.gw-packrow>.gw-icon:last-child{width:20px;height:20px;color:var(--gw-subtle);margin-left:-4px}

/* owner's off-ramp guide: the same row as the locked rail, a check where the lock was, on surface not sand */
.gw-packrow--owned{background:var(--gw-surface);box-shadow:var(--gw-shadow-card)}
.gw-packrow--owned .gw-packrow-title>.gw-icon{color:var(--gw-accent-ink)}

/* ---- owned shot-day pack: its own shelf above the library ----------------------------------- */
.gw-ownpack{margin:4px 0 28px}
.gw-ownpack-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}
.gw-ownpack-row{list-style:none;margin-block:0 -10px;gap:12px;scroll-snap-type:x mandatory;padding-bottom:10px}
.gw-ownpack-row>li{width:160px;display:flex;scroll-snap-align:start}
.gw-ownpack-row .gw-rcard{width:100%}
.gw-rsection{margin:0 0 12px}

/* ---- recipe cards --------------------------------------------------------------------------- */
.gw-rcard-art{overflow:hidden}
.gw-rcard-art>img.gw-rart{position:relative;width:100%;height:100%;object-fit:cover;display:block}
/* photo cards: zoom into the dish so the props at the frame edges (napkin, cutlery) fall outside the tile.
   Per photo (rart_focus in _recipe_art.html): --rart-x/--rart-y = dish centre, --rart-s = zoom. The origin that
   lands the dish centre in the tile centre is (s*d - 50%)/(s - 1), clamped so the tile never shows past the photo. */
.gw-rcard-art--photo{--rart-s:1.28}
.gw-rcard-art--photo>img.gw-rart{transform:scale(var(--rart-s));
  transform-origin:clamp(0%,calc((var(--rart-s) * var(--rart-x,50%) - 50%) / (var(--rart-s) - 1)),100%) clamp(0%,calc((var(--rart-s) * var(--rart-y,52%) - 50%) / (var(--rart-s) - 1)),100%)}
.gw-rcard-badge{z-index:1}

/* placeholder: the recipe's palette ground (inline style) plus its dish glyph, under the photo */
.gw-rart-ph{position:absolute;left:50%;top:50%;width:32px;height:32px;margin:-16px 0 0 -16px;stroke:var(--gw-accent);opacity:.5;pointer-events:none}
.gw-recipe-hero>.gw-rart-ph{width:48px;height:48px;margin:-24px 0 0 -24px}
img.gw-rart[data-fade]{opacity:0;transition:opacity .28s var(--gw-ease)}
img.gw-rart[data-fade][data-loaded]{opacity:1}
/* cards in a row share their bottom edge; titles get 3 lines so real dish names never ellipsize */
.gw-recipes{align-items:stretch}
.gw-recipes>li{display:flex}
.gw-recipes .gw-rcard{width:100%;height:100%}
.gw-rcard-body{min-height:84px}
.gw-rcard-title{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
@media (max-width:400px){.gw-rcard-title{font-size:16px;line-height:21px;letter-spacing:-.005em}}

/* ---- safety notes: a quiet card, same wording ----------------------------------------------- */
.gw-rnotes{flex-direction:row;align-items:flex-start;gap:12px;margin-top:24px;padding:16px;background:var(--gw-bg-deep);border-radius:var(--gw-r-field);color:var(--gw-muted)}
.gw-rnotes>.gw-icon{width:20px;height:20px;margin-top:0;color:var(--gw-accent-ink)}
.gw-rnotes>div{display:flex;flex-direction:column;gap:8px;min-width:0}
.gw-rnotes p{margin:0;text-wrap:pretty}

/* ---- recipe detail -------------------------------------------------------------------------- */
.gw-recipe-hero{position:relative;border-radius:var(--gw-photo-radius);box-shadow:none;border:1px solid var(--gw-line);background:var(--gw-bg-deep)}
/* detail hero and locked dish share the content-hero ratio (16/10) so the first ingredient / the pack CTA sit higher */
.gw-recipe-hero--photo{aspect-ratio:var(--gw-hero-ratio)}
.gw-recipe-hero>img.gw-rart{position:relative;width:100%;height:100%;object-fit:cover;display:block}
.gw-recipe-hero+.gw-recipe-head{margin-top:-4px}
.gw-recipe-head{gap:8px}
.gw-recipe-head>.gw-eyebrow{margin-bottom:-4px}
.gw-rtags{flex-wrap:nowrap;margin:0 -24px;padding:0 24px 2px;gap:8px}
.gw-rtags>li{flex:none}
.gw-rtags:empty{display:none}
.gw-rtags .gw-tag{white-space:nowrap}
/* at-a-glance card: three stats on one row, the protein footnote as a full-width last row inside the card */
.gw-recipe .gw-stats{grid-auto-flow:row;grid-template-columns:repeat(3,minmax(0,1fr))}
.gw-stats-note{grid-column:1/-1;margin:10px 0 0;padding:8px 14px 0;border-top:1px solid var(--gw-line);font-size:12px;line-height:16px;color:var(--gw-muted);text-wrap:pretty}

/* r5: tighter run from the Contains callout into Ingredients (stack gap 16 -> 12, card head 16 -> 14,
   heading -> list 12 -> 8) so the first ingredient clears the tab bar at 390x844 */
.gw-recipe>.gw-allergens+.gw-recipe-sec{margin-top:-4px;padding-top:14px;gap:8px}

/* ---- locked pack teaser --------------------------------------------------------------------- */
.gw-locked{scroll-margin-top:24px}
/* library Packs block: two compact cards (no hero, glyph or Locked pill: the rail above already says it) */
.gw-packs{display:flex;flex-direction:column;gap:12px}
/* the 2nd+ card in the stack is quieter (flat card; section class stays exactly "gw-locked": tests count it): outline button (gw.css .gw-btn--secondary) so one filled CTA leads */
.gw-packs>.gw-locked+.gw-locked{box-shadow:none}
.gw-packs .gw-btn--secondary{min-height:44px;box-shadow:none}
.gw-locked-head--bare .gw-title{font-size:20px;line-height:26px;font-weight:600;margin:0}
.gw-locked-head--bare .gw-smallprint{margin-top:4px}
.gw-locked-head--bare+.gw-locked-peek{margin-top:12px}
.gw-eyebrow--quiet{color:var(--gw-muted)}
.gw-locked-hero{width:100%;height:auto;aspect-ratio:16/9;margin-bottom:14px}
.gw-locked-hero+.gw-locked-head>.gw-chip{display:none}
.gw-locked-head .gw-locked-pill{margin-bottom:6px}
.gw-locked-head .gw-title{text-wrap:balance}
.gw-locked-head .gw-smallprint{margin-top:2px;text-wrap:pretty}
.gw-locked-peek--named .gw-thumb--sm{flex:none;width:32px;border-radius:8px}
.gw-lockedhead .gw-h1{text-wrap:balance}
.gw-locked-stats{margin-top:-2px}
/* locked dish: the H1 already names the pack, so the card title is visually hidden (kept for aria-labelledby),
   the H1 steps down a size and the peek shows two dishes, so the one action clears the tab bar on a 390x844 screen */
.gw-lockedhead--dish .gw-h1{font-size:28px;line-height:34px}
.gw-lockedhead--dish~.gw-locked .gw-locked-peek li:nth-child(n+3){display:none}
.gw-locked-head--bare .gw-sr+.gw-smallprint{margin-top:0}

/* locked recipe: the dish the person tapped, with a quiet Locked pill on the photo */
.gw-locked-dish{margin:4px 0 16px}
.gw-locked-dish-pill{position:absolute;left:16px;bottom:16px;z-index:1;display:inline-flex;align-items:center;gap:6px;padding:5px 10px 5px 8px;border-radius:999px;background:color-mix(in srgb,var(--gw-surface) 92%,transparent);color:var(--gw-ink);font-size:13px;line-height:18px;font-weight:600;box-shadow:var(--gw-shadow-1,none)}
.gw-locked-dish-pill>.gw-icon{width:14px;height:14px;color:var(--gw-muted)}

/* ---- off-ramp guide ------------------------------------------------------------------------- */
/* one page hero for both states of the guide (owned and locked); the wrapper carries the spacing and the Locked pill */
.gw-orp-herowrap{position:relative;margin:4px 0 16px}
.gw-orp-hero{width:100%;height:auto;margin:0}
.gw-orp-intro2{font-size:15px;line-height:22px;text-wrap:pretty}
.gw-orp-jump{margin-top:-4px}
.gw-orp-jump .gw-filter{gap:6px}
.gw-orp-jump .gw-orp-jump-urgent{border-color:var(--gw-warn-rule);color:var(--gw-warn-fg)!important}
.gw-orp-sec,.gw-orp-urgent{scroll-margin-top:16px}
.gw-orp-qlist li{gap:12px}
.gw-orp-qlist .gw-rules-n{width:24px;height:24px;font-size:13px;margin-top:-1px}
.gw-orp-urgent>div{gap:0}
.gw-orp-urgent .gw-redflag-title b{font-size:17px;line-height:24px}
.gw-orp-urgent .gw-redflag-title{margin-bottom:6px}
.gw-orp-urgent .gw-redflag-action{margin-bottom:12px}
.gw-orp-urgent ul{gap:10px}

/* ---- off-ramp guide: "Back to sections" (gw.css .gw-backtop) closes each long section; the chip row
   is its anchor, kept clear of the top edge */
#guide-nav{scroll-margin-top:16px}
#guide-nav~.gw-backtop-row,#guide-nav~* .gw-backtop-row{justify-content:flex-end;margin-top:-4px}
#guide-nav~.gw-backtop-row .gw-backtop,#guide-nav~* .gw-backtop{margin:0 -8px 0 0}

/* ---- motion: a short rise for the grid and the detail page, and a shared-element morph from a
   card's photo to the detail hero where cross-document view transitions exist (the pages opt in
   with an inline @view-transition rule, also behind prefers-reduced-motion). ----------------- */
@media (prefers-reduced-motion:no-preference){
  .gw-recipes>li,.gw-ownpack-row>li{animation:gw-rise .18s var(--gw-ease) both}
  .gw-recipes>li:nth-child(2),.gw-ownpack-row>li:nth-child(2){animation-delay:30ms}
  .gw-recipes>li:nth-child(3),.gw-ownpack-row>li:nth-child(3){animation-delay:60ms}
  .gw-recipes>li:nth-child(4),.gw-ownpack-row>li:nth-child(4){animation-delay:90ms}
  .gw-recipes>li:nth-child(5){animation-delay:120ms}
  .gw-recipes>li:nth-child(n+6){animation-delay:150ms}
  .gw-recipe-head,.gw-recipe>.gw-stats{animation:gw-rise .24s var(--gw-ease) .04s both}
  ::view-transition-group(*){animation-duration:.28s;animation-timing-function:var(--gw-ease)}
}
@media (prefers-reduced-motion:reduce){.gw-packrow{transition:none!important}img.gw-rart[data-fade]{opacity:1;transition:none}}
