/* =========================================
   COMMUNITY / FORUM MODULE
   ========================================= */

/* --- Layout Grid --- */
.community-container {
    padding: 120px 20px 20px;
    /* Top padding for navbar */
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    /* Sidebar | Feed | Trending */
    gap: 32px;
    height: 100vh;
    overflow: hidden;
    pointer-events: auto;
}

/* --- Sidebar (Categories) --- */
.sidebar-glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 24px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.category-item:hover,
.category-item.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.category-item i {
    width: 20px;
    text-align: center;
}

/* --- Main Feed --- */
.forum-feed {
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
    /* For scrollbar */
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Hide Scrollbar but keep functionality */
.forum-feed::-webkit-scrollbar {
    width: 6px;
}

.forum-feed::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Post Card */
.forum-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid white;
    border-radius: var(--r-xl);
    padding: 32px;
    /* Increased padding inside the card */
    margin-bottom: 32px;
    /* Added margin as a safeguard */
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.forum-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Featured Tag */
.tag-featured {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-bottom-left-radius: 12px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--blackberry-cream);
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-content h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.post-content p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Trip Route Visual (Mini Map placeholder) */
.post-route-preview {
    background: #f1f3f5;
    border-radius: var(--r-md);
    height: 120px;
    width: 100%;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.post-route-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.post-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.post-tag {
    background: rgba(var(--primary-rgb), 0.05);
    /* Needs RGB var fallback or use hex with opacity */
    background: #fff0f6;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.post-actions {
    display: flex;
    gap: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    /* Using blue/grey */
    font-size: 0.9rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--primary);
}

.action-btn.active {
    color: #fa5252;
}

/* --- Right Sidebar (Trending) --- */
.trending-card {
    background: white;
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.trending-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-number {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.trending-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.trending-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Mobile / Responsive --- */
@media (max-width: 1024px) {
    .community-container {
        grid-template-columns: 80px 1fr;
        /* Compact sidebar */
    }

    .sidebar-title,
    .category-item span {
        display: none;
        /* Icon only */
    }

    .right-sidebar {
        display: none;
    }

    .category-item {
        justify-content: center;
    }
}