/* =========================================================
   C. LACERDA ENGENHARIA — DESIGN TOKENS (idênticos ao HTML original)
   ========================================================= */
:root {
    --bg-primary: #051124;
    --bg-secondary: #0a1e3b;
    --text-title: #ffffff;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(59, 130, 246, 0.15);
    --glass-bg: rgba(5, 17, 36, 0.85);
    --glass-border: rgba(59, 130, 246, 0.15);
    --card-bg: rgba(10, 30, 59, 0.95);
    --canvas-bg: #051124;
    --canvas-line-r: 59;
    --canvas-line-g: 130;
    --canvas-line-b: 246;
    --blueprint-glow: rgba(59, 130, 246, 0.08);
    --shadow-intensity: rgba(0, 0, 0, 0.5);
    --logo-bg-container: #ffffff;

    --brand-blue: #005596;
    --brand-accent: #3b82f6;
    --brand-orange: #f97316;
    --cursor-default: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3L11.5 24L14.5 14.5L24 11.5L3 3Z' fill='%23005596' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 3 3, auto;
    --cursor-text: url("data:image/svg+xml,%3Csvg width='12' height='24' viewBox='0 0 12 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4V20M2 4H10M2 20H10' stroke='%23005596' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 6 12, text;
}

.light-theme {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --text-title: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: rgba(10, 30, 59, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(10, 30, 59, 0.15);
    --card-bg: #ffffff;
    --canvas-bg: #f8fafc;
    --canvas-line-r: 10;
    --canvas-line-g: 85;
    --canvas-line-b: 150;
    --blueprint-glow: rgba(10, 85, 150, 0.05);
    --shadow-intensity: rgba(15, 23, 42, 0.08);
    --logo-bg-container: #ffffff;
}

/* CURSORES PERSONALIZADOS (idênticos ao original) */
body {
    cursor: var(--cursor-default);
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}
 a,
 a:any-link,
 a:hover,
 a:focus,
 a:active,
 a *,
 button,
 button:hover,
 button:focus,
 button:active,
 button *,
 .text-interactive,
 .text-interactive *,
 [onclick],
 [onclick] *,
 .card-tilt,
 .card-tilt *,
 input[type="submit"] {
    cursor: var(--cursor-default) !important;
}
input, textarea, .text-interactive-field {
    cursor: var(--cursor-text) !important;
}
@media (max-width: 1024px) {
    body, a, button, .text-interactive, [onclick], .card-tilt, input, textarea { cursor: auto !important; }
}

/* TIPOGRAFIA */
.font-display { font-family: 'Poppins', sans-serif; }
.font-sans    { font-family: 'Inter', sans-serif; }

/* COMPONENTES PRINCIPAIS */
.glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s ease, border-bottom 0.3s ease;
}
.hero-gradient {
    background: radial-gradient(circle at top right, var(--bg-secondary), var(--bg-primary));
    transition: background 0.3s ease;
}
.card-tilt {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    background-color: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 10px 30px -10px var(--shadow-intensity);
}
.card-tilt.js-post-card,
.card-tilt.js-post-card *,
.post-card.js-post-card,
.post-card.js-post-card *,
.post-card.js-post-card:hover,
.post-card.js-post-card:hover *,
.post-card.js-post-card a,
.post-card.js-post-card a:hover,
.post-card.js-post-card [onclick],
.post-card.js-post-card [onclick]:hover {
    cursor: var(--cursor-default) !important;
}
.post-card.js-post-card .save-btn,
.post-card.js-post-card .save-btn *,
.card-tilt.js-post-card .save-btn,
.card-tilt.js-post-card .save-btn * {
    cursor: var(--cursor-default) !important;
}
.card-tilt:hover { transform: translateY(-4px); }

#canvas-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    background: var(--canvas-bg);
    transition: background 0.3s ease;
}
.blueprint-overlay {
    position: fixed; inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--blueprint-glow) 0%, transparent 60%);
    z-index: -1; pointer-events: none;
}
.text-glow { text-shadow: 0 0 12px rgba(59, 130, 246, 0.25); }
.no-select { user-select: none; }

/* TIPOGRAFIA INTERNA DOS POSTS */
.article-body p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: var(--text-body);
    font-size: 1rem;
    transition: color 0.3s ease;
}
.article-body h2,
.article-body h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-title);
    border-left: 4px solid var(--brand-accent);
    padding-left: 0.75rem;
    transition: color 0.3s ease;
}
.article-body h2 { font-size: 1.6rem; }
.article-body h3 { font-size: 1.4rem; }
.article-body h4 { font-size: 1.15rem; font-weight: 700; color: var(--text-title); margin: 1.25rem 0 .5rem; }
.article-body ul, .article-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}
.article-body ul { list-style-type: disc; }
.article-body ol { list-style-type: decimal; }
.article-body li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    line-height: 1.7;
    transition: color 0.3s ease;
}
.article-body strong { color: var(--text-title); font-weight: 700; }
.article-body a {
    color: var(--brand-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-body img { max-width: 100%; height: auto; border-radius: 1rem; margin: 1.5rem 0; }
.article-body blockquote {
    border-left: 4px solid var(--brand-blue);
    padding: .75rem 1rem;
    background: var(--bg-primary);
    border-radius: .75rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-style: italic;
}
.article-body code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: var(--bg-primary);
    color: var(--brand-accent);
    padding: .15rem .4rem;
    border-radius: .35rem;
    font-size: .9em;
}
.article-body pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.25rem 0;
}

/* FILTROS */
.cat-btn.active {
    background: var(--brand-blue) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px -8px rgba(0,85,150,.6);
}

/* CARTÕES DE POSTS */
.post-card {
    display: flex; flex-direction: column;
    border-radius: 1.5rem; overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    box-shadow: 0 10px 30px -10px var(--shadow-intensity);
    transition: transform .3s, box-shadow .3s;
    cursor: var(--cursor-default) !important;
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 20px 45px -15px var(--shadow-intensity); }
.post-card .thumb {
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}
.post-card .thumb .thumb-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.post-card:hover .thumb .thumb-img { transform: scale(1.04); }
.post-card .thumb .cat-tag {
    position: absolute; top: 12px; left: 12px;
    background: var(--brand-orange); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 4px 10px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .08em;
}
.post-card .thumb .save-btn {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,0,0,.55); color:#fff;
    width: 34px; height: 34px; border-radius: .75rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.15);
    transition: background .2s;
    cursor: var(--cursor-default) !important;
}
.post-card .thumb .save-btn.saved { background: var(--brand-orange); }
.post-card .body { padding: 1.25rem 1.25rem 1rem; flex:1; display:flex; flex-direction:column; gap:.75rem; }
.post-card h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1.3;
    font-size: 1.05rem;
    transition: color .2s;
}
.post-card:hover h3 { color: var(--brand-blue); }
.post-card .excerpt { color: var(--text-body); font-size: .85rem; line-height: 1.55; flex:1; }
.post-card .meta {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: .75rem; font-size: .7rem; color: var(--text-muted);
}
.post-card .meta .read-link { color: var(--brand-blue); font-weight: 700; }

/* COMENTÁRIOS */
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .comment { margin-bottom: 1rem; }
.comment-list .children { margin-left: 1.25rem; padding-left: 1rem; border-left: 2px solid var(--border-color); margin-top: 1rem; }
.comment-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    transition: border-color .2s;
}
.comment-box:hover { border-color: var(--brand-accent); }
.comment-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap;
}
.comment-author {
    display: flex; align-items: center; gap: .55rem;
    font-weight: 700; color: var(--text-title); font-size: .85rem;
}
.comment-author .avatar-mini {
    width: 30px; height: 30px; border-radius: 999px;
    background: var(--brand-blue); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700;
}
.comment-meta-line { color: var(--text-muted); font-size: .68rem; }
.comment-body-text { color: var(--text-body); font-size: .85rem; line-height: 1.55; }
.comment-actions { margin-top: .5rem; display: flex; gap: .85rem; flex-wrap: wrap; }
.comment-actions a, .comment-actions button {
    background: transparent; border: 0; padding: 0;
    font-size: .72rem; font-weight: 700;
    color: var(--brand-accent);
}
.comment-actions .delete-own-comment { color: #ef4444; }
.comment-actions .delete-own-comment:hover { text-decoration: underline; }
.comment-actions .edit-own-comment { color: var(--brand-accent); }
.comment-actions .edit-own-comment:hover { text-decoration: underline; }
.comment-edit-form { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.comment-edit-textarea {
    width: 100%; min-height: 90px; padding: .6rem .75rem; border-radius: .5rem;
    background: var(--bg-secondary); color: var(--text-body);
    border: 1px solid var(--border-color); font: inherit; resize: vertical;
}
.comment-edit-textarea:focus { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.comment-edit-actions { display: flex; gap: .5rem; }
.comment-edit-actions button {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .75rem; border-radius: .4rem; font-size: .75rem; font-weight: 600;
    border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-body);
    cursor: var(--cursor-default) !important;
}
.comment-edit-actions .comment-edit-save { background: var(--brand-accent); color: #fff; border-color: var(--brand-accent); }
.comment-edit-actions button:disabled { opacity: .6; }

/* FORMULÁRIO COMENTÁRIO NATIVO WP — REESTILIZADO */
#commentform, .comment-respond form {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.25rem;
}
#commentform p { margin-bottom: .75rem; }
#commentform label { display: block; font-size: .7rem; color: var(--text-muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
#commentform input[type=text],
#commentform input[type=email],
#commentform input[type=url],
#commentform textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: .85rem;
    padding: .65rem .9rem;
    color: var(--text-body);
    font-size: .85rem;
}
#commentform input:focus, #commentform textarea:focus {
    outline: none; border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0,85,150,.15);
}
#commentform .form-submit input[type=submit],
.comment-respond .form-submit input[type=submit] {
    background: var(--brand-blue);
    color: #fff; border: 0;
    font-weight: 700; font-size: .8rem;
    padding: .7rem 1.4rem; border-radius: .85rem;
    transition: background .2s;
}
#commentform .form-submit input[type=submit]:hover { background: #003e6e; }

/* PAGINAÇÃO WP */
.wp-pagenavi, .nav-links {
    display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
    margin-top: 2.5rem;
}
.wp-pagenavi a, .wp-pagenavi span, .nav-links a, .nav-links span {
    padding: .5rem .9rem;
    border-radius: .65rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-body);
    font-size: .8rem; font-weight: 700;
    text-decoration: none;
}
.wp-pagenavi .current, .nav-links .current {
    background: var(--brand-blue); color: #fff; border-color: var(--brand-blue);
}

/* TOAST */
.cl-toast {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: .85rem;
    padding: .65rem 1rem;
    color: var(--text-title);
    font-size: .8rem;
    box-shadow: 0 10px 30px -10px var(--shadow-intensity);
    pointer-events: auto;
    animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   OTIMIZAÇÕES DE PERFORMANCE & RESPONSIVIDADE
   ========================================================= */

/* Imagens fluidas por padrão */
img { max-width: 100%; height: auto; }

/* Reduzir motion para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Botão WhatsApp flutuante — reposicionar em mobile para não cobrir conteúdo */
@media (max-width: 640px) {
    a[href*="wa.me"].fixed {
        bottom: 1rem !important;
        right: 1rem !important;
        width: 3.25rem !important;
        height: 3.25rem !important;
        font-size: 1.5rem !important;
    }
}

/* Hero: padding mais compacto em telas pequenas */
@media (max-width: 640px) {
    #inicio { padding-top: 6.5rem; padding-bottom: 3rem; }
    #inicio h1 { font-size: 2.25rem; line-height: 1.15; }
    .card-tilt { padding: 1.25rem !important; }
}

/* Cards menores: ajustes finos */
@media (max-width: 480px) {
    .post-card h3 { font-size: 1rem; }
    .post-card .body { padding: 1rem 1rem .85rem; gap: .5rem; }
    .post-card .excerpt { font-size: .8rem; }
}

/* Toque em mobile: botões com área mínima de 44px (acessibilidade) */
@media (max-width: 1024px) {
    .post-card .thumb .save-btn { width: 40px; height: 40px; }
}

/* Containment/perf hints */
.post-card { contain: layout paint; }
#postsGrid { content-visibility: auto; contain-intrinsic-size: 1px 800px; }

/* Footer WhatsApp não deve sobrepor toasts */
#toastContainer { bottom: 5.5rem; }
@media (min-width: 641px) {
    #toastContainer { bottom: 7rem; }
}
