/* =========================================
   Modern Grid Container
   ========================================= */
.blog-over-modern-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

/* Fix overflow for grid items with long content */
.blog-over-modern-grid>* {
    min-width: 0;
}

/* =========================================
   Modern Card Base
   ========================================= */
.blog-over-modern-card {
    margin-bottom: 0;
}

.blog-over-modern-card-inner {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Fix overflow for flex children */
.blog-over-modern-card-inner>* {
    min-width: 0;
}

/* Modern Card Hover: Bold 3D lift with perspective tilt */
.blog-over-modern-card-inner:hover {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.1);
    transform: translateY(-8px) rotateX(2deg);
}

/* =========================================
   Modern Thumbnail with Shine Effect
   ========================================= */
.blog-over-modern-thumbnail {
    position: relative;
    overflow: hidden;
}

.blog-over-modern-thumbnail.fixed-height {
    height: 220px;
}

.blog-over-modern-thumbnail.auto-height img {
    height: auto;
}

.blog-over-modern-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Modern Image: Strong zoom on hover */
.blog-over-modern-card-inner:hover .blog-over-modern-thumbnail img {
    transform: scale(1.12);
}

/* Modern Thumbnail: Shine sweep effect */
.blog-over-modern-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    z-index: 2;
    transition: left 0.6s ease;
    pointer-events: none;
}

.blog-over-modern-card-inner:hover .blog-over-modern-thumbnail::before {
    left: 150%;
}

/* Subtle overlay - removed heavy effect */
.blog-over-modern-overlay {
    display: none;
}

/* Modern Category: Square badge (distinct from Classic's pill) */
.blog-over-modern-category {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-over-modern-category a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: var(--blog-over-secondary, #1e40af);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.blog-over-modern-category a:hover {
    background: var(--blog-over-primary, #3b82f6);
    color: #fff !important;
    transform: scale(1.05);
    text-decoration: none !important;
}

/* Modern Card: Underline animation on hover */
.blog-over-modern-card-inner {
    position: relative;
}

.blog-over-modern-card-inner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blog-over-primary), var(--blog-over-secondary));
    transition: width 0.4s ease;
    border-radius: 3px 3px 0 0;
}

.blog-over-modern-card-inner:hover::after {
    width: 80%;
}

/* Content Container */
.blog-over-modern-content {
    padding: 24px 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

/* =========================================
   Modern Title
   ========================================= */
.blog-over-modern-header {
    margin-bottom: 12px;
}

.blog-over-modern-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

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

.blog-over-modern-title a:hover {
    color: var(--blog-over-primary);
}

/* =========================================
   Modern Meta
   ========================================= */
.blog-over-modern-meta {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.blog-over-modern-meta .blog-over-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #64748b;
}

.blog-over-modern-meta .blog-over-meta-info span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-over-modern-meta .blog-over-meta-info i {
    color: #94a3b8;
    font-size: 0.75rem;
}

.blog-over-modern-meta .blog-over-meta-info a {
    color: #7e7e7e;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-over-modern-meta .blog-over-meta-info a:hover {
    color: var(--blog-over-primary);
}

.blog-over-modern-edit a {
    color: #94a3b8;
    font-size: 12px;
}

.blog-over-modern-edit a:hover {
    color: #3b82f6;
}

/* =========================================
   Modern Excerpt
   ========================================= */
.blog-over-modern-excerpt {
    flex-grow: 1;
    margin-bottom: 20px;
}

.blog-over-modern-excerpt p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
    /* Line-clamp removed - excerpt length controlled by Customizer word count setting */
}

/* =========================================
   Modern Read More
   ========================================= */
.blog-over-modern-footer {
    margin-top: auto;
}

.blog-over-modern-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--blog-over-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.blog-over-modern-readmore:hover {
    background: var(--blog-over-secondary);
    color: #fff !important;
    text-decoration: none !important;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.blog-over-modern-readmore i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.blog-over-modern-readmore:hover i {
    transform: translateX(4px);
}

/* =========================================
   Responsive Styles
   ========================================= */
@media (max-width: 992px) {
    .blog-over-modern-grid {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-over-modern-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .blog-over-modern-thumbnail.fixed-height {
        height: 200px;
    }

    .blog-over-modern-content {
        padding: 20px;
    }

    .blog-over-modern-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .blog-over-modern-grid {
        gap: 20px;
    }

    .blog-over-modern-thumbnail.fixed-height {
        height: 180px;
    }

    .blog-over-modern-content {
        padding: 16px;
    }

    .blog-over-modern-meta {
        gap: 12px;
        font-size: 12px;
    }

    .blog-over-modern-readmore {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   Dark Mode Support
   ========================================= */
body.blog-over-dark-mode .blog-over-modern-card-inner {
    background: #1e293b;
    border-color: #334155;
}

body.blog-over-dark-mode .blog-over-modern-title a {
    color: #f1f5f9;
}

body.blog-over-dark-mode .blog-over-modern-title a:hover {
    color: var(--blog-over-primary);
}

body.blog-over-dark-mode .blog-over-modern-meta {
    color: #94a3b8;
    border-bottom-color: #334155;
}

body.blog-over-dark-mode .blog-over-modern-author a {
    color: #cbd5e1;
}

body.blog-over-dark-mode .blog-over-modern-excerpt p {
    color: #94a3b8;
}

body.blog-over-dark-mode .blog-over-modern-card-inner:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* =========================================
   Masonry Grid Mode
   ========================================= */

/* Override CSS Grid → CSS Columns for masonry */
.blog-over-modern-grid.bo-masonry {
    display: block;
    columns: 3;
    column-gap: 20px;
}

/* Each card: inline-block for column flow + break-inside prevention */
.blog-over-modern-grid.bo-masonry .blog-over-modern-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

/* Natural height — remove equal-height flex constraint */
.blog-over-modern-grid.bo-masonry .blog-over-modern-card-inner {
    height: auto;
}

/* Sidebar: reduce to 2 columns */
.has-sidebar .blog-over-modern-grid.bo-masonry {
    columns: 2;
}

/* =========================================
   Masonry Responsive
   ========================================= */
@media (max-width: 1200px) {
    .blog-over-modern-grid.bo-masonry {
        columns: 3;
    }

    .has-sidebar .blog-over-modern-grid.bo-masonry {
        columns: 2;
    }
}

@media (max-width: 992px) {
    .blog-over-modern-grid.bo-masonry {
        columns: 2;
    }

    .has-sidebar .blog-over-modern-grid.bo-masonry {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .blog-over-modern-grid.bo-masonry {
        columns: 1 !important;
    }
}

/* =========================================
   Masonry Dark Mode
   ========================================= */
body.blog-over-dark-mode .blog-over-modern-grid.bo-masonry .blog-over-modern-card-inner {
    height: auto;
}