.smc-fb-feed,
.smc-fb-feed * {
    box-sizing: border-box;
}

.smc-fb-feed {
    width: 100%;
    background: #fff;
    color: #1c1e21;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid #d9d9d9;
    overflow: hidden;
}

.smc-fb-scroll {
    width: 100%;
    height: var(--smc-fb-feed-height, 520px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #b8b8b8 #f1f1f1;
    background: #f1f2f4;
}

.smc-fb-scroll::-webkit-scrollbar {
    width: 8px;
}

.smc-fb-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.smc-fb-scroll::-webkit-scrollbar-thumb {
    background: #b8b8b8;
    border-radius: 8px;
}

.smc-fb-masonry {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 1px;
    width: 100%;
    background: #e7e7e7;
}

.smc-fb-masonry.is-masonry {
    display: flex;
    gap: 1px;
    align-items: flex-start;
}

.smc-fb-column {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.smc-fb-post {
    background: #fff;
    padding: 16px 16px 14px;
    min-width: 0;
    break-inside: avoid;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.smc-fb-post:hover {
    background: #fdfdfd;
}

.smc-fb-post-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 22px;
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
}

.smc-fb-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.smc-fb-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f319;
    color: #111;
    font-size: 10px;
    font-weight: 800;
}

.smc-fb-post-meta {
    min-width: 0;
    line-height: 1.15;
}

.smc-fb-page-name {
    color: #2b2b2b !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.smc-fb-page-name:hover {
    text-decoration: underline !important;
}

.smc-fb-post-meta time {
    display: block;
    margin-top: 4px;
    color: #777;
    font-size: 11px;
    font-weight: 400;
}

.smc-fb-open {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a3a6aa !important;
    text-decoration: none !important;
}

.smc-fb-open svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.smc-fb-message {
    position: relative;
    color: #2c2f33;
    font-size: 13px;
    line-height: 1.42;
    margin-bottom: 12px;
}

.smc-fb-message-text {
    white-space: normal;
    overflow-wrap: anywhere;
}

.smc-fb-message.is-collapsible:not(.is-expanded) .smc-fb-message-text {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smc-fb-more {
    appearance: none;
    border: 0;
    background: transparent;
    color: #777;
    font: inherit;
    font-size: 12px;
    padding: 3px 0 0;
    cursor: pointer;
}

.smc-fb-more:hover {
    color: #111;
    text-decoration: underline;
}

.smc-fb-media {
    display: grid;
    width: 100%;
    overflow: hidden;
    background: #e8e8e8;
    margin: 0 0 10px;
    text-decoration: none !important;
}

.smc-fb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-width: 0;
}

.smc-fb-media-1 {
    grid-template-columns: 1fr;
}

.smc-fb-media-1 img {
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: #f5f5f5;
}

.smc-fb-media-2 {
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 16 / 9;
}

.smc-fb-media-3,
.smc-fb-media-4 {
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 1 / 1;
}

.smc-fb-media-3 img:first-child {
    grid-row: span 2;
}

.smc-fb-engagement {
    padding: 0 0 10px;
    color: #6c7178;
    font-size: 11px;
}

.smc-fb-counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.smc-fb-reaction-icons {
    display: inline-flex;
    align-items: center;
}

.smc-fb-like,
.smc-fb-heart {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: -3px;
    border: 1px solid #fff;
}

.smc-fb-like {
    background: #1877f2;
}

.smc-fb-heart {
    background: #f55368;
}

.smc-fb-like svg,
.smc-fb-heart svg {
    width: 10px;
    height: 10px;
    fill: #fff;
}

.smc-fb-count-number {
    margin-left: 7px;
}

.smc-fb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #ececec;
    padding-top: 10px;
}

.smc-fb-share,
.smc-fb-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 3px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
}

.smc-fb-share {
    gap: 5px;
    padding: 0 11px;
    color: #65676b !important;
    background: #fff;
    border: 1px solid #dddfe2;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.smc-fb-share svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.smc-fb-view {
    margin-left: auto;
    color: #555 !important;
    padding: 0 4px;
}

.smc-fb-share:hover,
.smc-fb-view:hover {
    color: #111 !important;
}

.smc-fb-footer {
    min-height: 38px;
    background: #272727;
    color: #bfc0c2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    font-size: 11px;
}

.smc-fb-footer a {
    color: #f6f319 !important;
    text-decoration: none !important;
    font-weight: 700;
}

.smc-fb-footer a:hover {
    text-decoration: underline !important;
}

.smc-fb-error {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #c3c4c7;
    background: #fff;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

@media (max-width: 900px) {
    .smc-fb-masonry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .smc-fb-scroll {
        height: min(680px, 78vh);
    }

    .smc-fb-masonry {
        grid-template-columns: 1fr;
    }

    .smc-fb-post {
        padding: 14px;
    }

    .smc-fb-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ==========================================================
   SMC NARROW SIDEBAR FEED
   Matches the slim Elfsight-style rail used beside the calendar.
   ========================================================== */
.smc-fb-sidebar,
.smc-fb-sidebar * {
    box-sizing: border-box;
}

.smc-fb-sidebar {
    width: 100%;
    min-width: 0;
    background: #fff;
    color: #1c1e21;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid #d9d9d9;
    overflow: hidden;
}

.smc-fb-sidebar-scroll {
    width: 100%;
    height: var(--smc-fb-sidebar-height, 520px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #b8b8b8 #f1f1f1;
}

.smc-fb-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.smc-fb-sidebar-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.smc-fb-sidebar-scroll::-webkit-scrollbar-thumb {
    background: #b8b8b8;
    border-radius: 8px;
}

.smc-fb-sidebar-post {
    background: #fff;
    padding: 13px 13px 11px;
    border-bottom: 1px solid #e5e5e5;
    min-width: 0;
}

.smc-fb-sidebar-post:last-child {
    border-bottom: 0;
}

.smc-fb-sidebar-head {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 18px;
    gap: 8px;
    align-items: start;
    margin-bottom: 8px;
}

.smc-fb-sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.smc-fb-sidebar-meta {
    min-width: 0;
    line-height: 1.15;
}

.smc-fb-sidebar-name {
    display: block;
    color: #2b2b2b !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.smc-fb-sidebar-name:hover {
    text-decoration: underline !important;
}

.smc-fb-sidebar-meta time {
    display: block;
    margin-top: 3px;
    color: #7b7f86;
    font-size: 10.5px;
    font-weight: 400;
}

.smc-fb-sidebar-open {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a3a6aa !important;
    text-decoration: none !important;
}

.smc-fb-sidebar-open svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.smc-fb-sidebar-message {
    color: #2c2f33;
    font-size: 12px;
    line-height: 1.45;
    margin: 0 0 10px;
}

.smc-fb-sidebar-message-text {
    overflow-wrap: anywhere;
}

.smc-fb-sidebar-message.is-collapsible:not(.is-expanded) .smc-fb-sidebar-message-text {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smc-fb-sidebar-more {
    display: inline;
    padding-top: 2px;
    font-size: 11px;
    color: #7b7f86;
}

.smc-fb-sidebar-media {
    display: block;
    width: 100%;
    margin: 0 0 9px;
    background: #f0f0f0;
    overflow: hidden;
    text-decoration: none !important;
}

.smc-fb-sidebar-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    background: #f5f5f5;
}

.smc-fb-sidebar-engagement {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #6c7178;
    font-size: 10.5px;
    white-space: nowrap;
}

.smc-fb-sidebar-engagement .smc-fb-like,
.smc-fb-sidebar-engagement .smc-fb-heart {
    width: 16px;
    height: 16px;
}

.smc-fb-sidebar-engagement .smc-fb-like svg,
.smc-fb-sidebar-engagement .smc-fb-heart svg {
    width: 9px;
    height: 9px;
}

.smc-fb-sidebar-engagement .smc-fb-count-number {
    margin-left: 6px;
}

.smc-fb-sidebar-spacer {
    flex: 1 1 auto;
}

@media (max-width: 600px) {
    .smc-fb-sidebar-scroll {
        height: var(--smc-fb-sidebar-height, 520px);
    }
}
