/* Core Styles */
:root { --primary: #2ecc71; --secondary: #2c3e50; --bg-color: #f4f7f6; --text-color: #333; }
body { font-family: 'Anek Kannada', sans-serif; margin: 0; padding: 0; background-color: var(--bg-color); color: var(--text-color); }
a { text-decoration: none; color: inherit; cursor: pointer; }

/* Header */
header { background-color: var(--secondary); color: #fff; padding: 15px 0; text-align: center; border-bottom: 4px solid var(--primary); }
.header-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
header h1 { margin: 0; font-size: 2.2em; color: #ffffff; font-weight: 700; transition: color 0.3s; }
header h1:hover { color: var(--primary); }

/* Navigation (Centered) */
nav { background-color: #fff; display: flex; justify-content: center; align-items: center; padding: 10px 5%; box-shadow: 0 2px 5px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; flex-wrap: wrap; gap: 40px; }
.nav-collapse { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; }
.nav-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.nav-links a { color: var(--secondary); padding: 10px 15px; font-weight: 600; transition: 0.3s; }
.nav-links a:hover { color: var(--primary); }

/* Mobile-only icon buttons (search + hamburger), hidden on desktop where the search bar is always inline */
.nav-icons { display: none; align-items: center; gap: 4px; margin-left: auto; }
.nav-icon-btn { background: none; border: none; color: var(--secondary); font-size: 1.3em; padding: 8px 12px; cursor: pointer; border-radius: 4px; line-height: 1; }
.nav-icon-btn:hover, .nav-icon-btn[aria-expanded="true"] { color: var(--primary); }
.mobile-search-bar { display: none; background: #fff; padding: 0 5% 14px; }
.mobile-search-bar.open { display: block; }
.mobile-search-bar .search-bar { width: 100%; }
.mobile-search-bar .search-bar input { flex: 1; min-width: 0; }

/* Dropdown Menu */
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: #fff; min-width: 200px; box-shadow: 0px 8px 16px rgba(0,0,0,0.1); z-index: 1; border-top: 3px solid var(--primary); }
.dropdown-content a { color: var(--secondary); padding: 12px 16px; display: block; border-bottom: 1px solid #eee; text-align: left; }
.dropdown-content a:hover { background-color: #f9f9f9; color: var(--primary); }
.dropdown:hover .dropdown-content { display: block; }
.dropdown.open .dropdown-content { display: block; }

/* Standard mobile nav: icon row (search + hamburger) up top; hamburger opens links below; search icon opens its own bar */
@media (max-width: 860px) {
    nav { justify-content: flex-end; padding: 12px 5%; gap: 0; flex-wrap: wrap; }
    .nav-icons { display: flex; }
    .nav-collapse { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; order: 3; margin-top: 12px; }
    .nav-collapse.nav-open { display: flex; }
    .nav-links { flex-direction: column; align-items: stretch; width: 100%; }
    .nav-links a { width: 100%; padding: 14px 10px; border-bottom: 1px solid #f0f0f0; }
    .dropdown { width: 100%; }
    .dropdown-content { position: static; width: 100%; box-shadow: none; border-top: none; }
    .dropdown-content a { padding-left: 24px; }
    .nav-collapse .desktop-search { display: none; }
}

/* Search Bar */
.search-bar { display: flex; align-items: center; }
.search-bar input { padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px 0 0 4px; outline: none; font-family: inherit; }
.search-bar button { padding: 8px 15px; background: var(--primary); color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-weight: 600; transition: background 0.3s; }
.search-bar button:hover { background: #27ae60; }

/* Ads Placeholders */
.ad-banner { background: #e0e0e0; color: #7f8c8d; text-align: center; margin: 20px auto; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 1px dashed #bdc3c7; }
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; }
.ad-sidebar { width: 100%; height: 250px; margin-bottom: 25px; }

/* Main Container */
.container { width: 95%; max-width: 1200px; margin: 20px auto; display: flex; flex-wrap: wrap; gap: 25px; }
.main-content { flex: 3; min-width: 60%; }
.sidebar { flex: 1; min-width: 300px; }

/* Cards & Grids */
.section-title { font-size: 1.5em; color: var(--secondary); border-bottom: 2px solid var(--primary); padding-bottom: 5px; margin-bottom: 20px; font-weight: 700; }
.featured-card { background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 30px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); display: block; transition: 0.3s; }
.featured-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.featured-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.featured-content { padding: 25px; }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: block; transition: transform 0.3s; }
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.card-content { padding: 15px; }
.category-tag { background: #e8f8f5; color: #1abc9c; padding: 4px 8px; font-size: 0.8em; font-weight: 700; border-radius: 4px; display: inline-block; margin-bottom: 10px; }
.post-title { font-size: 1.2em; font-weight: 700; color: var(--secondary); margin: 0 0 10px; }
.card:hover .post-title, .featured-card:hover .post-title { color: var(--primary); }
.post-excerpt { color: #666; font-size: 0.95em; line-height: 1.5; margin: 0; }

/* General Page Styles */
.page-view { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); line-height: 1.8; color: #444; }
.page-view h1 { color: var(--secondary); border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-top: 0; margin-bottom: 25px; font-size: 2.2em; }
.page-view h2 { color: var(--secondary); margin-top: 25px; }
.page-view p { margin-bottom: 15px; font-size: 1.1em; }
.page-view ul { margin-bottom: 20px; padding-left: 20px; font-size: 1.1em; }
.page-view li { margin-bottom: 10px; }

/* Contact View Styles */
#contact-view { text-align: center; }
#contact-view i.fa-envelope-open-text { font-size: 4em; color: var(--primary); margin-bottom: 20px; }
#contact-view h1 { border-bottom: none; }

/* Search Results Styles */
.search-view h1 { font-size: 2em; color: var(--secondary); border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin-top: 0; margin-bottom: 30px; }
.no-results { font-size: 1.2em; color: #e74c3c; padding: 20px; background: #fdf2f0; border-radius: 8px; text-align: center; }

/* Single Post specific */
#post-view { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.post-header { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.post-header h1 { font-size: 2.2em; color: var(--secondary); margin: 10px 0; font-weight: 700; line-height: 1.3; }
.post-meta { color: #7f8c8d; font-size: 0.9em; margin-bottom: 15px; }
.post-meta i { margin-right: 5px; color: var(--primary); }
.featured-image { width: 100%; max-height: 500px; object-fit: cover; border-radius: 8px; margin-bottom: 25px; }
.post-body { font-size: 1.1em; line-height: 1.8; color: #444; }
.post-body h2 { color: var(--secondary); margin-top: 30px; }
.post-body h3 { color: var(--secondary); margin-top: 22px; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 18px 0; display: block; }
.post-body p { margin: 0 0 16px; }

/* Post gallery (multiple images) */
.post-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 25px 0; }
.post-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; cursor: pointer; }

.share-buttons { margin: 30px 0; padding: 15px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.share-btn { padding: 8px 15px; border-radius: 4px; color: #fff; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.share-fb { background: #1877f2; }
.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }

/* Related posts ("Read Next") */
.related-section { margin-top: 10px; }
.related-section .articles-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Comments */
.comments-section { margin-top: 30px; border-top: 1px solid #eee; padding-top: 25px; }
.comment-item { padding: 15px 0; border-bottom: 1px dashed #ddd; }
.comment-item strong { color: var(--secondary); }
.comment-date { color: #999; font-size: 0.85em; margin-left: 8px; }
.comment-text { margin: 8px 0 0; color: #444; }
.comment-form { margin-top: 20px; background: #f9fbfa; padding: 20px; border-radius: 8px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px; margin-bottom: 12px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; box-sizing: border-box; }
.comment-form button { padding: 10px 20px; background: var(--primary); color: #fff; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; }
.comment-form button:hover { background: #27ae60; }
.alert-success { background: #e8f8f5; color: #1abc9c; padding: 12px 15px; border-radius: 6px; margin-bottom: 15px; }
.alert-info { background: #fff8e1; color: #b7862c; padding: 12px 15px; border-radius: 6px; margin-bottom: 15px; font-size: 0.9em; }

/* Sidebar Styling */
.widget { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); margin-bottom: 25px; }
.widget h3 { color: var(--secondary); border-bottom: 2px solid var(--primary); padding-bottom: 5px; margin-top: 0; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: 12px 0; border-bottom: 1px dashed #ddd; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { font-weight: 600; color: var(--secondary); transition: 0.2s; }
.widget ul li a:hover { color: var(--primary); }

/* Footer */
footer { background-color: var(--secondary); color: #fff; text-align: center; padding: 40px 20px 20px; margin-top: 40px; }
.social-icons a { color: #fff; font-size: 1.8em; margin: 0 15px; transition: color 0.3s; }
.social-icons a:hover { color: var(--primary); }
.footer-links a { color: #bdc3c7; margin: 0 10px; font-size: 0.9em; transition: 0.3s; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* Cookie Consent Banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--secondary); color: #fff; padding: 16px 5%; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; z-index: 1000; box-shadow: 0 -4px 15px rgba(0,0,0,0.2); }
.cookie-banner p { margin: 0; font-size: 0.9em; max-width: 700px; }
.cookie-banner a { color: var(--primary); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-banner .btn { padding: 8px 18px; border-radius: 4px; font-weight: 700; cursor: pointer; border: none; font-family: inherit; font-size: 0.9em; }
.cookie-banner .btn-primary { background: var(--primary); color: #fff; }
.cookie-banner .btn-primary:hover { background: #27ae60; }
.cookie-banner .btn-secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4) !important; }
.cookie-banner .btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0 10px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 4px; background: #fff; color: var(--secondary); font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.08); }
.pagination a:hover { background: var(--primary); color: #fff; }
.pagination .active { background: var(--secondary); color: #fff; }
