/* ==========================================================================
   CannaKompass - News & Feeds Stylesheet
   Modern Glassmorphic 3-Column Design aligned with the Community page
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Sub-Navigation, Filters & Search Bar (Matching Community Page)
   -------------------------------------------------------------------------- */
.news-sub-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

html.dark-mode .news-sub-nav {
    background: rgba(24, 24, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 1px solid rgba(10, 207, 131, 0.35);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.dark-mode .news-sub-nav .search-bar {
    background: rgba(18, 18, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.news-sub-nav .community-filters {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-sub-nav .community-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-tab-btn);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.news-sub-nav .community-filter-pill:hover {
    background: var(--bg-tab-btn-hover);
    color: var(--text-main);
    border-color: rgba(10, 207, 131, 0.4);
    transform: translateY(-1px);
}

.news-sub-nav .community-filter-pill.active {
    background: rgba(10, 207, 131, 0.14);
    border-color: #0acf83;
    color: #0acf83;
    box-shadow: 0 2px 8px rgba(10, 207, 131, 0.2);
}


/* Category Filter Selector inside Search Box */
.search-channel-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(10, 207, 131, 0.12);
    border: 1px solid rgba(10, 207, 131, 0.35);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.search-channel-pill:hover {
    background: rgba(10, 207, 131, 0.2);
    border-color: var(--primary-color);
}

.search-channel-chevron {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   2. News Article Cards (Aligned with .community-post-card)
   -------------------------------------------------------------------------- */
.articles-feed-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-article-card {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
    overflow: hidden;
}

.news-article-card:hover {
    border-color: rgba(10, 207, 131, 0.45);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
}

html.dark-mode .news-article-card {
    background: rgba(24, 24, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.dark-mode .news-article-card:hover {
    border-color: rgba(10, 207, 131, 0.5);
    border-top-color: #34d399;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 16px rgba(10, 207, 131, 0.14);
}

/* Card Header adjustments */
.news-article-card .post-header {
    margin: -22px -24px 18px -24px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.news-article-card .post-header.header-team {
    background: linear-gradient(90deg, rgba(10, 207, 131, 0.09) 0%, rgba(5, 150, 95, 0.02) 45%, transparent 85%);
    border-bottom: 1px solid rgba(10, 207, 131, 0.2);
}

.post-sub-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}

.post-reading-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    color: var(--text-muted);
    background: var(--bg-tab-btn);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.post-reading-pill i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* User Badge Member fallback */
.user-badge.badge-member {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.user-badge.badge-member:hover {
    border-color: rgba(10, 207, 131, 0.45);
    color: var(--primary-color);
    background: rgba(10, 207, 131, 0.08);
}

/* Card Body: Magazine 2-Column Layout */
.news-card-body {
    display: flex;
    align-items: stretch;
    gap: 22px;
    margin-bottom: 18px;
}

.news-image-wrapper {
    flex-shrink: 0;
    width: 320px;
    height: 195px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    background: #181818;
}

.news-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.news-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-article-card:hover .news-image-link img {
    transform: scale(1.06);
}

.news-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.1) 60%, transparent 100%);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    transition: opacity 0.25s ease;
}

.news-article-card:hover .news-image-overlay {
    opacity: 1;
}

.news-overlay-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 207, 131, 0.9);
    color: #121212;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.news-card-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px 0;
}

.news-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title a:hover {
    color: var(--primary-color);
}

.news-excerpt {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Footer */
.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

/* Post Interaction Button (Comments) */
.post-interaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    background: rgba(10, 207, 131, 0.12);
    border: 1px solid rgba(10, 207, 131, 0.35);
    color: #8bc34a;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    text-decoration: none;
    box-shadow: var(--shadow-btn-raised);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    line-height: 1;
    white-space: nowrap;
}

.post-interaction-btn i {
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    color: inherit;
    transition: transform 0.2s ease;
}

.post-interaction-btn:hover {
    background: var(--primary-color);
    color: #121212;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(10, 207, 131, 0.35);
}

.post-interaction-btn:hover i {
    color: #121212;
    transform: scale(1.1);
}

.post-interaction-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Read More Action Button */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    background: rgba(10, 207, 131, 0.12);
    border: 1px solid rgba(10, 207, 131, 0.35);
    color: #8bc34a;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-btn-raised);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-read-more i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.btn-read-more:hover {
    background: var(--primary-color);
    color: #121212;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(10, 207, 131, 0.35);
}

.btn-read-more:hover i {
    transform: translateX(3px);
}

.btn-read-more:active {
    transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   3. Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .news-card-body {
        flex-direction: column;
        gap: 14px;
    }

    .news-image-wrapper {
        width: 100%;
        height: 220px;
    }
}

@media (max-width: 767.98px) {
    .news-sub-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .news-sub-nav .community-search-filter-bar {
        max-width: 100%;
    }

    .news-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .news-card-footer .post-interaction-group {
        justify-content: space-between;
    }

    .btn-read-more {
        justify-content: center;
        width: 100%;
    }
}

/* ==========================================================================
   4. Article Detail View (Preserved & Enhanced)
   ========================================================================== */
.article-detail-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.article-detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.article-detail-back-link:hover {
    color: var(--primary-color);
}

.article-detail-card {
    background: var(--bg-section);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.article-detail-hero {
    width: 100%;
    height: 420px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
}

.category-badge-overlay {
    background: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    color: #121212;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    display: inline-block;
}

.category-badge-overlay:hover {
    background: #09b874;
    color: #121212;
}

.hero-bottom {
    margin-top: auto;
}

.article-detail-title-overlay {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.article-detail-meta-overlay {
    color: #e2e8f0;
    font-size: 0.88rem;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.article-detail-meta-overlay a {
    color: #e2e8f0;
    text-decoration: none;
}

.article-detail-meta-overlay a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.article-detail-body {
    padding: 28px;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-main);
}

.article-detail-body > *:first-child {
    margin-top: 0 !important;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 1.5rem 0;
}
