/* ============================================================
   SENTIMENT & MEDIA — demo2026/css/sentiment-media.css
   ============================================================ */

/* ── PAGE LAYOUT ── */
.sm-page {
  max-width: 1280px;
  margin: 0 auto;
  /* 56px = 40px fixed F&G bar + 16px breathing room (the bar is position:fixed) */
  padding: 56px 24px 80px;
}

.sm-header { margin-bottom: 32px; }
.sm-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.sm-title .chrome-text-subtle { font-weight: 700; }
.sm-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0;
}

/* ── FEAR & GREED FIXED BAR ── */
/* position:fixed instead of sticky — sticky was failing for unclear reasons.
   .sm-page has padding-top: 56px to reserve space below the bar. */
.fg-bar {
  position: fixed;
  top: 100px;   /* fallback: navbar(64) + ticker(36). JS overrides on scroll to track ticker slide. */
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border-subtle);
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.fg-bar-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.fg-bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  flex-shrink: 0;
}
.fg-bar-meter {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 120px;
  max-width: 480px;
}
.fg-bar-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: visible;
}
.fg-bar-track-bg {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #E54360 0%,
    #F08040 25%,
    #F0B040 50%,
    #88D070 75%,
    #00C566 100%
  );
  opacity: 0.85;
}
.fg-bar-track-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border: 2px solid #0A0E14;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  left: 50%;
  transition: left 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.fg-bar-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}
.fg-bar-classification {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.fg-bar-classification.extreme-fear  { color: #E54360; }
.fg-bar-classification.fear          { color: #F08040; }
.fg-bar-classification.neutral       { color: var(--warning, #f59e0b); }
.fg-bar-classification.greed         { color: #88D070; }
.fg-bar-classification.extreme-greed { color: var(--green, #00C566); }

.fg-bar-help {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 200ms, border-color 200ms;
}
.fg-bar-help:hover {
  color: var(--green);
  border-color: var(--green);
}

@media (max-width: 640px) {
  .sm-page { padding-top: 52px; }   /* 36px mobile bar + 16px breathing room */
  .fg-bar {
    /* Mobile navbar = 64px + safe-area; mobile ticker shrinks to 32px */
    top: calc(64px + env(safe-area-inset-top) + 32px);
    padding: 0 16px;
    height: 36px;
  }
  .fg-bar-inner { gap: 10px; }
  .fg-bar-label { font-size: 9px; letter-spacing: 0.15em; }
  .fg-bar-meter { min-width: 60px; max-width: 180px; }
  .fg-bar-classification { font-size: 9px; }
  .fg-bar-help { display: none; }
}

/* ── SECTION HEADER ── */
.sm-section-header { margin: 16px 0 24px; }
.sm-section-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 8px 0 0;
}

/* ── NEWS HERO ── */
.news-hero-wrap { margin-bottom: 24px; }
.news-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 250ms, transform 250ms;
}
.news-hero:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.news-hero-image {
  aspect-ratio: 16/10;
  background: var(--bg-surface-3) center/cover no-repeat;
  position: relative;
  min-height: 240px;
}
.news-hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,197,102,0.05) 100%);
}
.news-hero-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.news-hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.news-hero-title {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 14px;
  color: var(--text);
}
.news-hero-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-hero-source {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.news-hero-source img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

/* skeleton placeholder before hero renders */
article.news-hero {
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
}

@media (max-width: 800px) {
  .news-hero { grid-template-columns: 1fr; }
  .news-hero-image { min-height: 200px; }
  .news-hero-body { padding: 20px 20px 24px; }
}

/* ── NEWS GRID ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 1000px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .news-grid { grid-template-columns: 1fr; } }

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms, transform 200ms;
}
.news-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
}
.news-card-image {
  aspect-ratio: 16/9;
  background: var(--bg-surface-3) center/cover no-repeat;
}
.news-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.news-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-source {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.news-card-source img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── LOAD MORE ── */
.news-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ── SKELETON LOADING ── */
.news-skeleton {
  background: linear-gradient(90deg, var(--bg-surface-1), var(--bg-surface-2), var(--bg-surface-1));
  background-size: 200% 100%;
  animation: news-shimmer 1.4s linear infinite;
  border-radius: 16px;
}
.news-hero-skeleton {
  aspect-ratio: 21/9;
  border-radius: 20px;
  width: 100%;
}
.news-card-skeleton { aspect-ratio: 4/5; }
@keyframes news-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── AD + AI FOOTER ── */
.ad-footer { padding: 1rem 2.5rem; border-top: 1px solid var(--border-subtle); text-align: center; }
.ai-footer { padding: 0.85rem 2.5rem; border-top: 1px solid var(--border-subtle); }
.ai-footer-inner { display: flex; align-items: center; gap: 0.6rem; }
.ai-footer-badge {
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  background: var(--green-dim, rgba(0,197,102,0.12)); color: var(--green, #00C566);
  padding: 0.15rem 0.45rem; border-radius: 4px; letter-spacing: 0.06em;
}
.ai-footer-inner span:last-child { font-size: 0.75rem; color: var(--text-tertiary); }

/* ── F&G HELP POPOVER ── */
.fg-help-popover {
  position: fixed;
  width: 320px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  pointer-events: none;
}
.fg-help-popover.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.fg-help-popover-arrow {
  position: absolute;
  top: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--bg-surface-1);
  border-top: 1px solid var(--border-default);
  border-left: 1px solid var(--border-default);
  transform: rotate(45deg);
}
.fg-help-popover-body {
  padding: 18px 20px;
  position: relative;
}
.fg-help-popover-body h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.fg-help-popover-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 10px;
}
.fg-help-popover-body p:last-of-type { margin-bottom: 14px; }
.fg-help-popover-body strong { color: var(--text); font-weight: 600; }

.fg-help-popover-scale {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fg-help-popover-scale .fg-scale-tick {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text-tertiary);
  text-align: center;
}
.fg-help-popover-scale .fg-scale-fear { color: var(--red-bright); background: rgba(229,67,96,0.08); }
.fg-help-popover-scale .fg-scale-greed { color: var(--green); background: rgba(0,197,102,0.08); }

@media (max-width: 640px) {
  .fg-help-popover {
    width: calc(100vw - 32px);
    left: 16px !important;
  }
}
