/* AI News Archive Styles */
/* Background is now handled by the template with bg-gray-50 class */

/* Article Content Reading Styles */
.prose {
    /* Typography */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #374151; /* gray-700 */
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #111827; /* gray-900 */
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.prose h1 {
    font-size: 2.25rem; /* 36px */
    margin-top: 0;
}

.prose h2 {
    font-size: 1.875rem; /* 30px */
}

.prose h3 {
    font-size: 1.5rem; /* 24px */
}

.prose p {
    color: #374151; /* gray-700 */
    font-size: 1.125rem; /* 18px */
    line-height: 1.7;
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

.prose a {
    color: #2563eb; /* blue-600 */
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.prose a:hover {
    color: #1d4ed8; /* blue-700 */
    border-bottom-color: #2563eb;
}

.prose strong {
    color: #111827; /* gray-900 */
    font-weight: 600;
}

.prose em {
    color: #4b5563; /* gray-600 */
    font-style: italic;
}

.prose blockquote {
    border-left: 4px solid #2563eb; /* blue-600 */
    background-color: #eff6ff; /* blue-50 */
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #374151; /* gray-700 */
    font-style: italic;
}

.prose ul, .prose ol {
    color: #374151; /* gray-700 */
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.prose img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.prose code {
    background-color: #f3f4f6; /* gray-100 */
    color: #dc2626; /* red-600 */
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.prose pre {
    background-color: #1f2937; /* gray-800 */
    color: #f9fafb; /* gray-50 */
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.prose pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prose th, .prose td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
}

.prose th {
    background-color: #f9fafb; /* gray-50 */
    font-weight: 600;
    color: #111827; /* gray-900 */
}

.prose hr {
    border: none;
    height: 1px;
    background-color: #e5e7eb; /* gray-200 */
    margin: 3rem 0;
}

/* Enhanced Reading Experience */
.prose {
    /* Optimal reading width */
    max-width: 65ch; /* 65 characters per line - optimal for reading */
    
    /* Better spacing */
    margin: 0 auto;
    
    /* Smooth scrolling for long content */
    scroll-behavior: smooth;
}

/* Focus mode for better concentration */
.prose p:focus {
    outline: none;
    background-color: #fef3c7; /* yellow-100 */
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

/* Reading progress indicator */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Typography improvements for Portuguese */
.prose {
    /* Better hyphenation for Portuguese */
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    
    /* Better word spacing */
    word-spacing: 0.05em;
    
    /* Better letter spacing for readability */
    letter-spacing: 0.01em;
}

/* Mobile reading optimizations */
@media (max-width: 768px) {
    .prose {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .prose p {
        font-size: 1rem; /* 16px on mobile */
        line-height: 1.6;
    }
    
    .prose h1 {
        font-size: 1.875rem; /* 30px on mobile */
    }
    
    .prose h2 {
        font-size: 1.5rem; /* 24px on mobile */
    }
    
    .prose h3 {
        font-size: 1.25rem; /* 20px on mobile */
    }
}

/* Comments System Styles */
.comment-form {
    background-color: #f9fafb; /* gray-50 */
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb; /* gray-200 */
}

.comment-form textarea {
    min-height: 120px;
    font-family: inherit;
    line-height: 1.6;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    font-family: inherit;
}

.comment-item {
    transition: all 0.2s ease;
}

.comment-item:hover {
    background-color: #fafafa;
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: -0.5rem;
}

.comment-reply {
    background-color: #f3f4f6; /* gray-100 */
    border-left: 3px solid #3b82f6; /* blue-500 */
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-left: 2rem;
}

/* Author Box Styles */
.author-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.author-avatar {
    border: 3px solid #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.author-stats {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

/* Comment Actions */
.comment-actions button {
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.comment-actions button:hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

/* Form Validation */
.comment-form input:invalid,
.comment-form textarea:invalid {
    border-color: #ef4444; /* red-500 */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.comment-form input:valid,
.comment-form textarea:valid {
    border-color: #10b981; /* green-500 */
}

/* Loading States */
.comment-loading {
    opacity: 0.6;
    pointer-events: none;
}

.comment-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success/Error Messages */
.comment-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.comment-message.success {
    background-color: #d1fae5; /* green-100 */
    color: #065f46; /* green-800 */
    border: 1px solid #a7f3d0; /* green-200 */
}

.comment-message.error {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
    border: 1px solid #fecaca; /* red-200 */
}

/* Hero Section */
.ai-news-hero {
    margin-bottom: 2rem;
}

.ai-news-hero-icon {
    width: 4rem;
    height: 4rem;
    background-color: #dbeafe;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-news-hero-icon svg {
    width: 2rem;
    height: 2rem;
    color: #2563eb;
}

.ai-news-hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.ai-news-hero-subtitle {
    color: #6b7280;
    font-size: 1.125rem;
}

/* Category Filter */
.ai-news-filter {
    margin-bottom: 2rem;
}

.ai-news-filter-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 1rem;
}

.ai-news-filter-buttons-container {
    position: relative;
    overflow: hidden;
}

.ai-news-filter-buttons {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 0.5rem;
    /* In mobile, allow horizontal scroll */
    flex-wrap: nowrap;
}

/* Hide scrollbar but keep functionality */
.ai-news-filter-buttons::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Desktop: Allow wrapping */
@media (min-width: 768px) {
    .ai-news-filter-buttons {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

.ai-news-filter-button {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.ai-news-filter-button.active {
    background-color: #2563eb;
    color: #ffffff;
}

.ai-news-filter-button:not(.active) {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #dbeafe;
}

.ai-news-filter-button:not(.active):hover {
    background-color: #eff6ff;
}

/* Call-to-Action Boxes */
.ai-news-cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ai-news-cta-box {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.ai-news-cta-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-news-cta-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #dbeafe;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.ai-news-cta-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #2563eb;
}

.ai-news-cta-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.ai-news-cta-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.ai-news-cta-features {
    margin-bottom: 1rem;
}

.ai-news-cta-feature {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.ai-news-cta-feature svg {
    width: 1rem;
    height: 1rem;
    color: #10b981;
    margin-right: 0.5rem;
}

.ai-news-cta-button {
    width: 100%;
    background-color: #2563eb;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.ai-news-cta-button:hover {
    background-color: #1d4ed8;
}

.ai-news-cta-button-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-news-cta-button-with-icon svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* WhatsApp Button */
.ai-news-whatsapp-button {
    width: 100%;
    border: 1px solid #10b981;
    color: #10b981;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background-color: transparent;
    transition: background-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.ai-news-whatsapp-button:hover {
    background-color: #f0fdf4;
}

.ai-news-whatsapp-button svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Telegram Button */
.ai-news-telegram-button {
    width: 100%;
    border: 1px solid #2563eb;
    color: #2563eb;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background-color: transparent;
    transition: background-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-news-telegram-button:hover {
    background-color: #eff6ff;
}

.ai-news-telegram-button svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* News Section */
.ai-news-section {
    margin-bottom: 2rem;
}

.ai-news-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ai-news-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.ai-news-section-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* News Grid */
.ai-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-news-hero-title {
        font-size: 1.875rem;
    }
    
    .ai-news-cta-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-news-grid {
        grid-template-columns: 1fr;
    }
}

/* Email Input */
.ai-news-email-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.ai-news-email-input:focus {
    outline: none;
    ring: 2px;
    ring-color: #2563eb;
    border-color: transparent;
}
