/**
 * SBC Facebook Feed - Frontend Styles
 */

/* Container principal */
.sbc-fb-feed {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

/* Colonnes */
.sbc-fb-cols-1 { grid-template-columns: 1fr; }
.sbc-fb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sbc-fb-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sbc-fb-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .sbc-fb-cols-4,
    .sbc-fb-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .sbc-fb-cols-4,
    .sbc-fb-cols-3,
    .sbc-fb-cols-2 { grid-template-columns: 1fr; }
}

/* Post individuel */
.sbc-fb-post {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sbc-fb-post:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Image du post */
.sbc-fb-post-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f0f2f5;
}

.sbc-fb-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sbc-fb-post-image:hover img {
    transform: scale(1.05);
}

/* Contenu du post */
.sbc-fb-post-content {
    padding: 16px;
}

/* Message */
.sbc-fb-post-message {
    color: #1c1e21;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sbc-fb-post-message a {
    color: #1877f2;
    text-decoration: none;
}

.sbc-fb-post-message a:hover {
    text-decoration: underline;
}

/* Hashtags */
.sbc-fb-hashtag {
    color: #1877f2 !important;
    font-weight: 500;
}

/* Meta (date, likes, lien) */
.sbc-fb-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #65676b;
    padding-top: 12px;
    border-top: 1px solid #e4e6eb;
}

.sbc-fb-post-date,
.sbc-fb-post-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sbc-fb-icon {
    flex-shrink: 0;
}

.sbc-fb-post-link {
    margin-left: auto;
    color: #1877f2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sbc-fb-post-link:hover {
    color: #145db2;
}

/* Messages d'erreur et vides */
.sbc-fb-error {
    background: #fff3f3;
    border: 1px solid #ffccd5;
    color: #c92a2a;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.sbc-fb-empty {
    background: #f0f2f5;
    color: #65676b;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* Template: Card (variante) */
.sbc-fb-template-card .sbc-fb-post {
    border: 1px solid #e4e6eb;
    box-shadow: none;
}

.sbc-fb-template-card .sbc-fb-post:hover {
    border-color: #1877f2;
    box-shadow: 0 2px 12px rgba(24, 119, 242, 0.15);
}

/* Template: Minimal */
.sbc-fb-template-minimal .sbc-fb-post {
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid #e4e6eb;
    border-radius: 0;
    padding-bottom: 16px;
}

.sbc-fb-template-minimal .sbc-fb-post:last-child {
    border-bottom: none;
}

.sbc-fb-template-minimal .sbc-fb-post:hover {
    transform: none;
    box-shadow: none;
}

.sbc-fb-template-minimal .sbc-fb-post-content {
    padding: 0;
    padding-top: 12px;
}

.sbc-fb-template-minimal .sbc-fb-post-meta {
    border-top: none;
    padding-top: 8px;
}

/* Template: Compact */
.sbc-fb-template-compact .sbc-fb-post {
    display: flex;
    align-items: flex-start;
}

.sbc-fb-template-compact .sbc-fb-post-image {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 1;
}

.sbc-fb-template-compact .sbc-fb-post-content {
    flex: 1;
}

.sbc-fb-template-compact .sbc-fb-post-message {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sbc-fb-post {
        background: #242526;
    }
    
    .sbc-fb-post-message {
        color: #e4e6eb;
    }
    
    .sbc-fb-post-meta {
        color: #b0b3b8;
        border-top-color: #3e4042;
    }
    
    .sbc-fb-empty {
        background: #3a3b3c;
        color: #b0b3b8;
    }
    
    .sbc-fb-template-minimal .sbc-fb-post {
        border-bottom-color: #3e4042;
    }
    
    .sbc-fb-template-card .sbc-fb-post {
        border-color: #3e4042;
    }
}
