/* AMZX 1.5.909 — correção de contraste do blog (WCAG 2.1 AA: 4,5:1 texto
 * normal, 3:1 texto grande).
 *
 * FONTE ÚNICA da correção: este arquivo. Ele é carregado SOMENTE nas páginas
 * do blog (primeiro segmento da rota = "blog", em layouts/main.php dos dois
 * temas), DEPOIS das folhas do tema — por isso as regras aqui só afetam
 * páginas do blog, nunca o resto do site.
 *
 * Causas-raiz corrigidas (bateria 1.5.905: 1.198 FAIL):
 *  A. V10 escuro: o dark mode virava o texto para branco e NÃO os fundos
 *     claros fixos (#f8f9fa) do blog -> texto branco invisível (1,05:1).
 *     Fix: fundo escuro na própria section#blog + quote/legenda/placeholder
 *     escuros no dark (o .bg-light dos badges é mantido claro de propósito:
 *     o contrast_guard já põe texto escuro neles, 16,83:1).
 *  B. Default escuro: .text-dark (#253649) = mesma cor do fundo do card
 *     (#253649) -> títulos invisíveis (1,0:1); links #0c66ff/#8492a6 e o
 *     menu de categorias #273444 sobre #1f2d3d. Fix: texto claro no dark.
 *  C. text-muted abaixo de AA nos claros: V10 #6c757d (4,45:1) e default
 *     #718096 (4,02:1) -> #4a5568 (7,53:1 no branco; 6,38:1 no #eaecf3).
 *     Exceção: no hero escuro do default instalado (#0e0b2b) o muted fica
 *     claro (#c0ccda, 11,70:1) — #4a5568 ali daria 2,53:1.
 *  D. Salmão V10 #f88d79 (2,31:1) como cor de link -> #c2410c (5,18:1).
 *  E. Azul default #008aff (3,45:1) -> #0066cc (5,57:1) em textos, botões
 *     .btn-primary e badges; links do corpo no escuro -> #8ab4ff (6,70:1).
 *  F. Menu do header no default claro (#79818b/#1996ff sobre #eaecf3) ->
 *     #1a202c / #005fcc (só quando a navbar é navbar-light).
 *  G. Placeholder #a0aec0 (2,26:1) / #6c757d no escuro (4,12:1) ->
 *     #595959 no claro (7,00:1) / #b1b9c4 no escuro (9,75:1).
 *
 * Cores novas verificadas por cálculo WCAG antes de entrar aqui (ver
 * RELATORIO-CORRECAO.md). Nada fora do blog é alterado: os botões .btn-primary
 * do V10 (salmão, já corrigidos em runtime pelo contrast_guard) não são
 * tocados — as regras de botão/bagde usam o escopo body.amzx-theme-default.
 */

/* ================= CLARO (html sem data-theme="dark") ================= */

/* C1/C2/C3/C4/C6/C7/C8/C9/C11/C12 — muted legível nos dois temas claros. */
html:not([data-theme="dark"]) .text-muted {
    color: #4a5568 !important;
}
/* C — exceção: hero escuro do default instalado (#0e0b2b). O muted claro
 * #c0ccda dá 11,70:1 ali; #4a5568 daria 2,53:1. Dentro dos cards (fundo
 * branco no claro) o muted volta a #4a5568. */
html:not([data-theme="dark"]) section.bg-section-dark .text-muted {
    color: #c0ccda !important;
}
html:not([data-theme="dark"]) section.bg-section-dark .card .text-muted {
    color: #4a5568 !important;
}

/* G1 — placeholder da busca (default claro/instalado). */
html:not([data-theme="dark"]) input::placeholder {
    color: #595959 !important;
    opacity: 1;
}

/* C5 — pull-quote no claro: texto escuro sobre o fundo #f8f9fa. */
html:not([data-theme="dark"]) .amzx-blog-quote {
    background-color: #f8f9fa !important;
    color: #343f52 !important;
}

/* A9/C — legenda de figura no claro (vence o #6c757d inline de single.php). */
html:not([data-theme="dark"]) .amzx-blog-inline figcaption,
html:not([data-theme="dark"]) .amzx-blog-caption {
    color: #595959 !important;
}

/* ---------- V10 claro ---------- */

/* D1/D2 — links de texto salmão (menu de categorias ativo, links do corpo)
 * -> laranja queimado. Exclui .btn/.badge (guard) e .text-dark (breadcrumb,
 * autor, títulos — já escuros e legíveis). */
html:not([data-theme="dark"]) body.amzx-theme-v10 section#blog a:not(.btn):not(.badge):not(.text-dark) {
    color: #c2410c !important;
}
html:not([data-theme="dark"]) body.amzx-theme-v10 section#blog a:not(.btn):not(.badge):not(.text-dark):hover,
html:not([data-theme="dark"]) body.amzx-theme-v10 section#blog a:not(.btn):not(.badge):not(.text-dark):focus {
    color: #9a3412 !important;
}
/* D3 — "AMZX Link" no copyright do rodapé (V10 claro). */
html:not([data-theme="dark"]) body.amzx-theme-v10 #footer-main .copyright a {
    color: #c2410c !important;
}
html:not([data-theme="dark"]) body.amzx-theme-v10 #footer-main .copyright a:hover,
html:not([data-theme="dark"]) body.amzx-theme-v10 #footer-main .copyright a:focus {
    color: #9a3412 !important;
}

/* ---------- Default claro / instalado ---------- */

/* C10/C11 — corpo do artigo e texto dos cartões (herdam #718096 do body). */
html:not([data-theme="dark"]) body.amzx-theme-default .card-body {
    color: #4a5568 !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default .amzx-blog-body {
    color: #4a5568 !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default .amzx-blog-lead {
    color: #4a5568 !important;
}

/* C11 — nome do autor no rodapé do cartão (span.avatar-content dentro de
 * .card-footer, fora do .card-body): herda #718096 do body. */
html:not([data-theme="dark"]) body.amzx-theme-default .card-footer .avatar-content {
    color: #4a5568 !important;
}

/* E3 — links no corpo do artigo (default claro/instalado). */
html:not([data-theme="dark"]) body.amzx-theme-default .amzx-blog-body a {
    color: #0066cc !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default .amzx-blog-body a:hover,
html:not([data-theme="dark"]) body.amzx-theme-default .amzx-blog-body a:focus {
    color: #004999 !important;
}

/* E1/E2/E5 — "Ler mais", selo "Destaque" e "Iniciar" do rodapé: branco sobre
 * #008aff (3,45:1) -> branco sobre #0066cc (5,57:1). Só nos modos claros
 * (no escuro o botão já é #0c66ff, 4,82:1). Escopo default: o V10 usa o
 * mesmo .btn-primary salmão, já tratado pelo contrast_guard. */
html:not([data-theme="dark"]) body.amzx-theme-default .btn-primary,
html:not([data-theme="dark"]) body.amzx-theme-default .btn-primary:hover,
html:not([data-theme="dark"]) body.amzx-theme-default .btn-primary:focus,
html:not([data-theme="dark"]) body.amzx-theme-default .badge-primary {
    background-color: #0066cc !important;
    border-color: #0066cc !important;
    color: #fff !important;
}

/* B6 — botão "Iniciar" do header (branco sobre verde #5cc9a7, 2,03:1) ->
 * texto escuro sobre o mesmo verde (8,76:1). Vale nos 3 modos default. */
body.amzx-theme-default .btn-success,
body.amzx-theme-default .btn-success:hover,
body.amzx-theme-default .btn-success:focus {
    color: #111827 !important;
}

/* F1/F2/F3 — menu do header no default claro (navbar-light sobre o hero
 * #eaecf3 ou sobre o branco das singles). A navbar-dark (instalado/escuro)
 * não é tocada: os links brancos sobre o hero escuro já passam. */
html:not([data-theme="dark"]) body.amzx-theme-default #navbar-main.navbar-light .navbar-nav .nav-link {
    color: #1a202c !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default #navbar-main.navbar-light .navbar-nav .nav-link:hover,
html:not([data-theme="dark"]) body.amzx-theme-default #navbar-main.navbar-light .navbar-nav .nav-link:focus {
    color: #1a202c !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default #navbar-main.navbar-light .navbar-nav .nav-link.active {
    color: #005fcc !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default #navbar-main.navbar-light .navbar-nav .nav-link.active:hover,
html:not([data-theme="dark"]) body.amzx-theme-default #navbar-main.navbar-light .navbar-nav .nav-link.active:focus {
    color: #005fcc !important;
}

/* Paginação (default claro/instalado): número/links #718096 e página ativa
 * branca sobre #007ce6 (4,18:1). */
html:not([data-theme="dark"]) body.amzx-theme-default .page-link {
    color: #4a5568 !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default .page-link:hover,
html:not([data-theme="dark"]) body.amzx-theme-default .page-link:focus {
    color: #004999 !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default .page-item.active .page-link {
    color: #fff !important;
    background-color: #0066cc !important;
    border-color: #0066cc !important;
}

/* E4/C12 — rodapé claro do default (footer .bg-white): links #008aff e
 * textos #718096. O rodapé escuro (instalado/escuro) não é tocado.
 * :not(.btn): o botão "Iniciar" (.btn-primary) do rodapé é um <a> e cairia
 * nesta regra — o ID #footer-main venceria o .btn-primary e o texto ficaria
 * #0066cc sobre o fundo #0066cc (1,0:1). Botões ficam fora desta regra. */
html:not([data-theme="dark"]) body.amzx-theme-default #footer-main .footer.bg-white a:not(.nav-link):not(.btn) {
    color: #0066cc !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default #footer-main .footer.bg-white a:not(.nav-link):not(.btn):hover,
html:not([data-theme="dark"]) body.amzx-theme-default #footer-main .footer.bg-white a:not(.nav-link):not(.btn):focus {
    color: #004999 !important;
}
html:not([data-theme="dark"]) body.amzx-theme-default #footer-main .footer.bg-white p,
html:not([data-theme="dark"]) body.amzx-theme-default #footer-main .footer.bg-white .copyright {
    color: #4a5568 !important;
}

/* ================= ESCURO (html[data-theme="dark"]) ================= */

/* A1/A2/A5/A6/A7 — V10 escuro: a section do blog mantinha o fundo claro
 * #f8f9fa com o texto virado para branco (1,05:1). Fundo escuro igual ao
 * dos cards (rgb 14,14,14): H1, breadcrumb, meta e títulos voltam a passar.
 * Só a section em si é escurecida — os badges .bg-light dentro dela ficam
 * claros de propósito (o contrast_guard põe texto #111827 neles, 16,83:1). */
html[data-theme="dark"] body.amzx-theme-v10 section#blog.bg-light {
    background-color: #0e0e0e !important;
}

/* B4/C5 — pull-quote no escuro (os dois temas): fundo claro não invertido
 * com texto claro por cima (1,05–1,55:1) -> fundo e texto escuros. */
html[data-theme="dark"] .amzx-blog-quote {
    background-color: #1f2937 !important;
    color: #e2e8f0 !important;
    border-left-color: #3b82f6 !important;
}

/* A9/B5 — legenda de figura no escuro (vence o #6c757d inline de single.php). */
html[data-theme="dark"] .amzx-blog-inline figcaption,
html[data-theme="dark"] .amzx-blog-caption {
    color: #b1b9c4 !important;
}

/* A8/G2 — placeholder da busca no escuro. */
html[data-theme="dark"] input::placeholder {
    color: #b1b9c4 !important;
    opacity: 1;
}

/* ---------- Default escuro ---------- */

/* B1/B2 — títulos dos cartões e da sidebar/populares: .text-dark #253649
 * sobre o fundo do card #253649 (1,0:1) -> #e2e8f0 (10,01:1). */
html[data-theme="dark"] body.amzx-theme-default .text-dark {
    color: #e2e8f0 !important;
}
html[data-theme="dark"] body.amzx-theme-default a.text-dark:hover,
html[data-theme="dark"] body.amzx-theme-default a.text-dark:focus {
    color: #ffffff !important;
}

/* B3 (menu de categorias) — inativos #8492a6 (4,43:1) e ativo #273444
 * (1,11:1) sobre #1f2d3d. O menu do header (.navbar-nav) não é tocado. */
html[data-theme="dark"] body.amzx-theme-default .nav .nav-link {
    color: #c0ccda !important;
}
html[data-theme="dark"] body.amzx-theme-default .nav .nav-link:hover,
html[data-theme="dark"] body.amzx-theme-default .nav .nav-link:focus {
    color: #ffffff !important;
}
html[data-theme="dark"] body.amzx-theme-default .nav .nav-link.border {
    color: #ffffff !important;
}

/* B3 (corpo do artigo) — links #0c66ff (2,90:1) sobre #1f2d3d. */
html[data-theme="dark"] body.amzx-theme-default .amzx-blog-body a {
    color: #8ab4ff !important;
}
html[data-theme="dark"] body.amzx-theme-default .amzx-blog-body a:hover,
html[data-theme="dark"] body.amzx-theme-default .amzx-blog-body a:focus {
    color: #b3ccff !important;
}
