/*
 * DevOps Mind — Redesign Fase D (FD-2)
 * Alvo visual: reports/fd-mockup-final-20260707.html (home Op.1 + sidebar Op.3, logo Conceito C)
 * Aplicar NO TEMA-FILHO blocksy-child (nunca no tema pai). Preparado localmente em 07/07/2026;
 * validar em STAGING antes de produção.
 *
 * Camadas: 1) tokens  2) base/tipografia  3) header  4) home (cards/grade/chips)
 *          5) sidebar  6) post (leitura/código/author box)  7) dark mode
 * O que NÃO é CSS (vai via Customizer/widgets no staging): ver theme/FD2-IMPLEMENTACAO.md
 */

/* ── 1. Tokens ─────────────────────────────────────────────────────────── */
:root {
  --dm-accent: #1E6BFF;
  --dm-ink: #16212E;
  --dm-muted: #5B6B7B;
  --dm-bg: #F7F9FB;
  --dm-surface: #FFFFFF;
  --dm-line: #E2E9F0;
  --dm-badge: #E6EDF3;
  --dm-node: #1B2A3A;
  --dm-code-bg: #0E1826;
  --dm-code-ink: #D6E2F2;
  --dm-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --dm-radius: 12px;

  /* pontes p/ as variáveis do Blocksy (paleta do Customizer usa --theme-palette-color-N) */
  --theme-palette-color-1: var(--dm-accent);
  --theme-text-color: var(--dm-ink);
  --theme-link-initial-color: var(--dm-accent);
}

/* ── 2. Base / tipografia ─────────────────────────────────────────────── */
body {
  background: var(--dm-bg);
  color: var(--dm-ink);
}

/* rótulos utilitários (categoria, meta) em monospace */
.ct-post-meta,
.entry-meta,
.ct-meta-element,
[class*="meta"] .ct-post-date {
  font-family: var(--dm-mono);
  font-size: 12px;
  color: var(--dm-muted);
}

/* categoria como eyebrow azul monospace */
.entry-card .ct-post-categories a,
.entry-header .ct-post-categories a {
  font-family: var(--dm-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--dm-accent);
  text-transform: none;
  background: none;
  padding: 0;
}

/* ── 3. Header — H2 TONAL (mesma cor do fundo, só divisor) + sticky ───── */
#header,
.site-header, [data-device] .ct-header,
#header [class*="ct-header-row"] {
  background-color: var(--dm-bg) !important;
}
#header {
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--dm-line);
}
.site-branding .site-title,
.ct-header .site-title a {
  font-family: var(--dm-mono);
  font-weight: 800;
  letter-spacing: -.01em;
}
/* menu enxuto */
.ct-header [data-id="menu"] a {
  font-size: 13.5px;
  color: var(--dm-muted);
}
.ct-header [data-id="menu"] a:hover { color: var(--dm-accent); }
/* remove o CTA "Linkedin" do header (social vai p/ o rodapé, não como botão de destaque) */
#header [data-id="button"], #header .ct-header-cta { display: none !important; }

/* ── 4. Home: destaque + grade (Op.1) ─────────────────────────────────── */
/* cards da listagem: linha divisória no lugar de sombra (minimalismo) */
.entry-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--dm-line);
  border-radius: 0;
  box-shadow: none;
  padding: 15px 0;
}
.entry-card:hover { box-shadow: none; }
.entry-card .entry-title {
  font-size: 15.5px;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.entry-card .entry-title a { color: var(--dm-ink); }
.entry-card .entry-title a:hover { color: var(--dm-accent); }
.entry-card .ct-media-container img { border-radius: 10px; }
.entry-card .entry-excerpt { font-size: 13.5px; color: var(--dm-muted); }

/* 1º post (destaque) maior — o structure do Blocksy define a grade; aqui só o refino */
.ct-featured-post .entry-title,
.entry-card:first-child .entry-title { font-size: 22px; letter-spacing: -.02em; }

/* chips de categoria (bloco no fim da home) */
.dm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.dm-chips a {
  font-family: var(--dm-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--dm-badge);
  color: var(--dm-ink);
  border: 1px solid var(--dm-line);
  text-decoration: none;
}
.dm-chips a:hover { border-color: var(--dm-accent); color: var(--dm-accent); }

/* ── 5. Sidebar (Op.3): autor, mais lidos, newsletter ─────────────────── */
.ct-sidebar .widget,
.sidebar .widget {
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  padding: 16px 18px;
  background: var(--dm-surface);
  margin-bottom: 16px;
}
.ct-sidebar .widget-title,
.sidebar .widget-title {
  font-family: var(--dm-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dm-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.ct-sidebar .widget ul { font-size: 13px; }
.ct-sidebar .widget ul li { padding: 4px 0; }
/* widget de newsletter destacado */
.ct-sidebar .widget_mc4wp_form_widget { background: var(--dm-badge); }
.ct-sidebar .widget_mc4wp_form_widget input[type="submit"],
.mc4wp-form input[type="submit"] {
  font-family: var(--dm-mono);
  font-weight: 700;
  font-size: 12.5px;
  background: var(--dm-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
}

/* ── 6. Post: leitura aprovada na rodada 1 ────────────────────────────── */
/* coluna de leitura confortável */
.single .entry-content { max-width: 700px; font-size: 16px; }
.single .entry-title { letter-spacing: -.02em; }

/* blocos de código (code-block-pro) — respiro e cantos */
.single .entry-content .wp-block-kevinbatdorf-code-block-pro,
.single .entry-content pre {
  border-radius: 10px;
  margin: 6px 0 18px;
}

/* tabelas nativas (convertidas na FA-7) */
.single .entry-content .wp-block-table table { font-size: 14px; }
.single .entry-content .wp-block-table td,
.single .entry-content .wp-block-table th {
  border: 1px solid var(--dm-line);
  padding: 8px 12px;
}

/* author box (FC-1) */
.author-box, .ct-author-box {
  border-top: 1px solid var(--dm-line);
  border-bottom: 0;
  background: transparent;
  padding: 22px 0 0;
  margin-top: 26px;
}
.author-box .author-name, .ct-author-box .author-name,
.author-box h5, .ct-author-box h5 {
  font-family: var(--dm-mono);
  font-weight: 800;
  font-size: 15px;
}
.author-box .author-description { font-size: 13px; color: var(--dm-muted); }

/* ── 6b. Botão "Leia mais" — link discreto (era botão azul full-width) ─── */
.entry-card .entry-button.ct-button,
.entry-card a.entry-button {
  background: transparent !important;
  color: var(--dm-accent) !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
  min-height: 0 !important;
  font-family: var(--dm-mono);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.entry-card .entry-button.ct-button::after { content: "\2192"; } /* seta → */
.entry-card .entry-button.ct-button:hover { text-decoration: underline; background: transparent !important; }

/* ── 7. Dark mode (toggle próprio: data-color-mode="dark" no <html>) ───── */
[data-color-mode="dark"],
html.dark {
  --dm-bg: #0C1420;
  --dm-surface: #121C2A;
  --dm-ink: #E6EDF3;
  --dm-muted: #8FA3B8;
  --dm-line: #22303F;
  --dm-badge: #16212E;
  --dm-accent: #4C8DFF;
  --dm-node: #9FC2FF;
  /* variáveis do Blocksy p/ o texto do tema acompanhar */
  --theme-text-color: #E6EDF3;
  --theme-headings-color: #F2F6FB;
  --theme-link-initial-color: #4C8DFF;
}
/* superfícies que o Blocksy pinta de claro via CSS próprio — forçar no escuro */
[data-color-mode="dark"] body { background: var(--dm-bg); color: var(--dm-ink); }
[data-color-mode="dark"] #header,
[data-color-mode="dark"] #header [class*="ct-header-row"] { background-color: var(--dm-surface) !important; } /* tonal: no escuro o body é pintado com --dm-surface */
[data-color-mode="dark"] .ct-footer,
[data-color-mode="dark"] [data-footer] { background-color: var(--dm-surface) !important; }
/* CAUSA do texto "apagado" no dark: o <article>/cards do Blocksy têm fundo BRANCO.
   Deixar transparente no escuro p/ o fundo escuro aparecer e o texto claro ficar legível. */
[data-color-mode="dark"] .single article,
[data-color-mode="dark"] .site-main article,
[data-color-mode="dark"] article[class*="post-"],
[data-color-mode="dark"] .ct-container,
[data-color-mode="dark"] .entry-content { background-color: transparent !important; }
/* logo escura no modo escuro (arquivo no próprio child theme; caminho relativo ao CSS) */
[data-color-mode="dark"] .site-logo-container img.default-logo,
[data-color-mode="dark"] .custom-logo { content: url("./logo-devopsmind-d-dark.svg"); }

/* dark: seções do Blocksy que permaneciam CLARAS (texto claro ficava ilegível) */
[data-color-mode="dark"] .ct-comments-container,
[data-color-mode="dark"] .ct-related-posts-container,
[data-color-mode="dark"] .ct-trending-block {
  background-color: var(--dm-surface) !important;
}
/* subtítulo/descrição do post (era cinza-escuro sobre fundo escuro) */
[data-color-mode="dark"] .page-description { color: var(--dm-muted) !important; }
/* código nativo (blocos e inline) — code-block-pro tem tema próprio e é preservado */
[data-color-mode="dark"] :not(pre) > code,
[data-color-mode="dark"] pre.wp-block-code,
[data-color-mode="dark"] .wp-block-code,
[data-color-mode="dark"] .wp-block-code code {
  background-color: var(--dm-code-bg) !important;
  color: var(--dm-code-ink) !important;
}
/* campos de formulário (comentários etc.) no escuro */
[data-color-mode="dark"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
[data-color-mode="dark"] textarea,
[data-color-mode="dark"] select {
  background-color: var(--dm-surface) !important;
  color: var(--dm-ink) !important;
  border-color: var(--dm-line) !important;
}
/* texto do conteúdo com cor escura FIXA (posts antigos colados com color:#000) — força claro
   no escuro. Não inclui span/a/code p/ preservar highlight do code-block-pro e links de acento. */
[data-color-mode="dark"] .entry-content p,
[data-color-mode="dark"] .entry-content li,
[data-color-mode="dark"] .entry-content strong,
[data-color-mode="dark"] .entry-content b,
[data-color-mode="dark"] .entry-content em,
[data-color-mode="dark"] .entry-content h1,
[data-color-mode="dark"] .entry-content h2,
[data-color-mode="dark"] .entry-content h3,
[data-color-mode="dark"] .entry-content h4,
[data-color-mode="dark"] .entry-content h5,
[data-color-mode="dark"] .entry-content h6 { color: var(--dm-ink) !important; }

/* dropdowns do header (Categorias e Idiomas) — painel escuro + itens claros no dark */
[data-color-mode="dark"] .ct-header .sub-menu,
[data-color-mode="dark"] .ct-header ul ul,
[data-color-mode="dark"] .ct-header [class*="dropdown"] {
  background-color: var(--dm-surface) !important;
  border-color: var(--dm-line) !important;
}
[data-color-mode="dark"] .ct-header .sub-menu a,
[data-color-mode="dark"] .ct-header ul ul a,
[data-color-mode="dark"] .lang-item a { color: var(--dm-ink) !important; }

/* títulos de posts em Relacionados/Em alta ficavam escuros sobre superfície escura */
[data-color-mode="dark"] .ct-related-posts-container .ct-post-title a,
[data-color-mode="dark"] .ct-trending-block .ct-post-title a,
[data-color-mode="dark"] .ct-post-title a { color: var(--dm-ink) !important; }
[data-color-mode="dark"] .ct-related-posts-container .ct-post-title a:hover,
[data-color-mode="dark"] .ct-trending-block .ct-post-title a:hover,
[data-color-mode="dark"] .ct-post-title a:hover { color: var(--dm-accent) !important; }
/* asterisco de campo obrigatório mais visível no escuro */
[data-color-mode="dark"] .required { color: #FF9B9B !important; }
[data-color-mode="dark"] .entry-title a,
[data-color-mode="dark"] .single .entry-content,
[data-color-mode="dark"] h1,
[data-color-mode="dark"] h2,
[data-color-mode="dark"] h3 { color: var(--dm-ink); }
[data-color-mode="dark"] .ct-header [data-id="menu"] a { color: var(--dm-muted); }

/* ── 10. Toggle de tema (botão injetado por fd-darkmode.js) ───────────── */
/* padrão: no header, ao lado da busca (não colide com o "subir ao topo") */
.dm-mode-toggle {
  background: transparent;
  border: 0;
  color: var(--dm-ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dm-mode-toggle:hover { color: var(--dm-accent); }
.dm-mode-toggle:focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 2px; border-radius: 6px; }
/* fallback: se não achou o header, vira botão flutuante ACIMA do subir-ao-topo */
.dm-mode-toggle--floating {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--dm-line);
  background: var(--dm-surface);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  margin: 0;
}

/* ── 10b. Sumário do post (TOC) — gerado por fd-toc.js ────────────────── */
.dm-toc {
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  background: var(--dm-badge);
  padding: 16px 20px;
  margin: 0 0 28px;
}
.dm-toc-label {
  font-family: var(--dm-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dm-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.dm-toc ol { margin: 0; padding-left: 1.2em; }
.dm-toc li { margin: 6px 0; line-height: 1.4; }
.dm-toc a { color: var(--dm-ink); text-decoration: none; }
.dm-toc a:hover { color: var(--dm-accent); text-decoration: underline; }
/* âncora com respiro sob o header fixo + rolagem suave */
html { scroll-behavior: smooth; }
.single .entry-content h2 { scroll-margin-top: 90px; }

/* ── 11. Desliga a animação de entrada do Blocksy no conteúdo (evita o
   efeito de texto "apagado" ao rolar; conteúdo sólido imediatamente) ──── */
.single .entry-header,
.single .entry-header *,
.single .entry-content,
.single .entry-content > *,
.entries .entry-card,
.entries .entry-card * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ── 8. Widget "Últimos posts" — lista numerada (Opção A) ─────────────── */
.dm-recent { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.dm-recent li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--dm-line);
}
.dm-recent li:first-child { border-top: 0; padding-top: 2px; }
.dm-recent .dm-n {
  font-family: var(--dm-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--dm-accent);
  line-height: 1.5;
}
.dm-recent a { text-decoration: none; display: block; }
.dm-recent .dm-t {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--dm-ink);
}
.dm-recent a:hover .dm-t { color: var(--dm-accent); }
.dm-recent .dm-m {
  display: block;
  font-family: var(--dm-mono);
  font-size: 11px;
  color: var(--dm-muted);
  margin-top: 3px;
}

/* ── 9. Newsletter (Mailchimp reestilizado) — lateral e fim de post ────── */
.dm-news { }
.dm-news .dm-news-lbl {
  font-family: var(--dm-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dm-muted);
  font-weight: 700;
}
.dm-news .dm-news-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 0; }
.dm-news p { font-size: 13px; color: var(--dm-muted); margin: 6px 0 0; }
.dm-news input[type="email"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  background: var(--dm-surface);
  color: var(--dm-ink);
  font: inherit;
  font-size: 14px;
  margin: 10px 0;
}
.dm-news button[type="submit"] {
  font-family: var(--dm-mono);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--dm-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
}
.dm-news .dm-news-mini { font-size: 12px; color: var(--dm-muted); margin-top: 8px; }
.dm-news .dm-news-privacy { font-size: 12px; color: var(--dm-muted); margin-top: 8px; display: flex; gap: 7px; align-items: flex-start; }
.dm-news .dm-news-privacy input { margin-top: 3px; }
/* variante lateral: empilhada */
.dm-news--side button[type="submit"] { width: 100%; }
/* variante fim de post: caixa destacada + linha e-mail+botão */
.dm-news--post {
  border: 1px solid var(--dm-line);
  border-radius: 12px;
  background: var(--dm-badge);
  padding: 22px 24px;
  margin: 32px 0 8px;
}
.dm-news--post .dm-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dm-news--post .dm-row input[type="email"] { flex: 1; margin: 0; min-width: 200px; }
.dm-news--post .dm-row button[type="submit"] { width: auto; }

/* ── 12. FF-1: sociais, nuvem de tags, sidebar condicional, busca lateral ── */
.dm-social { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-social a {
  width: 36px; height: 36px;
  border-radius: 9px; border: 1px solid var(--dm-line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dm-muted); text-decoration: none;
  transition: color .15s, border-color .15s;
}
.dm-social a svg { width: 17px; height: 17px; fill: currentColor; }
.dm-social a:hover { color: var(--dm-accent); border-color: var(--dm-accent); }

/* sociais do RODAPÉ removidos (redundantes com a sidebar) — elemento socials do footer_placements */
.ct-footer [data-id="socials"],
[data-footer] [data-id="socials"] { display: none !important; }

.dm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-tags a {
  font-family: var(--dm-mono); font-size: 11px; font-weight: 600;
  color: var(--dm-ink); text-decoration: none;
  background: var(--dm-badge); border: 1px solid var(--dm-line);
  border-radius: 999px; padding: 4px 10px;
}
.dm-tags a em { font-style: normal; color: var(--dm-muted); margin-left: 3px; }
.dm-tags a:hover { color: var(--dm-accent); border-color: var(--dm-accent); }

/* busca lateral no estilo do tema */
.ct-sidebar .wp-block-search__inside-wrapper { display: flex; gap: 6px; }
.ct-sidebar .wp-block-search input[type="search"] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--dm-line); border-radius: 8px;
  background: var(--dm-bg); color: var(--dm-ink); font: inherit; font-size: 13px;
}
.ct-sidebar .wp-block-search button {
  font-family: var(--dm-mono); font-weight: 700; font-size: 13px;
  background: var(--dm-accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 13px;
}

/* Últimos posts: some na HOME (lista já é a home), aparece nas páginas internas.
   Wrapper de widget do Blocksy é .ct-widget (não .widget). */
body.blog .ct-sidebar .ct-widget:has(.dm-latest-posts),
body.home .ct-sidebar .ct-widget:has(.dm-latest-posts) { display: none; }

/* rodapé: esconder o bloco "Em alta agora" (quebrado — ondas sobre o texto) */
.ct-trending-block, section[class*="trending"] { display: none !important; }

/* remove newsletters antigas (Blocksy nativa no single + embeds Mailchimp colados no conteúdo
   dos 12 posts legados) — substituídas pela dm-news (lateral + fim de post) */
.single .ct-newsletter-subscribe-container,
.single .entry-content #mc_embed_signup,
.single .entry-content #mc_embed_shell { display: none !important; }

/* acessibilidade: foco visível e sem animação forçada */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--dm-accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
