/* ==========================================================================
   Template 2 — Blogs Stylesheet
   Matches reference image:
   - Symmetric Hero banner with Total Articles stat pill.
   - Recent Articles: 1-column architecture with full-width horizontal cards.
   - Search bar: Right side of Recent Articles heading, stacks on mobile.
   - More Articles: Symmetric 5-column grid on desktop.
   - Mobile responsive: Cards adapt to phone width with zero horizontal overflow.
   ========================================================================== */

:root {
    --navy-darkest: #03142a;
    --navy-dark: #06234b;
    --navy-title: #0f294a;
    --blue-accent: #1a4fa0;
    --blue-link: #0284c7;
    --teal-bright: #00d2d3;
    --teal-primary: #0d9488;
    --gold-soft: #fbbf24;
    --white: #ffffff;
    --bg-page: #f0f4f9;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-body: #334155;
    --text-muted: #64748b;
    --radius-card: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: clip;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.blog-hero-banner {
    position: relative;
    min-height: 230px;
    background-color: var(--navy-dark);
    background-image:
        linear-gradient(to right, rgba(3, 20, 42, 0.95) 0%, rgba(6, 35, 75, 0.88) 48%, rgba(6, 35, 75, 0.3) 100%),
        url('../images/blogs_banner.jpg');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 42px 0 48px;
    overflow: hidden;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.blog-hero-content {
    position: relative;
    z-index: 2;
}

.blog-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--teal-bright);
    margin-bottom: 12px;
}

.blog-breadcrumb a {
    color: var(--teal-bright);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.blog-breadcrumb a:hover {
    opacity: 0.8;
}

.blog-bc-sep {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.blog-breadcrumb span:last-child {
    color: rgba(255, 255, 255, 0.8);
}

.blog-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.blog-hero-subtitle {
    font-size: 1.02rem;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 300;
    line-height: 1.55;
    margin-bottom: 22px;
}

.blog-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.blog-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 211, 0.15);
    border: 1px solid rgba(0, 210, 211, 0.32);
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 13.5px;
    color: var(--white);
    font-weight: 500;
    backdrop-filter: blur(6px);
    white-space: nowrap;
}

.blog-stat-pill i {
    color: var(--teal-bright);
    font-size: 14px;
}

.blog-stat-pill strong {
    color: var(--teal-bright);
    font-weight: 700;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.blog-main {
    padding: 40px 0 80px;
}

.blog-section {
    margin-bottom: 48px;
}

/* ==========================================================================
   SECTION HEADER & SEARCH BAR
   ========================================================================== */
.blog-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.blog-section-title-wrap {
    position: relative;
}

.blog-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy-title);
    line-height: 1.2;
}

.blog-title-accent {
    display: block;
    width: 44px;
    height: 3px;
    background: var(--teal-bright);
    border-radius: 2px;
    margin-top: 6px;
}

/* Search bar on right side */
.blog-search-box {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
}

.blog-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.92rem;
    pointer-events: none;
}

.blog-search-input {
    width: 100%;
    height: 44px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 0 40px 0 44px;
    font-size: 0.88rem;
    color: var(--navy-title);
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.blog-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.blog-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.blog-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    display: none;
    padding: 4px;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.2s;
}

.blog-search-clear:hover {
    color: #4b5563;
}

.blog-search-clear.visible {
    display: block;
}

/* ==========================================================================
   1. RECENT ARTICLES (1-Column Architecture, Horizontal Cards)
   ========================================================================== */
.blog-recent-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.blog-recent-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 18px 22px;
    display: flex;
    gap: 24px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    animation: blogFadeIn 0.35s ease both;
}

.blog-recent-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

@keyframes blogFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-recent-thumb-link {
    text-decoration: none;
    flex-shrink: 0;
}

.blog-recent-thumb {
    width: 140px;
    height: 110px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
    transition: transform 0.25s ease;
}

.blog-recent-card:hover .blog-recent-thumb {
    transform: scale(1.03);
}

.blog-recent-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.blog-fallback-box {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f294a 0%, #1a4fa0 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2rem;
    opacity: 0.9;
}

.blog-recent-body {
    flex: 1;
    min-width: 0;
}

.blog-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.blog-date i {
    color: #0ea5e9;
    font-size: 0.85rem;
}

.blog-recent-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
}

.blog-recent-title a {
    color: var(--blue-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-recent-title a:hover {
    color: #0284c7;
    text-decoration: underline;
}

.blog-recent-excerpt {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 10px;
}

.blog-recent-footer {
    display: flex;
    align-items: center;
}

.blog-read-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--blue-link);
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.blog-read-link i {
    font-size: 0.78rem;
    transition: transform 0.2s ease;
}

.blog-read-link:hover {
    color: #0369a1;
    gap: 9px;
}

.blog-read-link:hover i {
    transform: translateX(2px);
}

/* ==========================================================================
   2. MORE ARTICLES (Symmetric 5-Column Grid on Desktop)
   ========================================================================== */
.blog-more-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.blog-more-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    animation: blogFadeIn 0.35s ease both;
}

.blog-more-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.blog-more-thumb-link {
    text-decoration: none;
    display: block;
    margin-bottom: 12px;
}

.blog-more-thumb {
    width: 100%;
    height: 130px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
    transition: transform 0.25s ease;
}

.blog-more-card:hover .blog-more-thumb {
    transform: scale(1.03);
}

.blog-more-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.blog-more-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-more-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
    flex-grow: 1;
}

.blog-more-title a {
    color: var(--blue-accent);
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-more-title a:hover {
    color: #0284c7;
    text-decoration: underline;
}

.blog-more-footer {
    margin-top: auto;
    padding-top: 6px;
}

/* ==========================================================================
   EMPTY & NO RESULTS
   ========================================================================== */
.blog-empty,
.blog-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 70px 20px;
    color: #94a3b8;
    gap: 12px;
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
}

.blog-empty {
    display: flex;
}

.blog-no-results.visible {
    display: flex;
}

.blog-empty i,
.blog-no-results i {
    font-size: 42px;
    opacity: 0.35;
}

.blog-empty h3,
.blog-no-results h3 {
    font-size: 1.15rem;
    color: #334155;
    font-weight: 600;
}

.blog-empty p,
.blog-no-results p {
    font-size: 0.9rem;
}

.blog-no-results button {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Zero horizontal overflow)
   ========================================================================== */
@media (max-width: 1200px) {
    .blog-more-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .blog-more-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

    .blog-hero-banner {
        padding: 36px 0 42px;
        background-image:
            linear-gradient(to bottom, rgba(3, 20, 42, 0.96) 0%, rgba(6, 35, 75, 0.92) 100%),
            url('../images/blogs_banner.jpg');
    }

    /* Search bar stacks beneath section title */
    .blog-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .blog-search-box {
        max-width: 100%;
    }

    .blog-more-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .blog-hero-title {
        font-size: 1.75rem;
    }

    .blog-hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }

    .blog-main {
        padding: 24px 0 60px;
    }

    .blog-recent-card {
        padding: 14px;
        gap: 14px;
        align-items: flex-start;
    }

    .blog-recent-thumb {
        width: 80px;
        height: 76px;
    }

    .blog-recent-title {
        font-size: 0.95rem;
    }

    .blog-recent-excerpt {
        font-size: 0.82rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* On phone width, More Articles cards adapt horizontally matching phone mockup */
    .blog-more-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .blog-more-card {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 12px 14px;
    }

    .blog-more-thumb-link {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .blog-more-thumb {
        width: 76px;
        height: 76px;
        margin-bottom: 0;
    }

    .blog-more-title {
        font-size: 0.88rem;
        margin-bottom: 6px;
    }

    .blog-more-footer {
        padding-top: 0;
    }
}

@media (max-width: 400px) {
    .blog-stat-pill {
        font-size: 12px;
        padding: 6px 14px;
    }
}