/*!
 * Tap.Giving — light-funnel progress bar styles
 * Pairs with funnel-progress.js. See that file's header comment for the
 * full story. No build step: plain CSS, hand-written (not Tailwind
 * utility classes) on purpose, the same reason order-flow-shell.css
 * gives — this file ships independently of the tailwind.css
 * purge/rebuild pipeline, so a class this component needs can never
 * silently go missing.
 *
 * Loaded ONLY by the light funnel pages (order-light, finalize-light),
 * after order-flow-shell.css. The old order-flow shell bar keeps its
 * own treatment on the old funnel pages, which never load this file.
 *
 * Brand tokens mirror order-flow-shell.css / design.md: navy #1F3A5F,
 * gold #E2A33C, Inter.
 */

/* ---------- Reserved shell space (CLS) ----------
   Same pattern as order-flow-shell.css's reservation for the old bar:
   #tgfs-shell is empty until the page's step wiring renders the bar,
   so reserve this bar's height or the render pushes the page down.
   This file loads after order-flow-shell.css on the light pages, so
   this reservation replaces the old bar's 94px there (the old funnel
   pages never load this file and keep theirs). Heights measured on
   the rendered bar (headed browser, 2026-11-20): 80px at desktop
   widths and 74px at phone widths, labels on one line, so the
   reservations carry 2px of headroom; below 360px the labels can
   wrap to two lines and the reservation covers the wrapped bar. */
#tgfs-shell {
  min-height: 82px;
}
@media (max-width: 560px) {
  #tgfs-shell {
    /* Still-paint (Ryan, 2026-11-21): the 76px reservation was
       measured with the labels on one line, but that is the
       fallback font's layout; when Inter arrives the two long
       labels wrap to two lines and the bar grows about 14px past
       the reservation, pushing the whole page down. The label
       min-height below makes the phone bar two-line tall in
       every font, and this reservation matches that settled
       height, so the swap changes glyphs only, never geometry. */
    min-height: 90px;
  }
  .tgfp-label {
    min-height: 2.5em;
  }
}
@media (max-width: 359px) {
  #tgfs-shell {
    min-height: 96px;
  }
}

.tgfp {
  --tgfp-navy: #1F3A5F;
  --tgfp-navy-dark: #152840;
  --tgfp-gold: #E2A33C;
  --tgfp-gray-900: #111827;
  --tgfp-gray-600: #4b5563;
  --tgfp-gray-500: #6b7280;
  --tgfp-gray-300: #d1d5db;
  --tgfp-gray-200: #e5e7eb;

  position: relative;
  font-family: "Inter", system-ui, sans-serif;
  padding: 0.8rem 0 0.9rem;
}

/* The connecting track: runs badge-center to badge-center (the three
   steps are equal thirds, so the badge centers sit at 1/6 and 5/6 of
   the width). The fill covers the completed portion, up to the
   current step. top = .tgfp padding-top + half the badge height.
   Stacking: the track sits UNDER the steps row (z-index 0 against
   the steps row at 1), so the line passes behind the badges and the
   current badge's gold halo ring stays whole; painted over them,
   the 2px line visibly sliced through both (Ryan screenshot,
   2026-11-20). */
.tgfp-track {
  position: absolute;
  z-index: 0;
  top: calc(0.8rem + 13px);
  left: 16.6667%;
  right: 16.6667%;
  height: 2px;
  background: var(--tgfp-gray-200);
}
.tgfp-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--tgfp-navy);
}

.tgfp-steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.tgfp-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}

.tgfp-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  background: #fff;
  border: 2px solid var(--tgfp-gray-300);
  color: var(--tgfp-gray-500);
}
.tgfp-step--done .tgfp-badge {
  background: var(--tgfp-navy);
  border-color: var(--tgfp-navy);
  color: #fff;
}
.tgfp-step--current .tgfp-badge {
  background: var(--tgfp-gold);
  border-color: var(--tgfp-gold);
  color: var(--tgfp-navy-dark);
  box-shadow: 0 0 0 4px rgba(226, 163, 60, 0.25);
}

.tgfp-label {
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--tgfp-gray-500);
}
.tgfp-step--done .tgfp-label {
  color: var(--tgfp-navy);
  font-weight: 600;
}
.tgfp-step--current .tgfp-label {
  color: var(--tgfp-gray-900);
  font-weight: 700;
}

/* Backward navigation (Ryan, 2026-11-21): a done step's badge and
   label wrapped in one anchor. The anchor reproduces the step's own
   flex column, so the bar's geometry is unchanged; its colors inherit
   the done step's styling, so a linked step looks exactly like an
   unlinked done step. */
.tgfp-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
}
.tgfp-link:focus-visible {
  outline: 2px solid var(--tgfp-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 560px) {
  /* Phone widths: the three labels stay fully visible and legible in
     their equal thirds (each wraps to two lines) instead of shrinking
     below a readable size or squeezing the header's logo row, which
     sits above this bar in its own row. */
  .tgfp {
    padding: 0.7rem 0 0.8rem;
  }
  .tgfp-track {
    top: calc(0.7rem + 13px);
  }
  .tgfp-label {
    font-size: 0.78rem;
    /* Cap the label width so the text wraps into the compact
       two-line block the design intends, centered under its badge,
       instead of stretching the full third edge to edge and running
       into the neighbouring label (Ryan screenshot, 2026-11-20). */
    max-width: 5.5rem;
    text-wrap: balance;
  }
}
