/* ==========================================================================
   Category archive — taxonomy layer
   --------------------------------------------------------------------------
   Category archives intentionally reuse the blog hub's `.blh-*` component
   system: the hero, section-header, six-column grid, card, lead, opt-in strip,
   service index, pagination and closing CTA all come from blog-hub.css, which
   is enqueued as this bundle's dependency.

   This file therefore carries only what is taxonomy-specific:
     · the switcher pill bar that mirrors the blog hub filter pills as links
     · the "Category Hub Overview" hero card (stat row, focus tags, audit CTA)
     · tighter two-line excerpts so an archive row reads as a scan, not a read

   Palette is unchanged from the blog hub:
     Deep Navy #0B2545 · Slate Blue #13315C · Amber Gold #F5B700
     White #FFFFFF · Soft Cool Gray #F8FAFC
   ========================================================================== */

/* The pill bar sits outside `.blh-library`, so it needs the local tokens. */
.cat-pills {
  --cat-navy: #0B2545;
  --cat-slate: #13315C;
  --cat-gold: #F5B700;
  --cat-bg: #F8FAFC;
  --cat-white: #FFFFFF;
  --cat-ink: #334155;
  --cat-line: #E2E8F0;
}

/* ── Category switcher ─────────────────────────────────────────────────── */

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  background: var(--cat-bg);
  border: 1px solid var(--cat-line);
  border-radius: 999px;
  color: var(--cat-ink);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cat-pill:hover,
.cat-pill:focus-visible {
  border-color: rgba(11, 37, 69, 0.3);
  background: #fff;
  color: var(--cat-navy);
}

.cat-pill.is-active {
  background: var(--cat-navy);
  border-color: var(--cat-navy);
  color: #fff;
}

/* Gold focus ring for keyboard users on every new interactive surface. */
.cat-pill:focus-visible,
.cat-panel__cta:focus-visible {
  outline: 2px solid rgba(245, 183, 0, 0.75);
  outline-offset: 2px;
}

/* ── Hero overview card ────────────────────────────────────────────────── */

.cat-panel {
  --cat-navy: #0B2545;
  --cat-slate: #13315C;
  --cat-gold: #F5B700;
  --cat-bg: #F8FAFC;
  --cat-line: #E2E8F0;
  --cat-ink-strong: #0E1B2C;
}

/* Total count reads as the panel's headline figure. */
.cat-panel__stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.2rem 0 0.9rem;
  border-bottom: 1px solid var(--cat-line);
}

.cat-panel__num {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.7rem + 1.6vw, 2.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--cat-navy);
}

.cat-panel__unit {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #5F6E81;
}

.cat-panel__note {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #5F6E81;
}

.cat-panel__note strong {
  color: var(--cat-ink-strong);
  font-weight: 700;
}

.cat-panel__focus {
  margin-top: 1rem;
}

.cat-panel__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #64748B;
}

.cat-panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-tag {
  padding: 0.25rem 0.6rem;
  background: #FFF4D1;
  border-radius: 999px;
  color: #8A6300;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cat-panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--cat-line);
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cat-navy);
  text-decoration: none;
}

.cat-panel__cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.18s ease;
}

.cat-panel__cta:hover svg,
.cat-panel__cta:focus-visible svg {
  transform: translateX(3px);
}

/* ── Archive grid ──────────────────────────────────────────────────────── */

/*
 * Two-line excerpts: an archive row is scanned, not read, and the shorter
 * clamp keeps every card on the same rhythm without the blog hub's three-line
 * reservation (which is deliberately left in place on /blog/).
 */
.cat-grid .blh-card__excerpt {
  -webkit-line-clamp: 2;
  min-height: calc(2 * 1.6 * 0.875rem);
}

/* The featured lead sits above the grid with its own brighter flag. */
.cat-grid .blh-lead--featured {
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.cat-grid .blh-lead--featured .blh-lead__flag {
  background: var(--cat-gold, #F5B700);
  color: #0B2545;
}

/* ── Responsive ladder ─────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .cat-pill {
    font-size: 0.78rem;
    padding: 0.5rem 0.8rem;
  }

  .cat-pills {
    gap: 0.45rem;
  }

  .cat-panel__cta {
    margin-top: 1rem;
  }
}

@media (max-width: 599px) {
  .cat-panel__stat {
    padding-bottom: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-pill,
  .cat-panel__cta svg,
  .cat-panel__cta:hover svg {
    transition: none;
    transform: none;
  }
}
