/* ============================================================
   follow-the-money.css
   CapitolTea.com — Follow the Money section styles
   Mobile-first. Drop-in addition — doesn't override base styles.
   ============================================================ */

/* ─── Section container ──────────────────────────────────────── */

.ftm-section {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.ftm-section.hidden,
.ftm-list.hidden,
.ftm-detail.hidden,
.ftm-loading.hidden,
.ftm-empty.hidden {
  display: none !important;
}

/* ─── Tab button ─────────────────────────────────────────────── */

.ftm-tab-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
  color: inherit;
  white-space: nowrap;
}

.ftm-tab-btn:hover,
.ftm-tab-btn.active {
  background: #1a7a3c;  /* green to match GA state color */
  color: #fff;
}

/* ─── Header ─────────────────────────────────────────────────── */

.ftm-header {
  padding: 24px 0 16px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
}

.ftm-title {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  margin: 0 0 8px;
  color: #111;
}

.ftm-subtitle {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin: 0 0 16px;
  max-width: 600px;
}

.ftm-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ftm-select {
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  min-width: 180px;
}

.ftm-btn-sort {
  padding: 8px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ftm-btn-sort.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* ─── Explainer box ──────────────────────────────────────────── */

.ftm-explainer {
  display: flex;
  gap: 14px;
  background: #fffbeb;
  border: 1.5px solid #f6d860;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.ftm-explainer-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.ftm-explainer-text {
  font-size: 14px;
  line-height: 1.55;
  color: #444;
}

.ftm-explainer-text strong {
  color: #111;
}

/* ─── Loading ─────────────────────────────────────────────────── */

.ftm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
  color: #777;
  font-size: 14px;
}

.ftm-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #eee;
  border-top-color: #1a7a3c;
  border-radius: 50%;
  animation: ftm-spin 0.8s linear infinite;
}

@keyframes ftm-spin {
  to { transform: rotate(360deg); }
}

/* ─── Empty state ─────────────────────────────────────────────── */

.ftm-empty {
  text-align: center;
  padding: 48px 16px;
  color: #777;
}

.ftm-empty span { font-size: 32px; display: block; margin-bottom: 12px; }
.ftm-empty p { font-size: 15px; }

/* ─── Error ───────────────────────────────────────────────────── */

.ftm-error {
  padding: 20px;
  background: #fff0f0;
  border-radius: 10px;
  color: #c0392b;
  font-size: 14px;
}

.ftm-error button {
  background: none;
  border: 1.5px solid #c0392b;
  color: #c0392b;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
}

/* ─── Bill cards (list view) ─────────────────────────────────── */

.ftm-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ftm-card {
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  outline: none;
}

.ftm-card:hover,
.ftm-card:focus {
  border-color: #1a7a3c;
  box-shadow: 0 4px 18px rgba(26,122,60,0.12);
}

.ftm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.ftm-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ftm-bill-number {
  font-size: 13px;
  font-weight: 700;
  color: #1a7a3c;
  background: #e8f5ee;
  padding: 3px 8px;
  border-radius: 5px;
}

.ftm-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.ftm-status--signed    { background: #d4edda; color: #155724; }
.ftm-status--vetoed    { background: #f8d7da; color: #721c24; }
.ftm-status--governor  { background: #fff3cd; color: #856404; }
.ftm-status--passed    { background: #d1ecf1; color: #0c5460; }
.ftm-status--committee { background: #e2e3e5; color: #383d41; }
.ftm-status--intro     { background: #f3f0ff; color: #5a3e8f; }
.ftm-status--default   { background: #f5f5f5; color: #555; }

.ftm-money-total {
  font-size: 22px;
  font-weight: 800;
  color: #1a7a3c;
  white-space: nowrap;
}

.ftm-card-headline {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 0 0 10px;
  line-height: 1.4;
}

.ftm-money-headline {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #7a4a00;
  background: #fff8e6;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.ftm-money-headline--large {
  font-size: 15px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.ftm-money-icon { flex-shrink: 0; }

.ftm-money-breakdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ftm-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ftm-breakdown-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ftm-breakdown-value {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.ftm-industries {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ftm-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.ftm-pill--industry {
  background: #f0f0f0;
  color: #444;
}

.ftm-top-contribs {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
}

.ftm-contrib-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #f8f8f8;
}

.ftm-contrib-name {
  color: #333;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ftm-contrib-amount {
  font-weight: 700;
  color: #1a7a3c;
  white-space: nowrap;
}

.ftm-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.ftm-btn-detail {
  background: #1a7a3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.ftm-btn-detail:hover { background: #145c2d; }

.ftm-official-link {
  font-size: 12px;
  color: #1a7a3c;
  text-decoration: none;
}

.ftm-official-link:hover { text-decoration: underline; }

.ftm-official-link--large {
  display: inline-block;
  font-size: 14px;
  margin-top: 4px;
}

/* ─── Detail view ────────────────────────────────────────────── */

.ftm-detail-inner {
  max-width: 720px;
  margin: 0 auto;
}

.ftm-back-btn {
  background: none;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #555;
  margin-bottom: 20px;
  transition: all 0.15s;
}

.ftm-back-btn:hover {
  background: #f5f5f5;
  color: #111;
}

.ftm-detail-header {
  margin-bottom: 24px;
}

.ftm-detail-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ftm-detail-headline {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 800;
  color: #111;
  margin: 0 0 12px;
  line-height: 1.3;
}

/* ─── Totals grid ─────────────────────────────────────────────── */

.ftm-totals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .ftm-totals-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ftm-total-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ftm-total-card--main {
  background: #e8f5ee;
  border: 1.5px solid #a3d5b3;
}

.ftm-total-label {
  font-size: 11px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ftm-total-value {
  font-size: 20px;
  font-weight: 800;
  color: #111;
}

.ftm-total-card--main .ftm-total-value {
  color: #1a7a3c;
}

/* ─── Plain English ───────────────────────────────────────────── */

.ftm-plain-english {
  background: #fffbeb;
  border: 1.5px solid #f6d860;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.ftm-section-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  margin: 0 0 14px;
}

.ftm-plain-english p {
  font-size: 14px;
  color: #444;
  line-height: 1.65;
  margin: 0 0 10px;
}

.ftm-plain-english p:last-child { margin-bottom: 0; }

/* ─── Industry chart ──────────────────────────────────────────── */

.ftm-industry-section {
  margin-bottom: 28px;
}

.ftm-industry-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ftm-industry-row {
  display: grid;
  grid-template-columns: 160px 1fr 64px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

@media (max-width: 480px) {
  .ftm-industry-row {
    grid-template-columns: 120px 1fr 56px;
  }
}

.ftm-industry-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ftm-industry-emoji { font-size: 16px; flex-shrink: 0; }

.ftm-industry-name {
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ftm-industry-bar-wrap {
  background: #f0f0f0;
  border-radius: 4px;
  height: 12px;
  overflow: hidden;
}

.ftm-industry-bar {
  height: 100%;
  background: linear-gradient(90deg, #1a7a3c, #34c466);
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.5s ease;
}

.ftm-industry-amount {
  font-weight: 700;
  color: #1a7a3c;
  text-align: right;
  font-size: 12px;
}

/* ─── Sponsors section ───────────────────────────────────────── */

.ftm-sponsors-section {
  margin-bottom: 28px;
}

.ftm-sponsors-note {
  font-size: 13px;
  color: #777;
  margin: 0 0 16px;
  line-height: 1.5;
}

.ftm-sponsors-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ftm-sponsor-card {
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}

.ftm-sponsor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ftm-sponsor-name {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.ftm-sponsor-total {
  font-size: 16px;
  font-weight: 800;
  color: #1a7a3c;
}

.ftm-sponsor-breakdown {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.ftm-sponsor-contribs-title {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px;
}

.ftm-contrib-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ftm-contrib-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid #eee;
  gap: 10px;
}

.ftm-contrib-row:last-child { border-bottom: none; }

.ftm-contrib-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ftm-contrib-row-name {
  font-size: 13px;
  color: #222;
  font-weight: 500;
}

.ftm-contrib-row-industry {
  font-size: 11px;
  color: #888;
}

.ftm-contrib-row-amount {
  font-size: 13px;
  font-weight: 700;
  color: #1a7a3c;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Footer ──────────────────────────────────────────────────── */

.ftm-detail-footer {
  border-top: 1.5px solid #f0f0f0;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ftm-disclaimer {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

.ftm-sources {
  font-size: 11px;
  color: #aaa;
}

/* ─── "Follow the Money" link on post cards ──────────────────── */

.ftm-post-link {
  background: none;
  border: none;
  color: #1a7a3c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  transition: color 0.12s;
}

.ftm-post-link:hover { color: #145c2d; }

/* ─── Responsive tweaks ──────────────────────────────────────── */

@media (max-width: 480px) {
  .ftm-section { padding: 0 12px 36px; }
  .ftm-card { padding: 14px; }
  .ftm-card-header { flex-direction: column; }
  .ftm-money-total { font-size: 18px; }
  .ftm-totals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Dark mode support ──────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  .ftm-title, .ftm-card-headline, .ftm-detail-headline,
  .ftm-sponsor-name, .ftm-breakdown-value, .ftm-total-value { color: #f0f0f0; }

  .ftm-card { background: #1c1c1e; border-color: #333; }
  .ftm-card:hover, .ftm-card:focus { border-color: #34c466; }

  .ftm-explainer { background: #2a2600; border-color: #6b5b00; }
  .ftm-explainer-text { color: #ccc; }

  .ftm-plain-english { background: #2a2600; border-color: #6b5b00; }
  .ftm-plain-english p { color: #ccc; }

  .ftm-total-card { background: #2a2a2a; }
  .ftm-total-card--main { background: #1a3325; }

  .ftm-money-headline { background: #2a2600; color: #d4a000; }

  .ftm-sponsor-card { background: #1c1c1e; border-color: #333; }

  .ftm-industry-bar-wrap { background: #333; }

  .ftm-select { background: #1c1c1e; color: #f0f0f0; border-color: #444; }
  .ftm-btn-sort { background: #1c1c1e; color: #f0f0f0; border-color: #444; }
  .ftm-btn-sort.active { background: #f0f0f0; color: #111; }

  .ftm-subtitle, .ftm-sponsors-note, .ftm-disclaimer { color: #999; }
  .ftm-breakdown-label, .ftm-total-label { color: #888; }
  .ftm-contrib-row-name, .ftm-industry-name { color: #ddd; }
  .ftm-contrib-row { border-color: #333; }
}

/* Hide zero-value breakdown items in sponsor cards */
.ftm-sponsor-breakdown .ftm-sponsor-breakdown-item {
  display: none;
}
