/*
Theme Name: IncognitaX Blog Matemática
Theme URI: https://incognitax.com
Author: IncognitaX
Author URI: https://incognitax.com
Description: Tema oficial do blog de matemática do IncognitaX. Design limpo, responsivo e moderno, com header e footer no estilo do site principal.
Version: 1.2.0
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: incognitax-blog
Tags: blog, education, mathematics, custom-menu, responsive-layout, one-column
*/

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f0f2f5;
    color: #1e293b;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #4338ca;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== HEADER ===== */
.site-header {
    background: #0B1C2D;
    padding: 14px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 18px rgba(0,0,0,0.35);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo img {
    height: 52px;
    display: block;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.8rem;
}

.main-nav a {
    color: #f1f1f1;
    font-weight: 700;
    font-size: 14.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: color 0.25s;
}

.main-nav a:hover {
    color: #38bdf8;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger {
    display: block;
    width: 26px;
    height: 2px;
    background: #fff;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 26px;
    height: 2px;
    background: #fff;
    position: absolute;
    transition: 0.3s;
}

.hamburger::before { top: -8px; }
.hamburger::after  { top: 8px; }

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.site-main {
    flex: 1;
    padding: 36px 24px 70px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== BARRA DE PESQUISA ===== */
.blog-search-bar {
    margin-bottom: 32px;
}

.search-form {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.search-field {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    color: #1e293b;
}

.search-field::placeholder {
    color: #94a3b8;
}

.search-submit {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 0 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.search-submit:hover {
    background: #4338ca;
}

.search-results-title {
    font-size: 1.25rem;
    color: #475569;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 600;
}

/* ===== CARD DO POST ===== */
.post-card,
.page-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 42px 50px;
    margin-bottom: 36px;
}

/* ===== CABEÇALHO DO POST (título mais bonito) ===== */
.post-header {
    margin-bottom: 28px;
}

.post-categories {
    margin-bottom: 12px;
}

.post-categories a {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 6px;
    transition: background 0.2s;
}

.post-categories a:hover {
    background: #e0e7ff;
    color: #4338ca;
}

.post-card .entry-title,
.page-card .entry-title {
    font-family: 'Fjalla One', sans-serif;
    font-size: 2.35rem;
    color: #0f172a;
    margin: 0 0 16px;
    line-height: 1.22;
    letter-spacing: -0.4px;
    position: relative;
    padding-bottom: 16px;
}

.post-card .entry-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #38bdf8);
    border-radius: 2px;
}

.entry-meta {
    color: #64748b;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
}

.entry-meta .meta-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.entry-meta .meta-date svg {
    opacity: 0.7;
}

.entry-meta a {
    color: #6366f1;
}

/* Imagem destacada */
.featured-image {
    margin: 0 0 30px;
    border-radius: 12px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 440px;
}

/* Conteúdo */
.entry-content h2 {
    font-size: 1.45rem;
    color: #0f172a;
    margin: 40px 0 14px;
    padding-left: 14px;
    border-left: 4px solid #6366f1;
    font-weight: 700;
}

.entry-content h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin: 28px 0 10px;
}

.entry-content p {
    margin-bottom: 16px;
    font-size: 1.05rem;
    color: #334155;
}

.entry-content ul,
.entry-content ol {
    margin: 12px 0 22px 22px;
}

.entry-content li {
    margin-bottom: 7px;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
}

.entry-content th {
    background: #1e293b;
    color: #fff;
    padding: 12px 14px;
    text-align: left;
}

.entry-content td {
    padding: 11px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.entry-content tr:nth-child(even) {
    background: #f8fafc;
}

.entry-content a {
    color: #4f46e5;
    border-bottom: 1px solid transparent;
}

.entry-content a:hover {
    border-bottom-color: #4f46e5;
}

/* Links extras */
.post-links {
    margin-top: 32px;
    padding: 18px 22px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #38bdf8;
}

.post-links h4 {
    font-size: 0.9rem;
    color: #0f172a;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.post-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-links li {
    margin-bottom: 6px;
}

.post-links a {
    color: #0284c7;
    font-size: 0.95rem;
}

.post-links a:hover {
    text-decoration: underline;
}

/* ===== TAGS NO FINAL ===== */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tags-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    margin-right: 4px;
}

.post-tags a {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.82rem;
    padding: 4px 12px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.post-tags a:hover {
    background: #e0e7ff;
    color: #4f46e5;
}

/* ===== SOBRE O AUTOR ===== */
.author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 28px;
    padding: 18px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.author-box img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-box .author-info {
    flex: 1;
}

.author-box .author-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.author-box .author-bio {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* ===== LISTA DE POSTS ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.post-preview {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
    transition: transform 0.22s, box-shadow 0.22s;
    position: relative;
}

.post-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

/* Card inteiro clicável */
.post-preview-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.post-preview-link:hover {
    color: inherit;
}

.preview-thumb {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #e2e8f0;
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.post-preview:hover .preview-thumb img {
    transform: scale(1.05);
}

.preview-thumb-fallback {
    background: #0B1C2D;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-thumb-fallback img {
    width: 55%;
    height: auto;
    object-fit: contain;
    padding: 20px;
}

.preview-body {
    padding: 22px 24px 26px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-title {
    font-size: 1.22rem;
    margin-bottom: 8px;
    line-height: 1.35;
    color: #1e293b;
    font-weight: 700;
}

.post-preview:hover .preview-title {
    color: #4f46e5;
}

.post-preview .entry-meta {
    margin-bottom: 10px;
    font-size: 0.84rem;
}

.post-preview .excerpt {
    color: #64748b;
    font-size: 0.94rem;
    margin: 0 0 16px;
    flex: 1;
}

.read-more {
    display: inline-block;
    background: #4f46e5;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    align-self: flex-start;
    transition: background 0.2s;
}

.post-preview:hover .read-more {
    background: #4338ca;
}

/* ===== POSTS RELACIONADOS / RECENTES ===== */
.related-posts {
    margin-bottom: 40px;
}

.related-title {
    font-size: 1.3rem;
    color: #0f172a;
    margin-bottom: 20px;
    font-weight: 700;
    padding-left: 12px;
    border-left: 4px solid #6366f1;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
    color: inherit;
}

.related-thumb {
    height: 130px;
    overflow: hidden;
    background: #e2e8f0;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover .related-thumb img {
    transform: scale(1.05);
}

.related-thumb-fallback {
    background: #0B1C2D;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-thumb-fallback img {
    width: 50%;
    object-fit: contain;
    padding: 16px;
}

.related-body {
    padding: 14px 16px 18px;
}

.related-body h4 {
    font-size: 0.98rem;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.35;
    font-weight: 700;
}

.related-card:hover .related-body h4 {
    color: #4f46e5;
}

.related-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ===== PAGINAÇÃO ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 9px 15px;
    background: #fff;
    border-radius: 8px;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 0.9rem;
}

.pagination .current {
    background: #4f46e5;
    color: #fff;
}

/* ===== NAVEGAÇÃO ENTRE POSTS ===== */
.post-navigation {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.post-navigation a {
    color: #4f46e5;
    font-size: 0.9rem;
}

.post-navigation a:hover {
    text-decoration: underline;
}

/* ===== COMENTÁRIOS ===== */
.comments-area {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
    padding: 36px 42px;
    margin-bottom: 40px;
}

.comments-title {
    font-size: 1.35rem;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.comment-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}

.comment-list .comment {
    margin-bottom: 22px;
    padding: 18px 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.comment-list .children {
    list-style: none;
    margin: 16px 0 0 24px;
    padding: 0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-author img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 700;
    color: #1e293b;
    font-style: normal;
}

.comment-meta {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.comment-content p {
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 8px;
}

.reply a {
    font-size: 0.85rem;
    color: #6366f1;
    font-weight: 600;
}

.comment-respond {
    margin-top: 10px;
}

.comment-reply-title {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #1e293b;
}

.comment-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .form-submit {
    margin-top: 8px;
}

.comment-form .submit {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: #4338ca;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #0B1C2D;
    color: #f1f1f1;
    padding: 55px 0 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 36px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

.footer-col h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 9px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: #4facfe;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 9px;
}

.footer-col a {
    color: #cbd5e1;
    font-size: 0.92rem;
    transition: 0.25s;
}

.footer-col a:hover {
    color: #fff;
    padding-left: 3px;
}

.footer-brand img {
    height: 46px;
    margin-bottom: 12px;
}

.footer-brand p {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.55;
}

.footer-bottom {
    text-align: center;
    margin-top: 42px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.84rem;
    color: #64748b;
}

.footer-bottom a {
    color: #e2e8f0;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
    .site-header {
        padding: 12px 18px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0f172a;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .main-nav.active {
        max-height: 80vh;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 22px 0;
        gap: 1.3rem;
    }

    .post-card,
    .page-card,
    .comments-area {
        padding: 26px 20px;
        border-radius: 12px;
    }

    .post-card .entry-title {
        font-size: 1.7rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        padding: 0 22px;
        text-align: center;
    }

    .footer-col h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .search-form {
        max-width: 100%;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
