/* Posts feed page — clean layout under site header */
.posts-feed-layout .main-content {
    min-height: calc(100vh - var(--fb-topbar-height, 118px));
    padding-bottom: 72px;
}

.posts-feed-page {
    background: #f0f2f5;
    min-height: calc(100vh - var(--fb-topbar-height, 118px));
    padding-bottom: 72px;
    position: relative;
    z-index: 1;
}

.posts-feed-toolbar {
    position: relative;
    z-index: 1;
    background: #f0f2f5;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px 12px;
}

.posts-feed-toolbar__inner {
    max-width: 680px;
    margin: 0 auto;
}

.posts-feed-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 8px 6px 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

.posts-feed-search__input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: .9rem;
    color: #1e293b;
    min-width: 0;
    padding: 6px 0;
    outline: none;
}

.posts-feed-search__input::placeholder { color: #94a3b8; }

.posts-feed-search__icon {
    color: #94a3b8;
    font-size: .95rem;
    flex-shrink: 0;
}

.posts-feed-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease;
}

.posts-feed-filter-btn:hover { background: #e2e8f0; }

.posts-feed-filters {
    display: none;
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.posts-feed-filters.is-open { display: block; }

.posts-feed-filters__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 576px) {
    .posts-feed-filters__grid { grid-template-columns: repeat(4, 1fr); }
}

.posts-feed-filters select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: .82rem;
    color: #334155;
    background: #f8fafc;
}

.posts-feed-filters__apply {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding: 9px 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #5b6ee8, #7c4fbd);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
}

.posts-feed-tabs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
}

.posts-feed-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}

.posts-feed-tab i { font-size: .85rem; }

.posts-feed-tab.is-active {
    background: linear-gradient(135deg, #5b6ee8, #7c4fbd);
    color: #fff;
    box-shadow: 0 2px 8px rgba(91, 110, 232, .28);
}

.posts-feed-tab:not(.is-active):hover {
    background: #f1f5f9;
    color: #334155;
}

.posts-feed-meta {
    margin-top: 8px;
    font-size: .78rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

.posts-feed-body {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding: 12px;
    z-index: 1;
    scroll-margin-top: var(--fb-topbar-height, 118px);
}

#posts-container {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    min-height: 200px;
    position: relative;
    z-index: 1;
}

.posts-feed-body .posts-list {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
    position: relative;
    z-index: 1;
}

.posts-feed-body .post-card,
.posts-feed-body .posts-card,
.posts-feed-body .bg-white.rounded-lg.shadow-sm,
.posts-feed-body .posts-card-fallback {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 14px !important;
    border: 1px solid #e8ecf1 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05) !important;
    margin-bottom: 0 !important;
    background: #fff !important;
    overflow: hidden;
    color: #1e293b !important;
    min-height: 72px;
}

/* Full-width media — edge to edge inside card (Facebook-style) */
.posts-card__media {
    width: 100%;
    margin: 0;
    line-height: 0;
    background: #f1f5f9;
}

.posts-card__media-link {
    display: block;
    width: 100%;
}

.posts-card__img {
    width: 100%;
    height: auto;
    max-height: min(75vh, 680px);
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0;
    background: #f1f5f9;
}

.posts-card__head {
    padding-bottom: .5rem !important;
}

.posts-card__body {
    padding-top: .5rem !important;
}

.posts-card__embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 220px;
    background: #0f172a;
}

.posts-card__embed iframe,
.posts-card__embed video,
.posts-card__embed embed {
    width: 100% !important;
    height: 100% !important;
    min-height: 220px;
    border: 0;
    display: block;
}

.posts-card-fallback {
    padding: 14px 16px;
}

.posts-card-fallback__header {
    font-size: .85rem;
    color: #475569;
    margin-bottom: 8px;
}

.posts-card-fallback__body h3 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

.posts-card-fallback__body a {
    color: #1e293b;
    text-decoration: none;
}

.posts-card-fallback__body a:hover {
    color: #5b6ee8;
}

.posts-empty-state {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    color: #64748b;
}

.posts-empty-state h3 {
    margin: 0 0 8px;
    color: #334155;
    font-size: 1.1rem;
}

.posts-feed-body .post-card .px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.posts-feed-body .post-card .py-3 {
    padding-top: .75rem !important;
    padding-bottom: .75rem !important;
}

.posts-feed-body .post-card .flex {
    display: flex !important;
}

.posts-feed-body .post-card .items-center {
    align-items: center !important;
}

.posts-feed-body .post-card .justify-between {
    justify-content: space-between !important;
}

.posts-feed-loading {
    display: none;
    position: fixed;
    left: 50%;
    top: calc(var(--fb-topbar-height, 118px) + 50%);
    transform: translate(-50%, -50%);
    z-index: 200;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(255, 255, 255, .96);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    text-align: center;
    padding: 24px 28px;
    min-width: 180px;
    pointer-events: none;
}

.posts-feed-loading.is-visible {
    display: flex;
}

.posts-feed-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #5b6ee8;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: postsFeedSpin .7s linear infinite;
}

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

.posts-create-card {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
}

.posts-create-card__link {
    display: block;
    padding: 12px 14px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    color: #64748b;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.posts-create-card__link:hover {
    border-color: #5b6ee8;
    color: #5b6ee8;
}

.posts-create-card__title {
    font-weight: 600;
    font-size: .92rem;
    margin: 0;
}

.posts-create-card__sub {
    font-size: .78rem;
    margin: 4px 0 0;
    opacity: .85;
}

.posts-feed-end {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: .85rem;
}

@media (max-width: 767px) {
    .posts-feed-tab span { display: none; }
    .posts-feed-tab { padding: 10px; }
    .posts-feed-tab.is-active span { display: inline; }
}
