/**
 * Blog CSS - Techzentrix
 * Estilos específicos para o blog
 * 
 * @author Guilherme Bazilio - Techzentrix
 * @version 1.1.0 - Melhorias de contraste para modo claro
 */

/* Variáveis de contraste melhorado para modo claro */
:root {
    --blog-text-primary: #1e293b;
    --blog-text-secondary: #475569;
    --blog-text-tertiary: #64748b;
    --blog-bg-light: #f8fafc;
    --blog-border-light: #e2e8f0;
    --blog-border-medium: #d1d5db;
    
    /* Cores específicas para elementos do blog */
    --primary-color: #2563eb;
    --secondary-color: #0891b2;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #475569;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-light: #e2e8f0;
    --border-medium: #d1d5db;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* Blog Hero - Força sobreposição de outras regras */
section.blog-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    padding: 120px 0 80px;
    color: #1e293b !important;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.blog-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    padding: 120px 0 80px;
    color: #1e293b !important;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.blog-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #1e293b !important;
}

.blog-hero-description {
    font-size: 1.2rem;
    color: #475569 !important;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-weight: 500;
}

/* Blog Search */
.blog-search {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-form {
    position: relative;
}

.search-input-group {
    display: flex;
    background: #ffffff;
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #1e293b;
    font-size: 1rem;
}

.search-input::placeholder {
    color: #475569;
    font-weight: 500;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    padding: 15px 20px;
    border: none;
    background: #2563eb;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
}

.search-btn:hover {
    background: #1d4ed8;
    color: white;
}

.search-icon {
    font-size: 1.1rem;
}

/* Filtros Rápidos */
.quick-filters {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.filter-group label {
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 180px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: #2563eb;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select option {
    background: #1e293b;
    color: white;
    padding: 8px;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #ffffff;
    color: #1e293b;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-fast);
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-clear {
    color: #2563eb;
    text-decoration: underline;
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-clear:hover {
    color: #1d4ed8;
}

/* Blog Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 60px;
    margin: 60px 0;
}

.blog-content {
    min-width: 0; /* Prevent grid overflow */
}

/* Posts Grid */
.posts-grid {
    display: grid;
    gap: 40px;
    margin-bottom: 60px;
}

/* Post Card */
.post-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-featured {
    border: 2px solid var(--primary-color);
}

.featured-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.featured-icon {
    font-size: 0.9rem;
}

/* Post Image */
.post-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

/* Overlay para hover */
.post-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.post-card:hover .post-image-overlay {
    opacity: 1;
}

.read-more-overlay {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Placeholder para posts sem imagem */
.post-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
}

.placeholder-content {
    text-align: center;
    color: white;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 1;
}

.placeholder-text {
    font-size: 1rem;
    font-weight: 600;
    opacity: 1;
}

/* Post Content */
.post-content {
    padding: 30px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.post-category {
    padding: 4px 12px;
    border-radius: 15px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.post-category:hover {
    opacity: 0.8;
}

.post-date {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.post-reading-time {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.post-title {
    margin-bottom: 15px;
}

.post-title a {
    color: #1e293b;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    transition: color var(--transition-fast);
}

.post-title a:hover {
    color: #2563eb;
}

.post-excerpt {
    color: #334155;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
}

/* Post Footer */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 10px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.post-views,
.post-author {
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.read-more:hover {
    color: #1d4ed8;
    transform: translateX(5px);
}

/* Botões de Compartilhamento */
.share-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #ffffff;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn.whatsapp:hover {
    background: #25d366;
    color: white;
}

.share-btn.linkedin:hover {
    background: #0077b5;
    color: white;
}

.share-btn:not(.whatsapp):not(.linkedin):hover {
    background: #2563eb;
    color: white;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tag {
    color: #475569;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.post-tag:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.post-tag-more {
    font-size: 0.8rem;
    color: #475569;
    font-style: italic;
    font-weight: 500;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
}

.no-posts-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
    color: #64748b;
}

.no-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.no-posts p {
    color: #475569;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 60px 0;
}

.pagination-btn {
    padding: 12px 20px;
    background: #ffffff;
    color: #1e293b;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffffff;
    color: #1e293b;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination-number:hover,
.pagination-number.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.pagination-dots {
    padding: 0 10px;
    color: #475569;
    font-weight: 600;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-fast);
}

.sidebar-widget:hover {
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-description {
    color: #475569;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Newsletter Widget */
.newsletter-form .form-group {
    margin-bottom: 15px;
}

.newsletter-form input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-medium);
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-bottom: 10px;
    background: #ffffff;
    color: #1e293b;
}

.newsletter-form input[type="email"]::placeholder {
    color: #475569;
    font-weight: 500;
}

.newsletter-form .btn {
    width: 100%;
    justify-content: center;
}

.newsletter-terms {
    text-align: center;
    margin-top: 10px;
}

.newsletter-terms small {
    color: #475569;
}

/* Categories Widget */
.categories-list {
    list-style: none;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #1e293b;
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.category-link:hover,
.category-link.active {
    color: #2563eb;
    padding-left: 10px;
}

.category-name {
    font-weight: 600;
}

.category-count {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Popular Posts Widget */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popular-post {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.popular-post:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.popular-title {
    margin-bottom: 8px;
}

.popular-title a {
    color: #1e293b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color var(--transition-fast);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-title a:hover {
    color: #2563eb;
}

.popular-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.popular-category {
    font-weight: 600;
}

.popular-date {
    color: #475569;
    font-weight: 500;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud-item {
    padding: 6px 12px;
    background: #f8fafc;
    color: #475569;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid #e2e8f0;
}

.tag-cloud-item:hover,
.tag-cloud-item.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
}

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: #1e293b !important;
    text-align: center;
    border: 2px solid #2563eb;
}

.cta-widget .widget-title {
    color: #1e293b !important;
}

.cta-widget .widget-description {
    color: #475569 !important;
    font-weight: 500;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .sidebar-widget {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 100px 0 60px;
    }
    
    .blog-hero-title {
        font-size: 2rem;
    }
    
    .blog-hero-description {
        font-size: 1rem;
    }
    
    .blog-layout {
        margin: 40px 0;
    }
    
    .posts-grid {
        gap: 30px;
        margin-bottom: 40px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-title a {
        font-size: 1.3rem;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .blog-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar-widget {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .search-input-group {
        flex-direction: column;
        border-radius: var(--border-radius);
    }
    
    .search-btn {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .post-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pagination-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .pagination-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* ================================================
   NEWSLETTER STYLES
   ================================================ */

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    border: 2px solid #0891b2;
    color: #0e7490;
}

.newsletter-widget .widget-title {
    color: #0e7490 !important;
    margin-bottom: 10px;
}

.newsletter-widget .widget-description {
    color: #0e7490;
    font-weight: 500;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.newsletter-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input[type="email"] {
    padding: 12px 16px;
    border: 2px solid #0891b2;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #0e7490;
    transition: all 0.3s ease;
    width: 100%;
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: #0e7490;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.newsletter-form input[type="email"]::placeholder {
    color: #67e8f9;
    opacity: 0.8;
}

.newsletter-form .btn {
    padding: 12px 24px;
    background: #0891b2;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.newsletter-form .btn:hover:not(:disabled) {
    background: #0e7490;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.newsletter-form .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.newsletter-form .btn-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.newsletter-terms {
    font-size: 13px;
    color: #0e7490;
    opacity: 0.8;
    text-align: center;
    margin: 0;
}

/* Newsletter Message */
#newsletter-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease;
}

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

/* Success and Error States */
.newsletter-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #16a34a;
}

.newsletter-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #dc2626;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .newsletter-form .form-group {
        gap: 12px;
    }
    
    .newsletter-form input[type="email"],
    .newsletter-form .btn {
        padding: 14px 16px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .newsletter-widget {
        padding: 20px;
    }
}

/* Focus and Accessibility */
.newsletter-form input:focus,
.newsletter-form button:focus {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .newsletter-form .btn,
    #newsletter-message {
        transition: none;
        animation: none;
    }
    
    .newsletter-form .btn:hover {
        transform: none;
    }
}