/* post-card.css */
.post-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin: 8px auto; /* Center horizontally with auto */
    padding: 14px;
    padding-bottom: 10px;
    box-sizing: border-box;
    width: calc(100% - 34px); /* 17px space on each side */
    max-width: 100%;
}
.post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.avatar-circle {
    width: 65px;
    height: 65px;
    min-width: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    border: 1px solid #000;
    cursor: pointer;
    transition: opacity 0.2s;
}
.avatar-circle:hover { opacity: 0.85; }
.post-meta { flex: 1; min-width: 0; }
.where-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: -1px;
}
.where-title {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.where-title:hover { opacity: 0.7; }
.chevron-icon {
    font-size: 12px;
    font-weight: 600;
    color: #8e8e93;
    margin-left: 2px;
}
.where-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.7);
    letter-spacing: 0.2px;
    margin-top: 2px;
    margin-bottom: -2px;
}
.who-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: -4px;
    flex-wrap: wrap;
}
.by-text {
    font-size: 12px;
    font-weight: 600;
    color: #8e8e93;
}
.username-link {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 82, 147, 0.75);
    cursor: pointer;
    padding: 3px 0;
    text-decoration: none;
}
.username-link:hover { opacity: 0.7; }
.ellipsis-btn {
    margin-left: auto;
    padding: 4px 8px;
    cursor: pointer;
    color: #8e8e93;
    font-size: 16px;
}
.ellipsis-btn:hover { color: #000; }
.post-text {
    font-size: 15px;
    line-height: 1.4;
    color: #000;
    margin-top: 8px;
    word-wrap: break-word;
}
.post-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.post-time i {
    font-size: 11px;
    font-weight: 600;
    color: rgba(60, 60, 67, 0.3);
}
.post-time span {
    font-size: 12px;
    color: #8e8e93;
}

/* ===== POST MEDIA - FIXED ===== */
.post-media {
    margin: 8px -14px 4px -14px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    border-radius: 16px;
}

.post-media img,
.post-media video {
    width: 100%;
    display: block;
    border-radius: 16px;
}

/* Desktop: limit height */
@media (min-width: 769px) {
    .post-media {
        max-height: 600px;
    }
    .post-media img,
    .post-media video {
        height: auto;
        max-height: 600px;
        object-fit: cover;
    }
}

/* Tablet */
@media (min-width: 577px) and (max-width: 768px) {
    .post-media {
        max-height: 550px;
    }
    .post-media img,
    .post-media video {
        height: auto;
        max-height: 550px;
        object-fit: cover;
    }
}

/* Mobile: taller images like iOS app */
@media (max-width: 576px) {
    /* Hide scrollbar on mobile */
    html, body {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Opera */
        width: 0;
        height: 0;
    }

    .post-media {
        aspect-ratio: auto !important; /* Override inline aspect-ratio */
        max-height: none !important; /* Remove max-height limit */
    }
    .post-media img {
        width: 100% !important;
        height: auto !important;
        max-height: 80vh !important; /* 80% of viewport height */
        object-fit: contain !important; /* Show full image without cropping */
    }
    .post-media video {
        width: 100% !important;
        height: auto !important;
        max-height: 80vh !important;
        object-fit: contain !important;
    }
}

.post-link {
    margin-top: 8px;
    padding: 12px;
    background: #f5f5f7;
    border-radius: 12px;
    border-left: 4px solid #007AFF;
}
.post-link a {
    font-weight: 600;
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.post-link a:hover { color: #007AFF; }
.post-link i { font-size: 12px; color: #8e8e93; }
.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 4px;
}
.action-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8e8e93;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 4px;
}
.action-btn:hover { color: #007AFF; }
.action-btn i { font-size: 16px; }
.action-btn span { font-size: 13px; font-weight: 500; }
.category-pill {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 14px;
    background: #1a3a5c;
    color: #fff;
    letter-spacing: 0.3px;
}
.edited-text { font-size: 13px; color: #8e8e93; margin-top: 4px; }