/* Data Collection and Storage no Inteli: folha da disciplina com a paleta e as fontes do Inteli
   (roxo #2e2640, roxo claro #2e2640, azul #2e2640, Inter e JetBrains Mono). */
/* ==========================================================================
   dc-styles.css  -  páginas de material da disciplina Data Collection and Storage (Inteli)
   Shares the editorial design system with slides.css (same tokens).
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Typography imports
   -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. Design tokens  -  mirror slides.css so both surfaces match
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces */
  --bg:         #ffffff;
  --surface:    #f3f2f4;
  --surface-2:  #e9e7ec;
  --panel:      #ffffff;
  --line:       #dbdfe3;
  --line-soft:  #e6eaeb;

  /* Ink */
  --text:       #2e2640;
  --muted:      #4d475d;
  --accent:     #2e2640;
  --link:       #2e2640;

  /* Code */
  --code-bg:    #2e2640;
  --code-fg:    #f3f2f4;

  /* Callout semantic accents (kept minimal) */
  --ok:         #267562;
  --warn:       #d53f44;
  --danger:     #d53f44;

  /* Typography */
  --font-sans:  'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Legacy aliases kept for inline styles that still reference them */
  --border:     #dbdfe3;
}

/* --------------------------------------------------------------------------
   2. Base reset
   -------------------------------------------------------------------------- */

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  font-feature-settings: 'ss01', 'cv02', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { opacity: 0.8; }
a:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   3. Page shell shared by index + material
   -------------------------------------------------------------------------- */

.page {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.logo-full {
  display: block;
  height: 48px;
  width: auto;
  margin-bottom: 18px;
}

/* Hero, card, content-block share the same surface card definition */
.hero,
.card,
.content-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow:
    var(--ds-sombra-2);
}

/* --------------------------------------------------------------------------
   4. Hero block (index + material header)
   -------------------------------------------------------------------------- */

.hero {
  padding: 40px 44px 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 36px;
  align-items: center;
}
.hub-qr {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  text-align: center;
}
.hub-qr img {
  display: block;
  width: 100%;
  height: auto;
}
.hub-qr figcaption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.68em;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 3px; width: 140px;
  background: var(--accent);
}

/* Decorative year numeral in hero bottom-right, mirrors data-aula-number on slide covers */
.hero[data-year]::after {
  content: attr(data-year);
  position: absolute;
  bottom: -60px;
  right: -20px;
  font-family: var(--font-mono);
  font-size: 14em;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.045;
  letter-spacing: -0.05em;
  line-height: 0.8;
  pointer-events: none;
  user-select: none;
}

.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero .kicker::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--accent);
}

.hero h1,
.slide h1,
.material h1 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 2.4em;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 28ch;
}

.hero p {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.06em;
  margin: 0 0 10px;
}

.hero .meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Section heading: "kicker + rule" pattern to divide index groups */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-heading::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--accent);
}
.section-heading + .lesson-grid { margin-top: 0; }

/* --------------------------------------------------------------------------
   5. Index  -  lesson grid + cards
   -------------------------------------------------------------------------- */

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.lesson-grid:last-of-type { margin-bottom: 0; }

.card {
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: #a19da9;
  box-shadow: var(--ds-sombra-1);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.12em;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Big mono numeral in card corner - echoes data-aula-number on slide covers */
.card .card-num {
  position: absolute;
  top: 14px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 2em;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.12;
  letter-spacing: -0.03em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.card:hover .card-num { opacity: 0.22; }

.card p {
  margin: 8px 0;
  color: #2e2640;
  font-size: 0.98em;
}

.card p strong {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .15s ease;
}

.button:hover,
.button:focus {
  background: var(--surface);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   6. Material  -  body baseline
   -------------------------------------------------------------------------- */

body.material .page,
.material .page { padding: 40px 0 64px; }

.material .slide,
.material { min-height: 100vh; }

/* --------------------------------------------------------------------------
   7. Material  -  content-block typography
   -------------------------------------------------------------------------- */

.content-block {
  padding: 40px 44px;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
}
.content-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 3px; width: 140px;
  background: var(--accent);
}

.content-block h1 {
  margin: 0 0 18px;
  font-size: 2.3em;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 28ch;
}

.content-block h2 {
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.content-block h3 {
  margin: 28px 0 10px;
  font-size: 1.18em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.content-block p {
  margin: 0 0 14px;
  color: #222;
  max-width: 76ch;
}

.content-block ul,
.content-block ol {
  margin: 0 0 14px;
  padding-left: 20px;
  max-width: 76ch;
}

.content-block li { margin-bottom: 8px; }

.content-block em { color: #2e2640; }

.meta {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.summary {
  font-size: 1.08em;
  line-height: 1.6;
  color: #2e2640;
  max-width: 76ch;
  margin: 0 0 14px;
}

/* --------------------------------------------------------------------------
   8. Material  -  editorial tables
   -------------------------------------------------------------------------- */

.content-block table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95em;
  line-height: 1.45;
}

.content-block th,
.content-block td {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.content-block thead th {
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.content-block tbody tr:last-child td {
  border-bottom: 2px solid var(--accent);
}

.content-block tbody tr { transition: background .15s ease; }
.content-block tbody tr:hover td { background: var(--surface); }

/* --------------------------------------------------------------------------
   9. Material  -  code blocks and inline code
   -------------------------------------------------------------------------- */

.content-block code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
}

.content-block pre {
  position: relative;
  margin: 16px 0;
  padding: 28px 24px 22px;
  border: 1px solid #2e2640;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.65;
  overflow-x: auto;
  box-shadow: var(--ds-sombra-2);
}

.content-block pre::before {
  content: '';
  position: absolute;
  top: 10px; left: 14px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4d475d;
  box-shadow: 12px 0 0 #4d475d, 24px 0 0 #4d475d;
}

.content-block pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   10. Material  -  callouts .tip / .warning / .danger
   -------------------------------------------------------------------------- */

.content-block .tip,
.content-block .warning,
.content-block .danger,
.content-block blockquote.tip,
.content-block blockquote.warning,
.content-block blockquote.danger {
  padding: 18px 22px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  line-height: 1.55;
}

.content-block .tip,
.content-block blockquote.tip     { border-left: 3px solid var(--ok); }

.content-block .warning,
.content-block blockquote.warning { border-left: 3px solid var(--warn); }

.content-block .danger,
.content-block blockquote.danger  { border-left: 3px solid var(--danger); }

.content-block .tip strong:first-child,
.content-block .warning strong:first-child,
.content-block .danger strong:first-child {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

/* --------------------------------------------------------------------------
   11. Material  -  floating navigation bar (fixed bottom-right)
       The HTML keeps the <section class="content-block"><nav class="material-nav">
       wrapper, but here we "unwrap" the section visually with :has() and
       turn the nav itself into a floating chip visible from any scroll height.
   -------------------------------------------------------------------------- */

.content-block:has(> .material-nav) {
  display: contents;
}

.material-nav {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(243, 245, 245, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow:
    var(--ds-sombra-2);
  font-family: var(--font-mono);
  font-size: 0.78em;
  letter-spacing: 0.04em;
  flex-wrap: nowrap;
  max-width: calc(100% - 40px);
}

.material-nav a {
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}

.material-nav a:first-of-type {
  background: var(--panel);
  border-color: var(--line);
}

.material-nav a:last-of-type {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.material-nav a:first-of-type:hover { background: var(--surface); }
.material-nav a:last-of-type:hover  { background: #2e2640; }

.material-nav span {
  display: none; /* separator "·" is redundant with the flex gap + styled pills */
}

@media (max-width: 640px) {
  .material-nav {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    justify-content: center;
    flex-wrap: wrap; /* com 3-4 links a barra não cabe em uma linha a 390px */
    font-size: 0.72em;
  }
  .material-nav a { padding: 6px 10px; }
  /* reserva espaço para a barra fixa (até três linhas) no fim da página */
  .page:has(.material-nav) { padding-bottom: 150px; }
}

/* --------------------------------------------------------------------------
   12. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .page { width: min(100% - 20px, 1100px); padding: 24px 0 40px; }

  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 1.8em; }
  .hero-content { grid-template-columns: 1fr; gap: 22px; }
  .hub-qr { width: 150px; }

  .content-block { padding: 24px 22px; }
  .content-block h1 { font-size: 1.75em; }
  .content-block h2 { font-size: 1.35em; }
  .content-block h3 { font-size: 1.08em; }
  .content-block pre { padding: 22px 16px 16px; font-size: 0.78em; }
  .content-block table { font-size: 0.86em; }
}

/* --------------------------------------------------------------------------
   13. Material  -  note (callout de acento preto) e steps
   Compartilhados por todos os materiais. Ver specs/design_system.md.
   -------------------------------------------------------------------------- */

.content-block .note {
  padding: 18px 22px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  line-height: 1.55;
}

.content-block .note strong:first-child {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.content-block .note > :last-child { margin-bottom: 0; }

/* Tabela larga: rola dentro do contêiner em vez de ser cortada pelo
   overflow do .content-block ou de alargar a página no celular. */
.content-block .table-scroll {
  margin: 20px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.content-block .table-scroll > table { margin: 0; }

/* Bloco de código com quebra de linha: prompts CREATE e textos longos
   (ADR, especificação) que o aluno lê e copia por inteiro. */
.content-block pre.is-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Caminhos e identificadores longos em código inline não estouram a coluna. */
.content-block :not(pre) > code { overflow-wrap: break-word; }

/* Caixa de diagrama renderizado (Mermaid ou SVG) no material. */
.content-block .diagram {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  overflow-x: auto;
}
.content-block .diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.method-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
  counter-reset: method-step;
}

.method-step {
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.method-step::before {
  counter-increment: method-step;
  content: "0" counter(method-step);
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: .72em;
  font-weight: 700;
  color: var(--muted);
}

.method-step strong { display: block; margin-bottom: 6px; }
.method-step span { color: var(--muted); font-size: .86em; }
.method-step.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

.audit-template {
  margin: 22px 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.audit-template code { white-space: normal; }

@media (max-width: 760px) {
  .method-flow { grid-template-columns: 1fr; }
}

.content-block ol.steps {
  counter-reset: mstep;
  list-style: none;
  padding: 0;
  margin: 18px 0;
}

.content-block ol.steps > li {
  counter-increment: mstep;
  position: relative;
  padding-left: 44px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.content-block ol.steps > li::before {
  content: counter(mstep, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  background: #ffffff;
}

/* --------------------------------------------------------------------------
   Formulários  -  entrega de projeto e área do professor
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  gap: 18px;
  margin: 20px 0;
}

.form-grid[hidden],
.form-inline[hidden],
.aviso[hidden] { display: none; }

.form-grid label,
.form-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.form-grid .dica {
  font-weight: 400;
  font-size: 0.88em;
  color: var(--muted);
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.form-inline input,
.form-inline select,
.form-inline textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.form-grid textarea { min-height: 96px; resize: vertical; }

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.form-inline input:focus,
.form-inline textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.form-inline > * { flex: 1 1 180px; }
.form-inline > button { flex: 0 0 auto; }

button.button { cursor: pointer; }

button.button.primario {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.button:disabled { opacity: .5; cursor: progress; }

.aviso {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 12px 14px;
  margin: 16px 0;
}

.aviso.erro { border-left-color: var(--danger); }
.aviso.ok { border-left-color: var(--ok); }

.entrega-grupo {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 16px;
  margin: 14px 0;
}

.entrega-grupo h3 { margin: 0 0 6px; }

.entrega-grupo dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 12px 0;
}

.entrega-grupo dt { color: var(--muted); font-size: 0.9em; }
.entrega-grupo dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

.entrega-grupo details { margin-top: 10px; color: var(--muted); }

@media (max-width: 640px) {
  .entrega-grupo dl { grid-template-columns: 1fr; }
  .entrega-grupo dt { margin-top: 6px; }
}

/* Identidade Inteli */
:root { --inteli-grad: linear-gradient(135deg, #2e2640 0%, #2e2640 100%); }
.deck-kicker, .kicker { color: #2e2640; }
.slide-footer, .material-nav { border-top-color: #2e2640; }
