/* ═══════════════════════════════════════════════════════════════
   K14 NEWS CONTÁBIL — Design System HeroUI Dark
   Observatório editorial especializado para contadores e escritórios.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* ── HeroUI dark surfaces (zinc) ── */
  --bg-a: #000000;
  --bg-b: #09090b;
  --surface-a: #18181b;
  --surface-b: #27272a;
  --surface-c: #1f1f23;
  --ink: #ECEDEE;
  --ink-soft: #c4c7cb;
  --muted: #a1a1aa;
  --muted-2: #71717a;

  /* ── HeroUI primary (blue #006FEE) + acentos fiscais ── */
  --primary: #006FEE;
  --primary-600: #005bc4;
  --primary-400: #338ef7;
  --primary-300: #66aaf9;
  --primary-200: #99c7fb;
  --primary-grad: linear-gradient(180deg, #338ef7, #006FEE);
  --primary-flat: rgba(0, 111, 238, 0.16);
  --primary-flat-bd: rgba(0, 111, 238, 0.38);

  --accent-gold: #c5a059;
  --accent-gold-flat: rgba(197, 160, 89, 0.15);
  --accent-gold-bd: rgba(197, 160, 89, 0.35);

  --accent-green: #17c964;
  --accent-green-flat: rgba(23, 201, 100, 0.15);
  --accent-red: #f31260;
  --accent-red-flat: rgba(243, 18, 96, 0.15);
  --accent-warning: #f5a524;
  --accent-warning-flat: rgba(245, 165, 36, 0.15);

  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* ── Radius scale & Shadows ── */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 18px;
  --sh-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --sh-md: 0 10px 28px -12px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  --sh-lg: 0 28px 64px -24px rgba(0, 0, 0, 0.8), 0 10px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-b);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 50px;
  min-height: 100vh;
}

/* Redimensionabilidade total fluida */
.wrap {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3.2vw, 48px);
}

/* ═══ Header de Departamento ═══ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 11, 0.94);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  color: var(--muted);
}

.dept-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dept-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.dept-link:hover {
  color: #fff;
  border-color: var(--line-strong);
}

.dept-link.active {
  background: var(--primary-flat);
  border-color: var(--primary-flat-bd);
  color: var(--primary-300);
  font-weight: 600;
}

.dept-badge-future {
  font-size: 0.64rem;
  color: var(--muted-2);
  margin-left: 2px;
}

.brand-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo-main {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo-tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--accent-gold-flat);
  border: 1px solid var(--accent-gold-bd);
  color: var(--accent-gold);
  padding: 2px 10px;
  border-radius: 999px;
}

.site-motto {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.35;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-tool {
  background: var(--surface-a);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  background: var(--surface-b);
  border-color: var(--primary);
  color: var(--primary-300);
}

/* ═══ Seção Lead (Hero + Radar de Prazos) ═══ */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
  gap: clamp(24px, 3.5vw, 48px);
  padding: clamp(28px, 4vw, 46px) 0;
  align-items: start;
}

.hero-feature {
  display: flex;
  flex-direction: column;
  background: var(--surface-a);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  cursor: pointer;
  box-shadow: var(--sh-md);
}

.hero-feature:hover {
  border-color: var(--primary-flat-bd);
  transform: translateY(-2px);
}

.hero-figure {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface-b);
  position: relative;
  overflow: hidden;
}

.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.hero-feature:hover .hero-figure img {
  transform: scale(1.02);
}

.hero-body {
  padding: clamp(20px, 2.8vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pill-cat {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--primary-flat);
  border: 1px solid var(--primary-flat-bd);
  color: var(--primary-300);
  padding: 2px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
}

.hero-feature:hover .hero-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.hero-summary {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.55;
  font-weight: 300;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 6px;
}

/* ═══ Coluna Lateral: Radar de Prazos ═══ */
.prazos-aside {
  background: var(--surface-a);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: clamp(18px, 2.2vw, 24px);
  box-shadow: var(--sh-md);
}

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

.aside-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aside-month {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--primary-300);
  background: var(--primary-flat);
  padding: 2px 8px;
  border-radius: 4px;
}

.prazos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prazo-card {
  padding: 12px 14px;
  background: var(--surface-b);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all 0.2s;
}

.prazo-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-c);
}

.prazo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prazo-code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
}

.prazo-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.prazo-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.prazo-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.prazo-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted-2);
}

/* ═══ Radar Contábil (4 Colunas Técnicas) ═══ */
.radar-section {
  padding: 38px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-300);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
}

.section-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 4px;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.radar-col {
  background: var(--surface-a);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.radar-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.radar-col-head h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.radar-col-no {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-400);
}

.radar-col-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 16px;
  min-height: 2.2em;
}

.radar-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.radar-item {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.radar-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.radar-item-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  display: block;
  transition: color 0.2s;
}

.radar-item-link:hover {
  color: var(--primary-300);
}

.radar-item-summary {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.radar-item-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted-2);
  margin-top: 4px;
}

/* ═══ Grade Editorial de Cadernos Temáticos ═══ */
.editorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.news-card {
  background: var(--surface-a);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.25s;
}

.news-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.news-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--surface-b);
  overflow: hidden;
  position: relative;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.news-card:hover .news-thumb img {
  transform: scale(1.03);
}

.news-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.news-card-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.news-card:hover .news-card-title {
  color: var(--primary-200);
}

.news-card-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
  flex: 1;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
}

/* ═══ TICKER Fixo de Rodapé ═══ */
.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  z-index: 80;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #111114, #08080a);
  border-top: 1px solid var(--line-strong);
  overflow: hidden;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.7);
}

.ticker-label {
  flex: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  background: #18181b;
  border-right: 1px solid var(--line);
}

.ticker-mask {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: tickerSlide 45s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}

.ticker-item-name {
  color: var(--muted);
}

.ticker-item-val {
  font-weight: 600;
  color: #ffffff;
}

.ticker-pos { color: var(--accent-green) !important; }
.ticker-neg { color: var(--accent-red) !important; }

@keyframes tickerSlide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ═══ Modal de Leitura (ReaderModal) & Modal CNPJ ═══ */
.ov {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 4vh 16px 60px;
}

.ov.show { display: flex; }

.modal {
  background: var(--surface-a);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 860px;
  padding: clamp(24px, 4vw, 44px);
  position: relative;
  box-shadow: var(--sh-lg);
  color: var(--ink);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--surface-b);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--surface-c);
  color: #fff;
  border-color: var(--line-strong);
}

/* CNPJ modal form */
.cnpj-box {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.cnpj-input {
  flex: 1;
  min-width: 240px;
  background: var(--surface-b);
  border: 1px solid var(--line-strong);
  color: #fff;
  font-family: var(--mono);
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.2s;
}

.cnpj-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-flat);
}

.btn-primary {
  background: var(--primary-grad);
  border: none;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.92;
}

.cnpj-result {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.cnpj-field-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.cnpj-field {
  background: var(--surface-b);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--r-sm);
}

.cnpj-field-lbl {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cnpj-field-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}

/* Responsividade fluida */
@media (max-width: 900px) {
  .lead {
    grid-template-columns: 1fr;
  }
}

/* ═══ Estados reais (carregamento, vazio, indisponível) e leitor de íntegra ═══ */
.state-msg { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; padding: 10px 0; list-style: none; }
.prazos-note { margin-top: 12px; font-size: 0.72rem; line-height: 1.5; color: var(--muted); }
.prazo-meta { flex-wrap: wrap; gap: 4px 10px; }
.prazo-meta a { color: var(--primary-300); text-decoration: none; }
.prazo-meta a:hover { text-decoration: underline; }
.hero-feature, .news-card { cursor: pointer; }
.hero-feature:focus-visible, .news-card:focus-visible, .radar-item-link:focus-visible { outline: 2px solid var(--primary-300); outline-offset: 3px; }
.noimg { background: linear-gradient(135deg, var(--surface-a), var(--bg-a)); min-height: 120px; }
.ticker-ref { color: var(--muted); font-size: 0.68rem; margin-left: 4px; }
.reader-title { font-family: var(--serif); font-size: clamp(1.6rem, 2.8vw, 2.2rem); line-height: 1.2; margin-bottom: 14px; color: var(--ink); }
.reader-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.reader-figure { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; margin-bottom: 20px; background: linear-gradient(135deg, var(--surface-a), var(--bg-a)); }
.reader-figure img { width: 100%; height: 100%; object-fit: cover; }
.reader-body { font-family: var(--sans); font-size: 1.02rem; line-height: 1.7; color: var(--ink-soft); display: grid; gap: 16px; }
.reader-credit { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.reader-credit a { color: var(--primary-300); }

/* ═══ Contenção: nenhum texto sai do card, balão ou coluna, em qualquer largura ═══ */
/* Itens de grid/flex têm largura mínima automática = maior palavra; zerá-la deixa o texto quebrar. */
.lead > *, .radar-grid > *, .editorial-grid > *, .hero-body, .news-card, .news-card-body,
.radar-col, .radar-items-list, .radar-item, .prazos-list, .prazo-card, .cnpj-field, .brand-section > * { min-width: 0; }
.hero-title, .hero-summary, .news-card-title, .news-card-desc, .radar-item-link, .radar-item-summary,
.radar-item-date, .radar-col-head h3, .radar-col-sub, .prazo-name, .prazo-desc, .prazo-meta, .prazos-note,
.reader-title, .reader-body, .reader-credit, .cnpj-field-val, .site-motto, .section-title, .section-sub,
.state-msg { overflow-wrap: anywhere; }
.pill-cat, .prazo-badge, .prazo-code { max-width: 100%; overflow-wrap: anywhere; }
.hero-meta, .aside-head, .news-card-footer, .prazo-top, .radar-col-head, .section-head, .top-bar { flex-wrap: wrap; gap: 6px 14px; }
/* Mínimo de coluna nunca maior que a tela (celulares de 320 px). */
.editorial-grid { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.radar-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
@media (max-width: 900px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hero-title { font-size: clamp(1.45rem, 6.4vw, 2rem); }
  .brand-section { flex-wrap: wrap; gap: 14px; }
  .header-actions, .btn-tool { max-width: 100%; }
}
