/* News homepage layout — member & public announcements */
.news-home-page {
    padding-bottom: 2rem;
}

.public-announcements-page.news-home-page {
    padding: 2.5rem 0 3.5rem;
    background: linear-gradient(180deg, #f0f4f8 0%, #fff 160px);
}

.news-home-page .news-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.1rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8edf2;
    box-shadow: 0 2px 8px rgba(0, 71, 171, 0.06);
}

.news-home-page .news-toolbar .feed-count {
    margin: 0;
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
}

.news-home-page .news-toolbar .feed-count strong {
    color: #0047ab;
    font-size: 1.1rem;
}

.news-home-page .news-toolbar .feed-sort {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.news-home-page .news-toolbar .feed-sort i {
    color: #1eb53a;
}

.news-home-page .news-up-to-date {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.news-home-page .news-up-to-date i {
    color: #1eb53a;
}

/* Main layout: feed + sidebar */
.member-news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
}

.member-news-main {
    min-width: 0;
}

/* Lead / featured story */
.news-lead-story {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(0, 71, 171, 0.12);
    border: 1px solid #e8edf2;
    margin-bottom: 1.75rem;
    position: relative;
    scroll-margin-top: 1rem;
}

.news-lead-story::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #1eb53a 0%, #0047ab 100%);
}

.news-lead-story__inner {
    padding: 1.75rem 1.75rem 1.5rem;
}

.news-lead-story__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #1eb53a, #17a2b8);
    color: #fff;
    margin-bottom: 0.85rem;
}

.news-lead-story__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.news-lead-story__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.news-lead-story__meta i {
    color: #0047ab;
    font-size: 0.8rem;
}

.news-lead-story__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #1a2b3c;
    line-height: 1.25;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.news-lead-story__content {
    color: #495057;
    font-size: 1rem;
    line-height: 1.8;
    position: relative;
}

.news-lead-story__content p {
    margin: 0 0 1rem;
}

.news-lead-story__content p:last-child {
    margin-bottom: 0;
}

.news-lead-story__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    background: #f8fafc;
    border-top: 1px solid #e8edf2;
}

/* Article feed cards */
.member-news-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-article-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8edf2;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    scroll-margin-top: 1rem;
}

.news-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 71, 171, 0.1);
}

.news-article-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(0, 71, 171, 0.04), rgba(30, 181, 58, 0.04));
    border-bottom: 1px solid #eef2f6;
}

.news-article-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0047ab, #1a5fbf);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.news-article-card__icon i {
    color: #fff;
    font-size: 1rem;
}

.news-article-card__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.news-article-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.news-article-card__meta i {
    color: #0047ab;
    font-size: 0.75rem;
}

.news-article-card__body {
    padding: 1.25rem 1.25rem 1rem;
}

.news-article-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a2b3c;
    margin: 0 0 0.85rem;
    line-height: 1.35;
}

.news-article-card__content {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.75;
    position: relative;
}

.news-article-card__content p {
    margin: 0 0 0.85rem;
}

.news-article-card__footer {
    padding: 0.85rem 1.25rem 1.1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    border-top: 1px solid #eef2f6;
    background: #fafbfc;
}

/* Sidebar — elevated & prominent */
.member-news-sidebar {
    position: sticky;
    top: 1rem;
}

.member-news-sidebar::before {
    content: "";
    position: absolute;
    inset: -6px -6px -6px 0;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(0, 71, 171, 0.12), rgba(30, 181, 58, 0.1));
    z-index: 0;
    pointer-events: none;
}

.news-sidebar-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    border: 2px solid rgba(0, 71, 171, 0.15);
    border-left: 5px solid #1eb53a;
    box-shadow:
        0 10px 40px rgba(0, 71, 171, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.news-sidebar-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem;
    background: linear-gradient(135deg, #003d94 0%, #0047ab 40%, #1a5fbf 70%, #159c32 100%);
    color: #fff;
}

.news-sidebar-card__header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.news-sidebar-card__header-text {
    flex: 1;
    min-width: 0;
}

.news-sidebar-card__header-text h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.news-sidebar-card__header-text p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    opacity: 0.88;
}

.news-sidebar-card__count {
    flex-shrink: 0;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.news-headlines-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    max-height: 560px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.news-headlines-list li {
    border-bottom: 1px solid #e8edf2;
}

.news-headlines-list li:last-child {
    border-bottom: none;
}

.news-headline-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.news-headline-link:hover,
.news-headline-link:focus {
    background: rgba(0, 71, 171, 0.07);
    text-decoration: none;
    color: inherit;
}

.news-headline-link.is-active {
    background: linear-gradient(90deg, rgba(30, 181, 58, 0.12), rgba(0, 71, 171, 0.04));
    border-left: 4px solid #1eb53a;
    padding-left: calc(1rem - 4px);
}

.news-headline-link__index {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    background: #e8edf2;
    color: #0047ab;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.news-headline-link:hover .news-headline-link__index,
.news-headline-link.is-active .news-headline-link__index {
    background: #0047ab;
    color: #fff;
}

.news-headline-link--featured .news-headline-link__index {
    background: linear-gradient(135deg, #1eb53a, #17a2b8);
    color: #fff;
}

.news-headline-link__body {
    flex: 1;
    min-width: 0;
}

.news-headline-link__date {
    display: block;
    font-size: 0.68rem;
    color: #6c757d;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.news-headline-link__title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a2b3c;
    line-height: 1.4;
}

.news-headline-link--featured .news-headline-link__title {
    color: #0047ab;
    font-weight: 700;
}

.news-headline-link__tag {
    flex-shrink: 0;
    align-self: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #1eb53a, #17a2b8);
    color: #fff;
}

/* Shared content + read more */
.news-home-page .announcement-preview {
    transition: max-height 0.35s ease;
}

.news-home-page .announcement-preview.has-more {
    position: relative;
}

.news-home-page .announcement-fade-overlay {
    position: absolute;
    bottom: 48px;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.97));
    pointer-events: none;
    z-index: 1;
}

.news-lead-story .announcement-fade-overlay {
    bottom: 52px;
}

.news-home-page .btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #0047ab, #1a5fbf);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 0.5rem;
}

.news-home-page .btn-read-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 71, 171, 0.25);
}

.news-home-page .btn-read-more.active {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.news-home-page .read-more-icon {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
}

.news-home-page .btn-read-more.active .read-more-icon {
    transform: rotate(180deg);
}

/* Audience badges */
.news-audience-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.news-badge--member {
    background: linear-gradient(135deg, #1eb53a, #17a2b8);
    color: #fff;
}

.news-badge--public {
    background: linear-gradient(135deg, #0047ab, #1a5fbf);
    color: #fff;
}

/* Empty state */
.news-home-page .news-empty-state {
    background: #fff;
    border-radius: 16px;
    padding: 3.5rem 2rem;
    text-align: center;
    border: 1px solid #e8edf2;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.news-home-page .news-empty-state__icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2f6, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-home-page .news-empty-state__icon i {
    font-size: 2.25rem;
    color: #6c757d;
}

.news-home-page .news-empty-state h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2b3c;
    margin: 0 0 0.65rem;
}

.news-home-page .news-empty-state p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

/* Rich text inside articles */
.news-home-page .announcement-preview img,
.news-home-page .news-lead-story__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.news-home-page .announcement-preview a,
.news-home-page .news-lead-story__content a {
    color: #0047ab;
    font-weight: 500;
}

.news-home-page .announcement-preview blockquote,
.news-home-page .news-lead-story__content blockquote {
    border-left: 4px solid #1eb53a;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #6c757d;
    font-style: italic;
}

/* Public hero (used by PublicAnnouncement) */
.public-hero-announcements {
    background-image: linear-gradient(rgba(0, 40, 85, 0.72), rgba(0, 40, 85, 0.72)),
        url('/assets/img/Flag-of-Tanzania.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
}

.public-hero-announcements h1 {
    color: #fff !important;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.public-hero-announcements p {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    margin: 0 auto;
    max-width: 36rem;
}

/* Responsive */
@media (max-width: 1100px) {
    .member-news-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .member-news-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .member-news-sidebar {
        position: static;
        order: -1;
    }

    .member-news-sidebar::before {
        inset: -4px;
    }

    .news-headlines-list {
        max-height: none;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 0;
        padding: 0;
    }

    .news-headlines-list li {
        border-bottom: none;
        border-right: 1px solid #e8edf2;
    }

    .news-sidebar-card__header-text p {
        display: none;
    }
}

@media (max-width: 768px) {
    .public-announcements-page.news-home-page {
        padding: 1.75rem 0 2.5rem;
    }

    .news-home-page .news-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-lead-story__inner {
        padding: 1.25rem 1.15rem 1rem;
    }

    .news-lead-story__footer {
        padding: 0.85rem 1.15rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .news-article-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-article-card__meta {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
    }

    .news-article-card__body {
        padding: 1rem 1.15rem 0.85rem;
    }

    .news-article-card__title {
        font-size: 1.1rem;
    }

    .news-home-page .btn-read-more {
        width: 100%;
        justify-content: center;
    }

    .news-headlines-list {
        grid-template-columns: 1fr;
    }

    .news-headlines-list li {
        border-right: none;
        border-bottom: 1px solid #e8edf2;
    }
}

@media (max-width: 576px) {
    .news-lead-story__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .news-article-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-sidebar-card__header {
        padding: 0.95rem 1rem;
    }
}

/* Back-compat alias */
.member-news-page {
    padding-bottom: 2rem;
}
