/* EC-IA: largura, hierarquia visual e identidade comum do site. */
:root {
  --ecia-brand: #1f5aa6;
  --ecia-brand-strong: #17467f;
  --ecia-brand-soft: #eef5fb;
  --ecia-ink: #172033;
  --ecia-muted: #637083;
  --ecia-border: #d8e1ec;
}

.wy-nav-content {
  max-width: 1200px;
}

/* Mantém o menu principal visualmente consistente com as visualizações. */
.wy-side-nav-search {
  background: linear-gradient(145deg, var(--ecia-brand-strong), var(--ecia-brand));
}

.wy-menu-vertical a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a {
  border-right: 3px solid #5aa3e8;
}

/* Mantém boa legibilidade em telas largas. */
.rst-content p,
.rst-content li {
  line-height: 1.65;
}

.rst-content h1,
.rst-content h2,
.rst-content h3 {
  color: var(--ecia-ink);
}

.rst-content h2 {
  margin-top: 1.7rem;
}

.rst-content table.docutils {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.rst-content table.docutils th {
  background: var(--ecia-brand-soft);
  color: var(--ecia-ink);
  vertical-align: top;
}

.rst-content pre {
  overflow-x: auto;
  border-radius: 8px;
}

/* Notas de aula: diagramas e blocos de revisão. */
.rst-content .mermaid {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  overflow: visible;
  text-align: center;
  border: 1px solid var(--ecia-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(23, 32, 51, 0.04);
}

.rst-content .mermaid svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.rst-content .mermaid .node,
.rst-content .mermaid .mindmap-node {
  overflow: visible;
}

.rst-content .mermaid text {
  paint-order: stroke;
  stroke-width: 0;
}

.rst-content .mermaid-error {
  color: #7a2e2e;
  border-color: #e0b4b4;
  background: #fff5f5;
  font-style: italic;
}

.rst-content blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--ecia-brand);
  background: #f4f8fb;
  border-radius: 0 8px 8px 0;
}

.rst-content blockquote p:last-child {
  margin-bottom: 0;
}

.rst-content code {
  word-break: normal;
}

.rst-content a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  .rst-content .mermaid {
    padding: 0.85rem;
    overflow-x: auto;
  }

  /* Evita encolhimento excessivo sem obrigar todos os diagramas a 720 px. */
  .rst-content .mermaid svg {
    width: auto;
    min-width: min(640px, 100%);
  }
}

@media (min-width: 1400px) {
  .wy-nav-content {
    max-width: 1380px;
  }
}

/* Cartões de acesso aos laboratórios: navegação consistente em ambos os temas. */
.rst-content .ecia-lab-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:1rem; margin:1rem 0 2rem; }
.rst-content .ecia-lab-card { border:1px solid #cad6e0; border-radius:12px; padding:1.1rem; background:#fff; display:flex; flex-direction:column; align-items:flex-start; }
.rst-content .ecia-lab-card h3 { margin:0 0 .45rem; font-size:1.08rem; }
.rst-content .ecia-lab-card p { margin:0 0 1rem; flex:1; line-height:1.5; }
.rst-content a.ecia-lab-link, html[data-theme="dark"] .rst-content a.ecia-lab-link,
.rst-content a.ecia-lab-link:visited, html[data-theme="dark"] .rst-content a.ecia-lab-link:visited { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; min-height:44px; width:100%; padding:.65rem .9rem; background:#176b42; color:#fff !important; font-weight:700; border-radius:7px; text-decoration:none; text-align:center; }
.rst-content a.ecia-lab-link:hover, html[data-theme="dark"] .rst-content a.ecia-lab-link:hover { background:#115332; color:#fff !important; }
.rst-content a.ecia-lab-link:focus-visible { outline:3px solid #efb54e; outline-offset:3px; }
html[data-theme="dark"] .rst-content .ecia-lab-card { background:#1b2530; border-color:#3e5161; }
