/* ═══════════════════════════════════════════════════════════════
   REDE FINANCEIRA — Blade Runner aesthetic
   Dark theme, monospace precision, neon-glow accents
   ═══════════════════════════════════════════════════════════════ */

/* Skip nav link for accessibility */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--accent, #00d4ff);
  color: #000;
  padding: 8px 16px;
  font-weight: 700;
  z-index: 9999;
  border-radius: 4px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-nav:focus {
  top: 8px;
}

/* Focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.filter-btn:focus-visible,
.theme-pill:focus-visible,
.tier-btn:focus-visible {
  outline: 2px solid var(--accent, #00d4ff);
  outline-offset: 2px;
}

:root {
  --navbar-height: 44px;
  --bg-0: #0a0c14;        /* Deep blue-black */
  --bg-1: #0e1019;
  --bg-2: #131620;        /* Cards */
  --bg-3: #1a1e2e;        /* Hover */
  --bg-4: #222740;
  --border: #1e2340;      /* Blue-tinted border */
  --border-light: #2a3050;
  --text-primary: #d4d8e8; /* Lighter, more readable */
  --text-secondary: #7a80a0;
  --text-muted: #404668;
  --accent: #00d4ff;      /* Cyan neon */
  --accent-dim: rgba(0, 212, 255, 0.12);
  --accent-glow: rgba(0, 212, 255, 0.15);
  --purple: #7c5cfc;
  --purple-dim: rgba(124, 92, 252, 0.12);
  --tier1: #d4a840;
  --tier1-bg: rgba(212, 168, 64, 0.08);
  --tier2: #00d4ff;       /* Match accent for tier2 now */
  --tier2-bg: rgba(0, 212, 255, 0.08);
  --tier3: #555770;
  --tier3-bg: rgba(85, 87, 112, 0.06);
  --red: #ff4466;
  --green: #00ff88;       /* Neon green */
  --neon-pink: #ff2d7b;
  --neon-amber: #ffb800;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --heading-color: #ffffff;
  --navbar-bg: rgba(10, 12, 20, 0.92);
  --scanline-opacity: 0.015;  /* Reduced scanlines */
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg-0: #f5f6f8;
  --bg-1: #edeef2;
  --bg-2: #ffffff;
  --bg-3: #f0f1f5;
  --bg-4: #e6e7ed;
  --border: #d8dae3;
  --border-light: #c5c8d4;
  --text-primary: #1a1d2e;
  --text-secondary: #555872;
  --text-muted: #9498b0;
  --accent: #0095b3;
  --accent-dim: rgba(0, 149, 179, 0.1);
  --accent-glow: rgba(0, 149, 179, 0.1);
  --purple: #6940e0;
  --purple-dim: rgba(105, 64, 224, 0.08);
  --tier1: #b58a1a;
  --tier1-bg: rgba(181, 138, 26, 0.08);
  --tier2: #0095b3;
  --tier2-bg: rgba(0, 149, 179, 0.06);
  --tier3: #8a8da4;
  --tier3-bg: rgba(138, 141, 164, 0.06);
  --red: #d43d3d;
  --green: #1a9e55;
  --heading-color: #0f1120;
  --navbar-bg: rgba(245, 246, 248, 0.92);
  --scanline-opacity: 0;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,var(--scanline-opacity)) 2px, rgba(0,0,0,var(--scanline-opacity)) 4px);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); opacity: 0.8; }

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--neon-pink, #ff2d7b));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ── Navbar ── */
/* ── Compact Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 44px;
}
.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  gap: 8px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--heading-color);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.navbar-signal {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-signal 3s ease-in-out infinite;
}
@keyframes pulse-signal {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  flex: 1;
  justify-content: center;
}
.navbar-links a {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text-primary);
  background: var(--bg-3);
}
.navbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-dim);
  border-radius: 1px;
}
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.navbar-hamburger {
  display: none;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.navbar-hamburger:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}
.navbar-mobile-menu {
  display: none;
  position: fixed;
  top: 40px;
  right: 0;
  width: 200px;
  height: calc(100vh - 40px);
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 99;
  padding: 12px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.navbar-mobile-menu.open {
  transform: translateX(0);
}
.navbar-mobile-menu a {
  display: block;
  padding: 8px 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
}
.navbar-mobile-menu a:hover,
.navbar-mobile-menu a.active {
  color: var(--text-primary);
  background: var(--bg-3);
}
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 40px;
  background: rgba(0,0,0,0.5);
  z-index: 98;
}
.mobile-menu-overlay.open {
  display: block;
}
.navbar-search {
  position: relative;
  width: 160px;
}
.navbar-search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 5px 10px 5px 24px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.navbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.navbar-search input::placeholder { color: var(--text-muted); }
.navbar-search::before {
  content: '>';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}
/* ── Nav Dropdown ── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-btn {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.nav-dropdown-btn:hover {
  color: var(--text-primary);
  background: var(--bg-3);
}
.nav-arrow {
  font-size: 0.5rem;
  opacity: 0.5;
  transition: transform 0.2s;
}
.nav-dropdown.open .nav-arrow {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 140px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-dropdown-menu a:hover {
  color: var(--text-primary);
  background: var(--bg-3);
}
.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.nav-dropdown-menu .nav-pillar.pillar-ia { color: #7c5cfc; }
.nav-dropdown-menu .nav-pillar.pillar-fintech { color: #3ddc84; }
.nav-dropdown-menu .nav-pillar.pillar-mercado { color: #d4a840; }
.nav-dropdown-menu .nav-pillar.pillar-ia:hover { background: rgba(124,92,252,0.1); }
.nav-dropdown-menu .nav-pillar.pillar-fintech:hover { background: rgba(0,255,136,0.1); }
.nav-dropdown-menu .nav-pillar.pillar-mercado:hover { background: rgba(212,168,64,0.1); }

/* Mobile menu section header */
.mobile-menu-section {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
  margin-top: 4px;
}

.nav-pillar.pillar-ia.active { color: #7c5cfc !important; }
.nav-pillar.pillar-fintech.active { color: #00ff88 !important; }
.nav-pillar.pillar-mercado.active { color: #d4a840 !important; }

/* ── Shell / Main container ── */
.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── Hero Compact ── */
/* ── Hero Minimal ── */
.hero-minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.hero-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading-color);
}
.hero-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Top Stories ── */
.top-stories {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.top-story {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.top-story:hover {
  border-color: var(--accent-dim);
  background: var(--bg-3);
  transform: translateY(-1px);
}
.top-story-main {
  grid-column: 1;
  grid-row: 1;
}
.ts-pilar {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.ts-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ts-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ── Home Pilar Filters ── */
.home-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.pill-filter {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pill-filter:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}
.pill-filter.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}
.pill-ia.active { border-color: #7c5cfc; color: #7c5cfc; background: rgba(124,92,252,0.1); }
.pill-fintech.active { border-color: #00ff88; color: #00ff88; background: rgba(0,255,136,0.1); }
.pill-mercado.active { border-color: #d4a840; color: #d4a840; background: rgba(212,168,64,0.1); }

/* ── Sidebar Slim ── */
.sidebar-slim {
  width: 260px;
  flex-shrink: 0;
}
.sidebar-link-all {
  display: block;
  margin-top: 8px;
  text-align: right;
  font-size: 0.65rem;
  color: var(--accent);
}
.quick-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  transition: all 0.2s;
}
.quick-card:hover {
  background: var(--bg-3);
  border-color: var(--accent-dim);
}
.quick-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  color: var(--accent);
}
.quick-card small {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: 4px;
}

@media (max-width: 768px) {
  .top-stories { grid-template-columns: 1fr; }
  .hero-minimal { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sidebar-slim { width: 100%; }
  .layout-main { flex-direction: column; }
}

/* ── Legacy hero (keep for other pages) ── */
.hero-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-compact-title {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 0 40px rgba(0,212,255,0.08);
}

.hero-compact-title .accent { color: var(--accent); }

.hero-compact-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.hero-compact-stats {
  display: flex;
  gap: 20px;
}

.hero-compact-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hck-value {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--heading-color);
  line-height: 1;
}

.hck-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── Featured Strip ── */
.home-featured-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  position: relative;
}

.home-featured-strip::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 4px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--bg-0));
  pointer-events: none;
}

.fstrip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.fstrip-item:hover {
  border-color: var(--border-light);
  background: var(--bg-3);
}

.fstrip-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 3px;
}

.fstrip-badge-profile {
  background: var(--purple-dim);
  color: var(--purple);
}

.fstrip-badge-guide {
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
}

.fstrip-name {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.fstrip-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-4);
  padding: 1px 8px;
  border-radius: 10px;
}

.fstrip-guide {
  border-left: 2px solid var(--green);
}

/* Theme filter buttons in filter bar */
.theme-filter-btn.active {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--purple);
}

/* Sidebar pills compact */
.sidebar-pills {
  gap: 4px;
}

.sidebar-pills .theme-pill {
  font-size: 0.6rem;
  padding: 3px 8px;
}

.sidebar-pills .pill-count {
  font-size: 0.55rem;
  padding: 0 4px;
}

.fstrip-item, .fstrip-badge {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

[data-theme="light"] .fstrip-item:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

@media (max-width: 768px) {
  .hero-compact {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-compact-stats {
    width: 100%;
    justify-content: space-between;
  }
  .home-featured-strip {
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Hero / Page Header ── */
.hero {
  padding: 48px 0 32px;
}

.hero-eyebrow {
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--heading-color);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero h1 .accent { color: var(--accent); }

.hero-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.hero-stat b { color: #fff; font-weight: 600; }

/* ── KPI Cards ── */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.kpi {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.kpi:hover { border-color: var(--border-light); }

.kpi::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.4;
}

.kpi:nth-child(2)::after { background: var(--purple); }
.kpi:nth-child(3)::after { background: var(--tier1); }
.kpi:nth-child(4)::after { background: var(--green); }

.kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading-color);
  line-height: 1;
}

.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.kpi-sub .highlight { color: var(--green); }

/* ── Section ── */
.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 1px;
}

.section-count {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── Two Column Layout ── */
.layout-main {
  display: flex;
  gap: 24px;
  align-items: start;
}
.articles-feed {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 68px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

.sidebar-title {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Theme Pills ── */
.theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-pill {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.theme-pill:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.theme-pill.active {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--purple);
}

.pill-count {
  background: var(--bg-1);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.6rem;
  color: var(--text-muted);
}

.theme-pill.active .pill-count {
  background: rgba(124, 92, 252, 0.2);
  color: var(--purple);
}

/* ── Timeline ── */
.timeline {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

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

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding-top: 4px;
}

.timeline-date small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-top: 2px;
}

.timeline-content { min-width: 0; }

.timeline-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.timeline-bar {
  height: 24px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
}

.timeline-bar-seg { height: 100%; }
.timeline-bar-seg.t1 { background: var(--tier1); opacity: 0.8; }
.timeline-bar-seg.t2 { background: var(--tier2); opacity: 0.6; }
.timeline-bar-seg.t3 { background: var(--tier3); opacity: 0.5; }

.timeline-bar-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading-color);
  min-width: 30px;
}

.timeline-highlights {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-highlight {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.4;
}

.timeline-highlight::before {
  content: '\2014';
  color: var(--text-muted);
  flex-shrink: 0;
}

.timeline-highlight a {
  color: var(--text-secondary);
  text-decoration: none;
}

.timeline-highlight a:hover { color: var(--accent); }

.timeline-highlight .hl-domain {
  color: var(--text-muted);
  font-size: 0.65rem;
  flex-shrink: 0;
}

/* ── Filters Bar ── */
.filters-bar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-right: 4px;
}

.filter-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover { border-color: var(--border-light); color: var(--text-primary); }

.filter-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.tier1.active { border-color: var(--tier1); color: var(--tier1); background: var(--tier1-bg); }
.filter-btn.tier2.active { border-color: var(--tier2); color: var(--tier2); background: var(--tier2-bg); }
.filter-btn.tier3.active { border-color: var(--tier3); color: var(--tier3); background: var(--tier3-bg); }

.filter-clear {
  background: none;
  border: none;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: none;
}

.filter-clear.visible { display: inline; }
.filter-clear:hover { opacity: 1; }

.filter-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Content Filters (blog/aprender index) ── */
.content-filters {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.content-filters .filter-btn {
  font-family: var(--font-mono);
}

.content-filters .filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Article Cards ── */
.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 18px;
  transition: all 0.2s;
}

.article-card:hover {
  border-color: var(--border-light);
  background: var(--bg-3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.article-top {
  display: flex;
  align-items: start;
  gap: 12px;
}

.article-tier {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.article-tier.t1 { background: var(--tier1); box-shadow: 0 0 6px rgba(212,168,64,0.3); }
.article-tier.t2 { background: var(--tier2); box-shadow: 0 0 6px rgba(0,212,255,0.3); }
.article-tier.t3 { background: var(--tier3); }

.article-body { flex: 1; min-width: 0; }

.article-title {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.article-title:hover { color: var(--accent); }

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.article-domain { font-size: 0.7rem; color: var(--text-muted); }
.article-date { font-size: 0.65rem; color: var(--text-muted); }

.article-themes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.article-theme-tag {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--bg-4);
  color: var(--text-muted);
}

.article-excerpt {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

/* ── Article Header (article pages) ── */
.article-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.article-breadcrumb {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  color: var(--accent);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.reading-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-title {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.article-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-family: var(--font-sans);
}

/* ── Table of Contents ── */
.article-toc {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
  max-width: 680px;
}

.article-toc-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.article-toc a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 0;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: color 0.2s;
}

.article-toc a:hover {
  color: var(--accent);
}

/* ── Sources Table ── */
.sources-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
}

.sources-table th {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.sources-table td {
  padding: 8px 14px;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.sources-table tr:last-child td { border-bottom: none; }
.sources-table tr:hover td { background: var(--bg-3); }

.source-rank { color: var(--text-muted); font-size: 0.65rem; width: 30px; }
.source-name { font-weight: 500; color: var(--text-primary); }
.source-bar-cell { width: 40%; }

.source-bar {
  height: 6px;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.source-bar.t1 { background: linear-gradient(90deg, var(--tier1), rgba(212,168,64,0.3)); }
.source-bar.t2 { background: linear-gradient(90deg, var(--tier2), rgba(0,212,255,0.3)); }
.source-bar.t3 { background: linear-gradient(90deg, var(--tier3), rgba(85,87,112,0.3)); }

.tier-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.tier-dot.t1 { background: var(--tier1); }
.tier-dot.t2 { background: var(--tier2); }
.tier-dot.t3 { background: var(--tier3); }

.tier-label { font-size: 0.6rem; color: var(--text-muted); }

/* ── Entities ── */
.entities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.entity-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  transition: all 0.2s;
}

.entity-card:hover {
  border-color: var(--border-light);
}

.entity-name {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.entity-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.entity-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.5;
  margin-top: 8px;
}

.entity-articles {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entity-article-link {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.entity-article-link::before {
  content: '\2014';
  color: var(--text-muted);
  flex-shrink: 0;
}

.entity-article-link a {
  color: var(--text-secondary);
}

.entity-article-link a:hover { color: var(--accent); }

/* ── Page Header (for inner pages) ── */
.page-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: var(--font-sans);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 6px;
}

.page-header .subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 48px;
  text-align: center;
}

.footer-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer-text a { color: var(--text-secondary); }

/* ── Calendar Editorial ── */
.cal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cal-header h1 {
  font-size: 1.2rem;
  margin: 0;
}
.cal-stats {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.cal-filters {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.cal-grid {
  display: flex;
  flex-direction: column;
}
.cal-day-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.cal-day-count {
  font-size: 0.55rem;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 0 4px;
  border-radius: 2px;
  margin-left: 4px;
}
.cal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.78rem;
}
.cal-row:hover {
  background: var(--bg-3);
}
.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-dot.pub { background: #00ff88; }
.cal-dot.draft { background: #ffa500; }
.cal-row-pilar {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 28px;
  flex-shrink: 0;
}
.cal-row-title {
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-row-reading, .cal-row-words {
  font-size: 0.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cal-hidden-preview {
  display: none;
}

/* Calendar Modal */
.cal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.cal-modal.open { display: flex; }
.cal-modal-inner {
  margin: 20px auto;
  width: 90%;
  max-width: 800px;
  max-height: calc(100vh - 40px);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cal-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cal-modal-close {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
}
.cal-modal-close:hover { color: var(--text-primary); border-color: var(--accent); }
.cal-modal-status {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}
.cal-modal-status.pub { background: rgba(0,255,136,0.15); color: #00ff88; }
.cal-modal-status.draft { background: rgba(255,165,0,0.15); color: #ffa500; }
.cal-modal-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: auto;
}
.cal-modal-content {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.cal-modal-content h1 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.cal-preview-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}
[data-theme="light"] .cal-modal-inner { background: var(--bg-0); }
[data-theme="light"] .cal-dot.pub { background: #0a8a4a; }
[data-theme="light"] .cal-dot.draft { background: #b07000; }

/* ── Entity Cards Page ── */
.ent-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ent-search {
  margin-left: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 4px;
  width: 200px;
  outline: none;
}
.ent-search:focus { border-color: var(--accent); }
.ent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ent-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ent-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-3);
}
.ent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ent-type {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.ent-type-pessoa { background: rgba(0,212,255,0.12); color: #00d4ff; }
.ent-type-org { background: rgba(74,245,255,0.12); color: #4af5ff; }
.ent-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.ent-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.ent-name-link { color: var(--text-primary); text-decoration: none; }
.ent-name-link:hover { color: var(--accent); }
.ent-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ent-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Fonte Filters ── */
.fonte-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Markdown Blockquotes & HR ── */
.guide-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 16px 0;
  padding: 8px 16px;
  color: var(--text-secondary);
  background: var(--bg-2);
  border-radius: 0 4px 4px 0;
  font-style: italic;
}
.guide-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
.guide-content ol {
  padding-left: 24px;
  margin: 12px 0;
}
.guide-content ol li {
  font-size: 1.066rem;
  line-height: 1.8;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

/* ── Markdown Tables ── */
.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.8rem;
}
.md-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-3);
  border-bottom: 2px solid var(--border-light);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.md-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.md-table tr:hover td {
  background: var(--bg-2);
}
[data-theme="light"] .md-table th {
  background: var(--bg-2);
}

/* ── Blog Post Enhancements ── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tag-pill {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
}
.share-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-2);
}
.share-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--bg-3);
}
.share-twitter:hover { color: #1DA1F2; border-color: #1DA1F2; }
.share-linkedin:hover { color: #0A66C2; border-color: #0A66C2; }
.share-whatsapp:hover { color: #25D366; border-color: #25D366; }

.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.post-nav a {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  max-width: 40%;
}
.post-nav a:hover { color: var(--accent); }
.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; }
.post-nav-all {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.related-posts {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.related-posts h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  background: var(--bg-2);
}
.related-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-3);
}
.related-pilar {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.related-title {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}
.related-date {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ── About page ── */
.about-content {
  max-width: 720px;
}

.about-content h2 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 12px;
}

.about-content p {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.about-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.about-content li {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .layout-main {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-panel {
    flex: 1;
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .navbar-search { display: none; }
  .navbar-hamburger { display: flex; }
  .navbar-mobile-menu { display: block; }
  .navbar-links { display: none; }
  .hero h1 { font-size: 1.6rem; }
  .article-title, .page-header h1 { font-size: 1.4rem; }
  .timeline-row {
    grid-template-columns: 1fr;
  }
  .entities-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kpis {
    grid-template-columns: 1fr;
  }
  .hero-stats { flex-direction: column; align-items: flex-start; }
}

/* ── Search highlight ── */
.search-highlight { background: rgba(0, 212, 255, 0.2); border-radius: 2px; padding: 0 2px; }

/* ── No results ── */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Load more ── */
.load-more {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.load-more-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 8px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   PILLAR SYSTEM — Multi-theme colors and components
   ═══════════════════════════════════════════════════════════════ */

/* Pillar colors */
.pillar-ia { --pillar-color: #7c5cfc; }
.pillar-fintech { --pillar-color: #00ff88; }
.pillar-mercado { --pillar-color: #d4a840; }

/* Pillar indicator dots */
.pillar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.article-indicators {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

/* Pillar filter buttons */
.filter-btn.pillar-ia-btn.active { border-color: #7c5cfc; color: #7c5cfc; background: rgba(124,92,252,0.12); }
.filter-btn.pillar-fintech-btn.active { border-color: #00ff88; color: #00ff88; background: rgba(0,255,136,0.12); }
.filter-btn.pillar-mercado-btn.active { border-color: #d4a840; color: #d4a840; background: rgba(212,168,64,0.12); }

/* ── Pillar Cards (homepage) ── */
.pillar-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.pillar-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.pillar-card.pillar-ia::before { background: #7c5cfc; }
.pillar-card.pillar-fintech::before { background: #00ff88; }
.pillar-card.pillar-mercado::before { background: #d4a840; }

.pillar-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.pillar-card-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--heading-color);
  margin-bottom: 4px;
}

.pillar-card-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.pillar-card-headlines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.pillar-headline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pillar-headline::before {
  content: '\2014 ';
  color: var(--text-muted);
}

.pillar-card-link {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── Pillar badge ── */
.pillar-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: 3px;
  color: var(--heading-color);
  margin-bottom: 12px;
}

.pillar-badge-sm {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 2px;
  color: var(--heading-color);
}

/* ── Grid view toggle ── */
.articles-grid.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.articles-grid.grid-mode .article-card {
  height: fit-content;
}

/* ── Aprender / Educational ── */
.aprender-pilar-section {
  margin-bottom: 32px;
}

.aprender-pilar-title {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading-color);
  padding-bottom: 10px;
  border-bottom: 2px solid;
  margin-bottom: 16px;
}

.aprender-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.aprender-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.aprender-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.aprender-card.pillar-ia::before { background: #7c5cfc; }
.aprender-card.pillar-fintech::before { background: #00ff88; }
.aprender-card.pillar-mercado::before { background: #d4a840; }

.aprender-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.05);
}

.aprender-card-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--heading-color);
  margin-bottom: 8px;
  line-height: 1.3;
}

.aprender-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.aprender-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.aprender-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--bg-4);
  color: var(--text-muted);
}

/* Guide content page */
.guide-content {
  max-width: 680px;
  padding: 24px 0;
}

.guide-content h2 {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 28px 0 12px;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  letter-spacing: -0.02em;
}

.guide-content h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 20px 0 8px;
}

.guide-content p {
  font-family: var(--font-sans);
  font-size: 1.066rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 14px;
}

.guide-content ul {
  padding-left: 0;
  list-style: none;
  margin-bottom: 14px;
}

.guide-content li {
  font-family: var(--font-sans);
  font-size: 1.066rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 4px;
  padding-left: 20px;
  position: relative;
}

.guide-content li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.75em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.guide-content strong { color: var(--text-primary); }
.guide-content code {
  background: var(--bg-4);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--accent);
}

.guide-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-3);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 6px 6px 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.guide-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.guide-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.guide-nav {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.guide-back {
  font-size: 0.8rem;
  color: var(--accent);
}

/* ── Site Oficial Button ── */
.site-oficial-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-oficial-btn:hover {
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  opacity: 1;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* Light theme: tone down glows */
[data-theme="light"] .article-tier.t1 { box-shadow: none; }
[data-theme="light"] .article-tier.t2 { box-shadow: none; }
[data-theme="light"] .navbar-signal { box-shadow: 0 0 4px var(--green); }
[data-theme="light"] .pillar-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
[data-theme="light"] .aprender-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
[data-theme="light"] .article-card:hover { background: var(--bg-3); }

/* Smooth transition for theme change */
body, .navbar, .article-card, .kpi, .sidebar-panel,
.pillar-card, .aprender-card, .timeline, .filters-bar,
.sources-panel, .entity-card, .filter-btn, .theme-pill {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

/* ═══════════════════════════════════════════════════════════════
   FEATURED SECTION — Homepage highlights
   ═══════════════════════════════════════════════════════════════ */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.featured-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.featured-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.featured-card-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--heading-color);
  margin-bottom: 6px;
  line-height: 1.3;
}

.featured-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.featured-card-stat {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: auto;
}

.featured-guide {
  border-left: 3px solid var(--green);
}

.featured-guide-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  border-radius: 3px;
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
  border: 1px solid var(--green);
  margin-bottom: 8px;
  width: fit-content;
}

.featured-card, .featured-guide-badge {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

[data-theme="light"] .featured-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

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

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGES — Dossie layout
   ═══════════════════════════════════════════════════════════════ */

.profile-type-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 4px 14px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.profile-type-badge.type-pessoa {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid var(--purple);
}

.profile-type-badge.type-organizacao {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.profile-ficha {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 24px 28px;
}

.profile-ficha h2 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 24px 0 10px;
}

.profile-ficha h2:first-child { margin-top: 0; }

.profile-ficha h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 18px 0 8px;
}

.profile-ficha p {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.profile-ficha ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.profile-ficha li {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 4px;
}

.profile-ficha strong { color: var(--text-primary); }

.entity-name-link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-muted);
  transition: all 0.2s;
}

.entity-name-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.profile-connection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.profile-connection:last-child { border-bottom: none; }

.profile-connection .conn-name { color: var(--text-primary); }
.profile-connection .conn-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-4);
  padding: 1px 8px;
  border-radius: 10px;
}

.profile-related-link {
  display: block;
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}

.profile-related-link:last-child { border-bottom: none; }
.profile-related-link:hover { opacity: 0.8; }

.article-entity-tag {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--purple-dim);
  color: var(--purple);
  text-decoration: none;
  transition: all 0.2s;
}

a.article-entity-tag:hover {
  background: var(--purple);
  color: var(--bg-0);
}

/* Smooth transition for profile elements */
.profile-ficha, .profile-type-badge, .profile-connection, .profile-related-link {
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

/* ── Responsive: pillar cards ── */
@media (max-width: 768px) {
  .pillar-cards {
    grid-template-columns: 1fr;
  }
  .aprender-grid {
    grid-template-columns: 1fr;
  }
  .articles-grid.grid-mode {
    grid-template-columns: 1fr;
  }
}
