/* ─────────────────────────────────────────
   COMPONENT — CHIP
   The rounded pill from The Venues, now one component for every pill on the
   site (new pages; index.html still uses the old .venue-tab in tabs.css).

   Markup
     <div class="chip-group" role="tablist">
       <button class="chip active" role="tab" aria-selected="true">
         <img src="assets/images/SVG/flower-terracotta.svg" alt="" aria-hidden="true" class="chip-flower">Ceremony
       </button>
       <button class="chip" role="tab" aria-selected="false">…</button>
     </div>
   or a link: <a class="chip" href="#venues">Venues</a>

   States     .active      — selected: clay fill, cream text, the flower grows in
              :hover       — a soft wash
              :focus-visible — clay ring
   Variant    .chip--inverse — on clay (page headers): cream outline, fills cream on hover
   Text style Label (foundations/text-styles.css).
   Used by    venue tabs, dress code + plan day chips, FAQ groups, gift
              payment tabs, page-header links.
───────────────────────────────────────── */

.chip-group {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease), padding 250ms var(--ease);
}

.chip:not(.active):hover { background: var(--surface-sunken); }

.chip:focus-visible {
  outline: 2px solid var(--border);
  outline-offset: 2px;
}

/* the flower only takes up space on the selected chip */
.chip-flower {
  width: 0;
  height: 16px;
  margin-right: 0;
  opacity: 0;
  flex-shrink: 0;
  transform: rotate(90deg);
  transition: width 250ms var(--ease), margin-right 250ms var(--ease), opacity 200ms var(--ease);
}

.chip.active {
  padding-left: 10px;
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--cream-50);
}

.chip.active .chip-flower {
  width: 16px;
  margin-right: 8px;
  opacity: 1;
  filter: brightness(0) invert(1);   /* cream on the clay fill */
}

/* ── on clay (page headers) ── */
.chip--inverse {
  color: var(--on-inverse);
  border-color: var(--on-inverse-muted);
}

.chip--inverse:not(.active):hover,
.chip--inverse:focus-visible {
  background: var(--on-inverse);
  border-color: var(--on-inverse);
  color: var(--inverse);
  outline-color: var(--on-inverse);
}


/* responsive — mobile */
@media (max-width: 640px) {
  .chip--inverse { padding: 6px 12px; }
}

/* Optically centre the caps: trim the line box to cap height → baseline so the
   empty descender space no longer pushes the text up. Padding grows to keep the
   same chip height; the flower hangs outside the trimmed line so it can't
   stretch the active chip. */
@supports (text-box: trim-both cap alphabetic) {
  .chip {
    text-box: trim-both cap alphabetic;
    padding-block: 11px;
  }
  .chip-flower { margin-block: -4px; }
  @media (max-width: 640px) {
    .chip--inverse { padding-block: 10px; }
  }
}
