/* ===================================
   Knowledge Theme Hub
   ================================== */

/* Global Styles - Professional Magazine Theme */
:root {
    /* Magazine Color Palette */
    --primary-color: #1a365d;        /* Deep navy blue - professional, trustworthy */
    --primary-light: #2a4a6b;        /* Lighter navy for hover states */
    --accent-color: #c53030;         /* Deep red - attention-grabbing */
    --accent-light: #e53e3e;         /* Lighter red for hover */
    --secondary-color: #4a5568;      /* Charcoal gray - sophisticated */
    --success-color: #38a169;        /* Professional green */
    --info-color: #3182ce;           /* Professional blue */
    --warning-color: #d69e2e;        /* Professional amber */
    --danger-color: #e53e3e;         /* Professional red */
    --dark-color: #1a202c;           /* Deep dark - premium feel */
    --light-color: #f7fafc;          /* Pure white tint - clean */
    --text-primary: #2d3748;         /* Dark gray for main text */
    --text-secondary: #4a5568;       /* Medium gray for secondary text */
    --text-muted: #718096;           /* Light gray for muted text */
    --border-color: #e2e8f0;         /* Light gray for borders */
    
    /* Magazine Gradients */
    --gradient-primary: linear-gradient(135deg, #1a365d 0%, #2a4a6b 100%);
    --gradient-hero: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);
    --gradient-accent: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
    
    /* Professional Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
    
    /* Magazine Design System */
    --border-radius: 0.375rem;
    --border-radius-lg: 0.75rem;
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 40px; /* Account for fixed navbar */
}

/* Header Styles - Magazine Navigation */
.index-header .navbar {
    background: rgba(26, 32, 44, 0.95) !important; /* Deep dark with transparency */
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.index-header .navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.index-header .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem !important;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0 0.1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    line-height: 1.1;
}

.index-header .navbar-nav .nav-link:hover,
.index-header .navbar-nav .nav-link:focus {
    color: white !important;
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.index-header .navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.index-header .navbar-toggler:focus {
    box-shadow: none;
}

.index-header .container {
    max-width: 1600px; /* Even wider navbar container */
    width: 95%; /* Use more screen width */
}

.index-header .navbar-nav {
    flex: 1; /* Allow nav items to expand */
    margin-left: 1.5rem;
}

.index-header .navbar-nav .nav-item {
    margin-right: 1.5rem; /* Add more spacing between items */
}

.index-header .navbar-nav .nav-item:last-child {
    margin-right: 0;
}

.index-header .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.index-search-form {
    min-width: 300px;
    position: relative;
    margin-left: auto; /* Push search form to the right */
}

.index-search-form .input-group {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.index-search-form .form-control {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.index-search-form .form-control:focus {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 0.2rem rgba(197, 48, 48, 0.25);
    color: white;
}

.index-search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.index-search-form .btn {
    border: 1px solid var(--accent-color);
    background-color: var(--accent-color);
    color: white;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.index-search-form .btn:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateY(-1px);
}

/* Hero Section - Magazine Style */
.index-hero {
    background: var(--gradient-hero);
    color: white;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--accent-color);
}

.index-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.02) 75%, transparent 75%),
        linear-gradient(-45deg, transparent 25%, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.02) 75%, transparent 75%);
    background-size: 60px 60px;
    opacity: 0.3;
}

.index-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color) 50%, transparent);
}

.index-hero .container {
    position: relative;
    z-index: 2;
}

.index-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.index-hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.index-hero-actions .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 2px solid transparent;
}

.index-hero-actions .btn-primary {
    background: var(--gradient-accent);
    border-color: var(--accent-color);
}

.index-hero-actions .btn-outline-primary {
    background: transparent;
    border-color: white;
    color: white;
}

.index-hero-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.index-hero-actions .btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

.index-hero-actions .btn-outline-primary:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.index-hero-image img {
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.index-hero-image img:hover {
    transform: scale(1.05);
}

/* Section Titles - Magazine Style */
.index-section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.index-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.index-section-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* ===== MAGAZINE TRENDING SECTION ===== */
.magazine-trending {
    background: var(--light-color);
    position: relative;
}

/* Magazine Section Header */
.magazine-header {
    text-align: left;
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
}

.magazine-section-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Georgia', serif;
    letter-spacing: -0.02em;
}

.magazine-section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0;
}

/* Magazine Hero Article (Full Width Banner) */
.magazine-hero-link {
    text-decoration: none;
    color: inherit;
}

.magazine-hero-article {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-slow);
    position: relative;
}

.magazine-hero-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.magazine-hero-image {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.magazine-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.magazine-hero-article:hover .magazine-hero-image img {
    transform: scale(1.08);
}

.magazine-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
    color: white;
    padding: 3rem;
}

.magazine-hero-badge {
    display: inline-block;
    background: var(--gradient-accent);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.magazine-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: white;
    font-family: 'Georgia', serif;
}

.magazine-hero-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.magazine-hero-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Magazine Grid Layout */
.magazine-grid {
    margin-top: 2rem;
}

.magazine-grid-link {
    text-decoration: none;
    color: inherit;
}

.magazine-grid-article {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-slow);
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.magazine-grid-article:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.magazine-article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.magazine-large-article .magazine-article-image {
    height: 250px;
}

.magazine-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.magazine-grid-article:hover .magazine-article-image img {
    transform: scale(1.1);
}

.magazine-article-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-accent);
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius);
}

.magazine-article-content {
    padding: 1.5rem;
}

.magazine-large-article .magazine-article-content {
    padding: 2rem;
}

.magazine-article-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-family: 'Georgia', serif;
}

.magazine-large-article .magazine-article-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.magazine-article-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.magazine-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--light-color);
    padding-top: 0.75rem;
}

.magazine-date {
    font-weight: 500;
}

.magazine-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Magazine Placeholder */
.magazine-placeholder {
    background: white;
    border: 2px dashed rgba(45, 55, 72, 0.2);
    border-radius: var(--border-radius-lg);
}

/* Mobile Responsive for Magazine Layout */
@media (max-width: 768px) {
    .magazine-section-title {
        font-size: 2.5rem;
    }
    
    .magazine-hero-image {
        height: 300px; /* Increased height for better mobile display */
    }
    
    .magazine-hero-overlay {
        padding: 1.5rem 1rem;
        background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95)); /* Stronger gradient for mobile */
    }
    
    .magazine-hero-title {
        font-size: 1.5rem; /* Reduced size for mobile */
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .magazine-hero-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden; /* Limit text to 3 lines on mobile */
    }
    
    .magazine-hero-meta {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.8rem;
    }
    
    .magazine-article-image {
        height: 180px;
    }
    
    .magazine-large-article .magazine-article-image {
        height: 200px;
    }
    
    .magazine-article-content {
        padding: 1.25rem;
    }
    
    .magazine-article-title {
        font-size: 1.1rem;
    }
    
    .magazine-large-article .magazine-article-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .magazine-section-title {
        font-size: 2rem;
    }
    
    .magazine-hero-image {
        height: 280px; /* Adequate height for small screens */
    }
    
    .magazine-hero-overlay {
        padding: 1.25rem 0.875rem;
        background: linear-gradient(transparent 25%, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.98)); /* Even stronger gradient for small screens */
    }
    
    .magazine-hero-title {
        font-size: 1.3rem;
        line-height: 1.25;
        margin-bottom: 0.5rem;
    }
    
    .magazine-hero-excerpt {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 2; /* Limit to 2 lines on very small screens */
    }
    
    .magazine-hero-meta {
        font-size: 0.75rem;
        gap: 0.2rem;
    }
    
    .magazine-article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ===== MAGAZINE CATEGORIES SECTION ===== */
.magazine-categories {
    background: white;
    position: relative;
}

/* Category Section Container */
.magazine-category-section {
    position: relative;
    border-radius: var(--border-radius-lg);
    background: white;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition-slow);
}

.magazine-category-section:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

/* Category Header */
.magazine-category-header {
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 1rem;
}

.magazine-category-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-family: 'Georgia', serif;
}

.magazine-category-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0;
}

.magazine-category-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(197, 48, 48, 0.1);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    transition: all 0.25s ease;
    border: 1px solid rgba(197, 48, 48, 0.2);
    margin-left: 1rem;
    position: relative;
    text-transform: none;
    letter-spacing: 0.25px;
    white-space: nowrap;
    min-width: fit-content;
}

.magazine-category-link:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(197, 48, 48, 0.25);
    transform: translateY(-1px);
}

.magazine-category-link:hover i {
    transform: translateX(1px);
}

.magazine-category-link i {
    font-size: 0.8rem;
    transition: transform 0.25s ease;
    opacity: 0.8;
}

.magazine-category-link:hover i {
    opacity: 1;
}

/* Featured Article (Left Side) */
.magazine-category-featured-link {
    text-decoration: none;
    color: inherit;
}

.magazine-category-featured {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-slow);
    height: 100%;
}

.magazine-category-featured:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
}

.magazine-category-featured-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.magazine-category-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.magazine-category-featured:hover .magazine-category-featured-image img {
    transform: scale(1.08);
}

.magazine-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-accent);
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius);
}

.magazine-category-featured-content {
    padding: 1.5rem;
}

.magazine-category-featured-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-family: 'Georgia', serif;
}

.magazine-category-featured-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.magazine-category-featured-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--light-color);
    padding-top: 0.75rem;
}

/* Sidebar Articles (Right Side) */
.magazine-category-sidebar-link {
    text-decoration: none;
    color: inherit;
}

.magazine-category-sidebar-item {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
}

.magazine-category-sidebar-item:hover {
    background: #e8f4fd;
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.magazine-category-thumb {
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.magazine-category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.magazine-category-sidebar-item:hover .magazine-category-thumb img {
    transform: scale(1.1);
}

.magazine-category-sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.magazine-category-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Georgia', serif;
}

.magazine-category-sidebar-excerpt {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.magazine-category-sidebar-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Category Divider */
.magazine-category-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color) 30%, var(--accent-color) 70%, transparent);
    margin: 3rem 0;
    opacity: 0.3;
}

/* Empty State */
.magazine-category-empty {
    background: var(--light-color);
    border-radius: var(--border-radius);
    border: 2px dashed rgba(45, 55, 72, 0.2);
}

/* Mobile Responsive for Categories */
@media (max-width: 768px) {
    .magazine-category-section {
        padding: 1.5rem;
        margin-bottom: 3rem !important;
    }
    
    .magazine-category-title {
        font-size: 1.6rem;
    }
    
    .magazine-category-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    /* Mobile styles for View All button */
    .magazine-category-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.85rem;
        border-radius: 5px;
        letter-spacing: 0.2px;
        margin-left: 0.75rem;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .magazine-category-link i {
        font-size: 0.75rem;
    }
    
    .magazine-category-featured-image {
        height: 200px;
    }
    
    .magazine-category-featured-content {
        padding: 1.25rem;
    }
    
    .magazine-category-featured-title {
        font-size: 1.2rem;
    }
    
    .magazine-category-featured-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .magazine-category-sidebar-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem !important;
    }
    
    .magazine-category-thumb {
        width: 60px;
        height: 60px;
    }
    
    .magazine-category-sidebar-title {
        font-size: 0.9rem;
    }
    
    .magazine-category-sidebar-excerpt {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .magazine-category-section {
        padding: 1.25rem;
    }
    
    .magazine-category-title {
        font-size: 1.4rem;
    }
    
    .magazine-category-featured-image {
        height: 180px;
    }
    
    .magazine-category-featured-content {
        padding: 1rem;
    }
    
    .magazine-category-featured-title {
        font-size: 1.1rem;
    }
    
    .magazine-category-featured-excerpt {
        font-size: 0.9rem;
    }
    
    /* Extra small screens - View All button */
    .magazine-category-link {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
        border-radius: 4px;
        letter-spacing: 0.15px;
        gap: 0.3rem;
        margin-left: 0.5rem;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .magazine-category-link i {
        font-size: 0.7rem;
    }
}

/* Simplified Category Articles (replaces Featured/Sidebar layout) */
.magazine-category-article-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.magazine-category-article-link:hover {
    transform: translateY(-2px);
    color: inherit;
}

.magazine-category-article {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    margin: 1rem;
}

.magazine-category-article:hover {
    box-shadow: var(--shadow-lg);
}

.magazine-category-article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.magazine-category-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.magazine-category-article:hover .magazine-category-article-image img {
    transform: scale(1.05);
}

.magazine-category-article-content {
    padding: 1.25rem;
}

.magazine-category-article-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.magazine-category-article-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    font-size: 0.9rem;
}

.magazine-category-article-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    align-items: center;
}

/* Mobile responsive for simplified category articles */
@media (max-width: 768px) {
    .magazine-category-article {
        margin: 0.5rem 0;
    }
    
    .magazine-category-article-image {
        height: 160px;
    }
    
    .magazine-category-article-content {
        padding: 1rem;
    }
    
    .magazine-category-article-title {
        font-size: 1rem;
    }
    
    .magazine-category-article-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .magazine-category-article-meta {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
}

/* ===== SHARED COMPONENTS (Reusable across pages) ===== */

/* Article Cards - Shared between index and category pages */
.article-card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.article-card .article-image {
    position: relative;
    overflow: hidden;
}

.article-card .article-image img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-card .article-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.article-card .article-content {
    padding: 1rem 1.5rem 1rem 1.5rem; /* Reduce top and bottom padding */
    display: flex;
    flex-direction: column;
    /* Remove height: 100% to allow natural height */
}

.article-card .article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card .article-excerpt {
    color: var(--secondary-color);
    font-size: 0.9rem;
    /* Remove flex-grow: 1 to allow natural height */
    margin-bottom: 1rem;
    line-height: 1.5;
}

.article-card .article-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.article-card .article-meta i {
    opacity: 0.7;
}

/* .article-card .article-footer - removed for natural spacing */

.article-card .article-author {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.article-card .article-tags {
    margin-top: 0.5rem;
}

.article-card .tag-badge {
    display: inline-block;
    background: var(--light-color);
    color: var(--dark-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.article-card .tag-badge:hover {
    background: var(--primary-color);
    color: white;
}

/* Section Titles - Shared */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

/* Widget Styles - Shared */
.sidebar-widget {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}

.sidebar-widget .widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.sidebar-widget .widget-content {
    padding: 0 1.5rem 1.5rem;
}

/* ===== CATEGORY PAGE SPECIFIC STYLES ===== */

/* Category Hero Section - Magazine Style */
.category-hero {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(233, 236, 239, 0.9) 100%);
    border-bottom: 3px solid var(--accent-color);
    padding-top: 1rem !important; /* Minimal top padding */
    padding-bottom: 2rem !important; /* Reduce bottom padding */
    position: relative;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="0.5" fill="%23333" opacity="0.02"/><circle cx="80" cy="80" r="0.5" fill="%23333" opacity="0.02"/><circle cx="40" cy="60" r="0.3" fill="%23333" opacity="0.015"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Fix breadcrumb navigation being covered by fixed navbar */
.bg-light {
    margin-top: 20px; /* Minimal margin to avoid navbar overlap */
    padding-top: 0.5rem; /* Reduce internal padding */
    padding-bottom: 0.5rem; /* Reduce internal padding */
}

.category-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.25rem; /* Minimal bottom margin */
}

/* Override Bootstrap breadcrumb spacing */
.breadcrumb {
    margin-bottom: 0.25rem !important;
    padding: 0.25rem 0 !important; /* Minimal internal padding */
}

.category-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    font-family: 'Merriweather', Georgia, serif;
}

.category-meta .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.category-description {
    font-size: 1.1rem;
    color: var(--secondary-color);
    line-height: 1.6;
    margin: 0;
}

/* Category Stats Card */
.stats-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--primary-color);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* Category Content Section */
.category-content {
    background: white;
}

.category-articles .section-title {
    font-size: 1.8rem;
}

.category-sort .dropdown-toggle {
    border-color: #dee2e6;
    color: var(--secondary-color);
}

.category-sort .dropdown-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Category Sidebar - Sticky positioning */
.category-sidebar {
    position: sticky;
    top: 80px; /* Account for fixed navbar */
    height: fit-content;
    max-height: calc(100vh - 100px); /* Prevent overflow */
    overflow-y: auto; /* Allow scrolling if content is too tall */
}

/* Category Sidebar Widgets */
.category-sidebar .category-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.75rem;
}

.category-sidebar .category-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.category-sidebar .category-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.category-sidebar .category-item i {
    color: var(--primary-color);
    width: 20px;
}

.category-sidebar .category-item:hover i {
    color: white;
}

.category-sidebar .popular-article {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1rem;
}

.category-sidebar .popular-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.category-sidebar .popular-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.category-sidebar .popular-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius);
    flex-shrink: 0;
}

.category-sidebar .popular-content h6 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

/* Newsletter Widget - Magazine Style */
.newsletter-widget {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
    text-align: center;
    color: white;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.newsletter-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.newsletter-widget .widget-title {
    color: white !important;
    padding: 0 !important;
    margin-bottom: 1rem !important;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.025em;
}

.newsletter-form .input-group {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.newsletter-form .form-control {
    border: none;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark-color);
    font-size: 0.95rem;
}

.newsletter-form .form-control:focus {
    background: white;
    box-shadow: none;
    color: var(--dark-color);
}

.newsletter-form .form-control::placeholder {
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
}

.newsletter-form .btn {
    border: none;
    background: var(--gradient-accent);
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    transition: var(--transition);
}

.newsletter-form .btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Category Empty State */
.category-empty {
    background: white;
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    opacity: 0.5;
}

/* Category Pagination */
.category-pagination {
    display: flex;
    justify-content: center;
}

.category-pagination .pagination {
    margin: 0;
}

/* Reduce article card bottom spacing */
.category-articles .col-md-6 {
    margin-bottom: 0.25rem !important; /* Minimal spacing between cards */
    padding-left: 0.5rem !important; /* Reduce Bootstrap column padding */
    padding-right: 0.5rem !important; /* Reduce Bootstrap column padding */
}

.article-card {
    margin-bottom: 0 !important; /* Remove any extra bottom margin */
}

/* Reduce spacing in category content section */
.category-content {
    padding-top: 2rem !important; /* Reduce from default 5rem */
    padding-bottom: 2rem !important; /* Reduce from default 5rem */
}

/* Fix Bootstrap row margins in articles grid */
.category-articles .row {
    margin-left: -0.5rem !important; /* Match reduced column padding */
    margin-right: -0.5rem !important; /* Match reduced column padding */
    margin-bottom: 0 !important; /* Remove any bottom margin */
}

/* ===== LAZY LOADING STYLES ===== */

/* Lazy loading states */
img[loading="lazy"] {
    transition: opacity 0.3s ease-in-out;
}

.lazy-loading {
    opacity: 0.6;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.lazy-loaded {
    opacity: 1;
}

.lazy-error {
    opacity: 0.5;
    background-color: #f8f9fa;
    position: relative;
}

.lazy-error::after {
    content: "📷";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.5;
}

/* Shimmer animation for loading state */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .lazy-loading {
        animation: none;
    }
    
    img[loading="lazy"] {
        transition: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .category-title {
        font-size: 2rem;
    }
    
    .category-info {
        padding: 1.5rem;
    }
    
    .stats-card {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .category-sort {
        margin-top: 1rem;
    }
    
    .category-sidebar .popular-item {
        flex-direction: column;
        text-align: center;
    }
    
    .category-sidebar .popular-thumb {
        width: 80px;
        height: 80px;
        align-self: center;
    }
    
    /* Reduce spacing on mobile */
    .category-articles .col-md-6 {
        margin-bottom: 0.25rem !important; /* Minimal spacing on mobile */
        padding-left: 0.25rem !important; /* Even tighter on mobile */
        padding-right: 0.25rem !important; /* Even tighter on mobile */
    }
    
    .category-articles .row {
        margin-left: -0.25rem !important; /* Match mobile column padding */
        margin-right: -0.25rem !important; /* Match mobile column padding */
    }
    
    .bg-light {
        margin-top: 15px !important; /* Less margin on mobile */
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    
    .category-hero {
        padding-top: 0.75rem !important; /* Minimal padding on mobile */
        padding-bottom: 1.5rem !important;
    }
}

.index-trending .row {
    align-items: stretch; /* Ensure equal height alignment */
}

.index-trending .col-lg-8,
.index-trending .col-lg-4 {
    display: flex;
    flex-direction: column;
    min-height: 380px; /* Reduced height to better match content */
}

.index-featured-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    min-height: 480px;
    flex: 1; /* Ensure it takes full height */
}

.index-featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.index-featured-card .card-body {
    padding: 2rem;
}

.index-featured-card .card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.index-featured-card .badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.index-trending-sidebar {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    min-height: 480px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.index-trending-sidebar .index-trending-item:not(:last-child) {
    margin-bottom: 2rem; /* Increased spacing to fill height better */
}

.index-trending-sidebar h4 {
    color: var(--dark-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.index-trending-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.index-trending-item:last-child {
    border-bottom: none;
}

.index-trending-item:hover {
    background-color: #f8f9fa;
    padding-left: 0.5rem;
    border-radius: 0.25rem;
    transform: translateX(5px);
}

/* Clickable area improvements */
.index-trending-sidebar a {
    display: block;
    transition: var(--transition);
}

.index-trending-sidebar a:hover .index-trending-item {
    background-color: #f8f9fa;
    padding-left: 0.5rem;
    border-radius: 0.25rem;
    transform: translateX(5px);
}

.index-featured-card a {
    display: block;
    height: 100%;
}

.index-featured-card a:hover {
    text-decoration: none !important;
}

.index-featured-card img {
    object-fit: cover;
    transition: var(--transition);
}

.index-trending-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.index-trending-item h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

/* Categories Section */
.index-categories {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.index-category-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
    margin-bottom: 0;
}

.index-category-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.index-category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0;
}

.index-category-title i {
    font-size: 1.2rem;
}

/* Category posts styling */
.index-category-section .index-article-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.index-category-section .index-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.index-category-section .index-article-card .card-body {
    padding: 1rem;
}

.index-category-section .index-article-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.index-category-section .index-article-card .card-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

/* Compact post items */
.index-category-section .bg-light {
    transition: background-color 0.2s ease;
}

.index-category-section .bg-light:hover {
    background-color: #e9ecef !important;
}

.index-article-card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    overflow: hidden;
}

.index-article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.index-article-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.index-article-card:hover .card-img-top {
    transform: scale(1.05);
}

.index-article-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.index-article-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.index-article-card .card-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.index-article-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.index-article-meta i {
    opacity: 0.7;
}

/* Newsletter Section - Magazine Style */
.index-newsletter {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.index-newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(https://css.metalstudy.com/assets/css/%23dots)"/></svg>');
}

.index-newsletter .container {
    position: relative;
    z-index: 2;
}

.index-newsletter h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.index-newsletter-form .input-group {
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.index-newsletter-form .form-control {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

.index-newsletter-form .btn {
    padding: 1rem 2rem;
    font-weight: 600;
    border: 2px solid white;
    background: var(--gradient-accent);
    color: white;
    transition: var(--transition);
}

.index-newsletter-form .btn:hover {
    background-color: var(--accent-light);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer Styles - Magazine Design */
.index-footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2d3748 100%) !important;
    border-top: 3px solid var(--accent-color);
    position: relative;
}

.index-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color) 50%, transparent);
}

.index-footer h5 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
    font-size: 1.1rem;
    letter-spacing: 0.025em;
}

.index-footer ul li {
    margin-bottom: 0.5rem;
}

.index-footer a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 400;
    font-size: 0.95rem;
}

.index-footer a:hover {
    color: var(--accent-color) !important;
    padding-left: 0.5rem;
    transform: translateX(4px);
}

.index-footer .text-only-menu {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.9rem;
    line-height: 1.6;
}

.index-social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    font-size: 1.2rem;
}

.index-social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Copyright Section */
.index-copyright {
    background: #000 !important;
    border-top: 1px solid #333;
}

.index-copyright p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d !important; /* Ensure text is visible */
}

.index-copyright a {
    color: #6c757d !important;
}

.index-copyright a:hover {
    color: var(--primary-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 30px;
    }
    
    /* Reset navigation layout on mobile for better UX */
    .index-header .navbar-nav .nav-link {
        text-align: left;
        display: block;
        align-items: flex-start;
        justify-content: flex-start;
        min-height: auto;
        padding: 0.5rem 1rem !important;
    }
    
    .index-hero-title {
        font-size: 2.5rem;
    }
    
    .index-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .index-section-title {
        font-size: 2rem;
    }
    
    .index-search-form {
        min-width: 250px;
        margin-top: 1rem;
    }
    
    .index-hero-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Mobile newsletter form fixes - Enhanced */
    .index-newsletter-form .input-group {
        flex-direction: column !important;
        max-width: 100%;
        gap: 0.75rem;
    }
    
    .index-newsletter-form .form-control {
        font-size: 1rem !important;
        padding: 0.875rem 1rem !important;
        border-radius: var(--border-radius) !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        border: 1px solid #ced4da !important;
        background-color: #ffffff !important;
        color: #212529 !important;
        min-height: 48px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1 !important;
    }
    
    .index-newsletter-form .btn {
        margin-top: 0 !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        border-radius: var(--border-radius) !important;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 48px !important;
    }
    
    /* Ensure button is always visible on mobile */
    .index-newsletter-form .btn-light {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        border: 1px solid #f8f9fa !important;
    }
    
    /* Force input visibility on mobile - Ultimate fix */
    .index-newsletter input[type="email"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: white !important;
        color: #333 !important;
        min-height: 48px !important;
        width: 100% !important;
        border: 2px solid #007bff !important;
        border-radius: 8px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    
    /* Force container visibility */
    .index-newsletter .input-group {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }
    
    .index-trending-sidebar {
        margin-top: 2rem;
    }
}

/* ===================================
   Newsletter CTA Stability Fix
   ================================== */

/* Prevent layout shift and scrollbar flicker */
.newsletter-cta-stable {
    /* Pre-allocate space to prevent layout shift */
    min-height: 200px;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
}

.newsletter-cta-stable .newsletter-widget {
    /* Ensure immediate visibility */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    animation: none !important;
}

/* Smooth fade-in without layout shift */
.newsletter-cta-stable {
    animation: smoothFadeIn 0.6s ease-out;
}

@keyframes smoothFadeIn {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

/* Override AOS animations for stable elements */
.newsletter-cta-stable[data-aos] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
}

/* Prevent scrollbar flicker on page load */
body.loading {
    overflow-y: scroll;
}

/* Mobile stability */
@media (max-width: 768px) {
    .newsletter-cta-stable {
        min-height: 180px;
    }
}

@media (max-width: 576px) {
    .index-hero {
        text-align: center;
        padding: 3rem 0 !important;
    }
    
    .index-hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .index-hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .index-featured-card .row {
        flex-direction: column;
    }
    
    .index-featured-card img.img-fluid {
        height: 250px !important;
        max-height: 250px !important;
        width: 100% !important;
    }
    
    .index-category-title {
        font-size: 1rem;
    }
    
    /* Mobile spacing adjustments */
    .index-categories {
        padding: 2rem 0 !important;
    }
    
    .index-trending {
        padding: 2rem 0 !important;
    }
    
    /* Mobile button adjustments */
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Categories mobile optimization */
    .index-category-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .index-category-title {
        font-size: 1.1rem;
    }
    
    .index-category-section .index-article-card .card-title {
        font-size: 1rem;
    }
    
    .index-category-section .index-article-card .card-text {
        font-size: 0.85rem;
    }
    
    /* Newsletter mobile optimization */
    .index-newsletter {
        padding: 3rem 0 !important;
    }
    
    .index-newsletter h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .index-newsletter p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
}

/* Animation Enhancements */
.index-article-card,
.index-featured-card,
.index-trending-item {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.index-loading {
    opacity: 0.6;
    pointer-events: none;
}

.index-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.index-text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.index-shadow-hover {
    transition: var(--transition);
}

.index-shadow-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Search Suggestions */
.index-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Focus States for Accessibility */
.index-search-form .form-control:focus,
.index-newsletter-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Progress Bar - Removed duplicate definition */

/* Skip to main content */
.index-skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.index-skip-link:focus {
    top: 0;
    color: white;
}

/* Back to Top Button */
.index-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.index-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.index-back-to-top:hover {
    background: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* CTA Button Enhancement */
.index-cta-btn {
    padding: 1rem 3rem !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.index-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.index-cta-btn:hover::before {
    left: 100%;
}

/* Print Styles */
@media print {
    .index-header,
    .index-newsletter,
    .index-footer,
    .index-copyright,
    .index-progress-bar,
    .index-back-to-top {
        display: none;
    }
    
    .index-hero {
        background: white;
        color: black;
    }
    
    .index-article-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ===== SHARED UI COMPONENTS ===== */

/* Back to Top Button */
.index-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.index-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.index-back-to-top:hover {
    background: var(--dark-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Progress Bar - Fixed styles */
.index-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s ease;
}

/* Fade-in animation for lazy loaded images */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile adjustments for shared components */
@media (max-width: 768px) {
    .index-back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .breadcrumb {
        margin-bottom: 0.25rem !important;
        padding: 1.25rem 0 !important; /* Minimal internal padding */
    }
}

/* Post page specific styles post-article */

.post-breadcrumb {
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    background: rgba(248, 249, 250, 0.8);
}

.post-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    position: relative;
}

.post-meta {
    font-size: 0.9rem;
}

.post-excerpt .lead {
    font-size: 1.1rem;
    line-height: 1.6;
}

.post-content-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.post-content-text h1,
.post-content-text h2,
.post-content-text h3,
.post-content-text h4,
.post-content-text h5,
.post-content-text h6 {
    font-family: 'Merriweather', Georgia, serif;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    scroll-margin-top: 100px; /* Offset for fixed header when scrolling to headings */
}

.post-content-text h2 {
    font-size: 1.875rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.post-content-text h3 {
    font-size: 1.5rem;
}

.post-content-text p {
    margin-bottom: 1.75rem;
    text-align: justify;
}

.post-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin: 2rem auto;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

/* Image captions */
.post-content-text img + em,
.post-content-text figure figcaption {
    display: block;
    text-align: center;
    font-style: italic;
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.post-content-text blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6c757d;
}

.post-content-text code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.post-content-text pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

/* Table Styles for Article Content */
.post-content-text table {
    width: 100%;
    margin: 2rem 0 2.5rem 0; /* Extra bottom margin for spacing */
    border-collapse: collapse;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
}

.post-content-text thead {
    background: #f3f4f6;
}

.post-content-text th {
    padding: 0.875rem 1rem;
    text-align: center; /* Center align headers */
    font-weight: 700; /* Bold headers */
    color: #374151;
    background: #e5e7eb; /* Darker background for headers */
    border-bottom: 2px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.post-content-text th:last-child {
    border-right: none;
}

.post-content-text td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
    line-height: 1.5;
}

.post-content-text td:last-child {
    border-right: none;
}

.post-content-text tbody tr:nth-child(even) {
    background: #f9fafb;
}

.post-content-text tbody tr:hover {
    background: #f3f4f6;
    transition: background-color 0.2s ease;
}

/* Mobile Table Wrapper - Prevent page width overflow */
.post-content-text .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0 2.5rem 0;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
}

.post-content-text .table-responsive table {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-width: 600px; /* Minimum table width to maintain readability */
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .post-content-text th,
    .post-content-text td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .post-content-text th {
        font-size: 0.8rem;
    }
}

/* Prevent content overflow and maintain responsive layout */
.post-content-text,
.page-content-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Handle long URLs and code snippets */
.post-content-text a,
.page-content-text a {
    word-break: break-all;
    overflow-wrap: break-word;
}

.post-content-text code,
.page-content-text code {
    word-break: break-all;
    white-space: pre-wrap;
}

/* Ensure pre blocks don't cause horizontal overflow */
.post-content-text pre,
.page-content-text pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Handle very long words in content */
.post-content-text p,
.post-content-text li,
.page-content-text p,
.page-content-text li {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.share-buttons .btn {
    transition: all 0.3s ease;
}

.share-buttons .btn:hover {
    transform: translateY(-2px);
}


/* Sidebar sticky positioning - Remove scrollbar */
.sticky-sidebar {
    position: sticky;
    top: 70px;
    max-height: none;
    overflow: visible;
}

/* Ensure proper Bootstrap grid layout */
.post-article .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

 .post-article .col-md-8,
 .post-article .col-md-4 {
     position: relative;
     width: 100%;
     padding-right: 15px;
     padding-left: 15px;
 }
 
 @media (min-width: 768px) {
     .post-article .col-md-8 {
         flex: 0 0 66.666667%;
         max-width: 66.666667%;
     }
     
     .post-article .col-md-4 {
         flex: 0 0 33.333333%;
         max-width: 33.333333%;
     }
 }

/* Clean sidebar styling - NO MARGINS OR PADDING */
.post-sidebar {
    padding: 0;
    margin: 0;
}

.post-article .sidebar-widget {
    background: #fff;
    border: 1px solid #e9ecef;
}

.post-article .widget-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* TOC specific styling - Responsive height */
.toc-container {
    overflow: visible;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.toc-container::-webkit-scrollbar {
    width: 4px;
}

.toc-container::-webkit-scrollbar-track {
    background: transparent;
}

.toc-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 2px;
}

.toc-container::-webkit-scrollbar-thumb:hover {
    background-color: #a0aec0;
}

.toc-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-container li {
    margin: 0;
    margin-bottom: 0.3rem;
}

.toc-container a {
    display: block;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    padding: 0.2rem 0.4rem;
    border-radius: 0.375rem;
}

.toc-container a:hover,
.toc-container a.active {
    color: #007bff;
    background: #f8f9fa;
}

/* Mobile TOC Styles */
.mobile-toc {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mobile-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.mobile-toc-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.mobile-toc-count {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
    margin-left: 0.5rem;
}

.mobile-toc-toggle {
    color: #007bff;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.mobile-toc-toggle:hover {
    color: #0056b3;
    text-decoration: none;
}

.mobile-toc-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    border-radius: 0.25rem;
}

.mobile-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-toc-item {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-toc-item[data-level="3"] {
    margin-left: 1rem;
}

.mobile-toc-link {
    display: block;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.7);
}

.mobile-toc-link:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.08);
    border-color: rgba(0, 123, 255, 0.2);
    text-decoration: none;
    transform: translateX(2px);
}

.mobile-toc-link.active {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
    font-weight: 500;
}

/* Animation for expand/collapse */
.mobile-toc-hidden {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.mobile-toc-list.expanded .mobile-toc-hidden {
    opacity: 1;
    transform: translateY(0);
}

/* Hide sidebar TOC on mobile since we have mobile TOC */
@media (max-width: 768px) {
    .post-sidebar .sidebar-widget:has(#tableOfContents),
    .post-sidebar .sidebar-widget:has(.toc-container) {
        display: none !important;
    }
    
    /* Fallback for browsers that don't support :has() */
    .post-sidebar .sidebar-widget .widget-title:contains("Table of Contents") {
        display: none !important;
    }
    
    .post-sidebar .toc-container {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .mobile-toc {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .mobile-toc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .mobile-toc-toggle {
        align-self: flex-end;
        font-size: 0.8rem;
    }
    
    .mobile-toc-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.6rem;
    }
}

/* ===== FORM FEEDBACK STYLES ===== */

/* Form alert messages */
.form-alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideInDown 0.3s ease-out;
}

.form-alert.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.form-alert.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Form field validation styles */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Form submission loading state */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Animation for form alerts */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form container enhancements */
.page-content-text form {
    background: rgba(248, 249, 250, 0.5);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
    margin: 2rem 0;
}

.page-content-text .form-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

.page-content-text .form-description {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Mobile form optimizations */
@media (max-width: 768px) {
    .page-content-text form {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .form-alert {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .invalid-feedback {
        font-size: 0.8rem;
    }
}

/* Remove post-specific newsletter overrides - use unified Magazine style */

/* Author card styles */
.author-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.author-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.author-bio {
    position: relative;
}

.author-bio.collapsed #authorBioText {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-social .btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        font-size: 0.85rem;
    }
    
    .post-content-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .post-content-text h2 {
        font-size: 1.5rem;
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 0.5rem;
    }
    
    .post-content-text img {
        border-radius: 8px;
        margin: 1.5rem auto;
        max-height: 300px;
    }
    
    .share-buttons .btn {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
    }
    
    .sticky-sidebar {
        position: relative !important;
        top: auto !important;
        max-height: none !important;
    }
    
    .post-sidebar {
        margin-top: 2rem;
        min-height: auto;
    }
    
    .author-card {
        margin-top: 2rem;
    }
}

/* ===== PAGE TEMPLATE STYLES ===== */

/* Page Article Layout */
.page-article {
    min-height: 60vh;
}

.page-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 3rem;
    margin-bottom: 2rem;
    max-width: none; /* Allow full container width */
}

/* Page Header */
.page-header {
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

.page-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a202c;
    margin-bottom: 1rem;
}

.page-meta {
    font-size: 0.9rem;
    justify-content: center;
}

.page-meta .d-flex {
    justify-content: center;
}

/* Page Content Text */
.page-content-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.125rem;
    line-height: 1.75;
    color: #374151;
    letter-spacing: -0.01em;
}

.page-content-text h1,
.page-content-text h2,
.page-content-text h3,
.page-content-text h4,
.page-content-text h5,
.page-content-text h6 {
    font-family: 'Merriweather', Georgia, serif;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: #1a202c;
    font-weight: 600;
    line-height: 1.3;
    scroll-margin-top: 100px;
}

.page-content-text h1 {
    font-size: 2.25rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.page-content-text h2 {
    font-size: 1.875rem;
    padding-bottom: 0.5rem;
}

.page-content-text h3 {
    font-size: 1.5rem;
}

.page-content-text h4 {
    font-size: 1.25rem;
}

.page-content-text p {
    margin-bottom: 1.75rem;
    text-align: justify;
}

.page-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin: 2rem auto;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

.page-content-text blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6c757d;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.page-content-text code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #e83e8c;
}

.page-content-text pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
}

.page-content-text ul,
.page-content-text ol {
    margin-bottom: 1.75rem;
    padding-left: 2rem;
}

.page-content-text li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.page-content-text table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

.page-content-text th,
.page-content-text td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.page-content-text th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Page Actions */
.page-actions {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
}

.page-actions .share-buttons .btn {
    transition: all 0.3s ease;
}

.page-actions .share-buttons .btn:hover {
    transform: translateY(-2px);
}

.page-navigation .btn {
    min-width: 120px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .page-content {
        padding: 2rem 1.5rem;
        border-radius: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
        text-align: left;
    }
    
    .page-header {
        text-align: left;
        padding-bottom: 1.5rem;
    }
    
    .page-meta .d-flex {
        justify-content: flex-start;
    }
    
    .page-content-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .page-content-text h1 {
        font-size: 1.75rem;
    }
    
    .page-content-text h2 {
        font-size: 1.5rem;
    }
    
    .page-content-text h3 {
        font-size: 1.25rem;
    }
    
    .page-content-text img {
        border-radius: 8px;
        margin: 1.5rem auto;
        max-height: 300px;
    }
    
    .page-actions {
        padding: 1.5rem;
    }
    
    .page-actions .row {
        text-align: center;
    }
    
    .page-actions .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .page-actions .share-buttons .btn {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 1.5rem 1rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-actions {
        padding: 1rem;
    }
}

/* ===== EU COOKIE CONSENT BANNER - Magazine Style ===== */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 3px solid var(--accent-color);
    backdrop-filter: blur(10px);
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-consent-banner.hide {
    transform: translateY(100%);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ecf0f1;
}

.cookie-consent-description {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #bdc3c7;
}

.cookie-consent-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-consent-banner .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cookie-consent-banner .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    background-color: transparent;
}

.cookie-consent-banner .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
    transform: translateY(-1px);
}

.cookie-consent-banner .btn-light {
    background: var(--gradient-accent);
    border-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

.cookie-consent-banner .btn-light:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile responsive for cookie banner */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-consent-title {
        font-size: 1rem;
    }
    
    .cookie-consent-description {
        font-size: 0.85rem;
    }
    
    .cookie-consent-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .cookie-consent-banner .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}