/* ==========================================================================
   Opsim Custom Blog Posts Gutenberg Block Layout & Styles
   ========================================================================== */
.blog-grid-section {
    padding: 60px 0;
    background: transparent;
    box-sizing: border-box;
}

.blog-grid-section .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.blog-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.blog-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.blog-card-image-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #e2e8f0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.blog-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    margin: 0;
}

.blog-card-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.blog-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
    box-sizing: border-box;
}

.blog-card-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 500;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
    font-family: inherit;
}

.blog-card-title a {
    color: #1e293b;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.blog-card-title a:hover {
    color: var(--primary-color, #427A76);
}

.blog-card-excerpt {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-card-excerpt p {
    margin: 0;
    padding: 0;
}

.blog-card-readmore {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color, #427A76);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
    margin-top: auto;
}

.blog-card-readmore:hover {
    transform: translateX(4px);
}

/* Blog Pagination */
.blog-pagination {
    margin-top: 50px;
    text-align: center;
}

.blog-pagination .page-numbers {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
    background: var(--primary-color, #427A76);
    color: #ffffff !important;
    border-color: var(--primary-color, #427A76);
}

.blog-pagination .page-numbers.prev,
.blog-pagination .page-numbers.next {
    width: auto;
    padding: 0 16px;
    border-radius: 30px;
}

/* Hide entry header and page titles dynamically on pages using the dynamic Blog block */
.has-opsim-blog-block .entry-header,
.has-opsim-blog-block .entry-title,
.has-opsim-blog-block .page-header,
.has-opsim-blog-block .page-title,
.has-opsim-blog-block h1.page-title {
    display: none !important;
}
