/*
Theme Name: Tech Blog Theme (Final Optimized)
Author: osmarjrlima
Version: 9.0
*/

:root {
    --primary-blue: #2563eb;       
    --primary-hover: #1d4ed8;      
    --text-dark: #1f2937;          
    --text-gray: #6b7280;          
    --bg-light: #f3f4f6;           
    --max-width: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #fff; color: var(--text-dark); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

header { border-bottom: 1px solid #e5e7eb; padding: 15px 0; margin-bottom: 40px; background: #fff; position: relative; z-index: 1000; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.navbar { display: flex; justify-content: space-between; align-items: center; min-height: 60px; }
.logo { font-size: 1.5rem; font-weight: bold; display: flex; align-items: center; gap: 10px; z-index: 1001; }
.logo span { background: #000; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 1.2rem; }

.menu-toggle, .mobile-menu-header, .mobile-socials, .menu-close { display: none !important; }

.main-menu { display: flex; align-items: center; gap: 20px; }
.main-menu ul { display: flex; gap: 20px; margin: 0; padding: 0; }
.main-menu a { font-weight: 500; font-size: 0.95rem; }
.main-menu a:hover { color: var(--primary-blue); }

.header-search-form { display: flex; align-items: center; border: 1px solid #e5e7eb; border-radius: 20px; padding: 4px 12px; background: #f9fafb; margin-left: 10px; }
.search-field { border: none; background: transparent; outline: none; font-size: 0.85rem; width: 140px; color: #333; }
.search-submit { border: none; background: none; cursor: pointer; font-size: 0.9rem; }

.site-content { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-bottom: 60px; position: relative; z-index: 1; }
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.post-card { display: flex; flex-direction: column; background: #fff; border-radius: 8px; }
.post-thumbnail { border-radius: 4px; overflow: hidden; margin-bottom: 15px; background: #eee; aspect-ratio: 16/9; }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.cat-badge { background-color: var(--primary-blue); color: white; padding: 4px 8px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; border-radius: 3px; display: inline-block; margin-bottom: 10px; }
.post-title { font-size: 1.25rem; margin-bottom: 10px; line-height: 1.3; font-weight: bold; }
.post-meta { font-size: 0.85rem; color: var(--text-gray); margin-bottom: 10px; }
.post-excerpt { font-size: 0.95rem; color: #4b5563; }
.pagination { margin-top: 40px; display: flex; gap: 10px; }
.page-numbers { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }
.page-numbers.current { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }

aside { display: block; }
.sidebar-widget { background: #fff; padding: 20px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 30px; }
.widget-title { font-size: 1rem; color: var(--primary-blue); text-transform: uppercase; font-weight: bold; margin-bottom: 20px; border-bottom: 2px solid #f3f4f6; padding-bottom: 10px; }
.social-sidebar-links { display: flex; gap: 12px; margin-bottom: 10px; }
.social-sidebar-links a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background-color: var(--bg-light); color: var(--text-dark); border-radius: 4px; transition: all 0.3s ease; }
.social-sidebar-links a svg { width: 20px; height: 20px; }
.social-sidebar-links a:hover { background-color: var(--primary-blue); color: #fff; transform: translateY(-2px); }
.numbered-list { list-style: none; counter-reset: post-counter; }
.numbered-list li { position: relative; padding-left: 30px; margin-bottom: 15px; counter-increment: post-counter; }
.numbered-list li::before { content: counter(post-counter); position: absolute; left: 0; top: 2px; font-weight: bold; color: #ef4444; font-size: 1.1rem; }
select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; background: #fff; }

.entry-header { margin-bottom: 30px; }
.entry-title { font-size: 2.5rem; margin: 15px 0; line-height: 1.2; color: #111; }
.single-post-thumbnail { margin-bottom: 30px; border-radius: 8px; overflow: hidden; }
.entry-content { font-size: 1.125rem; color: #374151; line-height: 1.8; }
.entry-content p { margin-bottom: 1.5em; }
.entry-content h2, .entry-content h3 { color: #111; margin-top: 2em; margin-bottom: 0.75em; font-weight: bold; }
.entry-content blockquote { border-left: 4px solid var(--primary-blue); padding: 15px 20px; background: #f9f9f9; margin: 20px 0; font-style: italic; }
.entry-content pre { background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 6px; overflow-x: auto; font-family: monospace; font-size: 0.9rem; margin-bottom: 1.5em; }

.comments-area { margin-top: 50px; padding-top: 30px; border-top: 1px solid #e5e7eb; }
.comment-list { list-style: none; margin-bottom: 30px; }
.comment-body { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.comment-author { font-weight: bold; margin-bottom: 5px; }
.comment-metadata { font-size: 0.85rem; color: #999; margin-bottom: 10px; }
.comment-form p { margin-bottom: 15px; }
.comment-form label { display: block; margin-bottom: 5px; font-weight: 500; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
.form-submit .submit { background: var(--text-dark); color: #fff; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.form-submit .submit:hover { background: var(--primary-blue); }

.ad-slot { display: flex; justify-content: center; align-items: center; margin: 30px auto; background: #f9f9f9; border: 1px dashed #ddd; padding: 10px; overflow: hidden; }
.ad-label { font-size: 0.65rem; color: #999; text-transform: uppercase; text-align: center; display: block; }

footer { text-align: center; padding: 40px 0; border-top: 1px solid #eee; margin-top: 40px; color: #666; font-size: 0.9rem; }

/* =========================================
   8. RESPONSIVO MOBILE (FINAL)
   ========================================= */
@media (max-width: 768px) {
    .site-content, .post-grid { grid-template-columns: 1fr; }
    
    /* ESCONDER CATEGORIAS DA SIDEBAR NO CELULAR */
    .widget-categories { display: none !important; }

    /* Header Mobile */
    .navbar { 
        flex-wrap: wrap; 
        padding: 10px 0;
        position: relative;
        justify-content: center;
    }
    .logo { margin: 0 auto; font-size: 1.4rem; z-index: 1002; }

    /* Botão Hambúrguer */
    .menu-toggle { 
        display: flex !important; flex-direction: column; gap: 5px; 
        position: absolute; left: 20px; top: 22px; 
        border: none; background: none; cursor: pointer; padding: 5px; z-index: 1003;
    }
    .menu-toggle span { display: block; width: 25px; height: 3px; background-color: #333; border-radius: 2px; }

    /* Menu "Empurra Conteúdo" */
    .main-menu {
        position: static; 
        width: 100%;
        height: auto; 
        background-color: #fff;
        display: none !important;
        order: 3; 
        border-top: 1px solid #eee;
        margin-top: 15px;
        padding-bottom: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
        transform: none; 
    }

    .main-menu.active { 
        display: block !important; 
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .mobile-menu-header { display: none !important; }

    .main-menu ul { display: flex !important; flex-direction: column; width: 100%; gap: 0; padding: 0; margin: 0; }
    .main-menu li { border-bottom: 1px solid #f9f9f9; width: 100%; }
    .main-menu a { 
        display: block;
        padding: 15px 20px; 
        color: #333; 
        font-weight: 500;
        font-size: 1rem;
    }

    .header-search-form { width: 90%; margin: 20px auto; background: #f9f9f9; border: 1px solid #eee; }
    .search-field { width: 100%; color: #333; }

    .mobile-socials { 
        display: flex !important; justify-content: center; gap: 30px; 
        margin-top: 20px; padding-bottom: 10px;
    }
    
    .mobile-socials a {
        display: flex; align-items: center; justify-content: center;
        color: #555; padding: 5px; transition: color 0.3s;
    }
    
    .mobile-socials svg { width: 24px; height: 24px; }
    .mobile-socials a:hover { color: var(--primary-blue); }
    
    .sub-menu { display: none; background: #fafafa; }
    .sub-menu.open { display: block; }
    .menu-item-has-children > a::after { content: '▼'; font-size: 0.7rem; color: #ccc; float: right; }
}