/* ============================================================
   Widget · Insurance Grid
   ============================================================
   Grid of insurance carrier pills used on the home page's
   "We accept most major insurances" section. Two visual bands:
   primary (commercial / PPO) and veterans (Tricare / TriWest)
   with a subtle divider between them.
   ============================================================ */

.bdc-insurance-grid {
  --bdc-ig-cols: 1fr 1fr 1fr 1fr;
  font-family: var(--bdc-sans);
  color: var(--bdc-ink);
}

.bdc-insurance-grid__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;               /* mobile: 2 columns */
  gap: 10px;
}

@media (min-width: 600px) {
  .bdc-insurance-grid__list {
    grid-template-columns: var(--bdc-ig-cols);
    gap: 12px;
  }
}

/* ── Chip ────────────────────────────────── */

.bdc-insurance-grid__chip {
  position: relative;                           /* anchor for the plan-type badge */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 56px;
  padding: 12px 14px;
  background: var(--bdc-surface);
  border: 1px solid var(--bdc-line);
  border-radius: var(--bdc-r-md);
  color: var(--bdc-ink);
  font-family: var(--bdc-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

/* ── Plan-type badge ──────────────────────────
   Corner label ("PPO" / "HMO" / "PPO/HMO") shown on carrier chips so
   a visitor can spot at a glance whether their plan needs a referral
   (HMO) or not (PPO). Two colour tokens by intent — PPO uses the
   calming sage tint (default / most-common), HMO uses a warmer amber
   to signal "check your referral requirement". `both` reuses the
   sage palette since it's the permissive superset.
   ────────────────────────────────────────────── */

.bdc-insurance-grid__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--bdc-sans);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--bdc-sage-tint, #e6ede6);
  color: var(--bdc-sage-2, #1f3f33);
  pointer-events: none;                         /* never intercept the chip's link click */
}

.bdc-insurance-grid__chip--plan-hmo .bdc-insurance-grid__badge {
  background: #f5e2c8;
  color: #7a4a1a;
}

/* On mobile the chip is only ~150px wide — nudge the badge in a hair
   so it doesn't clip the rounded corner or overlap short carrier names. */
@media (max-width: 599px) {
  .bdc-insurance-grid__badge { top: 4px; right: 4px; font-size: 8px; padding: 2px 5px; }
}

/* When the chip is a link, kill default `<a>` styling so the tile
   still reads as a chip. Hover-lift only makes sense on the
   clickable variant, so scope :hover to `a.bdc-insurance-grid__chip`. */
a.bdc-insurance-grid__chip {
  text-decoration: none;
  cursor: pointer;
}
a.bdc-insurance-grid__chip:hover,
a.bdc-insurance-grid__chip:focus-visible {
  border-color: var(--bdc-sage-tint);
  background: var(--bdc-sage-soft);
  transform: translateY(-1px);
  outline: none;
}
a.bdc-insurance-grid__chip:focus-visible {
  box-shadow: 0 0 0 2px var(--bdc-sage), 0 0 0 4px rgba(31, 63, 51, 0.15);
}

/* ── Logo variant ─────────────────────────────
   Chip renders as an image + visually-hidden name when a Carrier
   post has a featured image. The tile size grows a little (72px vs
   56px) so the logo has room to breathe; images object-fit inside
   to normalise wildly different aspect ratios (tall shield vs wide
   wordmark). */

.bdc-insurance-grid__chip--has-logo {
  min-height: 72px;
  padding: 10px 12px;
}
.bdc-insurance-grid__logo {
  display: block;
  max-width: 100%;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Slight desaturation keeps the mixed logos visually calm; hover
     restores full colour. Feels premium; also softens the mismatch
     between vector marks (crisp) and rasterised marks (fuzzy). */
  filter: saturate(0.85) contrast(0.98);
  transition: filter 160ms ease, transform 160ms ease;
}
a.bdc-insurance-grid__chip--has-logo:hover .bdc-insurance-grid__logo,
a.bdc-insurance-grid__chip--has-logo:focus-visible .bdc-insurance-grid__logo {
  filter: saturate(1) contrast(1);
  transform: scale(1.02);
}
@media (min-width: 768px) {
  .bdc-insurance-grid__chip--has-logo { min-height: 80px; }
  .bdc-insurance-grid__logo { max-height: 48px; }
}

.bdc-insurance-grid__name--visuallyhidden {
  /* Standard visually-hidden (a11y): logo is decorative-plus-labeled,
     but screen readers still need the carrier name. Alt on <img> and
     this hidden span cover both scanners and text-mode browsers. */
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Veterans chips use a soft accent tint so the block reads as
   "different rules apply" without shouting. */
.bdc-insurance-grid__chip--veterans {
  background: var(--bdc-accent-soft);
  border-color: var(--bdc-accent-soft);
  color: var(--bdc-accent-2);
}
.bdc-insurance-grid__chip--veterans:hover {
  background: var(--bdc-accent-soft);
  border-color: var(--bdc-accent);
}

/* ── Divider between primary + veterans ─── */

.bdc-insurance-grid__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
  color: var(--bdc-ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bdc-insurance-grid__divider::before,
.bdc-insurance-grid__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bdc-line);
}
.bdc-insurance-grid__divider-label {
  padding: 0 4px;
  white-space: nowrap;
}

/* ── Footnote ────────────────────────────── */

.bdc-insurance-grid__footnote {
  margin: 24px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bdc-ink-2);
  text-align: center;
}
.bdc-insurance-grid__footnote strong { color: var(--bdc-ink); font-weight: 600; }
.bdc-insurance-grid__footnote a {
  color: var(--bdc-sage-2);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

/* ── Desktop scale ───────────────────────── */

@media (min-width: 768px) {
  .bdc-insurance-grid__chip {
    min-height: 60px;
    font-size: 15px;
    padding: 14px 16px;
  }
  .bdc-insurance-grid__footnote {
    font-size: 15px;
    margin-top: 28px;
  }
}

/* ── Specificity safety ─────────────────────
   Theme styles for `ul li` (0,1,2) would bump font-size + color
   on our chips. Re-declare under .bdc-v3 (0,2,0) — same pattern
   as trust-tiles / journey-steps. */

.bdc-v3 .bdc-insurance-grid__chip {
  font-family: var(--bdc-sans);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  color: var(--bdc-ink);
  font-size: 14px;
  line-height: 1.3;
}
.bdc-v3 .bdc-insurance-grid__chip--veterans {
  color: var(--bdc-accent-2);
}
.bdc-v3 .bdc-insurance-grid__footnote {
  font-family: var(--bdc-sans);
  color: var(--bdc-ink-2);
}
.bdc-v3 .bdc-insurance-grid__footnote strong { color: var(--bdc-ink); }
.bdc-v3 .bdc-insurance-grid__footnote a { color: var(--bdc-sage-2); }

@media (min-width: 768px) {
  .bdc-v3 .bdc-insurance-grid__chip { font-size: 15px; }
  .bdc-v3 .bdc-insurance-grid__footnote { font-size: 15px; }
}
