/*!
 * ANKY.AI -- Proprietary License
 * Copyright (c) 2026 ANKY.AI. All rights reserved.
 *
 * This file is part of the Jatin Sethi WordPress theme, designed and built
 * by ANKY.AI (https://anky.ai) exclusively for Jatin Sethi & Co.
 * (https://jatinsethi.com). Redistribution, resale, sublicensing, or listing
 * on any third-party marketplace or public repository is strictly prohibited.
 * Use on any domain other than jatinsethi.com requires a separate written
 * license from ANKY.AI. See LICENSE.txt in the theme root.
 * Contact: licensing@anky.ai
 */

/**
 * Blog Styles - Jatin Sathi WordPress Theme
 *
 * Extracted from:
 *  - frontend/pages/blog.php (listing page styles)
 *  - frontend/pages/blog-post.php (single post styles)
 *
 * Covers blog listing, single post, reading progress, sidebar, and related posts.
 */

/* =========================================================================
 *  1. BLOG HERO SECTION
 * ========================================================================= */

.blog-hero-section {
    padding: 80px 0;
    color: white;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2e335b 0%, #1a1f3a 100%);
}

.blog-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.blog-hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.blog-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* =========================================================================
 *  2. FILTER BAR
 * ========================================================================= */

.blog-filter-bar {
    background: white;
    border-radius: 20px;
    padding: 24px 28px;
    margin: -40px auto 48px;
    max-width: 1000px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 2;
}
.blog-filter-bar .field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}
.blog-filter-bar input[type="text"],
.blog-filter-bar select,
.blog-filter-bar .w-input,
.blog-filter-bar .w-select {
    width: 100%;
    box-sizing: border-box;
    display: block;
    margin: 0;
    padding: 0 14px;
    height: 42px;
    line-height: 42px;
    font-size: 14px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    vertical-align: middle;
}
.blog-filter-bar textarea.w-input { line-height: 1.4; padding: 10px 14px; }
.blog-filter-bar input[type="text"]:focus,
.blog-filter-bar select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.blog-filter-bar select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.blog-filter-bar .button {
    height: 42px;
    padding: 0 22px !important;
    font-size: 14px;
    border-radius: 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
}
.blog-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: start;
}
.blog-filter-grid__col { min-width: 0; display: flex; flex-direction: column; }
/* Push the Actions column down so its buttons line up with the OTHER inputs (which sit below labels). */
.blog-filter-grid__col--actions {
    padding-top: 24px; /* label height (12px) + margin-bottom (6px) + label line-height buffer */
}
.blog-filter-grid__col--actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.blog-filter-grid__col--actions .button {
    margin: 0 !important;
}
@media (max-width: 820px) {
    .blog-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
    .blog-filter-grid__col--search,
    .blog-filter-grid__col--actions {
        grid-column: 1 / -1;
    }
}
@media (max-width: 520px) {
    .blog-filter-grid { grid-template-columns: 1fr; }
    .blog-filter-grid__col--search,
    .blog-filter-grid__col--actions {
        grid-column: auto;
    }
}

/* =========================================================================
 *  3. FEATURED POSTS GRID
 * ========================================================================= */

.featured-posts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 80px;
}

.featured-post-main {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 500px;
    background: linear-gradient(45deg, #1e3c72, #2a5298);
}

.featured-posts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.featured-post-secondary {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    min-height: 240px;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

/* =========================================================================
 *  4. BLOG POSTS GRID (listing)
 * ========================================================================= */

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* =========================================================================
 *  5. BLOG POST CARD
 * ========================================================================= */

.blog-post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.blog-post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.blog-post-card img,
.blog-post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.blog-post-image {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

/* Card-inner body padding — scoped so we don't clash with the single-post wrapper. */
.blog-post-card > .blog-post-content {
    padding: 25px;
}

/* Single-post content wrapper — mirrors PHP site's `.blog-post-content` styling. */
.blog-post-hero + .blog-post-content {
    background: #fff;
    border-radius: 20px 20px 0 0;
    margin-top: -20px;
    position: relative;
    z-index: 2;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
}

.blog-post-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #1f2937;
}

.blog-post-title a {
    color: inherit;
    text-decoration: none;
}

.blog-post-excerpt {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 14px;
}

/* =========================================================================
 *  6. CATEGORY TAG
 * ========================================================================= */

.blog-category-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    color: white;
    text-decoration: none;
}

/* =========================================================================
 *  7. POST META
 * ========================================================================= */

.blog-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #6b7280;
    gap: 12px;
}

/* =========================================================================
 *  8. PAGINATION
 * ========================================================================= */

/* ---- Pagination ---- */
.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 48px 0 0;
    padding: 0;
    list-style: none;
}
.blog-pagination ul,
.blog-pagination ul.page-numbers {
    display: contents;
    list-style: none;
    padding: 0;
    margin: 0;
}
.blog-pagination li { list-style: none; margin: 0; padding: 0; }
.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    box-sizing: border-box;
}
.blog-pagination a.page-numbers:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1f2937;
}
.blog-pagination .page-numbers.current {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}
.blog-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    color: #9ca3af;
}
.blog-pagination .pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: inherit;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    width: auto;
    height: auto;
    border-radius: 0;
}

/* ---- No Results ---- */

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f9fafb;
    border: 1px solid #eef1f5;
    border-radius: 16px;
    margin: 20px 0 40px;
}
.search-no-results > div { max-width: 440px; }
.search-no-results__icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    opacity: 0.85;
}
.search-no-results h3 {
    font-size: 1.15rem !important;
    font-weight: 600;
    margin-bottom: 8px !important;
    color: #1f2937;
}
.search-no-results p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 18px !important;
    line-height: 1.5;
}
.search-no-results .button {
    padding: 8px 18px !important;
    font-size: 13.5px !important;
    border-radius: 10px !important;
    height: auto !important;
}

/* =========================================================================
 *  9. SINGLE POST - HERO
 * ========================================================================= */

.blog-post-hero {
    background: #2e335b;
    padding: 80px 0 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.blog-post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* =========================================================================
 *  10. SINGLE POST - CONTENT WRAPPER (2-column layout)
 * ========================================================================= */

.blog-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 50px;
    align-items: start;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 50px;
    align-items: start;
}

/* =========================================================================
 *  11. SINGLE POST - CONTENT BODY (typography)
 * ========================================================================= */

.blog-content-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    max-width: 100%;
}

.blog-content-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin: 40px 0 20px;
    line-height: 1.3;
}

.blog-content-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
    margin: 30px 0 15px;
    line-height: 1.3;
}

.blog-content-body p {
    margin-bottom: 20px;
}

.blog-content-body ul,
.blog-content-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.blog-content-body li {
    margin-bottom: 8px;
}

.blog-content-body blockquote {
    border-left: 4px solid #3b82f6;
    padding: 20px;
    padding-left: 20px;
    margin: 30px 0;
    background: #f8fafc;
    border-radius: 8px;
    font-style: italic;
    color: #4b5563;
}

.blog-content-body a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.blog-content-body a:hover {
    color: #2563eb;
}

.blog-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

.blog-content-body code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #dc2626;
    font-family: 'Courier New', Courier, monospace;
}

.blog-content-body pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

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

/* =========================================================================
 *  12. SINGLE POST - BLOG TAGS
 * ========================================================================= */

.blog-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.blog-tag:hover {
    background: #e5e7eb;
    color: #374151;
}

/* =========================================================================
 *  13. AUTHOR BIO
 * ========================================================================= */

.author-bio {
    background: #f9fafb;
    border-radius: 20px;
    padding: 30px;
    margin: 50px 0;
    border: 1px solid #e5e7eb;
    display: block;
}

.author-flex {
    display: flex;
    align-items: center;
    gap: 20px;
}

.author-skills {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* =========================================================================
 *  14. SOCIAL SHARE SIDEBAR
 * ========================================================================= */

.social-share {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 100px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    border: none;
    cursor: pointer;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* =========================================================================
 *  15. RELATED POSTS
 * ========================================================================= */

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.related-post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* =========================================================================
 *  16. BREADCRUMB NAVIGATION
 * ========================================================================= */

.breadcrumb-nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 12px 24px;
    margin-bottom: 30px;
    display: inline-block;
}

.breadcrumb-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
}

.breadcrumb-nav a:hover {
    color: white;
}

/* =========================================================================
 *  17. READING PROGRESS BAR
 * ========================================================================= */

.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* =========================================================================
 *  18. BLOG META (single post header meta info)
 * ========================================================================= */

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    opacity: 0.9;
    font-size: 1rem;
}

/* =========================================================================
 *  19. RESPONSIVE - 991px
 * ========================================================================= */

@media (max-width: 991px) {
    .blog-content-wrapper,
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .featured-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .social-share {
        position: static;
    }
}

/* =========================================================================
 *  20. RESPONSIVE - 768px
 * ========================================================================= */

@media (max-width: 768px) {
    .blog-hero-section {
        padding: 60px 0;
    }

    .blog-post-hero {
        padding: 60px 0 30px;
    }

    .blog-filter-bar {
        margin: -20px 15px 40px;
        padding: 20px;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .blog-layout {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .social-share {
        position: static !important;
        margin: 30px 0;
        padding: 20px;
        background: #f8fafc;
        border-radius: 15px;
        order: 2;
    }

    .author-bio {
        order: 3;
        margin: 30px 0 !important;
        padding: 20px !important;
    }

    .blog-sidebar {
        order: 4;
    }

    article {
        order: 1;
    }

    /* Blog Header Mobile */
    .blog-post-hero h1 {
        font-size: 2rem !important;
        line-height: 1.3 !important;
        margin-bottom: 25px !important;
        text-align: center !important;
    }

    .breadcrumb-nav {
        display: none !important;
    }

    .blog-category-tag {
        font-size: 0.75rem !important;
        padding: 6px 10px !important;
        margin-right: 8px !important;
        margin-bottom: 8px !important;
    }

    .blog-meta {
        gap: 20px !important;
        font-size: 0.85rem !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        margin-top: 20px !important;
    }

    .blog-meta > div {
        min-width: auto !important;
        text-align: center !important;
        background: rgba(255, 255, 255, 0.1) !important;
        padding: 8px 12px !important;
        border-radius: 20px !important;
        backdrop-filter: blur(10px) !important;
    }

    .author-flex {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }

    .author-skills {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
}

/* =========================================================================
 *  21. RESPONSIVE - 480px
 * ========================================================================= */

@media (max-width: 480px) {
    .blog-post-card img,
    .blog-post-image {
        height: 180px;
    }

    .blog-post-content {
        padding: 18px;
    }

    .blog-post-title {
        font-size: 17px;
    }

    .blog-content-body {
        font-size: 1rem;
        line-height: 1.7;
    }

    .blog-content-body h2 {
        font-size: 1.5rem;
    }

    .blog-content-body h3 {
        font-size: 1.2rem;
    }
}
