/* Blog Styles */

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Blog post content styling */
.prose {
    color: #374151;
    max-width: none;
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 2.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #111827;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 2.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.prose h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.75rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.prose p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.prose ul, .prose ol {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    line-height: 1.75;
}

.prose blockquote {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
    padding: 1rem;
    border-radius: 0.375rem;
    font-style: italic;
    color: #7f1d1d;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

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

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

.prose a {
    color: #dc2626;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #b91c1c;
}

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

.prose th {
    background-color: #f9fafb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.prose td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.prose th, .prose td {
    border-right: 1px solid #e5e7eb;
}

.prose th:last-child, .prose td:last-child {
    border-right: none;
}

/* Blog card hover effects */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Search input focus */
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Tag hover effects */
.tag-link {
    transition: all 0.2s ease;
}

.tag-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Pagination styles */
.pagination-link {
    transition: all 0.2s ease;
}

.pagination-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Sidebar link hover */
.sidebar-link {
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    transform: translateX(4px);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .prose h1 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .prose h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    .prose h3 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .prose blockquote {
        padding: 0.75rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .prose img {
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        border-radius: 0;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom scrollbar for blog content */
.blog-content::-webkit-scrollbar {
    width: 6px;
}

.blog-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.blog-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.blog-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Blog sidebar sticky positioning */
.blog-sidebar {
    position: sticky;
    top: 6rem; /* 96px from top to account for navbar */
    height: fit-content;
    max-height: calc(100vh - 8rem); /* Prevent overflow */
    overflow-y: auto; /* Add scroll if needed */
}

.blog-sidebar .sidebar-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.blog-sidebar .sidebar-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-sidebar .sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.blog-sidebar .sidebar-title i {
    margin-right: 0.5rem;
}

/* Blog post cards */
.blog-post-card {
    transition: all 0.3s ease;
}

.blog-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Full width images in blog post cards */
.blog-post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Category chip on image overlay */
.blog-post-card .absolute.top-4.right-4 {
    background: rgba(220, 38, 38, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Line clamp utilities for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Infinite scroll loading states */
#loading-indicator {
    transition: opacity 0.3s ease;
}

#end-of-content {
    color: #6b7280;
    font-style: italic;
}

/* Category chips */
.category-chip {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    margin: 0.25rem;
}

.category-chip:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

.category-chip i {
    margin-right: 0.25rem;
}

/* Tag chips */
.tag-chip {
    background: #eff6ff;
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    margin: 0.25rem;
}

.tag-chip:hover {
    background: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* Coming soon ad banner */
.ad-banner {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ad-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ad-banner .ad-icon {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.ad-banner .ad-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.ad-banner .ad-description {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.ad-banner .ad-placeholder {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    display: inline-block;
}

.ad-banner .ad-placeholder .placeholder-text {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Responsive adjustments for sidebar */
@media (max-width: 1024px) {
    .blog-sidebar {
        position: static;
        margin-top: 2rem;
    }

    .blog-sidebar .sidebar-section {
        margin-bottom: 1rem;
    }
}

/* Hide sidebar on mobile devices */
@media (max-width: 1023px) {
    .blog-sidebar {
        display: none !important;
    }
}

/* Ensure sidebar shows on desktop */
@media (min-width: 1024px) {
    .blog-sidebar {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .blog-sidebar .category-chip,
    .blog-sidebar .tag-chip {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }

    .blog-sidebar .sidebar-section {
        padding: 1rem;
    }
}

/* Recent Posts in Sidebar */
.recent-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.recent-post-item:hover {
    background: #f9fafb;
    border-radius: 0.375rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    transform: translateX(2px);
}

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

.recent-post-image {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f3f4f6;
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-content {
    flex: 1;
    min-width: 0;
}

.recent-post-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.recent-post-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.recent-post-meta i {
    font-size: 0.625rem;
}

/* Print styles */
@media print {
    .prose {
        font-size: 12pt;
        line-height: 1.5;
    }

    .prose h1, .prose h2, .prose h3, .prose h4 {
        page-break-after: avoid;
    }

    .prose img {
        max-width: 100%;
        height: auto;
    }

    nav, footer, .sidebar, .search-bar, .pagination, .social-share {
        display: none !important;
    }
}
