/* ─── POST FEED STYLES ─── */

.post-feed-section {
    margin-top: 20px;
}

.post-feed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 4px;
}

.post-feed-item {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.post-feed-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}


/* ─── MEDIA ─── */
.post-feed-media {
    margin: -16px -16px 12px -16px; /* This pulls the media UP */
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.post-feed-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

.post-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.post-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

.post-feed-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* ─── TIME INSIDE VIDEO/IMAGE ─── */
.video-time-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-time-badge i {
    font-size: 11px;
}

/* ─── MUTE BUTTON ─── */
.video-mute-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.2s;
}

.video-mute-btn:hover {
    background: rgba(0,0,0,0.9);
}

.video-views-badge {
    position: absolute;
    bottom: 12px;
    right: 60px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 5;
}

.video-views-badge i {
    margin-right: 4px;
}

/* ─── POST HEADER: Avatar + Username + Badge + Time ─── */
.post-feed-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
    gap: 8px;
    z-index: 2; /* Keeps it on top of media */
    padding: 0 0 10px 0; /* Space below the header */
    /* This pulls the header down so it's not covered by media */
    margin-top: 2px; /* Pushes header down by 16px */
}

.post-author-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.post-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* ─── MENU BUTTON ─── */
.post-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #888;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-top: -4px;
}

.post-menu-btn:hover {
    background: #f0f0f0;
}

.post-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 140px;
    z-index: 10;
    overflow: hidden;
}

.post-menu-dropdown.show {
    display: block;
}

.post-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.post-menu-dropdown button:hover {
    background: #f5f5f5;
}

/* ─── POST TITLE ─── */
.post-title {
    padding: 8px 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

/* ─── ACTIONS ─── */
.post-feed-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.post-feed-actions .act {
    background: none;
    border: none;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.post-feed-actions .act:hover {
    background: #f0f4ff;
    color: #3b82f6;
}

.post-feed-actions .act i {
    font-size: 15px;
}

.post-feed-actions .act .cnt {
    font-size: 12px;
}

/* ─── SHARE ICON ─── */
.share-icon {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    stroke: #555 !important;
    stroke-width: 1.2 !important;
}

.share-icon:hover {
    transform: scale(1.15);
}

/* ─── EMPTY STATE ─── */
.empty-feed {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-feed p {
    font-size: 16px;
}

/* ─── RESPONSIVE: TABLET & DESKTOP (2 COLUMNS) ─── */
@media (min-width: 768px) {
    .post-feed-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .post-feed-item {
        padding: 14px;
    }
    
    .post-author-name {
        font-size: 13px;
    }
}

@media (min-width: 1024px) {
    .post-feed-grid {
        gap: 20px;
    }
    
    .post-feed-item {
        padding: 18px;
    }
    
    .post-author-name {
        font-size: 14px;
    }
}

/* ─── RESPONSIVE: MOBILE (1 COLUMN, FULL WIDTH) ─── */
@media (max-width: 767px) {
    .post-feed-item {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 14px 12px;
    }
    
    .post-feed-grid {
        gap: 0;
        padding: 0;
    }
    
    .post-feed-actions {
        gap: 4px;
    }
    
    .post-feed-actions .act {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .post-author-name {
        font-size: 13px;
    }
    /* ─── AVATAR IMAGE ─── */
    .post-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.post-feed-video {
    /* Force video to be ready */
    will-change: transform;
    /* Prevent layout shifts during loading */
    aspect-ratio: 16/9;
}