/* Related Posts Elementor Widget - Frontend Styles */

/* Grid */
.rpew-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* List Layout */
.rpew-layout-list {
    grid-template-columns: 1fr !important;
}
.rpew-layout-list .rpew-post-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.rpew-layout-list .rpew-post-thumbnail {
    flex: 0 0 260px;
    max-width: 260px;
    height: auto !important;
    min-height: 180px;
    border-radius: 0;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.rpew-layout-list .rpew-post-content {
    flex: 1;
}

/* Masonry Layout */
.rpew-layout-masonry {
    display: block;
    column-count: 3;
    column-gap: 24px;
}
.rpew-layout-masonry .rpew-post-card {
    break-inside: avoid;
    margin-bottom: 24px;
    display: block;
}

/* Card */
.rpew-post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 300ms ease, transform 300ms ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}
.rpew-post-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
    transform: translateY(-4px);
}

/* Thumbnail - background-image based */
.rpew-post-thumbnail {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    display: block;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #dde0e8;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 400ms ease;
}
.rpew-post-card:hover .rpew-post-thumbnail {
    transform: scale(1.04);
}

/* Overlay on hover */
.rpew-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}
.rpew-post-card:hover .rpew-overlay {
    opacity: 1;
}

/* Content area */
.rpew-post-content {
    padding: 16px 18px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Title */
.rpew-post-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
}
.rpew-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 220ms ease;
}
.rpew-post-title a:hover {
    color: #5B2EFF;
}

/* Excerpt */
.rpew-post-excerpt {
    color: #555555;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 12px;
}

/* Footer row: [Category] [icon Date] ............... [Read More >] */
/* Footer: single row - [Category] [Date] ......... [Read More >] */
.rpew-post-footer {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: auto;
    padding-top: 6px;
    min-width: 0;
}

/* Meta group - left side, does NOT grow to fill, stays tight */
.rpew-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

/* Category text */
.rpew-meta-category {
    font-size: 12px;
    font-weight: 500;
    color: #555555;
    text-decoration: none;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    transition: color 200ms ease;
}
.rpew-meta-category:hover {
    color: #5B2EFF;
}

/* Date / Author / Comments meta items */
.rpew-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-size: 13px;
    color: #666666;
    flex-shrink: 0;
}
.rpew-meta-icon {
    font-size: 13px !important;
    color: #5B2EFF;
    line-height: 1 !important;
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0;
}

/* Read More - always on far right, same row as category */
.rpew-read-more {
    display: inline-flex;
    align-items: center;
    color: #5B2EFF;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 8px;
    transition: color 200ms ease;
}
.rpew-read-more:hover {
    color: #3a1fd8;
}

/* Section heading */
.rpew-section-heading {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    color: #111827;
}

/* No posts */
.rpew-no-posts {
    color: #888888;
    font-style: italic;
}

/* No thumbnail placeholder */
.rpew-post-thumbnail.rpew-no-thumb {
    background-color: #eff1f5;
}

/* Responsive */
@media (max-width: 1024px) {
    .rpew-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .rpew-layout-masonry {
        column-count: 2;
    }
    .rpew-layout-list .rpew-post-thumbnail {
        flex: 0 0 200px;
        max-width: 200px;
    }
}
@media (max-width: 767px) {
    .rpew-grid {
        grid-template-columns: 1fr;
    }
    .rpew-layout-masonry {
        column-count: 1;
    }
    .rpew-layout-list .rpew-post-card {
        flex-direction: column;
    }
    .rpew-layout-list .rpew-post-thumbnail {
        flex: unset;
        max-width: 100%;
        height: 200px !important;
        border-radius: 12px 12px 0 0;
    }
    .rpew-post-thumbnail {
        height: 200px;
    }
}
