/* =============================================================
   Sayiwe Microfinance — Blog / Financial Literacy & Insights
   Uses the brand tokens declared in main.css :root
   (--primary-color #b1095e, --secondary-color #8eda32, Poppins)
   ============================================================= */

.blog-page {
    background-color: #fbfbfd;
}

/* Shared container (blog pages don't load about.css) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Active nav underline (mirrors about.css) */
.nav-links a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* -------------------------------------------------------------
   Hero
   ------------------------------------------------------------- */
.blog-hero {
    background: linear-gradient(135deg, rgba(177, 9, 94, 0.92) 0%, rgba(122, 6, 66, 0.92) 100%),
        radial-gradient(circle at 80% 20%, rgba(142, 218, 50, 0.35), transparent 55%);
    color: #fff;
    padding: 7rem 1rem 4rem;
    text-align: center;
}

.blog-hero-content {
    max-width: 820px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-hero p {
    font-size: 1.15rem;
    line-height: 1.7;
    opacity: 0.95;
}

/* Search bar */
.blog-search {
    margin: 2rem auto 0;
    max-width: 560px;
    display: flex;
    background: #fff;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.blog-search input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    color: #333;
}

.blog-search button {
    border: none;
    background: var(--secondary-color);
    color: #fff;
    padding: 0 1.6rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.blog-search button:hover {
    background: #7ac72d;
}

/* -------------------------------------------------------------
   Category strip / pills
   ------------------------------------------------------------- */
.category-strip {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow);
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 30px;
    background: #f4f4f7;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.category-pill i {
    color: var(--primary-color);
    transition: var(--transition);
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.category-pill:hover i,
.category-pill.active i {
    color: #fff;
}

.category-pill .count {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 0 0.5rem;
    font-size: 0.75rem;
}

.category-pill:hover .count,
.category-pill.active .count {
    background: rgba(255, 255, 255, 0.25);
}

/* -------------------------------------------------------------
   Section headings
   ------------------------------------------------------------- */
.blog-section {
    padding: 3.5rem 0;
}

.blog-section.alt {
    background: #fff;
}

.section-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.section-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-head-row h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-head-row h2 i {
    color: var(--secondary-color);
}

.view-all-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.view-all-link:hover {
    color: var(--secondary-color);
}

/* -------------------------------------------------------------
   Featured article
   ------------------------------------------------------------- */
.featured-article {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.featured-article:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.featured-article-img {
    position: relative;
    min-height: 340px;
    background-size: cover;
    background-position: center;
}

.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--secondary-color);
    color: #fff;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-article-body {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-article-body .article-category {
    margin-bottom: 0.75rem;
}

.featured-article-body h2 {
    font-size: 1.9rem;
    color: var(--dark-color);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.featured-article-body p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------
   Article cards grid
   ------------------------------------------------------------- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

.article-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.article-card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.article-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.article-category:hover {
    color: var(--secondary-color);
}

.article-card-body h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.article-card-body h3 a {
    color: inherit;
    text-decoration: none;
}

.article-card-body h3 a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.read-more-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.read-more-btn i {
    transition: transform 0.2s ease;
}

.read-more-btn:hover {
    color: var(--secondary-color);
}

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

/* -------------------------------------------------------------
   Empty state
   ------------------------------------------------------------- */
.blog-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-light);
}

.blog-empty i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.blog-empty h3 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* -------------------------------------------------------------
   Category page header
   ------------------------------------------------------------- */
.category-header {
    background: linear-gradient(135deg, rgba(177, 9, 94, 0.92) 0%, rgba(122, 6, 66, 0.92) 100%);
    color: #fff;
    padding: 6.5rem 1rem 3.5rem;
    text-align: center;
}

.category-header .breadcrumb {
    justify-content: center;
    margin-bottom: 1rem;
}

.category-header i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.category-header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.75rem;
}

.category-header p {
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
    opacity: 0.95;
}

/* -------------------------------------------------------------
   Breadcrumbs
   ------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb a {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
}

.breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

.breadcrumb .sep {
    opacity: 0.5;
}

.breadcrumb .current {
    font-weight: 600;
}

/* Breadcrumb inside a light article page */
.article-breadcrumb {
    background: #f4f4f7;
    padding: 1rem 0;
}

.article-breadcrumb .breadcrumb {
    color: var(--text-color);
}

.article-breadcrumb .breadcrumb a {
    color: var(--primary-color);
}

/* -------------------------------------------------------------
   Pagination
   ------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    background: #fff;
    border: 1px solid #e5e5e5;
    font-weight: 500;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* -------------------------------------------------------------
   Single article page
   ------------------------------------------------------------- */
.article-hero-img {
    width: 100%;
    max-height: 460px;
    height: 46vw;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.article-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.article-header .article-category {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.4rem;
    color: var(--dark-color);
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.article-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-byline .author {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text-color);
}

.article-byline .author .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.article-byline span i {
    color: var(--secondary-color);
    margin-right: 0.3rem;
}

/* Article body typography */
.article-content {
    color: var(--text-color);
    font-size: 1.08rem;
    line-height: 1.85;
}

.article-content h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin: 2.25rem 0 1rem;
}

.article-content h3 {
    color: var(--dark-color);
    font-size: 1.3rem;
    margin: 1.75rem 0 0.75rem;
}

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

.article-content ul,
.article-content ol {
    margin: 0 0 1.35rem 1.5rem;
}

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

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

.article-content blockquote {
    border-left: 4px solid var(--secondary-color);
    background: #f9f9f9;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-color);
    border-radius: 0 8px 8px 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.article-content strong {
    color: var(--dark-color);
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2.5rem 0;
}

.article-tags .tag {
    background: #f4f4f7;
    color: var(--text-color);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    text-decoration: none;
    transition: var(--transition);
}

.article-tags .tag:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Share */
.article-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.article-share span.label {
    font-weight: 600;
    color: var(--text-color);
    margin-right: 0.25rem;
}

.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #000; }
.share-linkedin { background: #0a66c2; }
.share-whatsapp { background: #25d366; }
.share-copy { background: var(--primary-color); }

/* -------------------------------------------------------------
   Call-to-action block
   ------------------------------------------------------------- */
.blog-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7a0642 100%);
    color: #fff;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 3rem 0;
}

.blog-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.blog-cta p {
    max-width: 560px;
    margin: 0 auto 1.75rem;
    line-height: 1.7;
    opacity: 0.95;
}

.blog-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.blog-cta-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.cta-primary {
    background: var(--secondary-color);
    color: #fff;
}

.cta-primary:hover {
    background: #7ac72d;
    transform: translateY(-3px);
}

.cta-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.cta-secondary:hover {
    background: #fff;
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* -------------------------------------------------------------
   Related articles
   ------------------------------------------------------------- */
.related-section {
    background: #f4f4f7;
    padding: 3.5rem 0;
}

.related-section h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 1.75rem;
    text-align: center;
}

/* -------------------------------------------------------------
   Responsive
   ------------------------------------------------------------- */
@media (max-width: 900px) {
    .featured-article {
        grid-template-columns: 1fr;
    }

    .featured-article-img {
        min-height: 240px;
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-hero {
        padding: 6rem 1rem 3rem;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .featured-article-body {
        padding: 1.75rem;
    }

    .featured-article-body h2 {
        font-size: 1.5rem;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }
}

/* Skip link (accessibility) */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0.5rem;
    z-index: 10000;
    background: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border-radius: 6px;
    font-weight: 600;
}
.skip-link:focus {
    left: 0.75rem;
}

/* Real <img> featured / card / hero images (SEO + accessibility) */
.featured-article-img {
    display: block;
    min-height: 340px;
    overflow: hidden;
    background: #eee;
}
.featured-article-img img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: cover;
    display: block;
}

.article-card-img {
    display: block;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}
.article-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.article-card:hover .article-card-img img {
    transform: scale(1.04);
}

.article-hero-img {
    position: relative;
    width: 100%;
    max-height: 460px;
    height: 46vw;
    overflow: hidden;
    background: #eee;
}
.article-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-card-img:focus-visible,
.read-more-btn:focus-visible,
.category-pill:focus-visible,
.share-btn:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .featured-article-img,
    .featured-article-img img {
        min-height: 240px;
    }
}

@media (max-width: 768px) {
    .category-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
    }
    .category-pill {
        flex: 0 0 auto;
    }
    .article-hero-img {
        height: 220px;
    }
    .blog-cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}
