:root {
    /* --- Primary Colors --- */
    --primary-red: #C02C39; /* Deep Crimson for Brand/Accent */
    --primary-blue: #0A58A3; /* Strong Blue for Secondary/World */
    --primary-green: #047857; /* Darker Green for Success/Bangladesh */
    --primary-yellow: #ca8a04; /* Gold/Yellow for Economy */
    --primary-purple: #7c3aed; /* Purple for Sports */
    --primary-pink: #be185d; /* Pink for Entertainment */
    --primary-accent: var(--primary-red);

    /* --- Text & Background --- */
    --text-primary: #1F2937; /* Dark Gray for Main Text */
    --text-secondary: #6B7280; /* Medium Gray for Excerpts/Meta */
    --bg-body: #ffffff;
    --bg-light: #F9FAFB; /* Very Light Gray for Section Backgrounds */
    --border-color: #E5E7EB; /* Light Border */
    --box-shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);

    /* --- Category Colors (Mapped to section IDs) --- */
    --color-bangladesh: #0d9488;
    --color-economy: #0891b2;
    --color-tech: #2563eb;
    --color-world: #4F46E5;
    --color-sports: var(--primary-purple);
    --color-entertainment: var(--primary-pink);
}

/* --- Global & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kalpurush', 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-accent);
}

/* --- Header & Navigation (Refined) --- */
.top-bar {
    background: var(--text-primary); /* Darker top bar for contrast */
    color: #cbd5e1;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}
.top-bar .social-icons a {
    color: #cbd5e1;
    margin-left: 10px;
}
.top-bar .social-icons a:hover {
    color: var(--primary-accent);
}
.site-logo .logo-text {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--text-primary);
}
.site-logo .highlight {
    color: var(--primary-red); /* Use the new primary red for highlight */
}
.main-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.header-ad {
    text-align: right;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--text-secondary);
}

/* ================================================= */
/* --- MAIN NAVIGATION (MOBILE FOCUS) --- */
/* ================================================= */
.main-nav {
    background: #ffffff;
    border-bottom: 2px solid var(--primary-accent);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: start;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    display: block;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.2s ease;
}

.nav-menu li a:hover {
    color: var(--primary-accent);
    background-color: var(--bg-light);
}

/* Mobile Toggler for Main Nav */
.navbar-toggler-mobile {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    margin-left: auto; /* Push to the right */
}

@media (max-width: 991.98px) {
    /* Hide desktop elements */
    .top-bar .d-lg-block {
        display: none !important;
    }

    .main-header .header-ad {
        display: none; /* Hide ad on small screens */
    }

    /* Force site logo to left on mobile */
    .main-header .col-12.d-flex {
        justify-content: space-between !important;
        align-items: center;
    }

    /* Main Navigation Styles */
    .main-nav {
        /* Remove shadow/border for clean mobile look when collapsed */
        border-bottom: none;
        box-shadow: none;
        padding: 0;
    }

    .nav-menu {
        flex-direction: column; /* Stack items vertically */
        width: 100%;
        max-height: 0; /* Initially collapsed */
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        background: #ffffff; /* Ensure white background for menu */
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.show-menu {
        max-height: 500px; /* Adjust height based on content to make it visible */
        overflow-y: auto; /* Enable scroll if too many items */
    }

    .nav-menu li a {
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid var(--bg-light);
        font-size: 1rem;
    }

    .nav-menu li:last-child a {
        border-bottom: none;
    }

    .nav-menu li a:hover {
        background-color: var(--bg-light);
    }
}
/* ================================================= */
/* --- END MAIN NAVIGATION --- */
/* ================================================= */


/* Breaking News Ticker (Cleaner Look) */
.breaking-news {
    background: var(--primary-red);
    color: white;
    padding: 0.5rem 0;
    overflow: hidden;
}
.breaking-label {
    background: var(--text-primary);
    padding: 0.25rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0 8px 8px 0; /* Modern, cut-off look */
}
.ticker-content {
    animation: scroll 45s linear infinite;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 1rem;
}
@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}


/* --- Hero Section Styles (Modularized) --- */
.hero-section {
    padding: 2.5rem 0;
    background: var(--bg-light);
}

.hero-featured-card {
    position: relative;
    height: 520px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: block;
}
.hero-featured-card img {
    transition: transform 0.3s ease;
    object-fit: cover;
    width: 100%;
    height: 100%;
}
.hero-featured-card:hover img {
    transform: scale(1.03);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
    padding: 2.5rem;
    /* Stronger, clearer gradient */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 100%);
}

.hero-category {
    background: var(--primary-accent);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block; /* Ensure it wraps the content */
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-excerpt {
    font-size: 1rem;
    font-weight: 400;
}

.hero-side-story {
    height: 250px;
    border-radius: 12px;
    box-shadow: var(--box-shadow-light);
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column; /* Stack image and text */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.hero-side-story:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hero-side-story-content {
    display: block;
    padding: 0;
    height: 100%;
}

.hero-side-story-content img {
    width: 100%;
    height: 120px; /* Reduced side image height */
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.hero-side-story-content > div {
    padding: 1rem;
}

.hero-side-category {
    font-size: 0.8rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.hero-side-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* --- Section Headers & News Cards (Modular) --- */
.section-spacing {
    padding: 3rem 0;
}

/* Base style for the section header component */
.section-header {
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--border-color); /* Default light border */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dynamic border-bottom and link color based on ID */
#bangladesh .section-header { border-bottom-color: var(--color-bangladesh); }
#bangladesh .section-header .view-all { color: var(--color-bangladesh); }

#economy .section-header { border-bottom-color: var(--color-economy); }
#economy .section-header .view-all { color: var(--color-economy); }

#tech .section-header { border-bottom-color: var(--color-tech); }
#tech .section-header .view-all { color: var(--color-tech); }

#world .section-header { border-bottom-color: var(--color-world); }
#world .section-header .view-all { color: var(--color-world); }
#world .section-header h2.section-title { color: var(--color-world); } /* Specific title color for sidebar */


#sports .section-header { border-bottom-color: var(--color-sports); }
#sports .section-header .view-all { color: var(--color-sports); }

#entertainment .section-header { border-bottom-color: var(--color-entertainment); }
#entertainment .section-header .view-all { color: var(--color-entertainment); }

#popular-news .section-header { border-bottom-color: var(--primary-accent); }
#popular-news .section-header .view-all { color: var(--primary-accent); }


.section-header h2.section-title {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.75rem;
}

.section-header a.view-all {
    font-size: 1rem;
    font-weight: 600;
}

/* --- Base News Card --- */
.news-card {
    display: block;
    border: 1px solid var(--border-color); /* Added subtle border */
    border-radius: 8px;
    background: white;
    overflow: hidden;
    box-shadow: var(--box-shadow-light);
    transition: all 0.2s ease-in-out;
}

.news-card:hover {
    border-color: var(--primary-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.news-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-category {
    font-size: 0.7rem;
    font-weight: 700;
    position: absolute;
    bottom: 0;
    left: 0;
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 0 4px 0 0;
    z-index: 10;
}

.news-content {
    padding: 1.25rem;
}

.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.news-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.news-meta i {
    color: var(--primary-accent);
}

/* --- Specific List Styles --- */

/* Bangladesh Section List (Vertical List) */
.list-article-item {
    transition: background-color 0.2s;
    padding: 0.5rem 0;
}
.list-article-item:hover {
    background-color: var(--bg-light);
}
.list-article-item-image {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    overflow: hidden;
    border-radius: 4px;
}
.list-article-item h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

/* Economy/Tech List */
.hero-side-story-list-item {
    transition: background-color 0.2s;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}
.hero-side-story-list-item:hover {
    background-color: var(--bg-light);
}

/* Sidebar List */
.sidebar-list-item {
    transition: background-color 0.2s;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}
.sidebar-list-item:hover {
    background-color: var(--bg-light);
}
.sidebar-list-item h4 {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Sports/Entertainment List Card (Horizontal) */
.horizontal-news-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow-light);
    transition: all 0.2s ease-in-out;
    display: flex; /* Added flex for horizontal layout */
    align-items: center;
}
.horizontal-news-card:hover {
    border-color: var(--primary-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.horizontal-news-card .news-image {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px 0 0 8px;
}
.horizontal-news-card .news-image img {
    border-radius: 8px 0 0 8px;
}
.horizontal-news-card .news-content {
    padding: 1rem;
    flex-grow: 1; /* Allow content to take remaining space */
}

/* Sticky Sidebar Fix */
.sticky-top {
    top: 1.5rem; /* Adjust sticky position to account for header/nav */
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-featured-card {
        height: 400px;
        margin-bottom: 1rem;
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .hero-side-story {
        height: 120px;
    }
    /* Change side stories to horizontal layout on mobile */
    .hero-side-story {
        flex-direction: row;
        height: auto; /* Allow height to adjust */
    }
    .hero-side-story-content {
        display: flex; /* Enable flex for inner content */
    }
    .hero-side-story-content img {
        height: 100%;
        width: 100px;
        min-width: 100px;
        border-radius: 6px;
        border-radius: 12px 0 0 12px;
    }
    .hero-side-story-content > div {
        padding: 0.5rem 1rem;
    }
    .hero-side-title {
        font-size: 1rem;
    }
    .section-spacing {
        padding: 2rem 0;
    }

    /* Article details responsive typography */
    .editorial-headline {
        font-size: 1.75rem !important;
    }
    .article-body {
        font-size: 1.05rem !important;
    }
}

/* --- Footer Styling Start --- */

.footer {
    background-color: #1a1a1a; /* Dark background */
    color: #f0f0f0; /* Light text for contrast */
    padding: 50px 0 20px 0;
    font-family: 'Kalpurush', sans-serif; /* Ensure Bengali font is used */
}

/* Footer Logo/Brand Text */
.footer-logo {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.footer-logo .highlight {
    color: #C02C39; /* Accent color matching the header */
}

.footer-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #b0b0b0;
}

/* Footer Social Icons */
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.social-btn {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #333333;
    color: #ffffff;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.social-btn:hover {
    background-color: #C02C39; /* Hover with accent color */
    color: #ffffff;
}

/* Footer Titles */
.footer-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    position: relative;
    /* Underline effect for title */
    padding-bottom: 5px;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: #C02C39;
}

/* Footer Links List */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links li a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-links li a:hover {
    color: #C02C39; /* Hover with accent color */
    text-decoration: underline;
}

/* Bottom Copyright Bar */
.footer-bottom {
    border-top: 1px solid #333333;
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: #888888;
}

/* Responsive Adjustments for Mobile */
@media (max-width: 767.98px) {
    .footer {
        padding: 40px 0 15px 0;
        text-align: center;
    }

    .footer-logo {
        margin-bottom: 5px;
    }

    .footer-social {
        justify-content: center;
        margin-bottom: 30px;
    }

    .footer-title {
        text-align: center;
        margin-top: 20px;
    }

    .footer-title::after {
        left: 50%;
        transform: translateX(-50%); /* Center the underline on mobile */
    }

    .footer-links {
        text-align: center;
    }
}
/* --- Footer Styling End --- */

/* --- Article Details Specific Styles for Professional Look --- */
.article-container {
    padding: 30px 0;
}

.article-header-meta {
    margin-bottom: 25px;
}

.article-category {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #C02C39;
    background-color: #f5f5f5;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.editorial-headline {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 15px;
    color: #1a1a1a;
}

@media (min-width: 640px) {
    .editorial-headline {
        font-size: 3rem;
    }
}

.article-metadata-bar {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #555;
    padding: 10px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.article-metadata-bar span {
    margin-right: 20px;
}

.article-metadata-bar .publisher-name {
    font-weight: 600;
    color: #333;
}

.featured-image-container {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.featured-image {
    max-height: 550px;
    width: 100%;
    border-radius: 0;
    object-fit: cover;
    display: block;
}

.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #222;
    padding-top: 15px;
}

.article-body p {
    margin-bottom: 1.7em;
}

/* Styling for embedded HTML content */
.article-body h2, .article-body h3 {
    margin-top: 30px;
    margin-bottom: 18px;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
}

.error-message-box {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 30px;
    text-align: center;
}

.error-message-box h2 {
    font-size: 2.5rem;
    color: #C02C39;
    font-weight: 700;
    margin-bottom: 10px;
}

.error-message-box p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
}

.error-message-box a {
    padding: 8px 18px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.error-message-box a:hover {
    background-color: #0056b3;
}