.post-masonry-wrapper-081d4065 {
    --columns: 3;
    --gap: 15px;
    display: block;
    column-count: var(--columns);
    column-gap: var(--gap);
    width: 100%;
}

.post-masonry-item {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: var(--gap);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    background: #1e293b;
    box-sizing: border-box;
    break-inside: avoid;
    background-size: cover;
    background-position: center;
}

.post-masonry-item.has-bg {
    min-height: 280px;
    height: auto;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Stagger heights for authentic masonry grid columns */
.post-masonry-item:nth-child(2n) {
    min-height: 380px;
}
.post-masonry-item:nth-child(3n) {
    min-height: 440px;
}
.post-masonry-item:nth-child(4n) {
    min-height: 320px;
}

/* Override Preview Card 2 and Preview Card 6 to match the widget height (480px) */
.post-masonry-item:nth-child(2),
.post-masonry-item:nth-child(6) {
    min-height: 480px;
}

.post-masonry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.15) 100%);
    z-index: 1;
    display: none;
    transition: opacity 0.3s ease;
}

.post-masonry-item.has-bg .post-masonry-overlay {
    display: block;
}

.post-masonry-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.post-masonry-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-masonry-card-content {
    position: relative;
    padding: 24px;
    box-sizing: border-box;
    z-index: 2;
}

.post-masonry-meta {
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-top: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    opacity: 0.9;
}

.post-masonry-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-masonry-comments .comment-icon {
    font-size: 0.9rem;
}

.post-masonry-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.35;
    font-weight: 600;
}

.post-masonry-title a {
    text-decoration: none;
    color: #ffffff;
    transition: color 0.2s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.post-masonry-title a:hover {
    color: #cbd5e1;
}

.post-masonry-excerpt {
    margin: 10px 0 0 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Tablet & Mobile responsive fallback overrides */
@media (max-width: 1024px) {
    .post-masonry-wrapper-081d4065 {
        column-count: 2;
    }
}

@media (max-width: 767px) {
    .post-masonry-wrapper-081d4065 {
        column-count: 1;
    }
    .post-masonry-item.has-bg {
        min-height: 250px;
    }
}
