/*
 *  Final Corrected CSS for Elegant Blog
 *  Inspired by "CodeHub" with Optimized Ad Placements
 *  Version: 1.0
 */

:root {
    /* Colors */
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --dark-bg: #0b0c10;
    --dark-card-bg: #1f2833;
    --dark-text: #c5c6c7;
    --light-bg: #f5f7fa;
    --light-card-bg: #ffffff;
    --light-text: #333333;
       --border-light: #e9ecef; /* Add this line */
    --border-dark: #3a3a3a;   /* Add this line */
    /* ... other variables ... */

    /* Styles */
    --border-radius: 12px;
    --light-box-shadow: 0 6px 15px rgba(0, 0, 0, 0.07);
    --dark-box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s ease-in-out;
}

/* ============================================= */
/*          1. GLOBAL & BODY STYLES              */
/* ============================================= */

/* Import Additional Styles */
@import url('pagination.css');
@import url('dark-mode-fixes.css');

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--light-text);
    line-height: 1.6;
    transition: var(--transition);
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

.dark-mode a {
    color: var(--accent-color);
}

.dark-mode a:hover {
    color: #66d9ff;
}

/* ============================================= */
/*          2. HEADER & NAVIGATION               */
/* ============================================= */

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
}

.logo a {
    color: #ffffff;
}

.logo a:hover {
    color: #ffffff; /* Keep logo color consistent on hover */
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
}

nav ul li a {
    color: #ffffff;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 50px;
    transition: var(--transition);
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.theme-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

/* ============================================= */
/*        3. MAIN LAYOUT & AD STRATEGY           */
/* ============================================= */

.page-content {
    display: grid;
    /* Main content takes up more space, sidebar is narrower */
    grid-template-columns: 3fr 1fr; 
    gap: 30px;
    margin: 30px auto;
}

.ad-container {
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    height: fit-content;
    position: sticky;
    top: 100px; /* Adjust based on your header height */
    transition: var(--transition);
}

.dark-mode .ad-container {
    background-color: var(--dark-card-bg);
}

.ad-placeholder {
    background: #e9ecef;
    height: 600px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    font-size: 14px;
    text-align: center;
    border: 1px dashed #ddd;
}

.dark-mode .ad-placeholder {
    background: #2a2a2a;
    border: 1px dashed #444;
    color: #666;
}

/* New In-Feed Ad Card */
.ad-card {
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder-in-feed {
    width: 100%;
    height: 100%;
    min-height: 333px; /* Match the height of other post cards */
    background: #e9ecef;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    font-size: 14px;
    text-align: center;
    border: 2px dashed #ddd;
}

.dark-mode .ad-placeholder-in-feed {
    background: #2a2a2a;
    border: 2px dashed #444;
    color: #666;
}


/* ============================================= */
/*          4. FEATURED & POST SECTIONS          */
/* ============================================= */

.featured-section {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: var(--border-radius);
    padding: 40px;
    color: #ffffff;
    box-shadow: var(--light-box-shadow);
    margin-bottom: 30px;
}

.dark-mode .featured-section {
    box-shadow: var(--dark-box-shadow);
}

.featured-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.featured-title {
    font-size: 32px;
    margin-bottom: 15px;
    line-height: 1.3;
}

.featured-description {
    font-size: 18px;
    opacity: 0.9;
}

.posts-grid {
    display: grid;
    /* Create a responsive grid that fits as many columns as possible */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.post-card {
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--light-box-shadow);
    transition: var(--transition);
}

.dark-mode .post-card {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.dark-mode .post-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.post-image {
    height: 200px;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 25px;
}

.post-category {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.dark-mode .post-category {
    color: var(--accent-color);
}

.post-title {
    font-size: 20px;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--light-text);
}

.dark-mode .post-title {
    color: var(--dark-text);
}

/* ============================================= */
/*          5. FOOTER                            */
/* ============================================= */

footer {
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* ============================================= */
/*          6. RESPONSIVE MEDIA QUERIES          */
/* ============================================= */

/* For Tablets and smaller devices */
@media (max-width: 992px) {
    .page-content {
        /* Stack main content and sidebar on top of each other */
        grid-template-columns: 1fr;
    }

    .ad-container {
        /* Remove sticky positioning on mobile */
        position: static;
        margin-bottom: 30px;
    }
}

/* For Mobile Phones */
@media (max-width: 768px) {
    nav ul {
        /* Hide the desktop navigation */
        display: none;
    }

    .header-container {
        /* You can add a mobile menu button here later if needed */
        justify-content: space-between;
    }

    .featured-title {
        font-size: 28px;
    }
    .featured-description {
        font-size: 16px;
    }
}


/* ============================================= */
/*          7. FINAL POLISHING & ENHANCEMENTS      */
/* ============================================= */

.section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}
.dark-mode .section-header {
    border-bottom-color: var(--border-dark);
}
.section-header h2 {
    font-size: 24px;
    margin: 0;
    color: var(--light-text);
}
.dark-mode .section-header h2 {
    color: var(--dark-text);
}

/* New "No Posts" state styling */
.no-posts-card {
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    padding: 50px 30px;
    text-align: center;
    color: #999;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}
.dark-mode .no-posts-card {
    background-color: var(--dark-card-bg);
    color: #777;
    border-color: var(--border-dark);
}
.no-posts-card i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
    color: var(--primary-color);
}
.dark-mode .no-posts-card i {
    color: var(--accent-color);
}
.no-posts-card h3 {
    color: var(--light-text);
}
.dark-mode .no-posts-card h3 {
    color: var(--dark-text);
}


/* New Post Meta Info styling */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #777;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}
.dark-mode .post-meta {
    color: #888;
    border-top-color: #3a3a3a;
}
.post-meta span i {
    margin-right: 5px;
}



/* ============================================= */
/*          8. SINGLE POST PAGE STYLING          */
/* ============================================= */
.post-single {
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--light-box-shadow);
}
.dark-mode .post-single {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}
.post-single-image img {
    width: 100%;
    margin-bottom: 20px;
}
.post-single-content {
    font-size: 1.1rem;
    line-height: 1.8;
}
.post-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}
.post-single-content h2, .post-single-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}


.ad-placeholder-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    color: #aaa;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
}

.dark-mode .ad-placeholder-container {
    background-color: #2a2a2a;
    border-color: #444;
    color: #666;
}

/* Specific sizes for different ad units */
.ad-placeholder-leaderboard {
    width: 728px;
    height: 90px;
    max-width: 100%;
}
.ad-placeholder-sidebar {
    width: 160px;
    height: 600px;
    max-width: 100%;
}
.ad-placeholder-in-article {
    width: 100%;
    min-height: 90px;
    padding: 20px;
}
.ad-placeholder-in-feed {
    width: 100%;
    height: 100%;
    min-height: 333px; /* Match post card height */
}


.pagination-container .page-item .page-link {
    color: var(--primary-color);
    background-color: var(--light-card-bg);
    border: 1px solid var(--border-light);
    margin: 0 5px;
    border-radius: 5px;
    transition: var(--transition);
}
.dark-mode .pagination-container .page-item .page-link {
    background-color: var(--dark-card-bg);
    border-color: var(--border-dark);
    color: var(--accent-color);
}
.pagination-container .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: bold;
}
.dark-mode .pagination-container .page-item.active .page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--dark-bg);
}
.pagination-container .page-item .page-link:hover {
    background-color: var(--secondary-color);
    color: #fff;
}
.dark-mode .pagination-container .page-item .page-link:hover {
    background-color: #66d9ff;
    color: var(--dark-bg);
}


.comments-section {
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--light-box-shadow);
}
.dark-mode .comments-section {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}
.comment-form-container {
    background-color: var(--light-bg);
    border: 1px solid var(--border-light);
}
.dark-mode .comment-form-container {
    background-color: var(--dark-bg);
    border-color: var(--border-dark);
}
.comment {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}
.dark-mode .comment {
    border-bottom-color: var(--border-dark);
}
.comment:last-child {
    border-bottom: none;
}
.comment-avatar {
    width: 60px;
    height: 60px;
}
.comment h5 {
    font-size: 1rem;
    font-weight: bold;
}
.comment p {
    margin-bottom: 0;
}


/* ============================================= */
/*          12. ELEGANT POST PAGE OVERHAUL       */
/* ============================================= */

/* --- The New Hero Header --- */
.post-hero-header {
    position: relative;
    padding: 6rem 0;
    background-size: cover;
    background-position: center center;
    color: #fff;
    text-align: center;
}
.post-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
}
.post-hero-content {
    position: relative;
    z-index: 2;
}
.post-hero-category {
    background-color: var(--primary-color);
    color: #fff;
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
}
.dark-mode .post-hero-category {
    background-color: var(--accent-color);
    color: #000;
}
.post-hero-category:hover {
    color: #fff;
    background-color: var(--secondary-color);
}
.post-hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.post-hero-meta {
    font-size: 0.9rem;
    opacity: 0.9;
}
.post-hero-meta span {
    margin: 0 10px;
}
.post-hero-meta i {
    margin-right: 5px;
}

/* --- Main Article Body & Content Area --- */
.post-body {
    background-color: var(--light-card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--light-box-shadow);
}
.dark-mode .post-body {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}
.post-content-area {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}
.dark-mode .post-content-area {
    color: var(--dark-text);
}
.post-content-area p {
    margin-bottom: 1.5rem;
}
.post-content-area h2, .post-content-area h3, .post-content-area h4 {
    font-family: var(--font-heading);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
/* ============================================= */
/*       ENHANCED IN-ARTICLE IMAGE STYLING       */
/* ============================================= */

.post-content-area img {
    /* 1. Set the width */
    max-width: 100%; /* The image will be at most 90% of the content area's width */
    
    /* 2. Center the image horizontally */
    display: block; /* Treat the image as a block-level element */
    margin-left: auto; /* Auto margin on the left... */
    margin-right: auto; /* ...and right will center it */
    
    /* 3. Keep existing styles */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px; /* Keep the nice rounded corners */
    margin-top: 2rem; /* Keep the vertical spacing */
    margin-bottom: 2rem;
    box-shadow: var(--light-box-shadow); /* Add a subtle shadow for depth */
}

/* Add a shadow for dark mode as well */
.dark-mode .post-content-area img {
    box-shadow: var(--dark-box-shadow);
}
.post-content-area blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
}
.dark-mode .post-content-area blockquote {
    border-left-color: var(--accent-color);
    color: #999;
}

/* --- Related Posts & Sidebar Widgets --- */
.related-posts .post-card {
    margin-bottom: 1.5rem;
}
.sidebar-widget-area {
    position: sticky;
    top: 100px;
}
.sidebar-widget {
    background-color: var(--light-card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--light-box-shadow);
}
.dark-mode .sidebar-widget {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}
.widget-title {
    font-size: 1.25rem;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.dark-mode .widget-title {
    border-bottom-color: var(--border-dark);
}
.recent-post-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.dark-mode .recent-post-item {
    border-bottom-color: #3a3a3a;
}
.recent-post-item:last-child {
    border-bottom: none;
}
.recent-post-item a {
    font-weight: 500;
    color: var(--light-text);
}
.dark-mode .recent-post-item a {
    color: var(--dark-text);
}
.category-list-item a {
    display: block;
    padding: 0.4rem 0;
}

/* Responsive adjustments for the new layout */
@media (max-width: 991px) {
    .post-hero-title {
        font-size: 2.2rem;
    }
    .sidebar-widget-area {
        margin-top: 3rem;
        position: static;
    }
}


/* ============================================= */
/*       13. ADVANCED FEATURE STYLING            */
/* ============================================= */

/* --- Action Bar (Like/Bookmark) --- */
.post-action-bar {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.dark-mode .post-action-bar {
    border-bottom-color: var(--border-dark);
}
.btn-action {
    background-color: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}
.dark-mode .btn-action {
    background-color: #2c2c2c;
    color: #aaa;
}
.btn-action i {
    margin-right: 0.5rem;
}
.btn-action:hover {
    background-color: #e0e0e0;
}
.dark-mode .btn-action:hover {
    background-color: #3a3a3a;
}
.btn-action.liked, .btn-action.liked:hover {
    background-color: #ff4d6d; /* A pinkish red for liked */
    color: #fff;
}
.dark-mode .btn-action.liked, .dark-mode .btn-action.liked:hover {
    background-color: #e03150;
}
.btn-action.bookmarked, .btn-action.bookmarked:hover {
    background-color: var(--primary-color);
    color: #fff;
}
.dark-mode .btn-action.bookmarked, .dark-mode .btn-action.bookmarked:hover {
    background-color: var(--accent-color);
    color: #000;
}


/* --- Recent Posts with Images (Sidebar) --- */
.recent-post-item-with-image a {
    text-decoration: none;
    color: var(--light-text);
    margin-bottom: 1rem;
    display: flex;
    gap: 15px;
    align-items: center;
}
.dark-mode .recent-post-item-with-image a {
    color: var(--dark-text);
}
.recent-post-item-with-image:last-child a {
    margin-bottom: 0;
}
.recent-post-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.recent-post-title {
    font-weight: 500;
    line-height: 1.4;
}

/* Styling for the new icon button in header */
.btn-icon {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
    padding: 0 5px;
}


/* ============================================= */
/*      14. ENHANCED POST CARD STYLING (INDEX)   */
/* ============================================= */

.post-card-enhanced {
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--light-box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.dark-mode .post-card-enhanced {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}
.post-card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}
.dark-mode .post-card-enhanced:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.post-card-image-container {
    position: relative;
    height: 220px;
}
.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.post-card-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary-color);
    color: #fff !important;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1;
}
.dark-mode .post-card-category-badge {
    background-color: var(--accent-color);
    color: #000 !important;
}

.post-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-card-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    flex-grow: 1;
}
.post-card-title a {
    color: var(--light-text);
    text-decoration: none;
}
.dark-mode .post-card-title a {
    color: var(--dark-text);
}
.post-card-title a:hover {
    color: var(--primary-color);
}
.dark-mode .post-card-title a:hover {
    color: var(--accent-color);
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #777;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.dark-mode .post-card-meta {
    color: #888;
    border-top-color: var(--border-dark);
}

.btn-action-card {
    background: none;
    border: none;
    color: #777;
    padding: 0;
}
.dark-mode .btn-action-card {
    color: #888;
}
.btn-action-card.liked {
    color: #ff4d6d;
}


/* ============================================= */
/*      15. INDEX PAGE STATS DISPLAY STYLING     */
/* ============================================= */

.post-card-actions {
    display: flex;
    gap: 1rem;
}

.action-item {
    color: #777;
    font-weight: 500;
}

.dark-mode .action-item {
    color: #888;
}

.action-item i {
    margin-right: 4px;
}


/* ============================================= */
/*          16. RESPONSIVE MOBILE MENU           */
/* ============================================= */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hide hamburger on desktop, show on mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px; /* Start off-screen */
    width: 300px;
    height: 100%;
    background-color: var(--light-card-bg);
    z-index: 1050;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}
.dark-mode .mobile-menu {
    background-color: var(--dark-card-bg);
}
.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.dark-mode .mobile-menu-header {
    border-bottom-color: var(--border-dark);
}
.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--light-text);
    cursor: pointer;
}
.dark-mode .mobile-menu-close {
    color: var(--dark-text);
}
.mobile-menu-links {
    list-style: none;
    padding: 1rem;
    margin: 0;
    overflow-y: auto;
}
.mobile-menu-links li a {
    display: block;
    padding: 0.75rem 0.5rem;
    color: var(--light-text);
    font-weight: 500;
    border-radius: 5px;
    text-decoration: none;
}
.dark-mode .mobile-menu-links li a {
    color: var(--dark-text);
}
.mobile-menu-links li a:hover {
    background-color: #f0f0f0;
}
.dark-mode .mobile-menu-links li a:hover {
    background-color: #2c2c2c;
}
.mobile-menu-title {
    padding: 1rem 0.5rem 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    color: #888;
}

/* --- Media Queries to control visibility --- */
@media (max-width: 991px) {
    .desktop-nav {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .header-actions .d-flex { /* Hides the search form on smaller screens for more space */
        display: none !important;
    }
}


/* ============================================= */
/*          17. DARK MODE POLISH & FIXES         */
/* ============================================= */

/* Fix for invisible text in the comment form in dark mode */
.dark-mode .comment-form-container .card-title,
.dark-mode .comment-form-container .form-label {
    color: var(--dark-text); /* Use our main dark mode text color */
}

/* Optional: A slightly better look for form inputs in dark mode */
.dark-mode .form-control {
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border-color: var(--border-dark);
}

.dark-mode .form-control:focus {
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--accent-color), 0.25);
}


/* ============================================= */
/*          18. NEWSLETTER SECTION STYLING       */
/* ============================================= */
/* ============================================= */
/*     18. ATTRACTIVE NEWSLETTER SECTION STYLING   */
/* ============================================= */
/* ============================================= */
/*     18. ELEGANT NEWSLETTER SECTION v2.0       */
/* ============================================= */

/* Main Footer - This is where the dark background color is set */
footer.mt-auto {
    background-color: #1a1a2e; /* The dark footer color */
    color: #ffffff;
    padding: 0; /* Remove padding as the inner sections will handle it */
    margin-top: 60px;
}

/* Newsletter Section with Angled Top */
.newsletter-section {
    padding: 6rem 0 4rem;
    background-color: #1a1a2e; /* Match the footer color for a seamless look */
    color: #fff; /* Ensure text inside is white */
    
    /* This is the magic part that creates the angled top */
    clip-path: polygon(0 10%, 100% 0, 100% 100%, 0% 100%);
}

.newsletter-icon {
    font-size: 3rem;
    /* Use a color that pops against the dark background */
    color: var(--accent-color); 
    margin-bottom: 1rem;
}

.newsletter-title {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff; /* Ensure title is white */
}

.newsletter-text {
    color: #aaa; /* A softer white for the description */
    margin-bottom: 2rem;
    max-width: 600px; /* Constrain line width for readability */
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

/* Style the form input for the dark background */
.newsletter-form .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-align: center;
}
.newsletter-form .form-control::placeholder {
    color: #ccc;
}
.newsletter-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--accent-color), 0.25);
}

/* Style the subscribe button */
.newsletter-form .btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    font-weight: bold;
}
.newsletter-form .btn-primary:hover {
    background-color: #66d9ff;
    border-color: #66d9ff;
}

#newsletter-message .alert {
    max-width: 500px;
    margin: 1rem auto 0;
    border-radius: 50px;
}

/* The Bottom Footer Section */
.footer-bottom-section {
    background-color: #1a1a2e; /* Match the footer color */
    padding-bottom: 20px;
}


/* ============================================= */
/*          19. STATIC PAGE STYLING              */
/* ============================================= */
.page-hero-header {
    position: relative;
    padding: 5rem 0;
    background-size: cover;
    background-position: center center;
    color: #fff;
}
.content-card-page {
    margin-bottom: 3rem;
}
.section-title-page {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}
.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}


/* ============================================= */
/*       20. DARK MODE FOR STATIC PAGES          */
/* ============================================= */
/* ============================================= */
/*       20. DARK MODE FOR STATIC PAGES          */
/* ============================================= */

/* Style for the main content card on About, Contact, etc. */
.dark-mode .content-card-page {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
    /* *** THE FIX IS HERE *** */
    /* This new rule tells ALL text inside the card to use the light text color. */
    color: var(--dark-text); 
}

/* Style for the section titles (e.g., "Our Mission") */
.dark-mode .section-title-page {
    border-bottom-color: var(--accent-color);
}

/* Style for the icon circles on the Contact page */
.dark-mode .icon-circle {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--accent-color) !important;
}

/* Make sure the muted text on the contact page is also visible */
.dark-mode .content-card-page .text-muted {
    color: #aaa !important;
}

/* Change the checkmark icon color to match the theme on the About page */
.dark-mode .list-unstyled .fa-check-circle {
    color: var(--accent-color) !important;
}


/* ============================================= */
/*       21. DARK MODE PLACEHOLDER FIX           */
/* ============================================= */

/* Target the placeholder text specifically within dark mode */
.dark-mode .form-control::placeholder {
    color: #888; /* A light, visible grey */
    opacity: 1; /* Ensure it's not transparent */
}

/* For Firefox, which uses a different pseudo-element */
.dark-mode .form-control::-moz-placeholder {
    color: #888;
    opacity: 1;
}

/* For older versions of Edge/IE */
.dark-mode .form-control:-ms-input-placeholder {
    color: #888 !important; /* Important needed for older MS browsers */
}


/* ============================================= */
/*     22. FINAL SEARCH RESULTS PAGE STYLING     */
/* ============================================= */

.search-results-list {
    width: 100%;
}

/* The new horizontal card container */
.search-result-card {
    display: flex;
    background-color: var(--light-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--light-box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: var(--transition);
}
.dark-mode .search-result-card {
    background-color: var(--dark-card-bg);
    box-shadow: var(--dark-box-shadow);
}
.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.dark-mode .search-result-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}


/* Image container on the left */
.search-result-image {
    flex-basis: 30%; /* Image takes up 30% of the card width */
    flex-shrink: 0;
}
.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content container on the right */
.search-result-content {
    padding: 1.5rem 2rem;
    flex-grow: 1;
}

.search-result-title {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}
.search-result-title a {
    color: var(--light-text);
    text-decoration: none;
}
.dark-mode .search-result-title a {
    color: var(--dark-text);
}
.search-result-title a:hover {
    color: var(--primary-color);
}
.dark-mode .search-result-title a:hover {
    color: var(--accent-color);
}

.search-result-meta {
    font-size: 0.9rem;
    color: #777;
}
.dark-mode .search-result-meta {
    color: #888;
}

.search-result-excerpt {
    font-size: 1rem;
    color: #555;
    margin-top: 1rem;
    line-height: 1.7;
}
.dark-mode .search-result-excerpt {
    color: #bbb;
}

/* Styling for the highlighted search term */
mark {
    background-color: #fcf8e3;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    color: #8a6d3b;
    font-weight: bold;
}
.dark-mode mark {
    background-color: rgba(76, 201, 240, 0.3);
    color: #ade8ff;
}

/* Make it stack on mobile */
@media (max-width: 767px) {
    .search-result-card {
        flex-direction: column;
    }
    .search-result-image {
        flex-basis: auto;
        height: 200px;
    }
}


.social-share-section {
    background-color: var(--light-bg);
    border: 1px solid var(--border-light);
}
.dark-mode .social-share-section {
    background-color: var(--dark-bg);
    border-color: var(--border-dark);
}

.social-share-section .card-title {
    font-family: var(--font-heading);
    font-weight: 700;
}

.social-share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #555;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}
.dark-mode .btn-share {
    background-color: #2c2c2c;
    color: #aaa;
}

.btn-share:hover {
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* Brand Colors on Hover */
.btn-share.facebook:hover { background-color: #1877F2; }
.btn-share.twitter:hover { background-color: #1DA1F2; }
.btn-share.linkedin:hover { background-color: #0A66C2; }
.btn-share.pinterest:hover { background-color: #E60023; }
.btn-share.whatsapp:hover { background-color: #25D366; }
.btn-share.email:hover { background-color: #888; }







/* ============================================= */
/*          24. SCROLL TO TOP BUTTON STYLING     */
/* ============================================= */

.scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 1.2rem;
    line-height: 50px;
    z-index: 1000;
    
    /* Hide it by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.dark-mode .scroll-to-top-btn {
    background-color: var(--accent-color);
    color: #000;
}

.scroll-to-top-btn:hover {
    background-color: var(--secondary-color);
    color: #fff;
    transform: translateY(-2px); /* Lift effect on hover */
}
.dark-mode .scroll-to-top-btn:hover {
    background-color: #66d9ff;
    color: #000;
}

/* The class our JavaScript will add to show the button */
.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Responsive Styles for Main Content */



