/*
Theme Name: BUBasic
Theme URI: https://uknewshour.com
Author: Vipul Sipani
Author URI: https://uknewshour.com
Description: A modern news and magazine WordPress theme inspired by Business Upturn Basic design
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: business-frontliner
Tags: news, magazine, blog, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===================================
   CSS Reset & Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
}

/* ===================================
   CSS Variables
   =================================== */
:root {
    --primary-color: #1e3a5f;
    --secondary-color: #e74c3c;
    --text-color: #333333;
    --light-text: #666666;
    --border-color: #e5e5e5;
    --hover-color: #2c5282;
    --menu-font: 'Roboto', sans-serif;
    --body-font: 'Open Sans', sans-serif;
}

/* ===================================
   Typography
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   Lists
   =================================== */
ul, ol {
    margin: 0 0 1.5rem 1.5rem;
    padding: 0;
}

ul li, ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

ul {
    list-style-type: disc;
}

ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

ol {
    list-style-type: decimal;
}

ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
}

.no-bullets {
    list-style: none;
    margin-left: 0;
}

/* ===================================
   Container & Layout
   =================================== */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

/* ===================================
   Top Bar
   =================================== */
.top-bar {
    background-color: #f5f5f5;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    font-size: 14px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    color: var(--light-text);
}

.top-bar-right .menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}

.top-bar-right .menu a {
    color: var(--light-text);
    font-size: 13px;
}

.top-bar-right .menu a:hover {
    color: var(--primary-color);
}

/* ===================================
   Header
   =================================== */
.site-header {
    background-color: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo a {
    display: block;
}

.site-logo img {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    font-family: var(--menu-font);
}

.site-title a {
    color: var(--primary-color);
}

/* ===================================
   Navigation
   =================================== */
/* Main Navigation */
.main-navigation {
    background-color: var(--nav-bg-color);
    border-bottom: 2px solid var(--primary-color);
}

.main-navigation .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Primary Menu */
.primary-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 0;
}

.primary-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.primary-menu > li > a {
    display: block;
    padding: 15px 20px;
    color: var(--nav-text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a {
    color: var(--nav-hover-color);
    background-color: #f5f5f5;
}

/* Add separators between menu items */
.primary-menu > li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Submenu */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
}

.primary-menu .sub-menu li {
    margin: 0;
}

.primary-menu .sub-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    font-size: 14px;
    text-decoration: none;
}

.primary-menu .sub-menu a:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
}

/* Hide Search Icon */
.header-search {
    display: none !important;
}

/* ===================================
   Footer
   =================================== */
.site-footer {
    background-color: var(--footer-bg-color);
    color: #ffffff;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 0 0 20px 0;
    flex-wrap: wrap;
}

.footer-menu a {
    color: #ffffff;
    font-size: 14px;
}

.footer-menu a:hover {
    color: var(--secondary-color);
}

.site-info {
    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);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--hover-color);
}

/* ===================================
   Post Meta
   =================================== */
.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 15px;
}

.post-meta .author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.post-meta a {
    color: var(--light-text);
}

.post-meta a:hover {
    color: var(--primary-color);
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===================================
   PAGINATION - FIXED & UPDATED
   =================================== */
/* Horizontal Pagination - One Line */
.pagination,
.nav-links,
nav.navigation.pagination,
.wp-pagenavi {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 40px auto !important;
    padding: 0 !important;
    list-style: none !important;
    flex-wrap: wrap !important;
}

/* Remove all list styling */
.pagination *,
.nav-links *,
nav.navigation.pagination * {
    list-style: none !important;
    list-style-type: none !important;
}

/* Force list items to display inline */
.pagination li,
.nav-links li,
nav.navigation.pagination li {
    display: inline-block !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove bullet pseudo-elements */
.pagination li::before,
.pagination li::after,
.nav-links li::before,
.nav-links li::after {
    content: none !important;
    display: none !important;
}

/* Page number styling */
.pagination .page-numbers,
.nav-links .page-numbers,
.wp-pagenavi a,
.wp-pagenavi span {
    display: inline-block !important;
    padding: 8px 14px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

/* Current page */
.pagination .page-numbers.current,
.nav-links .page-numbers.current,
.wp-pagenavi .current {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

/* Hover state */
.pagination .page-numbers:hover,
.nav-links .page-numbers:hover,
.wp-pagenavi a:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

/* Dots/Ellipsis */
.pagination .dots,
.nav-links .dots,
.wp-pagenavi .extend {
    padding: 8px 14px;
    color: #999;
    border: none;
    background: none;
}

/* Previous/Next buttons */
.pagination .prev,
.pagination .next,
.nav-links .prev,
.nav-links .next {
    font-weight: 600;
}

/* Hide Sidebar Pagination */
.widget_archive .pagination,
.sidebar .pagination,
.widget-area .pagination,
.sidebar-pagination {
    display: none !important;
}

/* ===================================
   GLOBAL PAGINATION FIX - ALL PAGES
   =================================== */
.pagination,
.nav-links,
.wp-pagenavi {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 40px 0;
    padding: 0;
    list-style: none !important;
}

.pagination .page-numbers,
.nav-links .page-numbers,
.wp-pagenavi a,
.wp-pagenavi span {
    display: inline-block !important;
    padding: 10px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current,
.wp-pagenavi .current {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

.pagination .page-numbers:hover,
.nav-links .page-numbers:hover,
.wp-pagenavi a:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

.pagination .dots,
.nav-links .dots,
.wp-pagenavi .extend {
    padding: 10px 16px;
    color: #999;
    border: none;
    background: none;
}

.pagination .prev,
.pagination .next,
.nav-links .prev,
.nav-links .next {
    font-weight: 600;
}

/* ===================================
   ARCHIVE PAGE FIXES
   =================================== */
/* Clean Archive Header - Remove Box */
.archive-header,
.page-header {
    background: none !important;
    border: none !important;
    padding: 20px 0 !important;
    margin: 0 0 30px 0 !important;
    box-shadow: none !important;
}

.archive-title,
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

/* Hide Article Count in Archive Description */
.archive-description,
.taxonomy-description {
    display: none !important;
}

/* Subcategories Display (Like Tags) */
.category-children {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.category-children a {
    display: inline-block;
    padding: 6px 14px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.category-children a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Author Header Clean Style */
.author-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

.author-avatar-large {
    flex-shrink: 0;
}

.author-avatar-large img {
    border-radius: 50%;
    border: 3px solid #e8f5e9;
}

.author-header-info {
    flex: 1;
}

.author-header-info h1 {
    margin: 0 0 10px 0 !important;
}

/* ===================================
   PLACEHOLDER IMAGE FOR POSTS
   =================================== */
/* Placeholder for Posts Without Featured Image */
.post-thumbnail {
    position: relative;
    background-color: #e8f5e9; /* Light green */
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.post-thumbnail.no-image::before {
    content: '\f03e'; /* Font Awesome image icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 48px;
    color: #c8e6c9;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Grid Post Thumbnail Specific */
.grid-post-thumb {
    position: relative;
    background-color: #e8f5e9;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.grid-post-thumb.no-image::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 48px;
    color: #c8e6c9;
}

/* ===================================
   LIMIT HEADLINES TO 2 LINES
   =================================== */
/* Limit Headlines to 2 Lines on Archive Pages */
.archive .post-title,
.blog .post-title,
.category .post-title,
.tag .post-title,
.author .post-title,
.search .post-title,
.archive-grid .post-title,
.grid-post-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em; /* 1.4 * 2 lines */
    margin-bottom: 10px;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    /* Mobile Header - Logo left, Hamburger right */
    .site-header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .site-logo {
        order: 1;
    }
    
    .menu-toggle {
        order: 2;
        display: block;
    }
    
    /* Hide search icon in mobile */
    .header-search {
        display: none;
    }
    
    /* Mobile Menu */
    .menu-toggle {
        display: block;
    }
    
    .primary-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        flex-direction: column;
        padding: 80px 0 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }
    
    .primary-menu.active {
        left: 0;
    }
    
    .primary-menu > li {
        width: 100%;
    }
    
    .primary-menu > li > a {
        padding: 12px 20px;
    }
    
    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background-color: #f5f5f5;
        display: none;
    }
    
    .primary-menu li.menu-item-has-children.active > .sub-menu {
        display: block;
    }
    
    /* Author Bio Mobile Fix */
    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .author-avatar {
        margin-bottom: 15px;
    }
    
    /* Author Header Mobile */
    .author-header {
        flex-direction: column;
        text-align: center;
    }
    
    /* Footer Menu Mobile - Multiple items per line */
    .footer-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px 20px;
    }
    
    .footer-menu li {
        margin: 0;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
    
    /* Archive Title Mobile */
    .archive-title {
        font-size: 24px !important;
    }
    
    /* Category Children Mobile */
    .category-children {
        gap: 6px;
    }
    
    .category-children a {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* ===================================
   Utility Classes
   =================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ===================================
   Home Page Sections
   =================================== */

.home-content {
    margin-top: 30px;
}

/* Featured Section */
.featured-section {
    margin-bottom: 50px;
}

.featured-post {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 30px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.featured-title {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 15px;
}

.featured-title a {
    color: var(--text-color);
}

.featured-title a:hover {
    color: var(--primary-color);
}

.featured-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--light-text);
    margin-top: 15px;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    color: var(--text-color);
}

/* Missed It Section */
.missed-it-section,
.latest-section,
.trending-section,
.more-posts-section {
    margin-bottom: 50px;
}

.missed-it-grid,
.latest-grid,
.trending-grid,
.more-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Grid Items */
.grid-post-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.grid-post-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.grid-post-thumb {
    display: block;
    overflow: hidden;
}

.grid-post-thumb img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-post-item:hover .grid-post-thumb img {
    transform: scale(1.05);
}

.grid-post-content {
    padding: 20px;
}

.grid-post-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.grid-post-title a {
    color: var(--text-color);
}

.grid-post-title a:hover {
    color: var(--primary-color);
}

.grid-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--light-text);
    margin-bottom: 15px;
}

.grid-post-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: var(--light-text);
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* ===================================
   Responsive - Home Page
   =================================== */

@media (max-width: 1024px) {
    .featured-post {
        grid-template-columns: 1fr;
    }
    
    .missed-it-grid,
    .latest-grid,
    .trending-grid,
    .more-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .featured-content {
        padding: 20px;
    }
    
    .featured-title {
        font-size: 1.5rem;
    }
    
    .missed-it-grid,
    .latest-grid,
    .trending-grid,
    .more-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .grid-post-thumb img {
        height: 200px;
    }
    
    .grid-post-thumb {
        min-height: 200px;
    }
}

/* ===================================
   Page Template
   =================================== */

.page-container {
    margin-top: 30px;
}

.page-layout {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 40px;
}

.page-main {
    padding-right: 20px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-color);
}

.page-featured-image {
    margin: 25px 0;
}

.page-featured-image img {
    width: 100%;
    border-radius: 5px;
}

.page-entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.page-entry-content p {
    margin-bottom: 1.5rem;
}

.page-entry-content h2,
.page-entry-content h3,
.page-entry-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* ===================================
   Sidebar Post Fixes
   =================================== */

/* Sidebar thumbnail - square shape */
.sidebar-post-thumb {
    display: block;
    position: relative;
    background-color: #e8f5e9;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

/* Placeholder icon - only shows when no-image class exists */
.sidebar-post-thumb.no-image::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 24px;
    color: #c8e6c9;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Featured image - square crop */
.sidebar-post-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* Sidebar post item layout */
.sidebar-post-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.sidebar-post-content {
    flex: 1;
}

/* Meta - author left, date right on same line */
/* Meta - author and date stacked, clean layout */
.sidebar-post-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--light-text);
    margin-top: 8px;
    line-height: 1.4;
}

.sidebar-post-author,
.sidebar-post-date {
    display: block;
    text-align: left;
}

.sidebar-post-author {
    font-weight: 500;
    color: #555;
}

.sidebar-post-date {
    color: #999;
    font-size: 11px;
}

@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 65% 35%;
    }
}

@media (max-width: 768px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
    
    .page-main {
        padding-right: 0;
    }
    
    .page-sidebar {
        position: static;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

/* ===================================
   404 Error Page
   =================================== */

.error-404-container {
    text-align: center;
    padding: 60px 20px;
    margin-top: 30px;
}

.error-404-content {
    max-width: 800px;
    margin: 0 auto;
}

.error-404-number {
    font-size: 120px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 20px;
}

.error-404-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.error-404-text {
    font-size: 1.125rem;
    color: var(--light-text);
    margin-bottom: 40px;
}

.error-404-search {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
    margin-bottom: 40px;
}

.error-404-search h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.error-404-links {
    margin-bottom: 40px;
}

.error-404-links h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.error-404-links ul {
    list-style: none;
    margin: 0;
}

.error-404-links li {
    margin-bottom: 10px;
}

.error-404-links a {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.error-404-links a:hover {
    color: var(--hover-color);
}

.error-404-recent h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
}

.recent-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.recent-post-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    text-align: left;
}

.recent-post-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.recent-post-item h4 {
    padding: 15px;
    font-size: 1rem;
    line-height: 1.4;
}

.recent-post-item h4 a {
    color: var(--text-color);
}

.recent-post-item h4 a:hover {
    color: var(--primary-color);
}

.recent-post-date {
    padding: 0 15px 15px;
    font-size: 13px;
    color: var(--light-text);
}

@media (max-width: 768px) {
    .error-404-number {
        font-size: 80px;
    }
    
    .error-404-title {
        font-size: 1.75rem;
    }
    
    .recent-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Reading Progress Bar
   =================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(0,0,0,0.1);
    z-index: 9999;
}

.reading-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
}

/* ===================================
   Video Wrapper
   =================================== */

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===================================
   HOME PAGE - GRID POST FIXES
   =================================== */

/* Grid Post Card */
.grid-post,
.grid-post-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.grid-post:hover,
.grid-post-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

/* Thumbnail Container - Consistent Height */
.grid-post .post-thumbnail,
.grid-post-item .post-thumbnail {
    display: block;
    overflow: hidden;
    position: relative;
    background-color: #e8f5e9;
    min-height: 250px;
    max-height: 250px;
    width: 100%;
}

.grid-post .post-thumbnail a,
.grid-post-item .post-thumbnail a {
    display: block;
    height: 100%;
}

/* Thumbnail Images - Consistent Size */
.grid-post .post-thumbnail img,
.grid-post-item .post-thumbnail img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.grid-post:hover .post-thumbnail img,
.grid-post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* SVG Placeholder for Missing Images */
.post-placeholder {
    width: 100%;
    height: 250px;
    background-color: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.post-placeholder svg {
    width: 60px;
    height: 60px;
    color: #c8e6c9;
    opacity: 0.8;
}

.grid-post:hover .post-placeholder,
.grid-post-item:hover .post-placeholder {
    background-color: #dcedc8;
}

/* Post Content */
.grid-post .post-content,
.grid-post-item .post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* REDUCED HEADLINE SIZE FOR HOME PAGE */
.home .grid-post .post-title,
.home .grid-post-item .post-title {
    font-size: 1.1rem; /* Reduced from 1.25rem */
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.36em; /* 1.4 line-height * 1.1rem * 2 lines */
}

.grid-post .post-title a,
.grid-post-item .post-title a {
    color: var(--text-color);
    text-decoration: none;
}

.grid-post .post-title a:hover,
.grid-post-item .post-title a:hover {
    color: var(--primary-color);
}

/* Post Meta */
.grid-post .post-meta,
.grid-post-item .post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: 12px;
}

/* Post Excerpt */
.grid-post .post-excerpt,
.grid-post-item .post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--light-text);
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================
   RESPONSIVE - MOBILE
   =================================== */

@media (max-width: 1024px) {
    .grid-post .post-thumbnail,
    .grid-post-item .post-thumbnail,
    .grid-post .post-thumbnail img,
    .grid-post-item .post-thumbnail img,
    .post-placeholder {
        min-height: 220px;
        max-height: 220px;
        height: 220px;
    }
    
    .home .grid-post .post-title,
    .home .grid-post-item .post-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .grid-post .post-thumbnail,
    .grid-post-item .post-thumbnail,
    .grid-post .post-thumbnail img,
    .grid-post-item .post-thumbnail img,
    .post-placeholder {
        min-height: 200px;
        max-height: 200px;
        height: 200px;
    }
    
    .home .grid-post .post-title,
    .home .grid-post-item .post-title {
        font-size: 1rem;
    }
    
    .post-placeholder svg {
        width: 50px;
        height: 50px;
    }
}


.post-category, .post-category a { background-color: #4caf50 !important; color: #fff !important; }
.post-category:hover, .post-category a:hover { background-color: #388e3c !important; color: #fff !important; }