/* Matriz — estilos base
   Paleta: papel frio, tinta petróleo; as cores de calor só aparecem onde significam risco. */
:root {
  --paper: #F2F4F3;
  --surface: #FFFFFF;
  --ink: #16262E;
  --muted: #56666D;
  --rule: #D3DAD8;
  --link: #1F5F63;
  --heat-1: #8DB59A;
  --heat-2: #C9C46B;
  --heat-3: #E3A24F;
  --heat-4: #D6713F;
  --heat-5: #B8432F;
  --font-ui: "Schibsted Grotesk", system-ui, sans-serif;
  --font-text: "Literata", Georgia, serif;
  --measure: 68ch;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.5;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Cabeçalho */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 72px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand-mark { display: grid; grid-template-columns: repeat(3, 7px); gap: 2px; }
.brand-mark span { width: 7px; height: 7px; border-radius: 1px; }

.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.98rem; padding: 6px 0; display: inline-block; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

/* Hero da home */
.hero { padding: 72px 0 56px; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 56px; align-items: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  line-height: 1.02; letter-spacing: -0.035em; font-weight: 800;
  margin: 0 0 22px; max-width: 14ch;
}
.hero p { font-family: var(--font-text); font-size: 1.2rem; line-height: 1.6; color: var(--muted); max-width: 44ch; margin: 0 0 28px; }

.button {
  display: inline-block; background: var(--ink); color: var(--paper);
  font-weight: 600; text-decoration: none; padding: 12px 20px; border-radius: 6px;
}
.button:hover { background: var(--link); color: #fff; }
.button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.button.secondary:hover { background: var(--ink); color: var(--paper); }

/* Matriz de risco (hero) */
.matrix { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 10px; }
.matrix-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px;
  aspect-ratio: 1; width: 100%; max-width: 420px;
}
.matrix-grid span { border-radius: 4px; }
.matrix-axis { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.matrix-axis.y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.matrix-axis.x { grid-column: 2; text-align: center; }

.h1 { background: var(--heat-1); } .h2 { background: var(--heat-2); }
.h3 { background: var(--heat-3); } .h4 { background: var(--heat-4); }
.h5 { background: var(--heat-5); }

/* Seções */
.section { padding: 56px 0; border-top: 1px solid var(--rule); }
.section h2 { font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 10px; }
.section .lead { font-family: var(--font-text); color: var(--muted); max-width: var(--measure); margin: 0 0 32px; font-size: 1.08rem; line-height: 1.65; }

/* Lista de séries: uma tabela de verdade, porque é frequência × formato */
.series { width: 100%; border-collapse: collapse; }
.series th, .series td { text-align: left; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.series th { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.series td:first-child { font-weight: 700; font-size: 1.08rem; white-space: nowrap; }
.series td:nth-child(2) { color: var(--muted); white-space: nowrap; }
.series td:last-child { font-family: var(--font-text); }
.series .soon { color: var(--muted); font-size: 0.9rem; font-family: var(--font-ui); }

/* Destaque do painel */
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--heat-4);
  border-radius: 8px; padding: 28px;
}
.feature h3 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-family: var(--font-text); }

/* Páginas internas */
.page-head { padding: 56px 0 28px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 14px; font-weight: 800; }
.page-head p { font-family: var(--font-text); color: var(--muted); max-width: var(--measure); font-size: 1.12rem; line-height: 1.65; margin: 0; }

.prose { font-family: var(--font-text); max-width: var(--measure); line-height: 1.7; }
.prose h2 { font-family: var(--font-ui); font-size: 1.35rem; letter-spacing: -0.01em; margin: 2em 0 0.5em; }
.prose p, .prose li { margin: 0 0 1em; }

/* Painel embutido */
.dash { padding-bottom: 64px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.dash-meta { color: var(--muted); font-size: 0.95rem; margin: 4px 0 0; }
.embed {
  position: relative; width: 100%;
  aspect-ratio: 600 / 373.5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mobile-note { display: none; margin-top: 14px; font-size: 0.95rem; color: var(--muted); }

.dash-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
.dash-notes h3 { font-size: 1.05rem; margin: 0 0 8px; }
.dash-notes p { font-family: var(--font-text); color: var(--muted); margin: 0; font-size: 1rem; line-height: 1.6; }

.empty {
  background: var(--surface); border: 1px dashed var(--rule); border-radius: 8px;
  padding: 32px; max-width: var(--measure); font-family: var(--font-text); color: var(--muted);
}
.empty strong { color: var(--ink); font-family: var(--font-ui); display: block; margin-bottom: 6px; font-size: 1.1rem; }

/* Rodapé */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 48px; color: var(--muted); font-size: 0.92rem; margin-top: 24px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; max-width: 60ch; }

/* Responsivo */
@media (max-width: 860px) {
  .hero { padding: 48px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .matrix-grid { max-width: 300px; }
  .feature { grid-template-columns: 1fr; }
  .dash-notes { grid-template-columns: 1fr; gap: 24px; }
  .series td:nth-child(2) { white-space: normal; }
}
@media (max-width: 640px) {
  .embed { aspect-ratio: 3 / 4; }
  .mobile-note { display: block; }
  .series thead { display: none; }
  .series tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .series td { display: block; border: 0; padding: 2px 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .matrix-grid span { animation: heat-in 600ms ease-out both; animation-delay: calc(var(--i, 0) * 28ms); }
  @keyframes heat-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
}

/* Avisos e textos dos painéis */
.disclaimer { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }
.site-footer .disclaimer { margin-top: 8px; flex-basis: 100%; }
.jump { margin-top: 14px !important; font-family: var(--font-ui) !important; font-size: 0.98rem !important; }
.dash + .dash { border-top: 1px solid var(--rule); padding-top: 48px; }
.dash-intro { font-family: var(--font-text); max-width: var(--measure); line-height: 1.65; margin: 0 0 24px; }
.dash-intro p { margin: 0 0 12px; }
.dash-intro ul { margin: 0; padding-left: 1.2em; }
.dash-intro li { margin: 0 0 8px; }
.dash-intro strong { font-family: var(--font-ui); font-weight: 700; }
.site-footer .wrap { flex-direction: column; gap: 8px; }
.site-footer .disclaimer { margin-top: 6px; }

/* Menu suspenso de Dashboards */
.nav .has-sub { position: relative; }
.nav .submenu {
  display: none; position: absolute; top: 100%; left: -16px; z-index: 20;
  list-style: none; margin: 0; padding: 8px 0; min-width: 280px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(22, 38, 46, 0.12);
}
.nav .submenu a { display: block; padding: 10px 16px; color: var(--ink); font-weight: 600; }
.nav .submenu a:hover, .nav .submenu a[aria-current="page"] { background: var(--paper); box-shadow: none; }
@media (hover: hover) {
  .nav .has-sub:hover .submenu, .nav .has-sub:focus-within .submenu { display: block; }
}
@media (hover: none) {
  .nav .has-sub:focus-within .submenu { display: block; }
}

/* Lista de publicações */
.posts { list-style: none; margin: 8px 0 0; padding: 0; }
.post { padding: 24px 0; border-bottom: 1px solid var(--rule); max-width: 760px; }
.post:first-child { padding-top: 8px; }
.post h3 { margin: 0 0 8px; font-size: 1.35rem; letter-spacing: -0.015em; line-height: 1.25; }
.post h3 a { color: var(--ink); text-decoration: none; }
.post h3 a:hover { color: var(--link); text-decoration: underline; }
.post p { margin: 0; font-family: var(--font-text); color: var(--muted); line-height: 1.6; }
.post .post-meta, .page-head .post-meta { font-family: var(--font-ui); font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; }
.page-head .post-meta { margin-bottom: 12px; }

/* Indicadores do painel */
.indicators { margin-top: 48px; }
.indicators h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.indicators .lead { font-family: var(--font-text); color: var(--muted); margin: 0 0 16px; }
.series.ind td:first-child { white-space: nowrap; width: 200px; }
.dash-head { align-items: center; }
.series.ind td:nth-child(2) { white-space: normal; color: var(--ink); font-family: var(--font-text); }
