/* Blog-specific styles */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #7c3aed;
    --dark: #1f2937;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Body adjustments for fixed navigation */
body {
    padding-top: 80px !important;
    background: #f5f7fb !important;
    font-family: 'Inter', sans-serif !important;
    margin: 0 !important;
}

/* Override any conflicting styles from main styles.css for blog pages */
body.blog-page {
    padding-top: 80px !important;
    background: #f5f7fb !important;
}

/* Top Navigation Styling for Blog */
.top-nav {
    background: #fff;
    border-bottom: 1px solid var(--gray-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-main {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding-left: 2rem;
    padding-right: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.blog-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray);
    margin-left: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Ad Space */
.ad-space {
    background: #f8f9fa;
    border: 1px dashed var(--gray-light);
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ad-space:hover {
    background: #f0f2f5;
    border-color: var(--primary-light);
}

.ad-space h4 {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ad-space p {
    color: var(--gray);
    font-size: 0.8rem;
    margin-bottom: 0;
}

.ad-placeholder {
    background: linear-gradient(45deg, #f0f0f0 25%, #e8e8e8 25%, #e8e8e8 50%, #f0f0f0 50%, #f0f0f0 75%, #e8e8e8 75%);
    background-size: 20px 20px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: 500;
    margin-top: 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.blog-layout {
    display: flex;
    width: 100%;
    margin: 0;
    gap: 2rem;
    padding: 1rem;
    align-items: flex-start;
    min-height: calc(100vh - 160px); /* Account for fixed nav bar and body padding */
}

.blog-container {
    flex: 1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.blog-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%), 
                linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%), 
                linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
    opacity: 0.3;
}

.blog-header h1,
.blog-header .blog-subtitle {
    position: relative;
    z-index: 2;
}

.blog-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.blog-main {
    padding: 2rem;
}

/* Blog post cards */
.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-post-card {
    padding: 2rem;
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #fff;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background: white !important;
}

.post-category {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.post-date {
    color: #6b7280 !important;
}

.post-title {
    margin-bottom: 1rem;
}

.post-title a {
    color: var(--dark);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

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

.post-excerpt {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

.read-time {
    color: var(--gray);
    font-size: 0.9rem;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

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

/* Blog sidebar */
.blog-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-section h3 {
    color: var(--dark);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

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

.category-list li {
    margin-bottom: 0.75rem;
}

.category-list a {
    color: var(--gray);
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
    transition: color 0.2s;
}

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

.cta-box {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.cta-box p {
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.cta-box .btn-primary:hover {
    background: var(--gray-light);
}

/* Individual blog post styles */
.breadcrumb {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--gray-light);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.blog-post {
    padding: 2rem;
    background: white !important;
    color: #1f2937 !important;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    background: white !important;
}

.post-header .post-meta {
    margin-bottom: 1rem;
    background: white !important;
}

.post-header .post-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937 !important;
    margin-bottom: 1rem;
    background: white !important;
}

.post-author {
    color: var(--gray);
    font-style: italic;
}

.read-time {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Post content styling */
.post-content {
    line-height: 1.8;
    color: #1f2937 !important;
    margin-bottom: 2rem;
    background: white !important;
}

.post-content h2 {
    color: #1f2937 !important;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.post-content h3 {
    color: #1f2937 !important;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

.post-content p {
    margin-bottom: 1.5rem;
    color: #1f2937 !important;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    background: var(--gray-light);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.post-content code {
    background: var(--gray-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-content pre {
    background: var(--dark);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Post footer */
.post-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--gray-light);
}

.post-tags {
    margin-bottom: 2rem;
}

.tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-share h4 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.facebook {
    background: #4267b2;
    color: white;
}

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

.share-btn.copy {
    background: var(--gray-light);
    color: var(--dark);
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Related posts */
.related-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-post {
    padding: 1rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    transition: all 0.2s;
}

.related-post:hover {
    background: var(--gray-light);
}

.related-post h4 {
    margin-bottom: 0.5rem;
}

.related-post h4 a {
    color: var(--dark);
    text-decoration: none;
    font-size: 1rem;
}

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

.related-excerpt {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Empty states */
.no-posts,
.coming-soon {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.no-posts h2 {
    color: var(--dark);
    margin-bottom: 1rem;
}

/* Blog footer */
.blog-footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--gray-light);
    margin-top: 3rem;
}

.blog-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 1024px) {
    .blog-layout {
        flex-direction: column;
        padding: 1rem;
    }
    
    .blog-sidebar {
        width: 100%;
    }
    
    .sidebar-section {
        margin-bottom: 1rem;
    }

    .nav-main {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        margin: 0 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 120px; /* More padding for mobile stacked navigation */
    }
    
    .blog-layout {
        margin: 0;
        padding: 0.5rem;
    }
    
    .blog-header {
        padding: 2rem 1rem;
    }
    
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .blog-main,
    .blog-post {
        padding: 1.5rem;
    }

    .nav-main {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0.5rem;
    }

    .nav-links {
        order: 1;
        margin: 0;
        gap: 1rem;
    }

    .nav-logo {
        order: 0;
    }

    .ad-space {
        padding: 1rem;
    }

    .ad-placeholder {
        height: 150px !important;
    }
    
    .blog-post-card {
        padding: 1.5rem;
    }
    
    .post-header .post-title {
        font-size: 1.8rem;
    }
    
    .share-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .blog-header h1 {
        font-size: 1.6rem;
    }
    
    .blog-main,
    .blog-post {
        padding: 1rem;
    }
    
    .blog-post-card {
        padding: 1rem;
    }
    
    .post-header .post-title {
        font-size: 1.5rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .share-buttons {
        width: 100%;
        justify-content: flex-start;
    }
    
    .share-btn {
        flex: 1;
        min-width: 0;
    }
}

/* Search Section Styles */
.search-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-light);
}

.search-form {
    margin-bottom: 1rem;
}

.search-input-group {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-button {
    position: absolute;
    right: 8px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background: #1d4ed8;
}

.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
    margin-top: 1rem;
}

.search-results-info p {
    margin: 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.clear-search {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.clear-search:hover {
    text-decoration: underline;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0 1rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-light);
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.pagination-current {
    padding: 0.5rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.pagination-ellipsis {
    padding: 0.5rem 0.75rem;
    color: var(--gray);
    font-weight: 500;
}

.pagination-info {
    text-align: center;
    margin-bottom: 2rem;
}

.pagination-info p {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
}

/* Mobile responsiveness for search and pagination */
@media (max-width: 768px) {
    .search-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .search-input-group {
        max-width: 100%;
    }
    
    .search-results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .pagination {
        padding: 1rem;
        margin: 1.5rem 0 1rem 0;
    }
    
    .pagination-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
        min-width: 36px;
    }
    
    .pagination-current {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .search-input {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .search-button {
        right: 6px;
        padding: 0.4rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-numbers {
        gap: 0.1rem;
    }
    
    .pagination-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 32px;
    }
    
    .pagination-current {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 32px;
    }
}
