/* ════════════════════════════════════════════════════════════════
   QuicklyFig Freight Market Pulse Component v1
   Reusable current-state + event distribution layer
   Two variants: compact (homepage), expanded (FMI hub)
   ════════════════════════════════════════════════════════════════ */

:root {
  --fmi-teal: #0D9488;
  --fmi-teal-light: #5EEAD4;
  --fmi-teal-bg: rgba(13, 148, 136, 0.08);
  --fmi-teal-border: rgba(13, 148, 136, 0.25);
  --fmi-amber: #F59E0B;
  --fmi-amber-light: #FCD34D;
  --fmi-amber-bg: rgba(251, 191, 36, 0.12);
  --fmi-amber-border: rgba(251, 191, 36, 0.3);
}

/* ── CONTAINER ── */
.fmi-pulse {
  background: linear-gradient(135deg, rgba(12, 35, 64, 0.95) 0%, rgba(15, 45, 75, 0.92) 100%);
  border: 1px solid var(--fmi-teal-border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  position: relative;
}

.fmi-pulse.compact {
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

/* ── HEADER ── */
.fmi-pulse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fmi-pulse-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fmi-teal);
}

/* Coverage badges */
.fmi-cov-current {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(13, 148, 136, 0.18);
  color: var(--fmi-teal-light);
  border: 1px solid var(--fmi-teal-border);
}

.fmi-cov-reduced {
  background: var(--fmi-amber-bg);
  color: var(--fmi-amber-light);
  border-color: var(--fmi-amber-border);
}

.fmi-cov-insufficient {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* ── STALE NOTICE ── */
.fmi-pulse-stale {
  font-size: 11px;
  color: var(--fmi-amber-light);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ── COMPOSITE LABEL ── */
.fmi-pulse-label {
  font-family: 'Syne', sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: white;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.fmi-pulse.compact .fmi-pulse-label {
  font-size: clamp(18px, 3vw, 24px);
}

.fmi-pulse-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.fmi-pulse-watch {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
  font-style: italic;
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.fmi-pulse-nodata {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.9rem;
}

/* Dimmed composite when reduced coverage */
.fmi-pulse-composite.dimmed {
  opacity: 0.78;
}

/* ── DOMINANT FAMILY (compact mode) ── */
.fmi-pulse-dominant {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.9rem;
}

.fmi-pulse-dominant strong {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

/* ── HUB VARIANT ── */
.fmi-pulse.hub {
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.fmi-pulse-hub-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.fmi-pulse-hub-copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.fmi-pulse-hub-families {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

@media (max-width: 480px) {
  .fmi-pulse-hub-families {
    grid-template-columns: 1fr;
  }
}

.fmi-pulse-hub-family {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.fmi-pulse-hub-family .fmi-pulse-fam-name {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.fmi-pulse-hub-family .fmi-pulse-fam-state {
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* ── FAMILY GRID (expanded mode) ── */
.fmi-pulse-families {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

@media (max-width: 768px) {
  .fmi-pulse-families {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .fmi-pulse-families {
    grid-template-columns: 1fr;
  }
}

.fmi-pulse-fam {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  display: block;
  transition: all 0.15s;
}

.fmi-pulse-fam:hover {
  border-color: rgba(13, 148, 136, 0.35);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.fmi-pulse-fam-name {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.fmi-pulse-fam-state {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Family state colors */
.fmi-st-sb { color: var(--fmi-teal); }
.fmi-st-b { color: var(--fmi-teal-light); }
.fmi-st-h { color: rgba(255, 255, 255, 0.6); }
.fmi-st-e { color: var(--fmi-amber-light); }
.fmi-st-se { color: var(--fmi-amber); }

.fmi-pulse-fam-interp {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.32);
  line-height: 1.5;
}

/* Family tags */
.fmi-fam-tag-stale {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--fmi-amber-bg);
  color: var(--fmi-amber-light);
  border: 1px solid var(--fmi-amber-border);
  margin-left: 0.3rem;
}

.fmi-fam-tag-miss {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── EVENT SECTION ── */
.fmi-pulse-event {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.9rem;
}

.fmi-pulse-event-cat {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--fmi-teal-light);
  margin-bottom: 0.4rem;
}

.fmi-pulse-event-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.fmi-pulse-event-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── FRAMING & CTA ── */
.fmi-pulse-framing {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 0.75rem;
  line-height: 1.65;
}

.fmi-pulse-freshness {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 0.75rem;
}

.fmi-pulse-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.fmi-pulse-cta-primary {
  font-size: 12px;
  font-weight: 700;
  color: var(--fmi-teal-light);
  text-decoration: none;
  transition: color 0.15s;
}

.fmi-pulse-cta-primary:hover {
  color: white;
  text-decoration: underline;
}

.fmi-pulse-cta-secondary {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.32);
  text-decoration: none;
  transition: color 0.15s;
}

.fmi-pulse-cta-secondary:hover {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: underline;
}

/* ── UNAVAILABLE FALLBACK ── */
.fmi-pulse-unavailable {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.75rem;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.6;
}

.fmi-pulse-unavailable a {
  color: var(--fmi-teal-light);
  font-weight: 600;
  text-decoration: none;
}

.fmi-pulse-unavailable a:hover {
  text-decoration: underline;
}

/* ── LOADING STATE ── */
.fmi-pulse[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ── ACCESSIBILITY ── */
.fmi-pulse[role="status"],
.fmi-pulse[role="region"] {
  /* aria-live="polite" set via JS */
}

/* Focus-visible for keyboard navigation */
.fmi-pulse-fam:focus-visible {
  outline: 2px solid var(--fmi-teal-light);
  outline-offset: 2px;
}
