/*
Theme Name: Agrisolo Notícias
Theme URI: https://agrisolo.com.br
Author: Agrisolo
Description: Tema WordPress baseado no site principal da Agrisolo, com listagem em grid de postagens.
Version: 1.1
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f39c12;
    --secondary-color: #2c3e50;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --bg-light: #f8f9fa;
    --gradient: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo img {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 120px auto 0;
    padding: 0 2rem;
}

.container-wrapper {
    max-width: 1400px;
    margin: 120px auto 0;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    align-items: start;
}

.main-content {
    min-width: 0;
}

/* Grid de Posts - ESTE É O IMPORTANTE */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar customizada */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.sidebar-widget {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.widget-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-post-item {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.recent-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recent-post-item:hover {
    padding-left: 0.5rem;
}

.recent-post-item a {
    text-decoration: none;
    display: block;
}

.recent-post-date {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-post-title {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
    transition: color 0.3s ease;
    display: block;
    font-weight: 500;
}

.recent-post-item:hover .recent-post-title {
    color: var(--primary-color);
}

.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-list li {
    margin-bottom: 0;
}

.archive-list a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: 500;
}

.archive-list a:hover {
    color: var(--primary-color);
    background: #f8f9fa;
    padding-left: 1.2rem;
}

/* Cards de Posts */
.post-item {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-light);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-date {
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-item h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.post-item h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item h2 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: gap 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
    gap: 0.8rem;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

/* ===== MENU RESPONSIVO ===== */
.mobile-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 35px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    position: relative;
}

.mobile-menu span {
    width: 100%;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}
.mobile-menu.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}
.mobile-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Responsivo */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
        height: 70px;
        padding: 0 1rem;
    }

    .logo img {
        height: 40px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--white);
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
        padding: 0;
        margin: 0;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        padding: 0;
        border-bottom: 1px solid #eee;
        width: 100%;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 1.2rem 1.5rem;
        width: 100%;
        text-align: left;
    }

    .mobile-menu {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .container {
        margin-top: 90px;
        padding: 0 1rem;
    }

    .container-wrapper {
        grid-template-columns: 1fr;
        margin-top: 90px;
        padding: 0 1rem;
        gap: 2rem;
        display: flex;
        flex-direction: column;
    }

    /* Sidebar aparece PRIMEIRO no mobile */
    .sidebar {
        position: relative;
        top: 0;
        max-height: none;
        order: -1;
    }

    .main-content {
        order: 1;
    }

    /* Grid 1 coluna no mobile */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container-wrapper {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }

    /* Grid 2 colunas no tablet */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* FORÇAR centralização - títulos de posts/páginas/site */
.post-item h2,
.post-item h2 a,
h1.entry-title,
h1.page-title,
h1.site-title,
.entry-title,
.page-title,
.post-title {
    text-align: center !important;
    display: block; /* garante que o text-align funcione */
    width: 100%;
}