/* Seattle Market Pulse — Frontend Widget */

.smp-widget {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1a1a;
  max-width: 960px;
  margin: 2rem 0;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.smp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.smp-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a2740;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.smp-subtitle {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
}

.smp-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c9a84c;
  background: #fdf8ee;
  border: 1px solid #e8d49a;
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
}

.smp-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9a84c;
  animation: smpPulse 2s ease-in-out infinite;
}

@keyframes smpPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.85); }
}

/* ── Stat grid ───────────────────────────────────────────────────────────── */
.smp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.smp-stat-card {
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-top: 3px solid #1a2740;
  border-radius: 6px;
  padding: 0.875rem 1rem;
  transition: box-shadow 0.15s ease;
}

.smp-stat-card:hover {
  box-shadow: 0 2px 8px rgba(26, 39, 64, 0.08);
}

.smp-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.375rem;
}

.smp-stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1a2740;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.smp-stat-delta {
  font-size: 0.75rem;
  font-weight: 500;
}

.smp-up   { color: #166534; }
.smp-down { color: #991b1b; }
.smp-flat { color: #6b7280; }

/* ── Trend chart ─────────────────────────────────────────────────────────── */
.smp-trend {
  margin-bottom: 1.25rem;
}

.smp-trend-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.smp-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 60px;
}

.smp-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.smp-bar {
  width: 100%;
  background: #d1d5db;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: background 0.2s;
}

.smp-bar--current {
  background: #c9a84c;
}

.smp-bar-mo {
  font-size: 0.5625rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.smp-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 1.25rem 0;
}

/* ── Commentary ───────────────────────────────────────────────────────────── */
.smp-commentary { margin-bottom: 1.5rem; }

.smp-commentary-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.smp-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7280;
}

.smp-ai-badge {
  font-size: 0.625rem;
  font-weight: 600;
  background: #fdf8ee;
  color: #92400e;
  border: 1px solid #e8d49a;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

.smp-commentary-body p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #374151;
  margin: 0 0 0.875rem;
}

.smp-commentary-body p:last-child { margin-bottom: 0; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.smp-faq { margin: 1.5rem 0; }

.smp-faq-item {
  border-top: 1px solid #e5e7eb;
}

.smp-faq-item:last-child {
  border-bottom: 1px solid #e5e7eb;
}

.smp-faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: none;
  border: none;
  padding: 0.875rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a2740;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  font-family: inherit;
}

.smp-faq-q:hover { color: #c9a84c; }

.smp-faq-icon {
  font-size: 1.25rem;
  font-weight: 300;
  color: #c9a84c;
  flex-shrink: 0;
  line-height: 1;
}

.smp-faq-a {
  padding: 0 0 0.875rem;
}

.smp-faq-a p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #4b5563;
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.smp-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.smp-disclaimer {
  font-size: 0.75rem;
  line-height: 1.6;
  color: #9ca3af;
  margin: 0 0 0.5rem;
}

.smp-attribution {
  font-size: 0.6875rem;
  color: #9ca3af;
  margin: 0 0 0.25rem;
}

.smp-attribution a {
  color: #1a2740;
  text-decoration: none;
}

.smp-attribution a:hover { text-decoration: underline; }

.smp-fetched {
  font-size: 0.625rem;
  color: #d1d5db;
  margin: 0;
}

.smp-error {
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #991b1b;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media ( max-width: 640px ) {
  .smp-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .smp-title { font-size: 1.25rem; }
  .smp-stat-value { font-size: 1.125rem; }
}

@media ( max-width: 400px ) {
  .smp-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .smp-faq-a { display: block !important; }
  .smp-faq-icon { display: none; }
  .smp-pulse-dot { animation: none; }
}
