/* Facebook Feed Shortcode Styles */
.bn-facebook-feed {
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bn-facebook-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    align-items: start;
    margin-bottom: 30px;
}

/* Masonry is opt-in via JS (facebook-feed.js adds the class and sets
   grid-row-end spans). Without JS — e.g. in the Elementor editor preview —
   the feed falls back to a regular grid. */
.bn-facebook-posts.bn-masonry {
    grid-auto-rows: 8px;
    row-gap: 0;
}

.bn-facebook-posts.bn-masonry .bn-facebook-post {
    margin-bottom: 24px;
}

.bn-facebook-post {
    background: #fff;
    border: 1px solid #eaebed;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.bn-facebook-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Header: avatar, page name, date, Facebook logo */
.bn-facebook-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.bn-facebook-post-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
}

.bn-facebook-post-avatar img,
.bn-facebook-post-avatar svg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.bn-facebook-post-author {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.bn-facebook-post-author-name {
    font-size: 14px;
    font-weight: 700;
    color: #8a8d91;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bn-facebook-post-date {
    font-size: 12px;
    color: #9aa0a6;
}

.bn-facebook-post-logo {
    flex: 0 0 auto;
    align-self: flex-start;
    line-height: 0;
}

.bn-facebook-post-logo svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: opacity 0.2s ease;
}

.bn-facebook-post-logo:hover svg {
    opacity: 0.8;
}

/* Image */
.bn-facebook-post-image {
    margin-bottom: 12px;
}

.bn-facebook-post-image a {
    display: block;
    line-height: 0;
}

.bn-facebook-post-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Message */
.bn-facebook-post-message {
    margin-bottom: 12px;
}

.bn-facebook-post-message p {
    margin: 0;
    line-height: 1.5;
    color: #545861;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bn-facebook-post-message a {
    color: #9db8c9;
    text-decoration: none;
    word-break: break-all;
}

.bn-facebook-post-message a:hover {
    text-decoration: underline;
}

.bn-facebook-see-more {
    font-size: 12px;
    color: #9aa0a6 !important;
    white-space: nowrap;
}

/* Stats: likes, comments, shares */
.bn-facebook-post-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.bn-facebook-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bn-facebook-stat svg {
    width: 18px;
    height: 18px;
    display: block;
}

.bn-facebook-stat-count {
    font-size: 13px;
    font-weight: 600;
    color: #545861;
}

/* Footer: ellipsis link to the post */
.bn-facebook-post-footer {
    line-height: 0;
}

.bn-facebook-post-more {
    display: inline-block;
    line-height: 0;
}

.bn-facebook-post-more svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: opacity 0.2s ease;
}

.bn-facebook-post-more:hover svg {
    opacity: 0.8;
}

/* Load more */
.bn-facebook-load-more {
    margin-top: 20px;
}

.bn-load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #f0f1f3;
    color: #8a9bb0;
    border: none;
    border-radius: 6px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bn-load-more-btn:hover {
    background: #e6e8eb;
}

.bn-load-more-btn:disabled {
    color: #b7bcc4;
    cursor: not-allowed;
}

.bn-load-more-dots {
    font-size: 13px;
    letter-spacing: 1px;
    line-height: 1;
}

.bn-facebook-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
    font-size: 16px;
}

.bn-facebook-no-posts p {
    margin: 0;
}

/* Loading state */
.bn-facebook-feed.loading .bn-load-more-btn {
    position: relative;
    color: transparent;
}

.bn-facebook-feed.loading .bn-load-more-btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #8a9bb0;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .bn-facebook-posts {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bn-facebook-posts.bn-masonry {
        row-gap: 0;
    }

    .bn-facebook-posts.bn-masonry .bn-facebook-post {
        margin-bottom: 16px;
    }

    .bn-facebook-post {
        padding: 12px;
    }
}
