/* --- 1. Variables & Reset --- */
:root {
    --primary: #1e40af;       /* Royal Blue */
    --accent: #f97316;        /* Orange accent */
    
    --text-main: #111827;
    --text-light: #4b5563;
    
    --bg-body: #fdfdfd;       /* Clean Off-White */
    --bg-white: #ffffff;
    --border: #e5e7eb;
    
    --font-main: 'Manrope', sans-serif; 
    
    --container-width: 1140px;
    --radius: 0px;            /* Sharp corners */
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }

/* --- 2. Header & Dropdown --- */
.site-header { 
    background: var(--bg-white); 
    border-bottom: 1px solid var(--border); 
    position: sticky; top: 0; z-index: 100; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); 
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 72px; }

/* Simple Logo */
.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.logo img { max-height: 40px; }

/* Navigation */
.nav-list { display: flex; gap: 30px; align-items: center; }
.nav-link { 
    font-weight: 600; color: var(--text-main); font-size: 0.95rem; 
    text-transform: uppercase; letter-spacing: 0.5px; 
    display: flex; align-items: center; gap: 4px;
}
.nav-link:hover { color: var(--primary); }

/* Dropdown CSS */
.has-dropdown { position: relative; height: 72px; display: flex; align-items: center; }
.dropdown-menu {
    position: absolute; top: 100%; left: -15px; 
    background: var(--bg-white); min-width: 220px;
    border: 1px solid var(--border); border-top: 3px solid var(--primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.2s ease;
    flex-direction: column; gap: 0; padding: 10px 0; z-index: 101;
}
.has-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-menu li a { 
    display: block; padding: 10px 20px; 
    font-size: 0.9rem; text-transform: none; color: var(--text-main); font-weight: 500;
    border-bottom: 1px solid #f9fafb;
}
.dropdown-menu li a:hover { background: #f3f4f6; color: var(--primary); padding-left: 25px; }

/* Mobile Toggle */
.mobile-toggle { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; }

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .main-nav { position: absolute; top: 72px; left: 0; right: 0; background: var(--bg-white); border-bottom: 1px solid var(--border); padding: 20px; display: none; box-shadow: 0 5px 10px rgba(0,0,0,0.05); }
    .main-nav.active { display: block; }
    .nav-list { flex-direction: column; align-items: flex-start; gap: 0; }
    .has-dropdown { height: auto; display: block; width: 100%; margin: 10px 0; }
    .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 15px; border-left: 2px solid var(--border); margin-top: 10px; display: none; }
    .has-dropdown:hover .dropdown-menu { display: flex; }
    .nav-link { padding: 10px 0; width: 100%; }
}

/* --- 3. Cover Section (Scroll.in Layout) --- */
.cover-section { padding: 40px 20px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.cover-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }

/* Lead Story */
.lead-story { display: flex; flex-direction: column; gap: 15px; }
.lead-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 4px; }
.lead-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.lead-story:hover .lead-img { transform: scale(1.02); }

.lead-cat { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 5px; display: block; }
.lead-title { font-size: 2.2rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 5px; color: var(--text-main); }
.lead-story:hover .lead-title { color: var(--primary); }
.lead-summary { font-size: 1.05rem; color: var(--text-light); line-height: 1.6; }

/* Sub Stories (Right Column) */
.sub-stories { display: flex; flex-direction: column; gap: 25px; border-left: 1px solid var(--border); padding-left: 30px; }
.sub-card { display: flex; gap: 15px; align-items: flex-start; }
.sub-card:hover .sub-title { color: var(--primary); }
.sub-img { width: 90px; height: 90px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.sub-title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: 5px; color: var(--text-main); }
.sub-meta { font-size: 0.8rem; color: #9ca3af; }

/* --- 4. River Feed --- */
.main-layout { display: grid; grid-template-columns: 2.5fr 1fr; gap: 60px; padding-bottom: 60px; }
.section-heading { 
    font-size: 1.1rem; font-weight: 800; text-transform: uppercase; 
    color: var(--primary); border-bottom: 2px solid var(--primary); 
    padding-bottom: 8px; margin-bottom: 30px; display: inline-block; 
}

.feed-list { display: flex; flex-direction: column; gap: 35px; }
.feed-item { 
    display: grid; grid-template-columns: 240px 1fr; gap: 25px; 
    align-items: flex-start; padding-bottom: 35px; 
    border-bottom: 1px solid #f3f4f6; 
}
.feed-item:last-child { border: none; }

.feed-img-wrap { width: 100%; height: 160px; border-radius: 4px; overflow: hidden; }
.feed-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.feed-item:hover .feed-img { transform: scale(1.03); }

.feed-content { display: flex; flex-direction: column; }
.feed-cat { font-size: 0.75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.feed-title { font-size: 1.4rem; font-weight: 700; line-height: 1.3; margin-bottom: 8px; color: var(--text-main); transition: 0.2s; }
.feed-item:hover .feed-title { color: var(--primary); }
.feed-summary { font-size: 0.95rem; color: var(--text-light); line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-meta { font-size: 0.8rem; color: #9ca3af; font-weight: 500; }

/* Sidebar Trending */
.sidebar-widget { margin-bottom: 40px; position: sticky; top: 100px; }
.trending-list { counter-reset: trend-counter; display: flex; flex-direction: column; gap: 20px; }
.trend-item { display: flex; gap: 15px; position: relative; padding-left: 15px; }
.trend-item::before { 
    counter-increment: trend-counter; 
    content: counter(trend-counter); 
    font-size: 2rem; font-weight: 900; color: #e5e7eb; 
    line-height: 1; position: absolute; left: -10px; top: -5px; z-index: -1; 
}
.trend-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin-bottom: 5px; color: var(--text-main); }
.trend-item:hover .trend-title { color: var(--primary); }
.trend-meta { font-size: 0.8rem; color: #9ca3af; }

/* Footer */
.site-footer { background: #f9fafb; border-top: 1px solid var(--border); padding: 50px 0; font-size: 0.9rem; color: var(--text-light); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }

/* --- RESPONISVE FIXED (Image Left, No Stack) --- */
@media (max-width: 900px) {
    /* Stack main layout blocks (Sidebar goes below feed) */
    .cover-grid { grid-template-columns: 1fr; gap: 30px; }
    .sub-stories { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 30px; }
    .main-layout { grid-template-columns: 1fr; gap: 40px; }
    
    /* FEED ITEM FIX: Keep 2 columns (110px image + Rest for text) */
    .feed-item { 
        grid-template-columns: 110px 1fr; /* Fixed width for image column */
        gap: 15px; 
    }
    
    /* Adjust image container height for mobile */
    .feed-img-wrap { 
        height: 85px; 
    }
    
    /* Optional: Slightly smaller title on mobile to fit nicely */
    .feed-title {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    /* Footer stacking */
    .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
}

/* =========================================
   7. SINGLE POST STYLES
   ========================================= */

.post-col {
    /* No special grid needed, it sits in main-layout */
}

/* Header */
.post-cat {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: inline-block;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--text-main);
}

.post-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

/* Featured Image */
.post-feat-img {
    margin-bottom: 30px;
}
.post-feat-img img {
    width: 100%;
    border-radius: 4px;
}
.img-caption {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 8px;
    font-style: italic;
}

/* Article Content - The "Reader" View */
.post-content {
    font-size: 1.125rem; /* 18px for better readability */
    line-height: 1.7;
    color: #374151;
    margin-bottom: 40px;
}

.post-content p { margin-bottom: 20px; }
.post-content h2 { font-size: 1.8rem; font-weight: 700; margin: 40px 0 20px; color: #111; }
.post-content h3 { font-size: 1.4rem; font-weight: 700; margin: 30px 0 15px; }
.post-content ul, .post-content ol { margin-bottom: 20px; padding-left: 20px; }
.post-content li { margin-bottom: 10px; }
.post-content img { margin: 30px 0; border-radius: 4px; }
.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #4b5563;
    font-size: 1.2rem;
}

/* Share Section */
.post-footer {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.share-buttons button {
    background: #f3f4f6;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: 0.2s;
}
.share-buttons button:hover { background: #e5e7eb; }

/* Related Grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.related-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}
.related-card h4 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
}

/* Mobile Tweaks for Post */
@media (max-width: 768px) {
    .post-title { font-size: 1.8rem; }
    .related-grid { grid-template-columns: 1fr; }
    .post-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* =========================================
   8. CATEGORY & PAGINATION
   ========================================= */

/* Category Header */
.cat-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.cat-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 5px;
    display: block;
}
.cat-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 10px;
}
.cat-desc {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.page-btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
    border-radius: 4px;
    transition: 0.2s;
}

.page-btn:not(.disabled):hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: default;
    background: #f9fafb;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.no-posts {
    padding: 40px;
    background: #f9fafb;
    text-align: center;
    color: var(--text-muted);
    border-radius: 8px;
    font-weight: 500;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .cat-title { font-size: 2rem; }
    .pagination { gap: 10px; }
    .page-info { display: none; } /* Hide "Page X of Y" on mobile to save space */
}

/* =========================================
   9. SEARCH PAGE STYLES
   ========================================= */

.search-header-block {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.page-heading {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-main);
}

.search-bar-lg {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar-lg input {
    flex: 1;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
    font-family: var(--font-main);
    transition: 0.2s;
}

.search-bar-lg input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1); /* Slight blue glow */
}

.search-bar-lg button {
    padding: 0 25px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-main);
}

.search-bar-lg button:hover {
    background: #152e85; /* Darker blue */
}

.result-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .search-bar-lg {
        flex-direction: column;
    }
    .search-bar-lg button {
        padding: 12px;
    }
}

/* =========================================
   HEADER SEARCH STYLES
   ========================================= */

/* Desktop: Push Search to the right or inline */
.nav-search-item {
    margin-left: 10px;
}

.header-search-form {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 20px; /* Pill shape */
    padding: 5px 15px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.header-search-form:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.header-search-form input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-main);
    width: 120px; /* Compact width */
    font-family: var(--font-main);
}

.header-search-form input::placeholder {
    color: #9ca3af;
}

.header-search-form button {
    background: none;
    border: none;
    padding: 0;
    margin-left: 5px;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 1rem;
    transition: 0.2s;
}

.header-search-form button:hover {
    color: var(--primary);
}

/* Mobile Tweaks for Header Search */
@media (max-width: 768px) {
    .nav-search-item {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
    }

    .header-search-form {
        width: 100%;
        padding: 10px 15px;
        border-radius: 8px; /* Less rounded on mobile */
    }

    .header-search-form input {
        width: 100%;
        font-size: 1rem;
    }
}

/* =========================================
   SEARCH RESULT SECTIONS
   ========================================= */

.result-section {
    margin-bottom: 30px;
}

.section-label {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.count-badge {
    font-size: 0.75rem;
    background: #e5e7eb;
    color: var(--text-light);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 30px 0;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Compact Search Result Item (Reuse feed-item but smaller) */
.feed-item.sm-item .feed-img-wrap {
    min-width: 80px;
    aspect-ratio: 1; /* Square */
}
.feed-item.sm-item .feed-title {
    font-size: 1rem; /* Smaller title */
}

/* =========================================
   HOME PAGE UPDATES & MOBILE FIXES
   ========================================= */

/* 1. View All Link in Headers */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.section-header-flex .section-heading {
    border-bottom: none; /* Remove duplicate border */
    margin-bottom: 0;
    padding-bottom: 10px;
    /* Create the colored underline effect manually */
    position: relative; 
}
.section-header-flex .section-heading::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 100%; height: 2px;
    background: currentColor; /* Uses the border-color set inline */
}

.view-all-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    display: flex; align-items: center; gap: 4px;
}
.view-all-link:hover { text-decoration: underline; }

/* 2. Spacing Utility */
.mt-5 { margin-top: 50px; }

/* 3. MOBILE SPACING FIXES */
@media (max-width: 900px) {
    /* Fix Cover Section Squash */
    .cover-grid {
        display: flex;
        flex-direction: column;
        gap: 30px; /* Add breathing room between Lead and Subs */
    }

    /* Ensure images in cover don't overflow */
    .lead-img-wrap {
        aspect-ratio: 16/9;
        height: auto;
    }
    
    /* Sub Stories Spacing */
    .sub-stories {
        border-left: none;
        padding-left: 0;
        /* Add a separator line on mobile */
        border-top: 1px solid var(--border);
        padding-top: 25px;
    }

    /* Adjust Feed Item spacing on mobile */
    .feed-item {
        gap: 15px; /* Tighter gap */
    }
    
    .feed-img-wrap {
        width: 100px; /* Enforce specific width on mobile */
        min-width: 100px;
        height: 75px; /* Fixed height */
    }

    /* Font Size Adjustments */
    .lead-title { font-size: 1.6rem; }
    .section-heading { font-size: 1.3rem; }
}