/* ============================================================
   Radar de Mercado — consig-news
   Tema editorial · fintech · newsletter
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  /* neutral */
  --bg: #f5f7fa;
  --bg-elev: #ffffff;
  --ink: #0d1b2a;
  --ink-soft: #47607c;
  --ink-faint: #8296ab;
  --line: #e4eaf1;
  --line-strong: #d3dce7;

  /* brand */
  --accent: #2f6fed;
  --accent-deep: #1d4ed8;
  --accent-soft: #eaf1fe;
  --accent-softer: #f4f8ff;

  /* priority */
  --critico: #dc2626;
  --critico-bg: #fef2f2;
  --alto: #ea580c;
  --alto-bg: #fff7ed;
  --medio: #d97706;
  --medio-bg: #fffbeb;
  --baixo: #16a34a;
  --baixo-bg: #f0fdf4;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.05);
  --shadow: 0 1px 2px rgba(13, 27, 42, 0.06), 0 12px 32px -18px rgba(13, 27, 42, 0.28);
  --shadow-lift: 0 2px 6px rgba(13, 27, 42, 0.08), 0 24px 48px -22px rgba(13, 27, 42, 0.34);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Dark mode (auto) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --bg-elev: #101828;
    --ink: #eef3fa;
    --ink-soft: #a7b6c9;
    --ink-faint: #67788f;
    --line: #1e293b;
    --line-strong: #2a3a52;
    --accent: #5b8dff;
    --accent-deep: #7aa2ff;
    --accent-soft: #16233f;
    --accent-softer: #111d34;
    --critico: #f87171;
    --critico-bg: #2a1414;
    --alto: #fb923c;
    --alto-bg: #2b1c0e;
    --medio: #fbbf24;
    --medio-bg: #2a230e;
    --baixo: #4ade80;
    --baixo-bg: #10231a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.5), 0 28px 60px -24px rgba(0, 0, 0, 0.8);
  }
}

/* ---- Reset ---- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--accent); text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Header / masthead
   ============================================================ */
.masthead {
  position: relative;
  color: #fff;
  background:
    radial-gradient(1100px 520px at 82% -20%, rgba(91, 141, 255, 0.28), transparent 60%),
    radial-gradient(800px 460px at -10% 120%, rgba(56, 189, 248, 0.18), transparent 55%),
    linear-gradient(160deg, #0a1a30 0%, #0d2a4d 48%, #123a6d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* radar sweep decoration */
.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.06) 0, transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.05) 0, transparent 24%);
  pointer-events: none;
}

.masthead .inner { position: relative; padding-top: 20px; padding-bottom: 48px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.wordmark:hover { color: #fff; }
.wordmark .logo { width: 30px; height: 30px; flex: none; }

.wordmark .logo .ring { stroke: rgba(255, 255, 255, 0.55); }
.wordmark .logo .sweep { stroke: #7aa2ff; transform-origin: 12px 12px; animation: radar 6s linear infinite; }

@keyframes radar { to { transform: rotate(360deg); } }

.topbar-tag {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.hero { padding: 44px 0 8px; max-width: 780px; }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fb6ff;
  margin: 0 0 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
  margin-right: 8px;
  vertical-align: -1px;
}

.masthead h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.tagline {
  margin: 0;
  font-size: clamp(16px, 2.1vw, 18.5px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 640px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.meta-pill,
.stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.stat b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
}
.stat .dot { width: 7px; height: 7px; border-radius: 50%; }
.stat .dot.critico { background: #f87171; }
.stat .dot.alto { background: #fb923c; }
.stat .dot.medio { background: #fbbf24; }
.stat .dot.baixo { background: #4ade80; }

/* ============================================================
   Layout
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding: 36px 0 64px;
  align-items: start;
}

@media (min-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* ============================================================
   Feed head
   ============================================================ */
.feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.feed-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.feed-head .count {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ============================================================
   News cards
   ============================================================ */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.news-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* priority accent bar */
.news-card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: var(--acc, transparent);
}
.news-card.p-critico { --acc: var(--critico); }
.news-card.p-alto    { --acc: var(--alto); }
.news-card.p-medio   { --acc: var(--medio); }
.news-card.p-baixo   { --acc: var(--baixo); }

@media (hover: hover) {
  .news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
    border-color: var(--line-strong);
  }
}

.topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 7px;
  white-space: nowrap;
  line-height: 1.4;
}

.badge.p-critico { color: var(--critico); background: var(--critico-bg); }
.badge.p-alto    { color: var(--alto);    background: var(--alto-bg); }
.badge.p-medio   { color: var(--medio);   background: var(--medio-bg); }
.badge.p-baixo   { color: var(--baixo);   background: var(--baixo-bg); }

.badge.cat {
  color: var(--accent);
  background: var(--accent-soft);
}

.news-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.32;
  letter-spacing: -0.01em;
  font-weight: 700;
  overflow-wrap: break-word;
  hyphens: auto;
}

.news-card p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.68;
  overflow-wrap: break-word;
}
.news-card p strong { color: var(--ink); font-weight: 650; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 16px;
}
.meta .src { font-weight: 600; color: var(--ink-soft); }
.meta .sep { opacity: 0.6; }

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.source-link .arrow { transition: transform 0.18s ease; }
@media (hover: hover) {
  .source-link:hover { background: var(--accent-softer); border-color: var(--accent); text-decoration: none; }
  .source-link:hover .arrow { transform: translateX(3px); }
}

.source-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   Archive sidebar
   ============================================================ */
.archive {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 920px) {
  .archive { position: sticky; top: 20px; }
}

.archive h2 {
  margin: 0 0 8px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}

.archive ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive li a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border-radius: 10px;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) {
  .archive li a:hover { background: var(--accent-soft); text-decoration: none; }
}

.archive .date { font-weight: 650; font-size: 14.5px; }
.archive .count { font-size: 12.5px; color: var(--ink-faint); }

.archive li a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.archive li a.active .count { color: rgba(255, 255, 255, 0.8); }

/* ============================================================
   Back link
   ============================================================ */
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.back .arrow { transition: transform 0.18s ease; }
.back:hover { color: var(--accent); text-decoration: none; }
.back:hover .arrow { transform: translateX(-3px); }

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  color: var(--ink-soft);
  font-size: 13px;
  background: var(--bg-elev);
}
footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
footer .brand { font-weight: 650; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
footer .brand .logo { width: 18px; height: 18px; }
footer .brand .logo .ring { stroke: var(--ink-faint); }
footer .brand .logo .sweep { stroke: var(--accent); }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Responsive refinements ---- */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-tag { letter-spacing: 0.1em; }
  .feed-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-meta .meta-pill { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .news-card { padding: 20px 18px 18px; }
  .masthead .inner { padding-top: 16px; padding-bottom: 32px; }
  .hero { padding-top: 28px; }
  .masthead h1 { font-size: 32px; }
  .tagline { font-size: 15.5px; }
  .hero-meta { gap: 8px; margin-top: 20px; }
  .meta-pill, .stat { padding: 6px 11px; font-size: 12.5px; }
  .layout { gap: 24px; padding-top: 24px; }
  .feed-head h2 { font-size: 20px; }
  .news-card h3 { font-size: 17.5px; }
}