/* ============================================================
   BLOG PAGE — Professional Magazine Layout
   freecalculatortool.com / Astra Child Theme
   Add to bottom of style.css OR paste into:
   Appearance → Customize → Additional CSS
   ============================================================ */

/* ---- BLOG PAGE HERO BANNER ---- */
.blog .ast-archive-description,
.category-blog .ast-archive-description,
.blog .page-header,
.category-blog .page-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%) !important;
    padding: 56px 40px !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    position: relative;
    overflow: hidden;
}

.blog .ast-archive-description::before,
.category-blog .ast-archive-description::before {
    content: '✍️';
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    opacity: 0.15;
}

.blog .ast-archive-description h1,
.category-blog .ast-archive-description h1,
.blog .page-title,
.category-blog .page-title {
    color: #ffffff !important;
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 10px !important;
}

.blog .ast-archive-description p,
.category-blog .ast-archive-description p {
    color: rgba(255,255,255,0.7) !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
}

/* ---- BLOG LAYOUT WRAPPER ---- */
.blog #primary,
.category-blog #primary,
.blog .site-main,
.category-blog .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px !important;
}

/* ---- POSTS GRID CONTAINER ---- */
.blog #primary .ast-row,
.category-blog #primary .ast-row,
.blog .posts-container,
.category-blog .posts-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 28px !important;
    float: none !important;
    width: 100% !important;
}

/* ---- INDIVIDUAL POST CARD ---- */
.blog .ast-article-post,
.category-blog .ast-article-post,
.blog article.type-post,
.category-blog article.type-post {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

.blog article.type-post:hover,
.category-blog article.type-post:hover {
    box-shadow: 0 12px 36px rgba(37,99,235,0.12) !important;
    transform: translateY(-4px) !important;
    border-color: #bfdbfe !important;
}

/* ---- POST THUMBNAIL ---- */
.blog article.type-post .ast-blog-featured-section,
.category-blog article.type-post .ast-blog-featured-section,
.blog article.type-post .post-thumb,
.category-blog article.type-post .post-thumb {
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 16px 16px 0 0 !important;
    aspect-ratio: 16 / 9 !important;
    background: #f1f5f9;
}

.blog article.type-post .ast-blog-featured-section img,
.category-blog article.type-post .ast-blog-featured-section img,
.blog article.type-post .post-thumb img,
.category-blog article.type-post .post-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
    display: block !important;
}

.blog article.type-post:hover .ast-blog-featured-section img,
.category-blog article.type-post:hover .ast-blog-featured-section img {
    transform: scale(1.04) !important;
}

/* Placeholder for posts without image */
.blog article.type-post .ast-blog-featured-section:empty,
.blog article.type-post:not(:has(.ast-blog-featured-section)) .ast-article-inner::before {
    content: '📝';
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    height: 200px;
    border-radius: 16px 16px 0 0;
}

/* ---- POST CONTENT AREA ---- */
.blog article.type-post .ast-blog-summary-wrap,
.category-blog article.type-post .ast-blog-summary-wrap,
.blog article.type-post .entry-content-wrap,
.category-blog article.type-post .entry-content-wrap {
    padding: 24px 28px 28px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* ---- POST META (category + date) ---- */
.blog article.type-post .entry-meta,
.category-blog article.type-post .entry-meta,
.blog article.type-post .ast-blog-single-element.ast-meta-single,
.category-blog article.type-post .ast-blog-single-element.ast-meta-single {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-bottom: 12px !important;
}

.blog article.type-post .entry-meta .cat-links a,
.category-blog article.type-post .entry-meta .cat-links a,
.blog .ast-blog-single-element.ast-meta-single .cat-links a {
    display: inline-block !important;
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    border-radius: 50px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    text-decoration: none !important;
}

.blog article.type-post .entry-meta .posted-on,
.category-blog article.type-post .entry-meta .posted-on,
.blog .ast-blog-single-element.ast-meta-single .posted-on {
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
}

.blog article.type-post .entry-meta .byline,
.blog .ast-blog-single-element.ast-meta-single .byline {
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
}

/* ---- POST TITLE ---- */
.blog article.type-post .entry-title,
.category-blog article.type-post .entry-title,
.blog article.type-post h2.ast-blog-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 12px !important;
    color: #0f172a !important;
}

.blog article.type-post .entry-title a,
.category-blog article.type-post .entry-title a,
.blog article.type-post h2.ast-blog-title a {
    color: #0f172a !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.blog article.type-post .entry-title a:hover,
.category-blog article.type-post .entry-title a:hover {
    color: #2563eb !important;
}

/* ---- POST EXCERPT ---- */
.blog article.type-post .ast-excerpt,
.category-blog article.type-post .ast-excerpt,
.blog article.type-post .entry-summary,
.category-blog article.type-post .entry-summary,
.blog article.type-post p {
    font-size: 0.9rem !important;
    color: #64748b !important;
    line-height: 1.7 !important;
    margin-bottom: 20px !important;
    flex: 1 !important;
    /* Clamp to 3 lines */
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ---- READ MORE BUTTON ---- */
.blog article.type-post .ast-continue-reading,
.category-blog article.type-post .ast-continue-reading,
.blog article.type-post .read-more-container,
.category-blog article.type-post .read-more-container {
    margin-top: auto !important;
}

.blog article.type-post .ast-continue-reading a,
.category-blog article.type-post .ast-continue-reading a,
.blog article.type-post a.more-link,
.category-blog article.type-post a.more-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #2563eb !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    font-family: 'Space Grotesk', sans-serif !important;
    text-decoration: none !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transition: gap 0.2s ease, color 0.2s ease !important;
}

.blog article.type-post .ast-continue-reading a::after,
.blog article.type-post a.more-link::after {
    content: '→';
    transition: transform 0.2s ease;
}

.blog article.type-post .ast-continue-reading a:hover,
.blog article.type-post a.more-link:hover {
    color: #1d4ed8 !important;
    gap: 10px !important;
}

/* ---- FIRST POST — FEATURED LARGE CARD ---- */
.blog article.type-post:first-of-type,
.category-blog article.type-post:first-of-type {
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    max-height: 340px !important;
}

.blog article.type-post:first-of-type .ast-blog-featured-section,
.category-blog article.type-post:first-of-type .ast-blog-featured-section {
    width: 50% !important;
    flex-shrink: 0 !important;
    border-radius: 16px 0 0 16px !important;
    aspect-ratio: unset !important;
    min-height: 340px !important;
}

.blog article.type-post:first-of-type .ast-blog-summary-wrap,
.category-blog article.type-post:first-of-type .ast-blog-summary-wrap {
    padding: 36px 36px !important;
    justify-content: center !important;
}

.blog article.type-post:first-of-type .entry-title,
.category-blog article.type-post:first-of-type .entry-title {
    font-size: 1.6rem !important;
}

.blog article.type-post:first-of-type::before {
    content: 'Featured';
    position: absolute;
    top: 16px;
    left: 16px;
    background: #2563eb;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 2;
}

.blog article.type-post:first-of-type {
    position: relative !important;
}

/* ---- PAGINATION ---- */
.blog .ast-pagination,
.category-blog .ast-pagination,
.blog .pagination,
.category-blog .pagination,
.blog .nav-links,
.category-blog .nav-links {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 48px !important;
    padding-top: 32px !important;
    border-top: 1px solid #e2e8f0 !important;
}

.blog .nav-links .page-numbers,
.category-blog .nav-links .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    color: #374151 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    background: #fff !important;
}

.blog .nav-links .page-numbers:hover,
.category-blog .nav-links .page-numbers:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

.blog .nav-links .page-numbers.current,
.category-blog .nav-links .page-numbers.current {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

/* ---- SIDEBAR HIDE (make blog full width) ---- */
.blog #secondary,
.category-blog #secondary {
    display: none !important;
}

.blog #primary,
.category-blog #primary {
    width: 100% !important;
    max-width: 1200px !important;
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 768px) {
    .blog article.type-post:first-of-type,
    .category-blog article.type-post:first-of-type {
        flex-direction: column !important;
        max-height: none !important;
        grid-column: auto !important;
    }

    .blog article.type-post:first-of-type .ast-blog-featured-section,
    .category-blog article.type-post:first-of-type .ast-blog-featured-section {
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        min-height: 220px !important;
    }

    .blog #primary .ast-row,
    .category-blog #primary .ast-row {
        grid-template-columns: 1fr !important;
    }

    .blog .ast-archive-description,
    .category-blog .ast-archive-description {
        padding: 36px 24px !important;
    }
}
