/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f4f6f9;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
header {
  background: #1a1a2e;
  color: #fff;
  padding: 2rem;
  text-align: center;
}
header h1 { font-size: 1.8rem; margin-bottom: 0.4rem; }
header p  { color: #aab; font-size: 0.95rem; }

/* ===== Main ===== */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

/* ===== Cards ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  width: 100%;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-top: 4px solid #4361ee;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.card h2 { font-size: 1.2rem; margin-bottom: 0.4rem; color: #1a1a2e; }
.card .grupo { font-size: 0.78rem; color: #4361ee; font-weight: 600;
               text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.8rem; }
.card p:last-child { font-size: 0.92rem; color: #555; line-height: 1.5; }

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 1.2rem;
  font-size: 0.82rem;
  color: #888;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

/* ===== Viz pages ===== */
.viz-header {
  background: #1a1a2e;
  color: #fff;
  padding: 1.5rem 2rem;
}
.viz-header a { color: #7eb3ff; text-decoration: none; font-size: 0.88rem; }
.viz-header a:hover { text-decoration: underline; }
.viz-header h1 { font-size: 1.5rem; margin: 0.5rem 0 0.2rem; }
.viz-header .grupo { color: #aab; font-size: 0.85rem; }

.viz-container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.viz-description {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  line-height: 1.6;
  font-size: 0.95rem;
  color: #444;
}

.viz-chart {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  overflow-x: auto;
  overflow-y: visible;
  min-height: 540px;
}

svg { display: block; }

/* ===== Timeline controls ===== */
.viz-controls {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.viz-controls button {
  padding: 0.4rem 1rem;
  border: 1.5px solid #4361ee;
  background: #fff;
  color: #4361ee;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.viz-controls button:hover,
.viz-controls button.active {
  background: #4361ee;
  color: #fff;
}

.tooltip {
  position: absolute;
  background: rgba(0,0,0,0.82);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 220px;
  line-height: 1.4;
}
