/**
 * Blog Override CSS - Force Modern Card Layout
 * This will completely override Astra's default blog layout
 */

/* Hide default Astra blog layout completely and rebuild */
body.blog #primary,
body.archive #primary,
body.page-id-91 #primary {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
}

/* Force grid layout on the article container */
body.blog #main > div,
body.archive #main > div,
body.page-id-91 #main > div,
body.blog .ast-row,
body.archive .ast-row,
body.page-id-91 .ast-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
    gap: 35px !important;
    width: 100% !important;
    max-width: none !important;
}

/* Transform each article into a card */
body.blog article.ast-article-post,
body.archive article.ast-article-post,
body.page-id-91 article.ast-article-post {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.blog article.ast-article-post:hover,
body.archive article.ast-article-post:hover,
body.page-id-91 article.ast-article-post:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12) !important;
}

/* Inner article container */
body.blog .ast-article-inner,
body.archive .ast-article-inner,
body.page-id-91 .ast-article-inner {
    padding: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Featured image styling */
body.blog .ast-blog-featured-section,
body.archive .ast-blog-featured-section,
body.page-id-91 .ast-blog-featured-section {
    margin: 0 !important;
    width: 100% !important;
}

body.blog .post-thumb-img-content,
body.archive .post-thumb-img-content,
body.page-id-91 .post-thumb-img-content {
    height: 220px !important;
    overflow: hidden !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
}

body.blog .post-thumb-img-content img,
body.archive .post-thumb-img-content img,
body.page-id-91 .post-thumb-img-content img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
}

body.blog article:hover .post-thumb-img-content img,
body.archive article:hover .post-thumb-img-content img,
body.page-id-91 article:hover .post-thumb-img-content img {
    transform: scale(1.1) !important;
}

/* Content section */
body.blog .post-content,
body.archive .post-content,
body.page-id-91 .post-content {
    padding: 25px !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Post title */
body.blog .entry-title,
body.archive .entry-title,
body.page-id-91 .entry-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin: 0 0 12px 0 !important;
}

body.blog .entry-title a,
body.archive .entry-title a,
body.page-id-91 .entry-title a {
    color: #2C3E50 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

body.blog .entry-title a:hover,
body.archive .entry-title a:hover,
body.page-id-91 .entry-title a:hover {
    color: #3498DB !important;
}

/* Meta information */
body.blog .ast-blog-meta-container,
body.archive .ast-blog-meta-container,
body.page-id-91 .ast-blog-meta-container {
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.blog .posted-on,
body.blog .byline,
body.archive .posted-on,
body.archive .byline,
body.page-id-91 .posted-on,
body.page-id-91 .byline {
    color: #7F8C8D !important;
    font-size: 13px !important;
}

/* Excerpt */
body.blog .entry-content,
body.archive .entry-content,
body.page-id-91 .entry-content {
    flex-grow: 1 !important;
}

body.blog .entry-content p,
body.archive .entry-content p,
body.page-id-91 .entry-content p {
    color: #5A6C7D !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}

/* Read more link */
body.blog .ast-read-more-link,
body.blog .read-more,
body.archive .ast-read-more-link,
body.archive .read-more,
body.page-id-91 .ast-read-more-link,
body.page-id-91 .read-more {
    color: #3498DB !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
}

body.blog .ast-read-more-link:after,
body.blog .read-more:after,
body.archive .ast-read-more-link:after,
body.archive .read-more:after,
body.page-id-91 .ast-read-more-link:after,
body.page-id-91 .read-more:after {
    content: ' →' !important;
    margin-left: 5px !important;
    transition: margin-left 0.3s ease !important;
}

body.blog .ast-read-more-link:hover,
body.blog .read-more:hover,
body.archive .ast-read-more-link:hover,
body.archive .read-more:hover,
body.page-id-91 .ast-read-more-link:hover,
body.page-id-91 .read-more:hover {
    color: #2C3E50 !important;
}

body.blog .ast-read-more-link:hover:after,
body.blog .read-more:hover:after,
body.archive .ast-read-more-link:hover:after,
body.archive .read-more:hover:after,
body.page-id-91 .ast-read-more-link:hover:after,
body.page-id-91 .read-more:hover:after {
    margin-left: 10px !important;
}

/* Category/Tags */
body.blog .cat-links,
body.blog .tags-links,
body.archive .cat-links,
body.archive .tags-links,
body.page-id-91 .cat-links,
body.page-id-91 .tags-links {
    margin-top: auto !important;
    padding-top: 15px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.blog .cat-links a,
body.blog .tags-links a,
body.archive .cat-links a,
body.archive .tags-links a,
body.page-id-91 .cat-links a,
body.page-id-91 .tags-links a {
    display: inline-block !important;
    background: #F8F9FA !important;
    color: #5A6C7D !important;
    padding: 4px 12px !important;
    border-radius: 15px !important;
    font-size: 12px !important;
    margin-right: 8px !important;
    margin-bottom: 8px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

body.blog .cat-links a:hover,
body.blog .tags-links a:hover,
body.archive .cat-links a:hover,
body.archive .tags-links a:hover,
body.page-id-91 .cat-links a:hover,
body.page-id-91 .tags-links a:hover {
    background: #3498DB !important;
    color: #FFFFFF !important;
    transform: translateY(-2px) !important;
}

/* Pagination styling */
body.blog .ast-pagination,
body.archive .ast-pagination,
body.page-id-91 .ast-pagination {
    margin-top: 50px !important;
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    grid-column: 1 / -1 !important;
}

body.blog .ast-pagination .page-numbers,
body.archive .ast-pagination .page-numbers,
body.page-id-91 .ast-pagination .page-numbers {
    display: inline-block !important;
    padding: 10px 16px !important;
    background: #FFFFFF !important;
    color: #5A6C7D !important;
    border: 1px solid #E1E8ED !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

body.blog .ast-pagination .page-numbers:hover,
body.archive .ast-pagination .page-numbers:hover,
body.page-id-91 .ast-pagination .page-numbers:hover {
    background: #3498DB !important;
    color: #FFFFFF !important;
    border-color: #3498DB !important;
    transform: translateY(-2px) !important;
}

body.blog .ast-pagination .current,
body.archive .ast-pagination .current,
body.page-id-91 .ast-pagination .current {
    background: #2C3E50 !important;
    color: #FFFFFF !important;
    border-color: #2C3E50 !important;
}

/* Responsive design */
@media (max-width: 1024px) {
    body.blog #main > div,
    body.archive #main > div,
    body.page-id-91 #main > div,
    body.blog .ast-row,
    body.archive .ast-row,
    body.page-id-91 .ast-row {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
        gap: 25px !important;
    }
}

@media (max-width: 768px) {
    body.blog #main > div,
    body.archive #main > div,
    body.page-id-91 #main > div,
    body.blog .ast-row,
    body.archive .ast-row,
    body.page-id-91 .ast-row {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    body.blog #primary,
    body.archive #primary,
    body.page-id-91 #primary {
        padding: 20px 15px !important;
    }
}

/* Add decorative gradient line on top of each card */
body.blog article.ast-article-post::before,
body.archive article.ast-article-post::before,
body.page-id-91 article.ast-article-post::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #3498DB, #2C3E50) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

body.blog article.ast-article-post:hover::before,
body.archive article.ast-article-post:hover::before,
body.page-id-91 article.ast-article-post:hover::before {
    opacity: 1 !important;
}

/* Make sure cards maintain aspect ratio */
body.blog article.ast-article-post,
body.archive article.ast-article-post,
body.page-id-91 article.ast-article-post {
    min-height: 450px !important;
}

/* Animation on load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.blog article.ast-article-post,
body.archive article.ast-article-post,
body.page-id-91 article.ast-article-post {
    animation: fadeInUp 0.5s ease-out backwards !important;
}

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