/* Articles — estilos da secao. Sobrescreve os tokens de assets/css/main.css
   (--bg, --surface, --text, --dim, --accent, --bdr) SO' dentro de <main
   class="articles-theme">, pra ficar num tema claro com letras em verde
   escuro, sem mexer no header/nav/footer (que continuam no tema padrao do
   site). O --accent global (setado via $page_accent no header) ja' fica
   verde nas paginas de Articles, entao os links/realces do header/nav
   tambem acompanham. */

main.articles-theme {
  --bg:      #f4f7f4;
  --surface: #ffffff;
  --text:    #163825;
  --dim:     #4f6b5b;
  --accent:  #0b6e46;
  --bdr:     rgba(11, 110, 70, .18);
  background: var(--bg);
  color: var(--text);
}

/* ── listagem: grade de cards (thumbnail + titulo + resumo curto), no estilo
   dos cards de root/index.php, so' que estatica (sem carrossel/rotacao) ── */
.article-grid {
  padding: clamp(24px, 6vh, 56px) clamp(32px, 10vw, 120px) clamp(64px, 10vh, 110px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bdr);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(11, 60, 40, .06);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.article-card:hover {
  box-shadow: 0 14px 30px rgba(11, 60, 40, .12);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--bdr));
}

.article-card-image {
  height: 150px;
  flex: none;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  overflow: hidden;
}
.article-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  flex: 1;
}

.article-card-date {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.article-card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 10px;
}

.article-card-summary {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--dim);
  margin: 0 0 auto;
}

.article-card-langs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.lang-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── botao de troca de idioma, na pagina de um artigo ── */
.lang-switch {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.lang-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--dim);
  border: 1px solid var(--bdr);
  border-radius: 999px;
  padding: 5px 14px;
  transition: color .2s, border-color .2s, background .2s;
}
.lang-pill:hover { color: var(--accent); border-color: var(--accent); }
.lang-pill.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ── corpo de um artigo ── */
.article-card-date,
.article-hero { padding-bottom: 24px !important; }

.article-date {
  font-size: 13px;
  color: var(--dim);
  margin-top: -8px;
}

.article-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px clamp(24px, 6vw, 48px) 96px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.article-content h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 48px 0 18px;
}
.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 36px 0 14px;
}
.article-content p { margin: 0 0 20px; }
.article-content ul,
.article-content ol { margin: 0 0 20px 22px; }
.article-content li { margin-bottom: 8px; }
.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto 8px;
  border: 1px solid var(--bdr);
  border-radius: 6px;
}
.article-content em.caption,
.article-content figcaption {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
  margin: 0 0 28px;
}

.article-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 18px;
  margin: 0 0 24px;
  color: var(--dim);
  font-style: italic;
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--bdr);
  padding: 2px 6px;
  border-radius: 3px;
}
.article-content pre {
  background: var(--surface);
  border: 1px solid var(--bdr);
  padding: 18px;
  overflow-x: auto;
  margin: 0 0 28px;
  border-radius: 6px;
}
.article-content pre code { background: none; border: none; padding: 0; }

/* diagramas mermaid renderizados (mermaid.js troca o <pre class="mermaid">
   pelo SVG dele por dentro; tema 'default' do mermaid combina com o fundo
   claro desta secao) */
.article-content pre.mermaid {
  background: var(--surface);
  display: flex;
  justify-content: center;
  padding: 24px;
  border-radius: 6px;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 28px;
  font-size: 14px;
}
.article-content th,
.article-content td {
  border: 1px solid var(--bdr);
  padding: 8px 12px;
  text-align: left;
}
.article-content th { color: var(--dim); font-weight: 600; }
