/**
 * Blog Listing Page - Professional Modern Design
 * Premium blog grid with card-based layout and smooth interactions
 */

/* ============================================
   BLOG HERO SECTION
   ============================================ */
.blog .page-header,
.archive.category .page-header,
.archive.tag .page-header,
.page-id-91 .page-header {
    background: linear-gradient(135deg, #2C3E50 0%, #3498DB 100%);
    padding: 80px 20px;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog .page-header::before,
.archive.category .page-header::before,
.archive.tag .page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.blog .page-title,
.archive.category .page-title,
.archive.tag .page-title {
    color: #FFFFFF !important;
    font-size: clamp(36px, 5vw, 54px);
    font-weight: 700;
    margin: 0 0 20px 0;
    position: relative;
    z-index: 1;
}

.blog .archive-description,
.archive.category .archive-description,
.archive.tag .archive-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================
   BLOG CONTAINER & GRID - OVERRIDE ASTRA
   ============================================ */
.blog .site-main,
.archive.category .site-main,
.archive.tag .site-main,
.page-id-91 .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Override Astra's blog layout */
.blog .ast-row,
.archive.category .ast-row,
.archive.tag .ast-row,
.page-id-91 .ast-row,
.ast-blog-layout-4-grid .ast-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 40px !important;
    margin: 0 !important;
    flex-wrap: unset !important;
    flex-flow: unset !important;
}

/* ============================================
   BLOG CARD DESIGN - OVERRIDE ASTRA
   ============================================ */
.blog .ast-article-post,
.archive.category .ast-article-post,
.archive.tag .ast-article-post,
.page-id-91 .ast-article-post,
.ast-blog-layout-4-grid .ast-article-post {
    background: #FFFFFF !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    background-color: #FFFFFF !important;
}

.blog .ast-article-post:hover,
.archive.category .ast-article-post:hover,
.archive.tag .ast-article-post:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    border-color: #3498DB;
}

/* Featured Image Container */
.blog .post-thumb-img-content,
.archive.category .post-thumb-img-content,
.archive.tag .post-thumb-img-content {
    position: relative;
    overflow: hidden;
    height: 240px;
    background: linear-gradient(135deg, #E8F4F8 0%, #D1E7DD 100%);
}

.blog .post-thumb-img-content img,
.archive.category .post-thumb-img-content img,
.archive.tag .post-thumb-img-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog .ast-article-post:hover .post-thumb-img-content img,
.archive.category .ast-article-post:hover .post-thumb-img-content img,
.archive.tag .ast-article-post:hover .post-thumb-img-content img {
    transform: scale(1.15);
}

/* Category Badge */
.blog .ast-blog-featured-section::after,
.archive.category .ast-blog-featured-section::after,
.archive.tag .ast-blog-featured-section::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #F39C12, #E74C3C);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Content Area */
.blog .ast-article-inner,
.archive.category .ast-article-inner,
.archive.tag .ast-article-inner {
    padding: 30px !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    box-shadow: none !important;
}

/* Post Title */
.blog .entry-title,
.archive.category .entry-title,
.archive.tag .entry-title {
    font-size: 24px !important;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #2C3E50;
    transition: color 0.3s ease;
}

.blog .entry-title a,
.archive.category .entry-title a,
.archive.tag .entry-title a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(to right, #3498DB 0%, #3498DB 100%);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
}

.blog .entry-title a:hover,
.archive.category .entry-title a:hover,
.archive.tag .entry-title a:hover {
    color: #3498DB;
    background-size: 100% 2px;
}

/* Meta Information */
.blog .ast-blog-meta-container,
.archive.category .ast-blog-meta-container,
.archive.tag .ast-blog-meta-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.blog .posted-on,
.archive.category .posted-on,
.archive.tag .posted-on {
    color: #7F8C8D;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog .posted-on::before,
.archive.category .posted-on::before,
.archive.tag .posted-on::before {
    content: '📅';
    font-size: 16px;
}

.blog .byline,
.archive.category .byline,
.archive.tag .byline {
    color: #7F8C8D;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog .byline::before,
.archive.category .byline::before,
.archive.tag .byline::before {
    content: '✍️';
    font-size: 16px;
}

/* Excerpt */
.blog .entry-content p,
.archive.category .entry-content p,
.archive.tag .entry-content p {
    color: #5A6C7D;
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 25px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read More Button */
.blog .read-more,
.archive.category .read-more,
.archive.tag .read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498DB;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

.blog .read-more::after,
.archive.category .read-more::after,
.archive.tag .read-more::after {
    content: '→';
    font-size: 20px;
    transition: transform 0.3s ease;
}

.blog .read-more:hover,
.archive.category .read-more:hover,
.archive.tag .read-more:hover {
    color: #2C3E50;
    gap: 12px;
}

.blog .read-more:hover::after,
.archive.category .read-more:hover::after,
.archive.tag .read-more:hover::after {
    transform: translateX(5px);
}

/* ============================================
   CATEGORY/TAG BADGES
   ============================================ */
.blog .cat-links,
.archive.category .cat-links,
.archive.tag .cat-links,
.blog .tags-links,
.archive.category .tags-links,
.archive.tag .tags-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.blog .cat-links a,
.archive.category .cat-links a,
.archive.tag .cat-links a,
.blog .tags-links a,
.archive.category .tags-links a,
.archive.tag .tags-links a {
    display: inline-block;
    background: #F8F9FA;
    color: #5A6C7D;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin: 0 5px 10px 0;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.blog .cat-links a:hover,
.archive.category .cat-links a:hover,
.archive.tag .cat-links a:hover,
.blog .tags-links a:hover,
.archive.category .tags-links a:hover,
.archive.tag .tags-links a:hover {
    background: #3498DB;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* ============================================
   PAGINATION
   ============================================ */
.blog .ast-pagination,
.archive.category .ast-pagination,
.archive.tag .ast-pagination {
    margin: 60px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.blog .ast-pagination .page-numbers,
.archive.category .ast-pagination .page-numbers,
.archive.tag .ast-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    background: #FFFFFF;
    color: #5A6C7D;
    border: 2px solid #E1E8ED;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0 15px;
}

.blog .ast-pagination .page-numbers:hover,
.archive.category .ast-pagination .page-numbers:hover,
.archive.tag .ast-pagination .page-numbers:hover {
    background: #3498DB;
    color: #FFFFFF;
    border-color: #3498DB;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.blog .ast-pagination .page-numbers.current,
.archive.category .ast-pagination .page-numbers.current,
.archive.tag .ast-pagination .page-numbers.current {
    background: linear-gradient(135deg, #3498DB, #2C3E50);
    color: #FFFFFF;
    border-color: transparent;
}

.blog .ast-pagination .next,
.archive.category .ast-pagination .next,
.archive.tag .ast-pagination .next,
.blog .ast-pagination .prev,
.archive.category .ast-pagination .prev,
.archive.tag .ast-pagination .prev {
    font-weight: 500;
    padding: 0 20px;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog .ast-article-post,
.archive.category .ast-article-post,
.archive.tag .ast-article-post {
    animation: fadeInUp 0.6s ease-out backwards;
}

.blog .ast-article-post:nth-child(1) { animation-delay: 0.1s; }
.blog .ast-article-post:nth-child(2) { animation-delay: 0.2s; }
.blog .ast-article-post:nth-child(3) { animation-delay: 0.3s; }
.blog .ast-article-post:nth-child(4) { animation-delay: 0.4s; }
.blog .ast-article-post:nth-child(5) { animation-delay: 0.5s; }
.blog .ast-article-post:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.blog.ast-right-sidebar #primary,
.archive.category.ast-right-sidebar #primary,
.archive.tag.ast-right-sidebar #primary {
    width: 100%;
    padding-right: 40px;
}

.blog #secondary,
.archive.category #secondary,
.archive.tag #secondary {
    padding: 40px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
}

.blog #secondary .widget,
.archive.category #secondary .widget,
.archive.tag #secondary .widget {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.blog #secondary .widget:last-child,
.archive.category #secondary .widget:last-child,
.archive.tag #secondary .widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.blog #secondary .widget-title,
.archive.category #secondary .widget-title,
.archive.tag #secondary .widget-title {
    font-size: 20px;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.blog #secondary .widget-title::after,
.archive.category #secondary .widget-title::after,
.archive.tag #secondary .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #3498DB, #F39C12);
    border-radius: 2px;
}

/* ============================================
   NO SIDEBAR ADJUSTMENTS
   ============================================ */
.blog.ast-no-sidebar .ast-row,
.archive.category.ast-no-sidebar .ast-row,
.archive.tag.ast-no-sidebar .ast-row {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 50px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .blog .ast-row,
    .archive.category .ast-row,
    .archive.tag .ast-row {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .blog .page-header,
    .archive.category .page-header,
    .archive.tag .page-header {
        padding: 60px 20px;
        margin-bottom: 40px;
    }

    .blog .ast-row,
    .archive.category .ast-row,
    .archive.tag .ast-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .blog .ast-article-inner,
    .archive.category .ast-article-inner,
    .archive.tag .ast-article-inner {
        padding: 25px !important;
    }

    .blog .entry-title,
    .archive.category .entry-title,
    .archive.tag .entry-title {
        font-size: 20px !important;
    }

    .blog .ast-pagination,
    .archive.category .ast-pagination,
    .archive.tag .ast-pagination {
        flex-wrap: wrap;
    }

    .blog.ast-right-sidebar #primary,
    .archive.category.ast-right-sidebar #primary,
    .archive.tag.ast-right-sidebar #primary {
        padding-right: 0;
    }

    .blog #secondary,
    .archive.category #secondary,
    .archive.tag #secondary {
        margin-top: 40px;
        position: relative;
        top: 0;
    }
}

@media (max-width: 544px) {
    .blog .ast-row,
    .archive.category .ast-row,
    .archive.tag .ast-row {
        padding: 0 15px;
    }

    .blog .ast-article-inner,
    .archive.category .ast-article-inner,
    .archive.tag .ast-article-inner {
        padding: 20px !important;
    }

    .blog .post-thumb-img-content,
    .archive.category .post-thumb-img-content,
    .archive.tag .post-thumb-img-content {
        height: 200px;
    }

    .blog .ast-pagination .page-numbers,
    .archive.category .ast-pagination .page-numbers,
    .archive.tag .ast-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */
.blog .ast-article-post:focus-within,
.archive.category .ast-article-post:focus-within,
.archive.tag .ast-article-post:focus-within {
    outline: 3px solid #3498DB;
    outline-offset: 4px;
}

.blog a:focus,
.archive.category a:focus,
.archive.tag a:focus {
    outline: 2px dotted #3498DB;
    outline-offset: 2px;
}

/* ============================================
   FEATURED POST HIGHLIGHT
   ============================================ */
.blog .ast-article-post:first-child,
.archive.category .ast-article-post:first-child,
.archive.tag .ast-article-post:first-child {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .blog .ast-article-post:first-child,
    .archive.category .ast-article-post:first-child,
    .archive.tag .ast-article-post:first-child {
        grid-column: span 1;
    }
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.blog .ast-article-post.loading,
.archive.category .ast-article-post.loading,
.archive.tag .ast-article-post.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */
.blog .ast-article-post::before,
.archive.category .ast-article-post::before,
.archive.tag .ast-article-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498DB, #F39C12, #E74C3C);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.blog .ast-article-post:hover::before,
.archive.category .ast-article-post:hover::before,
.archive.tag .ast-article-post:hover::before {
    transform: scaleX(1);
}