/* ========================================================================
   Blog Posts Feed Shortcode Styles
   Styling for [blog_posts] shortcode
   ======================================================================== */

/* ========================================================================
   Container
   ======================================================================== */
.bf-posts-feed-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.bf-posts-feed {
    display: grid;
    gap: 24px;
}

/* Column variations */
.bf-posts-feed-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bf-posts-feed-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bf-posts-feed-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================================================
   Post Item
   ======================================================================== */
.bf-posts-feed-item {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(126, 217, 87, 0.2);
}

.bf-posts-feed-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--bf-color-primary, #7ed957);
}

.bf-posts-feed-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.bf-posts-feed-link:hover {
    text-decoration: none;
    color: inherit;
}

/* ========================================================================
   Image
   ======================================================================== */
.bf-posts-feed-image {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
}

.bf-posts-feed-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bf-posts-feed-item:hover .bf-posts-feed-image img {
    transform: scale(1.05);
}

/* Placeholder for posts without images */
.bf-posts-feed-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(126, 217, 87, 0.1), rgba(0, 0, 0, 0.6));
}

.bf-posts-feed-image-placeholder svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    color: rgba(126, 217, 87, 0.4);
}

/* ========================================================================
   Content
   ======================================================================== */
.bf-posts-feed-content {
    padding: 16px;
}

/* Category badge */
.bf-posts-feed-category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bf-color-primary, #7ed957);
    color: #000000;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Title */
.bf-posts-feed-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bf-posts-feed-item:hover .bf-posts-feed-title {
    color: var(--bf-color-primary, #7ed957);
}

/* Excerpt */
.bf-posts-feed-excerpt {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #aaaaaa;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Date */
.bf-posts-feed-date {
    display: block;
    font-size: 12px;
    color: #888888;
}

/* ========================================================================
   Load More Button
   ======================================================================== */
.bf-posts-feed-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.bf-posts-feed-load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: transparent;
    color: #7ed957;
    border: 2px solid #7ed957;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bf-posts-feed-load-more:hover,
.bf-posts-feed-load-more:focus {
    background: #7ed957;
    color: #000000;
}

.bf-posts-feed-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bf-load-more-spinner svg {
    display: block;
}

/* ========================================================================
   Empty State
   ======================================================================== */
.bf-posts-feed-empty {
    text-align: center;
    color: #888888;
    font-size: 16px;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px dashed rgba(126, 217, 87, 0.3);
}

/* ========================================================================
   Responsive - Tablets
   ======================================================================== */
@media (max-width: 992px) {
    .bf-posts-feed-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .bf-posts-feed-wrapper {
        padding: 15px 0;
    }

    .bf-posts-feed {
        gap: 16px;
    }

    .bf-posts-feed-cols-3,
    .bf-posts-feed-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .bf-posts-feed-title {
        font-size: 14px;
    }

    .bf-posts-feed-content {
        padding: 12px;
    }
}

/* ========================================================================
   Responsive - Mobile
   ======================================================================== */
@media (max-width: 480px) {
    .bf-posts-feed-cols-2,
    .bf-posts-feed-cols-3,
    .bf-posts-feed-cols-4 {
        grid-template-columns: 1fr;
    }

    .bf-posts-feed-item {
        display: flex;
        flex-direction: row;
    }

    .bf-posts-feed-link {
        display: flex;
        width: 100%;
    }

    .bf-posts-feed-image {
        width: 120px;
        min-width: 120px;
        padding-bottom: 0;
        height: auto;
        aspect-ratio: 1;
    }

    .bf-posts-feed-image-placeholder svg {
        width: 32px;
        height: 32px;
    }

    .bf-posts-feed-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 12px;
    }

    .bf-posts-feed-category {
        font-size: 10px;
        padding: 3px 8px;
        margin-bottom: 6px;
    }

    .bf-posts-feed-title {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .bf-posts-feed-date {
        font-size: 11px;
    }

    .bf-posts-feed-load-more {
        padding: 10px 24px;
        font-size: 13px;
    }
}