/*
Theme Name: Malayalam News Modern
Author: Jerin Mathew
Description: A modern, responsive Malayalam news theme with Noto Sans.
Version: 2.0
*/

/* --- 1. Variables & Reset --- */
:root {
    --primary-color: #0056b3; /* Classic News Blue */
    --secondary-color: #d32f2f; /* Breaking Red */
    --accent-color: #fbc02d; /* Highlight Yellow */
    --text-dark: #1a1a1a;
    --text-gray: #555555;
    --bg-light: #f4f6f8;
    --white: #ffffff;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font-family: 'Noto Sans Malayalam', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color 0.3s ease; }
a:hover { color: var(--primary-color); }
img { max-width: 100%; height: auto; }

/* --- 2. Header & Nav --- */
.top-bar { background: #fff; border-bottom: 1px solid #eee; padding: 8px 0; font-size: 0.85rem; color: var(--text-gray); }
.container { width: 90%; max-width: 1280px; margin: 0 auto; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; }
.social-icons a { margin-left: 15px; color: var(--text-gray); }

.main-header { background: var(--white); padding: 20px 0; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 2.5rem; font-weight: 800; color: var(--primary-color); letter-spacing: -1px; }
.logo span { color: var(--secondary-color); }
.header-ad { display: none; width: 728px; height: 90px; background: #eee; align-items: center; justify-content: center; color: #999; font-size: 0.8rem; }

.navbar { background: var(--primary-color); position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 50px; }
.nav-links { display: flex; list-style: none; height: 100%; align-items: center; overflow-x: auto; white-space: nowrap; margin: 0; }
.nav-links li a { color: var(--white); padding: 0 15px; font-weight: 600; font-size: 1rem; height: 50px; display: flex; align-items: center; border-bottom: 3px solid transparent; }
.nav-links li a:hover, .nav-links li.current-menu-item a { background: rgba(255,255,255,0.1); border-bottom-color: var(--accent-color); }

/* --- 3. Ticker --- */
.breaking-news { background: var(--text-dark); color: var(--white); display: flex; align-items: center; font-size: 0.9rem; height: 40px; margin-top: 0; }
.bn-label { background: var(--secondary-color); padding: 0 15px; height: 100%; display: flex; align-items: center; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.bn-content { flex-grow: 1; overflow: hidden; white-space: nowrap; padding: 0 10px; }

/* --- 4. Layout & Cards --- */
.main-content { padding: 30px 0; }
.grid-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }

.hero-article { position: relative; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 30px; }
.hero-img { width: 100%; height: 400px; object-fit: cover; transition: transform 0.5s ease; }
.hero-article:hover .hero-img { transform: scale(1.05); }
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); padding: 80px 30px 30px; color: var(--white); }
.category-tag { background: var(--secondary-color); color: white; padding: 4px 10px; font-size: 0.75rem; border-radius: 4px; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; display: inline-block; }
.hero-title { font-size: 2rem; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.hero-title a { color: #fff; text-decoration: none; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-left: 5px solid var(--primary-color); padding-left: 15px; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin: 0; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 40px; }
.news-card { background: var(--white); border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.3s ease, box-shadow 0.3s ease; height: 100%; display: flex; flex-direction: column; }
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-img-container { position: relative; overflow: hidden; padding-top: 56.25%; }
.card-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.card-meta { font-size: 0.75rem; color: #888; margin-bottom: 8px; display: flex; justify-content: space-between; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }

/* --- 5. Sidebar --- */
.sidebar-widget { background: var(--white); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--shadow-sm); margin-bottom: 30px; }
.widget-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px; position: relative; }
.widget-title::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 50px; height: 2px; background: var(--primary-color); }
.list-post { display: flex; gap: 15px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.list-img { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.list-content h4 { font-size: 0.95rem; line-height: 1.4; font-weight: 600; margin: 0; }
.list-meta { font-size: 0.75rem; color: #999; margin-top: 5px; }

/* --- 6. Local News --- */
.local-news-section { background: #e3f2fd; padding: 40px 0; margin: 40px 0; }
.district-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
.district-tag { background: var(--white); padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; color: var(--primary-color); cursor: pointer; border: 1px solid transparent; transition: all 0.3s; }
.district-tag:hover, .district-tag.active { background: var(--primary-color); color: var(--white); }

/* --- 7. Footer --- */
footer { background: #111; color: #ddd; padding: 60px 0 20px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h3 { color: var(--white); margin-bottom: 20px; font-size: 1.2rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a:hover { color: var(--primary-color); padding-left: 5px; }
.copyright { text-align: center; border-top: 1px solid #333; padding-top: 20px; font-size: 0.85rem; color: #777; }

/* --- Responsive --- */
@media (min-width: 992px) { .header-ad { display: flex; } }
@media (max-width: 991px) { 
    .grid-layout { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.5rem; }
}
@media (max-width: 768px) { .top-bar { display: none; } }
/* --- K-WIRE Brand Styles --- */
.logo {
    font-family: 'Manjari', sans-serif; /* Using the Malayalam font helps it blend */
    font-size: 2.8rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -2px; /* Tighten letters for a modern look */
    display: inline-flex;
    align-items: center;
}

.brand-k {
    color: var(--secondary-color); /* The "Breaking News" Red */
}

.brand-dash {
    color: #ccc; /* Light gray to be subtle */
    margin: 0 2px;
}

.brand-wire {
    color: var(--primary-color); /* The "News" Blue */
    font-style: italic; /* Adds forward momentum */
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--accent-color); /* The Yellow/Gold */
    margin-left: 5px;
    transform: translateY(-5px); /* Lift it slightly */
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
}
/* --- Single Post Specific Styles --- */

/* Breadcrumbs */
.breadcrumb { font-size: 0.85rem; color: #666; margin-bottom: 20px; padding: 10px 0; border-bottom: 1px solid #eee; }
.breadcrumb a { color: var(--primary-color); font-weight: 600; }
.separator { font-size: 0.7rem; margin: 0 8px; color: #ccc; }
.current-crumb { color: #999; }

/* Header & Meta */
.post-cat-badge { background: var(--secondary-color); color: #fff; padding: 4px 12px; font-size: 0.8rem; font-weight: 700; border-radius: 4px; display: inline-block; margin-bottom: 15px; }
.entry-title { font-size: 2.2rem; line-height: 1.3; margin-bottom: 20px; color: #000; }

.entry-meta { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 20px; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.meta-left { display: flex; gap: 20px; font-size: 0.9rem; color: #555; }
.meta-item i { margin-right: 5px; color: var(--primary-color); }

/* Share Buttons */
.share-box { display: flex; gap: 10px; }
.share-btn { width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 1rem; transition: transform 0.2s; }
.share-btn:hover { transform: translateY(-3px); color: #fff; }
.share-btn.fb { background: #3b5998; }
.share-btn.tw { background: #1da1f2; }
.share-btn.wa { background: #25d366; }

/* Featured Image */
.featured-image-wrapper { margin-bottom: 30px; border-radius: var(--border-radius); overflow: hidden; }
.main-feature-img { width: 100%; height: auto; display: block; }
.wp-caption-text { font-size: 0.85rem; color: #777; background: #f9f9f9; padding: 8px 10px; border-left: 3px solid #ccc; font-style: italic; }

/* Content Typography (Critical for Malayalam) */
.entry-content { font-size: 1.15rem; line-height: 1.8; color: #222; margin-bottom: 40px; }
.entry-content p { margin-bottom: 20px; }
.lead-text { font-size: 1.25rem; font-weight: 600; color: #444; margin-bottom: 25px; border-left: 4px solid var(--accent-color); padding-left: 15px; }
.entry-content blockquote { font-size: 1.4rem; font-style: italic; color: #555; border-left: 5px solid var(--primary-color); margin: 30px 0; padding: 10px 20px; background: #f0f7ff; }

/* Tags */
.entry-tags { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; }
.tag-label { font-weight: 700; color: #333; margin-right: 10px; }
.entry-tags a { display: inline-block; background: #f0f0f0; padding: 5px 12px; border-radius: 20px; color: #555; font-size: 0.85rem; margin-right: 8px; margin-bottom: 8px; transition: background 0.3s; }
.entry-tags a:hover { background: var(--primary-color); color: #fff; }

/* Related News */
.related-section { margin-top: 50px; padding-top: 30px; border-top: 3px solid #eee; }
.small-card .card-title { font-size: 1rem; line-height: 1.4; }
.card-date { font-size: 0.75rem; color: #999; margin-top: 5px; display: block; }

/* Mobile Response */
@media (max-width: 768px) {
    .entry-title { font-size: 1.6rem; }
    .entry-meta { flex-direction: column; align-items: flex-start; }
    .news-grid { grid-template-columns: 1fr; }
}
/* --- Category Hero Banner --- */
.category-hero {
    position: relative;
    width: 100%;
    height: 250px; /* Adjust height as needed */
    background-color: var(--primary-color); /* Fallback color if no image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
}

.category-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Darkens the image so text pops */
    display: flex;
    align-items: center;
}

.category-hero .page-title {
    color: #fff;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.archive-description {
    color: #ddd;
    font-size: 1.1rem;
    max-width: 600px;
    margin-top: 10px;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .category-hero {
        height: 180px;
    }
    .category-hero .page-title {
        font-size: 2rem;
    }
}
@media (max-width: 768px) {
    .category-hero {
        height: 180px; /* Shorter on mobile */
        background-position: center center; /* Ensure the middle is always visible */
    }
}

/* --- Branding & Tagline Styles --- */
.logo-wrapper {
    display: flex;
    flex-direction: column; /* Stacks Logo on top, Tagline below */
    justify-content: center;
    align-items: flex-start; /* Aligns them to the left */
}

/* Ensure the logo link doesn't have extra bottom margin */
.logo {
    line-height: 1; 
    margin-bottom: 5px; /* Tiny gap between logo and tagline */
    text-decoration: none; /* Removes underline */
}

.site-tagline {
    font-size: 0.85rem; /* Small and subtle */
    color: #666;        /* Grey color */
    margin: 0;          /* Remove default paragraph margins */
    font-weight: 500;
    letter-spacing: 0.5px; /* Slight spacing for readability */
    font-family: 'Noto Sans Malayalam', sans-serif; /* Ensure Malayalam renders well */
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .site-tagline {
        font-size: 0.75rem;
        display: none; /* Optional: Hide tagline on mobile to save space */
    }
}
/* --- Footer Logo Styles --- */
.footer-logo-img {
    width: 120px;       /* Good size for a square logo */
    height: auto;       /* Maintains aspect ratio */
    display: block;     /* Ensures it sits on its own line */
    border-radius: 8px; /* Optional: Adds slightly rounded corners */
    background: #fff;   /* Optional: Adds a white bg if the logo is transparent */
    padding: 5px;       /* Optional: Padding inside the white box */
}

/* Hover effect */
.footer-logo-img:hover {
    opacity: 0.9;
}

/* --- Custom Image Logo Styles --- */
.site-logo .custom-logo-link img {
    max-height: 80px; /* Limits height to match the Ad slot */
    width: auto;      /* Keeps aspect ratio perfect */
    display: block;   /* Removes weird spacing */
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .site-logo .custom-logo-link img {
        max-height: 60px; /* Smaller on phones */
    }
}