/* =============================================================================
   rehaul-reference.css
   Visual + motion rehaul for the iOS reference screens and the cocktail finder:
     Bottles · Glassware · Colour Codes · Bar Codes · What can I make?
   Owned by the reference-screens agent. NEW classes only, all prefixed `bkr-`.
   Reuses shared tokens (--ease-out, --dur-*, --surface, --line, --fg-*) and
   shared classes (.bk-empty, .bk-chip, .ios-photo-card, .ios-colour-pill …).
   Only transform/opacity is animated; the global prefers-reduced-motion block in
   colors_and_type.css neutralises every animation/transition here automatically.
   British spelling, no em dashes, no emojis.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Shared screen-header settle. The screen wrapper already fades the whole view
   in; this gives the title block its own gentle lead so the eye lands on the
   heading first, then the controls. Transform + opacity only.
   --------------------------------------------------------------------------- */
@keyframes bkr-rise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bkr-head { animation: bkr-rise 360ms var(--ease-out) both; }
.bkr-head .ios-screen__eyebrow { animation: bkr-rise 360ms var(--ease-out) both; animation-delay: 30ms; }
.bkr-head .ios-screen__title   { animation: bkr-rise 380ms var(--ease-out) both; animation-delay: 55ms; }
.bkr-head .ios-screen__sub     { animation: bkr-rise 380ms var(--ease-out) both; animation-delay: 90ms; }

/* Back link (cocktail finder) gets a tactile press to match every other control. */
.bkr-back {
  transition: transform var(--dur-press) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  border-radius: var(--radius-pill);
}
.bkr-back:active { transform: scale(0.96); opacity: 0.8; }

/* ---------------------------------------------------------------------------
   Search field — calmer, with a clear focus-within ring so it reads as the
   primary input rather than just a sunken bar. (Refines .ios-search only.)
   --------------------------------------------------------------------------- */
.bkr-search {
  transition: box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: inset 0 0 0 1px transparent;
}
.bkr-search:focus-within {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-action) 40%, transparent),
              0 0 0 4px var(--focus-ring-soft, color-mix(in srgb, var(--accent-action) 16%, transparent));
}

/* ---------------------------------------------------------------------------
   Manager "Add …" action row — single full-width secondary button with breathing
   room above the grid, and a confident press.
   --------------------------------------------------------------------------- */
.bkr-addrow { padding: 4px 16px 2px; }
.bkr-addbtn { width: 100%; }

/* ---------------------------------------------------------------------------
   Photo cards (Bottles + Glassware) — premium press feel. Pointer-fine devices
   get a gentle lift; touch keeps a crisp squeeze. The image well brightens its
   inner edge a touch on interaction so the card feels physical.
   --------------------------------------------------------------------------- */
.bkr-photo-card {
  transition: transform var(--dur-press) var(--ease-out),
              box-shadow var(--dur-press) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.04));
}
.bkr-photo-card .ios-photo-card__img {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
/* Tappable cards (manager glassware) press; static bottle cards lift on hover. */
@media (hover: hover) and (pointer: fine) {
  .bkr-photo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.10));
    border-color: color-mix(in srgb, var(--accent-action) 22%, var(--line));
  }
}
.bkr-photo-card--tap:active { transform: scale(0.97); }

/* ---------------------------------------------------------------------------
   Empty state wrap (Bottles) — gives the composed .bk-empty its own margin and
   a soft entrance so an empty search never looks like a broken page.
   --------------------------------------------------------------------------- */
.bkr-empty-wrap {
  margin: 8px 16px 0;
  animation: bkr-rise 320ms var(--ease-out) both;
}

/* ---------------------------------------------------------------------------
   Colour Codes — drop the per-pill boxes for one hairline-divided list. Reads
   as a single considered surface (negative space + dividers, not nested cards),
   with a refined swatch and a tactile press on editable rows.
   --------------------------------------------------------------------------- */
.bkr-colour-group {
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.04));
}
.bkr-colour-group > .bkr-colour-pill {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.bkr-colour-group > .bkr-colour-pill:last-child { border-bottom: 0; }
/* A crisper swatch: tighter inner ring so the colour reads true against the row. */
.bkr-colour-pill .ios-colour-pill__dot {
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.14), 0 1px 2px rgba(0,0,0,0.10);
}
.bkr-colour-pill--tap:active { transform: scale(0.99); }
.bkr-colour-pill--tap:active,
.bkr-colour-pill--tap:hover { background: var(--accent-action-soft); }
@media (hover: hover) and (pointer: fine) {
  .bkr-colour-pill--tap { cursor: pointer; }
}

/* ---------------------------------------------------------------------------
   BAR CODES — the headline upgrade. Was a stack of bordered boxes with a flat
   colour badge (read as "cheap"). Now one hairline-divided panel: each row is a
   confident code chip, a clear label/description, and the spoken example as a
   tinted mono tag. The accent colour rides a CSS custom property (--bkr-code-
   accent) set per row in the JSX, so no inline hex lives in the markup.
   --------------------------------------------------------------------------- */
.bkr-codes {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}
.bkr-code {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px 15px;
  border-bottom: 1px solid var(--line);
  /* gentle entrance stagger, capped so the tail never lags */
  animation: bkr-rise 300ms var(--ease-out) both;
}
.bkr-code:last-child { border-bottom: 0; }
.bkr-code:nth-child(1) { animation-delay: 0ms; }
.bkr-code:nth-child(2) { animation-delay: 32ms; }
.bkr-code:nth-child(3) { animation-delay: 64ms; }
.bkr-code:nth-child(4) { animation-delay: 96ms; }
.bkr-code:nth-child(5) { animation-delay: 128ms; }
.bkr-code:nth-child(6) { animation-delay: 160ms; }
.bkr-code:nth-child(7) { animation-delay: 192ms; }
.bkr-code:nth-child(n+8) { animation-delay: 220ms; }
/* A slim accent rail keys each row to its code colour without a heavy filled box. */
.bkr-code::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--bkr-code-accent, var(--accent-action));
  opacity: 0.9;
}

/* The code chip — tinted glassy fill in the accent, not a flat solid block, so it
   sits in the surface rather than shouting over it. */
.bkr-code__badge {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 8px 6px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  text-align: center;
  line-height: 1.12;
  overflow-wrap: break-word;
  color: var(--bkr-code-accent, var(--accent-action));
  background: color-mix(in srgb, var(--bkr-code-accent, var(--accent-action)) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bkr-code-accent, var(--accent-action)) 26%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.10);
}
.bkr-code__badge.is-num  { font-size: 1.9rem;  letter-spacing: -0.02em; }
.bkr-code__badge.is-word { font-size: 1.02rem; letter-spacing: -0.01em; }
.bkr-code__badge.is-tiny { font-size: 0.78rem; letter-spacing: -0.005em; }

.bkr-code__body { min-width: 0; }
.bkr-code__label {
  font: 700 1.02rem/1.2 var(--font-display);
  color: var(--fg-strong);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.bkr-code__sub {
  color: var(--fg-muted);
  font-size: 0.86rem;
  line-height: 1.42;
  margin-bottom: 7px;
}
.bkr-code__eg {
  display: inline-block;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--bkr-code-accent, var(--accent-action));
  background: color-mix(in srgb, var(--bkr-code-accent, var(--accent-action)) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--bkr-code-accent, var(--accent-action)) 16%, transparent);
  padding: 4px 9px;
  border-radius: 9px;
}

/* ---------------------------------------------------------------------------
   COCKTAIL FINDER — "What can I make?"
   --------------------------------------------------------------------------- */

/* Ingredient chooser frame — one calm container with an inner-shadow lip so the
   scroll area reads as a contained shelf, not a loose pile of chips. */
.bkr-chooser {
  /* Flows in the page (the page itself scrolls) — no inner scroll box and no
     frame. Phone-first: the chips read as a back-bar shelf, not a cramped
     window squeezed inside the screen. */
  padding: 0;
}

/* Category filter — wraps so every category is visible on a phone with no
   clipping and no sideways scroll. Sits above the flowing chip shelf. */
.bkr-quickpick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.bkr-quickpick .bk-chip { flex: 0 0 auto; }

/* Collapsible ingredient shelves — fold each section to reach the results
   faster; the count badge answers "how many in here". The whole header row is
   the tap target. */
.bkr-cf-cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 2px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: opacity var(--dur-press) var(--ease-out);
}
.bkr-cf-cat:first-child .bkr-cf-cat-head { border-top: 0; }
.bkr-cf-cat-head:active { opacity: 0.6; }
.bkr-cf-cat-title {
  flex: 1;
  min-width: 0;
  font: 600 0.82rem/1.2 var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.bkr-cf-cat-count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-strong, rgba(127, 127, 127, 0.14));
  color: var(--fg);
  font: 600 0.72rem/1.5 var(--font-display);
  text-align: center;
}
.bkr-cf-cat-chev {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--fg-subtle);
  transform: rotate(90deg);
  transition: transform var(--dur-pop) var(--ease-out);
}
.bkr-cf-cat.is-folded .bkr-cf-cat-chev { transform: rotate(0deg); }
.bkr-cf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
}

/* Gentle stagger for the chooser sections as they appear/filter. */
.bkr-chooser .cf-cat { animation: bkr-rise 260ms var(--ease-out) both; }
.bkr-chooser .cf-cat:nth-child(2) { animation-delay: 30ms; }
.bkr-chooser .cf-cat:nth-child(3) { animation-delay: 60ms; }
.bkr-chooser .cf-cat:nth-child(4) { animation-delay: 90ms; }
.bkr-chooser .cf-cat:nth-child(n+5) { animation-delay: 110ms; }

/* Result rows — the "just add X" hint earns the accent; rows keep the shared
   list press. (Row already animates via .ios-list stagger.) */
.bkr-cf-add { color: var(--accent-amber, #d9892e); font-weight: 600; }
.bkr-cf-row { transition: background var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out); }

/* Composed "you can make" empty state gets a soft entrance. */
.bkr-cf-empty { animation: bkr-rise 300ms var(--ease-out) both; }

/* ---------------------------------------------------------------------------
   Cocktail-finder control rows. The scope + pantry chips were inline flex rows;
   pull them into classes so the layout matches the rest of the kit. These live
   inside an .ios-section, so no horizontal margin is needed.
   --------------------------------------------------------------------------- */
.bkr-cf-scope { display: flex; gap: 8px; flex-wrap: wrap; }
.bkr-cf-scope--stack { margin-top: 8px; }

/* Ingredient search reuses the shared .ios-search field (icon + input). Inside
   an .ios-section it loses .ios-search's outer side margin and gains a little
   breathing room below before the chooser. */
.bkr-cf-search { margin: 0 0 10px; }

/* ---------------------------------------------------------------------------
   Expanded recipe spec. Was a stack of inline-styled spans; now a small block
   with hairline-quiet body text. A missing ingredient is tinted with the shared
   --status-warning token so it reads as "you still need this".
   --------------------------------------------------------------------------- */
.bkr-cf-spec {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
.bkr-cf-spec-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.bkr-cf-spec-missing { color: var(--status-warning); }
.bkr-cf-spec-foot { display: block; margin-top: 6px; }

/* ---------------------------------------------------------------------------
   Colour Codes — batch section. Each batched drink is one hairline row: the
   drink name, then its colour-code dots and the colour words. A single grouped
   inset list (no nested cards), so the manager can scan or search drink↔code.
   --------------------------------------------------------------------------- */
.bkr-batch-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.bkr-batch-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 14px;
}
.bkr-batch-row + .bkr-batch-row { border-top: 1px solid var(--line); }
.bkr-batch-row__name {
  font: 600 0.9rem/1.25 var(--font-display);
  color: var(--fg-strong);
}
.bkr-batch-row__code {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bkr-batch-row__dots { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.bkr-batch-dot {
  width: 16px; height: 16px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex: 0 0 16px;
}
.bkr-batch-row__words {
  font-size: 0.72rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
