/* CSS Principal - Novo Blog e-certificado.com */

/* 1. Design Tokens (Variáveis CSS) */
:root {
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
    --primary-light: #f0fdf4;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-dark: #1e293b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-footer: #0f172a;
    --border-color: #e2e8f0;
    --font-headings: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 25px -5px rgba(34, 197, 94, 0.06), 0 10px 10px -5px rgba(34, 197, 94, 0.03);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Resets e Estilos Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* 3. Cabeçalho (Header) */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 75px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Logo Estilizada */
.logo-link:hover {
    color: inherit;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-badge {
    background-color: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(34, 197, 94, 0.3);
}

.logo-brand {
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 1.35rem;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.logo-brand .logo-dot {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1.15rem;
}

.logo-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
}

.logo-blog-tag {
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--primary-color);
    background-color: var(--primary-light);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
}

/* Menu de Navegação */
.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-item {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 8px 4px;
    position: relative;
}

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

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 4px;
    right: 4px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.btn-nav {
    background-color: var(--primary-color);
    color: white !important;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-nav:hover {
    background-color: var(--primary-light);
    color: var(--primary-color) !important;
}

/* Menu Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-dark);
    transition: var(--transition);
}

/* 4. Banner Superior */
.banner-top {
    background-color: #0f172a;
    padding: 50px 0;
    text-align: center;
    color: #ffffff;
}

.banner-top h1 {
    font-family: var(--font-headings);
    color: #ffffff;
    font-weight: 700;
    font-size: 2.2rem;
    line-height: 1.3;
    letter-spacing: -0.5px;
    max-width: 900px;
    margin: 0 auto;
}

/* 5. Layout Principal (Grid Blog) */
.main-content {
    padding: 50px 0 80px;
}

.blog-container {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 40px;
    align-items: start;
}

/* Listagem de Posts */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 45px;
    min-width: 0;
}

/* 6. Cards de Post */
.post-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(34, 197, 94, 0.2);
}

.post-img-link {
    display: block;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.post-img-container {
    width: 100%;
    overflow: hidden;
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
}

.post-card-img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.post-card:hover .post-card-img {
    transform: scale(1.03);
}

.post-info {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.post-author {
    color: var(--primary-color);
    font-weight: 600;
}

.post-meta-dot {
    color: var(--border-color);
}

.post-title {
    font-family: var(--font-headings);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.post-title a {
    color: var(--text-dark);
}

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

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-read-more {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    letter-spacing: 0.5px;
}

.btn-read-more:hover {
    color: var(--primary-hover);
}

.btn-read-more:hover .arrow {
    transform: translateX(4px);
}

.btn-read-more .arrow {
    transition: var(--transition);
}

/* Post Hero (Destaque principal) */
.post-card-hero {
    border-color: rgba(34, 197, 94, 0.15);
}

.post-card-hero .post-img-wrapper {
    height: 380px;
}

.post-card-hero .post-title {
    font-size: 1.95rem;
    letter-spacing: -0.5px;
}

.post-card-hero .post-excerpt {
    font-size: 1.05rem;
    margin-bottom: 24px;
}

/* 7. Barra Lateral (Sidebar) */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-family: var(--font-headings);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
    letter-spacing: -0.2px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.widget-links {
    list-style: none;
}

.widget-links li {
    margin-bottom: 12px;
}

.widget-links li:last-child {
    margin-bottom: 0;
}

.widget-links a {
    color: var(--text-main);
    font-weight: 500;
    display: block;
    padding: 2px 0;
}

.widget-links a:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

.widget-posts {
    list-style: none;
}

.widget-posts li {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.widget-posts li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-post-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-dark);
    display: block;
    margin-bottom: 6px;
}

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

.sidebar-post-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* 8. Paginação */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-link:hover, .page-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-prev, .page-next {
    width: auto;
    padding: 0 16px;
}

/* 9. Página de Post Individual (templates/post.php) */
.breadcrumbs-bar {
    background-color: #0f172a;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.breadcrumbs-container {
    font-size: 0.85rem;
    color: var(--bg-main);
    font-weight: 500;
}

.breadcrumbs-path a {
    color: var(--bg-main);
}

.breadcrumbs-path a:hover {
    color: var(--primary-color);
}

.breadcrumbs-path .sep {
    margin: 0 8px;
    color: var(--bg-main);
    font-size: 1.1rem;
    vertical-align: middle;
}

.breadcrumbs-path .current-crumb {
    color: var(--bg-main);
    font-weight: 600;
}

/* Artigo Principal */
.post-single {
    display: flex;
    flex-direction: column;
}

.post-article {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 40px;
}

.post-hero-image-container {
    width: 100%;
    margin-bottom: 35px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-hero-image-img {
    width: 100%;
    height: auto;
    max-height: 550px;
    display: block;
    object-fit: contain;
}

.post-article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 25px;
}

.post-title-main {
    font-family: var(--font-headings);
    font-size: 2.35rem;
    color: var(--text-dark);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.8px;
    margin-top: 10px;
}

.post-category {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Tipografia Rica do Post Content (Importante para posts do WordPress/TinyMCE) */
.post-article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.post-article-content p {
    margin-bottom: 24px;
}

.post-article-content h2 {
    font-family: var(--font-headings);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 45px 0 20px;
    letter-spacing: -0.4px;
}

.post-article-content h3 {
    font-family: var(--font-headings);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 35px 0 15px;
    letter-spacing: -0.3px;
}

.post-article-content strong {
    font-weight: 700;
}

.post-article-content blockquote {
    border-left: 4px solid var(--primary-color);
    background-color: var(--primary-light);
    padding: 20px 24px;
    margin: 30px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-main);
}

.post-article-content ul, .post-article-content ol {
    margin: 0 0 24px 24px;
}

.post-article-content li {
    margin-bottom: 8px;
}

.post-article-content img {
    margin: 30px auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.post-article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.post-article-content a:hover {
    color: var(--primary-hover);
}

/* Footer do Post (Compartilhar) */
.post-article-footer {
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.share-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: white !important;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.share-btn.fb { background-color: #1877f2; }
.share-btn.fb:hover { background-color: #166fe5; }
.share-btn.tw { background-color: #1da1f2; }
.share-btn.tw:hover { background-color: #1a91da; }
.share-btn.wa { background-color: #25d366; }
.share-btn.wa:hover { background-color: #21b858; }

/* 10. Rodapé (Footer) */
.main-footer {
    background-color: var(--bg-footer);
    color: #94a3b8;
    padding: 70px 0 0;
    border-top: 1px solid #1e293b;
}

.footer-container {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 60px;
    padding-bottom: 60px;
}

.footer-info .logo-brand {
    color: #ffffff;
}

.footer-desc {
    margin-top: 15px;
    font-size: 0.95rem;
    max-width: 500px;
    line-height: 1.7;
    padding-left: 15px
}

.footer-links h4 {
    color: #ffffff;
    font-family: var(--font-headings);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 25px 0;
    text-align: center;
    font-size: 0.85rem;
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    font-size: 0.95rem;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-danger a {
    color: #991b1b;
    text-decoration: underline;
    font-weight: 600;
}

/* Estado Sem Posts */
.no-posts {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 60px 40px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.no-posts h3 {
    font-family: var(--font-headings);
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.no-posts p {
    color: var(--text-muted);
}

.no-posts a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

/* 11. Media Queries (Responsividade) */
@media (max-width: 991px) {
    .blog-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 50px;
    }
    
    .blog-sidebar {
        position: static;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 767px) {
    .main-header {
        height: 65px;
    }
    
    .logo-divider,
    .logo-blog-tag {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Menu Mobile Deslizante */
    .main-nav {
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border-bottom: 1px solid var(--border-color);
        padding: 20px 24px;
        display: none;
        box-shadow: var(--shadow-md);
    }
    
    .main-nav.open {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .nav-item {
        display: block;
        padding: 10px 0;
    }
    
    .nav-item.active::after {
        display: none;
    }
    
    .btn-nav {
        text-align: center;
        margin-top: 5px;
    }
    
    /* Menu Hamburger Efeito */
    .mobile-menu-toggle.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .banner-top {
        padding: 30px 0;
    }
    
    .banner-top h1 {
        font-size: 1.35rem;
    }
    
    .post-card-hero .post-img-wrapper {
        height: 240px;
    }
    
    .post-card-hero .post-title {
        font-size: 1.55rem;
    }
    
    .post-card-hero .post-excerpt {
        font-size: 0.95rem;
    }
    
    .post-img-wrapper {
        height: 180px;
    }
    
    .post-info {
        padding: 20px;
    }
    
    .post-title {
        font-size: 1.25rem;
    }
    
    .post-article {
        padding: 24px;
    }
    
    .post-hero-image {
        height: 220px;
        margin-bottom: 20px;
    }
    
    .post-title-main {
        font-size: 1.75rem;
    }
}
