/* Stride — documentação: legível, compacta e consistente com MkDocs Material */

:root {
  --stride-doc-max: 44rem;
  --stride-radius: 6px;
  --stride-purple: #9c27b0;
  --stride-purple-soft: rgba(156, 39, 176, 0.18);
  /* Tipografia otimizada: legibilidade + compactação */
  --stride-text: 15px;
  --stride-h1: 22px;
  --stride-h2: 18px;
  --stride-h3: 16px;
  --stride-h4: 15px;
  /* Material usa estas variáveis para escalar o artigo inteiro */
  --md-typeset-font-size: var(--stride-text);
  --md-typeset-a-font-size: var(--stride-text);
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0c0c10;
  --md-code-bg-color: #14141a;
}

/* --- Tipografia do artigo (Material usa .md-typeset) --- */
.md-typeset {
  font-size: var(--stride-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.md-typeset h1 {
  font-size: var(--stride-h1);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--md-default-fg-color);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.md-typeset h2 {
  font-size: var(--stride-h2);
  font-weight: 650;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--stride-purple-soft);
  color: var(--md-default-fg-color);
}

.md-typeset h3 {
  font-size: var(--stride-h3);
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.md-typeset h4 {
  font-size: var(--stride-h4);
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

.md-typeset p,
.md-typeset ul,
.md-typeset ol {
  font-size: inherit;
}

.md-typeset blockquote {
  font-size: inherit;
}

/* Largura confortável para leitura (evita linhas intermináveis) */
.md-content__inner {
  max-width: var(--stride-doc-max);
}

/* --- Cabeçalho e abas: compactos --- */
.md-header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.md-tabs {
  min-height: 2.25rem;
}

.md-tabs__link {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
}

.md-search__input {
  font-size: 0.8125rem;
}

/* --- Índice (TOC) à direita: menor e alinhado à hierarquia --- */
.md-nav--secondary .md-nav__title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.md-sidebar--secondary .md-nav__link {
  font-size: 0.75rem;
  line-height: 1.35;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.md-sidebar--secondary .md-nav .md-nav__link--passed {
  color: var(--md-default-fg-color--lighter);
}

/* Índice: conjuntos aninhados (h2 → h3 → h4) mais legíveis */
.md-sidebar--secondary .md-nav .md-nav {
  border-left: 1px solid var(--stride-purple-soft);
  margin: 0.1rem 0 0.15rem 0.2rem;
  padding-left: 0.4rem;
}

.md-sidebar--secondary .md-nav .md-nav .md-nav {
  margin-left: 0.15rem;
  border-left-color: rgba(156, 39, 176, 0.12);
}

.md-sidebar--secondary .md-nav .md-nav .md-nav .md-nav__link {
  font-size: 0.7rem;
}

/* --- Sidebar primária (navigation.sections: rótulos de grupo) --- */
.md-nav--primary .md-nav__item--section > .md-nav__link {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.md-nav--primary .md-nav__link {
  font-size: 0.8125rem;
}

/* --- Código --- */
.md-typeset code {
  font-size: 0.8em;
}

.md-typeset pre > code {
  font-size: 13px;
  line-height: 1.5;
}

.highlight {
  border-radius: var(--stride-radius);
  border: 1px solid var(--stride-purple-soft);
}

/* --- Admonitions: menos “efeito” --- */
.md-typeset .admonition {
  font-size: inherit;
  border-radius: var(--stride-radius);
  border-left-width: 3px;
  box-shadow: none;
  transform: none;
}

.md-typeset .admonition:hover {
  transform: none;
  box-shadow: none;
}

/* --- Links só no conteúdo (evita sublinhado animado em nav/header) --- */
.md-typeset a:not(.headerlink) {
  text-decoration: underline;
  text-decoration-color: rgba(156, 39, 176, 0.35);
  text-underline-offset: 2px;
}

.md-typeset a:not(.headerlink):hover {
  text-decoration-color: var(--stride-purple);
}

/* --- Rodapé --- */
.md-footer-meta {
  font-size: 0.75rem;
}

/* --- Mermaid --- */
.mermaid-wrapper {
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: var(--stride-radius);
  border: 1px solid var(--stride-purple-soft);
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
}

.mermaid svg {
  max-width: 100%;
  height: auto !important;
}

.mermaid-error-fallback {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--stride-radius);
  border: 1px solid rgba(200, 120, 120, 0.35);
  background: rgba(80, 20, 20, 0.15);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.mermaid-error-fallback__title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--md-default-fg-color);
}

.mermaid-error-fallback__hint {
  margin: 0 0 0.75rem;
  opacity: 0.9;
}

.mermaid-error-fallback__link {
  margin: 0 0 0.75rem;
}

.mermaid-error-fallback__link a {
  font-weight: 500;
}

.mermaid-error-fallback__details {
  margin: 0;
}

.mermaid-error-fallback__details summary {
  cursor: pointer;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.mermaid-error-fallback pre {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
  background: var(--md-code-bg-color);
  overflow-x: auto;
  font-size: 0.7rem;
  line-height: 1.45;
}

.mermaid-error-fallback__tech {
  margin: 0.5rem 0 0;
  opacity: 0.75;
}

/* --- Responsivo --- */
@media (max-width: 76.1875em) {
  .md-content__inner {
    max-width: 100%;
  }
}

/* Desktop/tablet: o tema pode ampliar tipografia em telas largas — mantém teto 15px no texto */
@media (min-width: 48em) {
  .md-content .md-typeset {
    font-size: var(--stride-text);
  }

  .md-content .md-typeset h1 {
    font-size: var(--stride-h1);
  }

  .md-content .md-typeset h2 {
    font-size: var(--stride-h2);
  }

  .md-content .md-typeset h3 {
    font-size: var(--stride-h3);
  }

  .md-content .md-typeset h4 {
    font-size: var(--stride-h4);
  }
}
