:root {
    /* BBC-Inspired Color Palette */
    --primary-color: #D32F2F;
    --primary-dark: #B71C1C;
    --secondary-color: #121212;
    --text-color: #222222;
    --text-light: #545454;
    --bg-color: #FFFFFF;
    --bg-light: #F9F9F9;
    --border-color: #EEEEEE;
    --hover-bg: #F5F5F5;

    /* Typography - BBC Style */
    --font-primary: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-nepali: 'Khand', 'Noto Sans Devanagari', sans-serif;

    /* Grid System */
    --grid-columns: 12;
    --grid-gap: 20px;
    --container-max: 1280px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-nepali,
body.nepali-mode,
body.nepali-mode h1,
body.nepali-mode h2,
body.nepali-mode h3,
body.nepali-mode h4,
body.nepali-mode h5,
body.nepali-mode h6,
body.nepali-mode p,
body.nepali-mode a,
body.nepali-mode span,
body.nepali-mode div {
    font-family: var(--font-nepali) !important;
}

.btn-toggle-cute {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
}

.btn-toggle-cute:hover {
    background: var(--primary-color);
    color: white;
}

/* Active State (Nepali) */
body.nepali-mode .btn-toggle-cute {
    background: var(--primary-color);
    color: white;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fixed dimensions for homepage images */
.article-card img {
    width: 350px;
    max-width: 100%;
    object-fit: cover;
}

.hero-featured img {
    width: 800px;
    max-width: 100%;
    object-fit: cover;
}

.widget img {
    max-width: 100%;
    object-fit: cover;
}

/* ============================================
   CONTAINER & GRID SYSTEM
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.main-container {
    padding-top: 20px;
    padding-bottom: 40px;
}

/* Main Content Layout (Flexbox for better control) */
.grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Main content area - 66% width */
.col-8 {
    flex: 0 0 calc(66.666% - 15px);
    max-width: calc(66.666% - 15px);
    min-width: 0;
}

/* Sidebar - 33% width */
.col-4 {
    flex: 0 0 calc(33.333% - 15px);
    max-width: calc(33.333% - 15px);
    min-width: 280px;
}

/* Other grid columns (for other pages) */
.col-1 {
    width: 8.333%;
}

.col-2 {
    width: 16.666%;
}

.col-3 {
    width: 25%;
}

.col-5 {
    width: 41.666%;
}

.col-6 {
    width: 50%;
}

.col-7 {
    width: 58.333%;
}

.col-9 {
    width: 75%;
}

.col-10 {
    width: 83.333%;
}

.col-11 {
    width: 91.666%;
}

.col-12 {
    width: 100%;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo img {
    height: 55px;
    width: auto;
    display: inline-block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo img:hover {
    transform: scale(1.02);
}

.logo-dark {
    display: none;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color);
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ============================================
   BREAKING NEWS BANNER (BBC-Style)
   ============================================ */
.breaking-news-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 0;
    border-bottom: 2px solid var(--primary-dark);
    overflow: hidden;
}

.breaking-news-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.breaking-news-label {
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 16px;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    white-space: nowrap;
    animation: pulse 2s ease-in-out infinite;
}

.breaking-news-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

/* Sidebar Scroll Animation */
.sidebar {
    position: sticky;
    top: 200px;
    animation: fadeInUp 0.6s ease;
    align-self: flex-start;
    width: 100%;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dynamic Ad Placement */
.dynamic-ad {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
    border: 1px dashed var(--border-color);
}

/* Specific Ad Sizes */
.ad-leaderboard {
    width: 728px;
    height: 90px;
    max-width: 100%;
    object-fit: contain;
    /* Keeps aspect ratio */
    display: inline-block;
}

.ad-rectangle {
    width: 300px;
    height: 250px;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.ad-responsive {
    width: 100%;
    max-width: 728px;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.header-ad .ad-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Prevent spillover */
}

/* ============================================
   TYPOGRAPHY - BBC STYLE
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 16px;
    line-height: 1.7;
}

/* ============================================
   HERO SECTION (BBC-Style)
   ============================================ */
.hero-section {
    margin-bottom: 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.hero-featured {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-featured img {
    width: 800px;
    max-width: 100%;
    height: 450px;
    object-fit: cover;
    opacity: 0.88;
    transition: opacity 0.3s ease;
}

.hero-featured:hover img {
    opacity: 0.7;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
}

.hero-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    border-radius: 2px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-summary {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.hero-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Latest Headlines Sidebar */
.latest-headlines {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.latest-headlines h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
}

.headline-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.headline-item:last-child {
    border-bottom: none;
}

.headline-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.headline-item:hover h4 {
    color: var(--primary-color);
}

.headline-time {
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================
   SECTION ROWS (BBC-Style Modules)
   ============================================ */
.section-row {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.section-link {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Article Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ============================================
   ARTICLE CARD COMPONENT
   ============================================ */
.article-card {
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.article-card-image {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.article-card-image img {
    width: 100%;
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 4px 4px 0 0;
}

.article-card:hover .article-card-image img {
    transform: scale(1.05);
}

.article-card-content {
    padding: 16px;
}

.article-category {
    display: inline-block;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.article-summary {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 12px;
}

.article-meta {
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================
   SIDEBAR WIDGETS
   ============================================ */
.sidebar {
    position: sticky;
    top: 180px;
}

.widget {
    background: var(--bg-light);
    padding: 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
}

/* Most Read Widget */
.most-read-list {
    list-style: none;
    counter-reset: most-read-counter;
}

.most-read-item {
    counter-increment: most-read-counter;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.most-read-item:last-child {
    border-bottom: none;
}

.most-read-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 30px;
}

.most-read-number::before {
    content: counter(most-read-counter);
}

.most-read-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.most-read-content:hover h4 {
    color: var(--primary-color);
}

.most-read-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   SEARCH BAR (Enhanced from previous)
   ============================================ */
.search-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.search-container {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 4px 4px 4px 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.15);
}

.search-form input {
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    width: 200px;
    transition: width 0.3s ease;
}

.search-form input:focus {
    width: 250px;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.search-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
    border-top: 4px solid var(--primary-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* Adjust main grid for tablets */
    .col-8 {
        flex: 0 0 calc(60% - 15px);
        max-width: calc(60% - 15px);
    }

    .col-4 {
        flex: 0 0 calc(40% - 15px);
        max-width: calc(40% - 15px);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    /* Stack layout vertically on mobile */
    .grid {
        flex-direction: column;
        gap: 20px;
    }

    .col-8,
    .col-4 {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 100%;
    }

    .top-bar {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .logo img {
        height: 45px;
    }

    .main-nav {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        overflow-x: auto;
        white-space: nowrap;
        gap: 16px;
        width: 100%;
        justify-content: flex-start;
    }

    .search-wrapper {
        width: 100%;
        margin-left: 0;
    }

    .search-form {
        width: 100%;
    }

    .search-form input {
        width: 100%;
        flex: 1;
    }

    .hero-featured img {
        height: 280px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    /* Breaking News Mobile */
    .breaking-news-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .breaking-news-label {
        width: 100%;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}