/* Modern Single Post Styles - Optimized for Performance */
/* Using CSS custom properties and modern techniques */

:root {
    /* Modern Blue Color Palette - consistent with landing page */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #1d4ed8;
    --accent: #0ea5e9;
    --success: #10b981;
    --neutral-50: #fafafa;
    --neutral-100: #f4f4f5;
    --neutral-200: #e4e4e7;
    --neutral-300: #d4d4d8;
    --neutral-400: #a1a1aa;
    --neutral-500: #71717a;
    --neutral-600: #52525b;
    --neutral-700: #3f3f46;
    --neutral-800: #27272a;
    --neutral-900: #18181b;
    
    /* Glass Morphism Effects */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    --font-display: 'Inter', var(--font-sans);
}

/* Modern Single Post Container - Full Width Responsive with Sticky Fix */
.modern-single-container {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 60px 40px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(600px, 2.5fr) minmax(280px, 1fr);
    gap: 40px;
    align-items: stretch; /* CRITICAL FIX: Changed from 'start' to 'stretch' for sticky positioning */
    font-family: var(--font-sans);
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    /* STICKY FIX: Ensure proper stacking context for sticky elements */
    isolation: isolate;
}

/* Container wrapper for proper full-width */
.ast-container,
.entry-content .alignfull,
.site-content .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Override Astra theme constraints for full-width layout */
.single .site-content > .ast-container {
    max-width: 100% !important;
    /* STICKY FIX: Ensure Astra container doesn't interfere with sticky positioning */
    position: static !important;
    transform: none !important;
}

.single article.ast-article-single {
    margin: 0;
    padding: 0;
    /* STICKY FIX: Ensure article container doesn't create new stacking context */
    position: static !important;
    transform: none !important;
}

/* Ensure full-width on all single post pages */
.single .site-main,
.single .content-area,
.single .site-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    /* STICKY FIX: Prevent Astra theme containers from interfering with sticky positioning */
    position: static !important;
    transform: none !important;
    overflow: visible !important;
}

/* Remove any Astra padding/margins */
.single .ast-separate-container .ast-article-post,
.single .ast-separate-container .ast-article-single,
.single.ast-separate-container .site-content > .ast-container {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Hide Astra's default post meta and title */
.single .ast-single-post-order,
.single .entry-header,
.single .ast-post-format-,
.single .post-thumb-img-content {
    display: none;
}

/* Full viewport width for hero */
.single .post-header {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
}

/* Main Content Area with Liquid Glass Effect */
.single-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 
        0 25px 80px -15px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    margin: 20px 0;
    align-self: start;
}

/* Liquid Glass Shimmer Effect */
.single-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 60%);
    transform: rotate(-45deg);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 1;
}

.single-content:hover::before {
    opacity: 1;
    animation: liquidShine 0.8s ease-out;
}

@keyframes liquidShine {
    0% {
        transform: translateX(-100%) rotate(-45deg);
    }
    100% {
        transform: translateX(100%) rotate(-45deg);
    }
}

/* Modern Post Header */
.post-header {
    position: relative;
    overflow: hidden;
    min-height: 450px;
    height: auto;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: end;
}

.post-featured-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    z-index: 1;
}

.post-header:hover .post-featured-image {
    transform: scale(1.05);
}

.post-header-overlay {
    position: relative;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.3) 80%, transparent 100%);
    padding: 50px;
    color: white;
    z-index: 2;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-top: auto;
    overflow: visible;
    box-sizing: border-box;
}

.post-title-single {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    animation: slideInUp 1s ease-out 0.2s both;
    line-height: 1.3;
    letter-spacing: -0.02em;
    font-family: var(--font-display);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.post-meta-single {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.95;
    animation: slideInUp 1s ease-out 0.4s both;
    flex-wrap: wrap;
    line-height: 1.4;
    margin-top: 8px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.author-avatar-single {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Content Wrapper */
.post-content-wrapper {
    padding: 50px;
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.post-content-single {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--neutral-800);
    animation: fadeIn 1s ease-out 0.6s both;
    font-family: var(--font-sans);
}

.post-content-single h2,
.post-content-single h3,
.post-content-single h4 {
    color: var(--neutral-900);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.post-content-single h2 {
    font-size: 1.875rem;
    border-left: 4px solid var(--primary);
    padding-left: 24px;
    position: relative;
}

.post-content-single h2::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

.post-content-single h3 {
    font-size: 1.5rem;
}

.post-content-single p {
    margin-bottom: 1.75rem;
}

.post-content-single blockquote {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
    padding: 30px;
    margin: 2.5rem 0;
    font-style: italic;
    border-radius: 16px;
    position: relative;
    box-shadow: var(--glass-shadow);
}

.post-content-single img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 2.5rem 0;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}

.post-content-single img:hover {
    transform: scale(1.02);
}

/* Modern Sticky Sidebars - FULL VIEWPORT HEIGHT, STICKY, AND SCROLLABLE */
.modern-sidebar {
    position: sticky !important; /* CRITICAL FIX: Force sticky positioning with specificity */
    top: 20px !important; /* CRITICAL FIX: Ensure sticky offset is respected */
    align-self: start; /* Keep alignment for proper sticky behavior */
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
    padding: 20px 8px 20px 0;
    box-sizing: border-box;
    /* STICKY FIX: Ensure proper z-index stacking */
    z-index: 10;
    /* STICKY FIX: Prevent transform interference */
    will-change: auto;
}

.modern-sidebar::-webkit-scrollbar {
    width: 6px;
}

.modern-sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.modern-sidebar::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.modern-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* Ensure sidebars maintain proper sticky behavior and fill ENTIRE screen height */
.sidebar-left,
.sidebar-right {
    position: sticky !important; /* CRITICAL FIX: Force sticky positioning with specificity */
    top: 20px !important; /* CRITICAL FIX: Ensure sticky offset is respected */
    align-self: start; /* Keep alignment for proper sticky behavior */
    height: calc(100vh - 40px); /* Account for top offset */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px 8px 20px 0;
    box-sizing: border-box;
    /* STICKY FIX: Ensure proper z-index stacking for each sidebar */
    z-index: 10;
    /* STICKY FIX: Create new stacking context to prevent interference */
    isolation: isolate;
}

.sidebar-left {
    animation: slideInLeft 0.8s ease-out 0.3s both;
}

.sidebar-right {
    animation: slideInRight 0.8s ease-out 0.3s both;
}

/* Sidebar Content Wrapper - ensures proper scrolling within sticky container */
.sidebar-content-wrapper {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px; /* Space for scrollbar */
    margin-right: -12px; /* Compensate for padding */
}

.sidebar-widget {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sidebar-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 60%);
    transform: rotate(-45deg);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.sidebar-widget:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.sidebar-widget:hover::before {
    opacity: 1;
    animation: liquidShine 0.8s ease-out;
}

.widget-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 24px;
    border-bottom: 2px solid var(--neutral-200);
    padding-bottom: 12px;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.widget-content {
    color: var(--neutral-700);
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--neutral-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.widget-list li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    width: 4px;
    height: 0;
    background: var(--primary);
    border-radius: 2px;
    transition: height 0.3s ease;
    transform: translateY(-50%);
}

.widget-list li:hover {
    background: rgba(59, 130, 246, 0.03);
    padding-left: 16px;
    border-radius: 12px;
    transform: translateX(4px);
}

.widget-list li:hover::before {
    height: 20px;
}

.widget-list li:last-child {
    border-bottom: none;
}

.widget-list a {
    color: var(--neutral-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.widget-list a:hover {
    color: var(--primary);
}

/* Enhanced Author Bio */
.author-bio {
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.author-bio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.author-bio .author-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.9);
    margin: 0 auto 20px;
    display: block;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.author-bio:hover .author-avatar-large {
    transform: scale(1.1);
}

.author-bio h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.author-bio p {
    opacity: 0.95;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    font-size: 1rem;
}

/* Recent Posts Widget */
.recent-post-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--neutral-200);
    transition: all 0.3s ease;
}

.recent-post-item:last-child {
    border-bottom: none;
}

.recent-post-item:hover {
    background: rgba(59, 130, 246, 0.03);
    margin: 0 -16px;
    padding: 20px 16px;
    border-radius: 12px;
}

.recent-post-thumb {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    background: linear-gradient(45deg, var(--primary), var(--accent));
}

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

.recent-post-content h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: 600;
}

.recent-post-content h4 a {
    color: var(--neutral-800);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.recent-post-date {
    font-size: 0.875rem;
    color: var(--neutral-500);
    font-weight: 500;
}

/* Enhanced Share Buttons */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.share-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.6s ease;
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877f2, #0c5dc7);
    color: white;
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
    color: white;
}

.share-btn.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
    color: white;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    color: white;
    text-decoration: none;
}

.share-btn:hover::before {
    left: 100%;
}

/* Reading Progress */
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--neutral-200);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.95rem;
    color: var(--neutral-600);
    text-align: center;
    margin: 0;
    font-weight: 500;
}

/* Modern Post Navigation */
.post-navigation {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    margin-top: 50px;
    box-shadow: var(--glass-shadow);
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.nav-link {
    flex: 1;
    text-align: center;
    padding: 24px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--neutral-700);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link span,
.nav-link strong {
    position: relative;
    z-index: 2;
}

.nav-link:hover {
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.3);
}

.nav-link:hover::before {
    opacity: 1;
}

/* Performance Optimizations */
.modern-single-container * {
    will-change: auto;
}

.single-content,
.sidebar-widget,
.post-navigation {
    contain: layout style paint;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .modern-single-container {
        grid-template-columns: 250px 1fr 250px;
        gap: 30px;
        padding: 50px 30px;
    }
    
    .post-content-wrapper {
        padding: 40px;
    }
}

@media (max-width: 1200px) {
    .modern-single-container {
        grid-template-columns: 220px 1fr 220px;
        gap: 25px;
        padding: 40px 20px;
    }
    
    .sidebar-widget {
        padding: 24px;
    }
}

@media (max-width: 1024px) {
    .modern-single-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 20px;
    }
    
    /* Stack sidebars on tablet */
    .sidebar-left,
    .sidebar-right {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* Remove fade effect on tablet/mobile */
    .sidebar-content-wrapper {
        max-height: none;
        overflow-y: visible;
    }
    
    .sidebar-content-wrapper::after {
        display: none;
    }
    
    .single-content {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }
    
    .post-header {
        min-height: 400px;
        height: auto;
    }
    
    .post-header-overlay {
        padding: 40px;
        min-height: 180px;
    }
    
    .modern-sidebar {
        position: static;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }
    
    .sidebar-content-wrapper {
        height: auto;
        overflow-y: visible;
        padding-right: 0;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .modern-single-container {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 20px 15px;
    }
    
    .single-content {
        border-radius: 20px;
    }
    
    .post-title-single {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
        line-height: 1.2;
    }
    
    .post-header {
        min-height: 350px;
        height: auto;
        border-radius: 20px 20px 0 0;
    }
    
    .post-header-overlay {
        padding: 30px 20px;
        min-height: 160px;
    }
    
    .post-content-wrapper {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .post-content-single {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    .modern-sidebar {
        position: static;
        order: 2;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }
    
    .single-content {
        order: 1;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 15px;
        padding: 30px 20px;
    }
    
    .sidebar-left,
    .sidebar-right {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .sidebar-widget {
        margin-bottom: 0;
        border-radius: 20px;
        padding: 24px;
    }
    
    /* Hide TOC on mobile for better UX */
    .sidebar-widget:first-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .modern-single-container {
        padding: 15px 10px;
        gap: 20px;
    }
    
    .post-content-wrapper {
        padding: 20px 16px;
    }
    
    .post-content-single {
        font-size: 1rem;
        line-height: 1.65;
    }
    
    .post-content-single h2 {
        font-size: 1.5rem;
    }
    
    .post-content-single h3 {
        font-size: 1.25rem;
    }
    
    .sidebar-widget {
        padding: 20px;
        border-radius: 16px;
    }
    
    .post-header {
        min-height: 280px;
        height: auto;
    }
    
    .post-header-overlay {
        padding: 20px 16px;
        min-height: 140px;
    }
    
    .post-title-single {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
        margin-bottom: 16px;
        line-height: 1.3;
    }
    
    .post-meta-single {
        gap: 12px;
        font-size: 0.875rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .author-avatar-single {
        width: 32px;
        height: 32px;
    }
    
    .post-navigation {
        padding: 24px 16px;
    }
    
    .nav-link {
        padding: 16px;
        font-size: 0.9rem;
    }
    
    /* Optimize share buttons for mobile */
    .share-buttons {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .share-btn {
        flex-shrink: 0;
        padding: 12px 16px;
        font-size: 0.875rem;
    }
    
    .share-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --neutral-50: #18181b;
        --neutral-100: #27272a;
        --neutral-200: #3f3f46;
        --neutral-800: #f4f4f5;
        --neutral-700: #d4d4d8;
        --neutral-600: #a1a1aa;
        --neutral-500: #71717a;
        --glass-bg: rgba(39, 39, 42, 0.95);
    }
    
    .single-content,
    .sidebar-widget,
    .post-navigation {
        background: var(--glass-bg);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Dark mode fade effect */
    .sidebar-content-wrapper::after {
        background: linear-gradient(to bottom, 
            transparent 0%, 
            rgba(24, 24, 27, 0.8) 50%, 
            rgba(24, 24, 27, 0.95) 100%);
    }
}

/* ===================================================================
   CRITICAL STICKY POSITIONING FIX - COMPREHENSIVE SOLUTION
   ================================================================== */

/* Force sticky positioning to work by overriding any theme conflicts */
.modern-single-post .modern-sidebar,
.modern-single-post .sidebar-left,
.modern-single-post .sidebar-right,
body.single .modern-sidebar,
body.single .sidebar-left,
body.single .sidebar-right {
    position: sticky !important;
    top: 20px !important;
    z-index: 10 !important;
    /* Prevent any transform interference that breaks sticky positioning */
    transform: none !important;
    /* Ensure proper stacking context */
    isolation: isolate;
    /* Prevent overflow issues in parent containers */
    contain: layout style;
}

/* Ensure parent containers don't interfere with sticky positioning */
body.single .modern-single-container,
body.modern-single-post .modern-single-container {
    /* Force grid alignment that works with sticky */
    align-items: stretch !important;
    /* Ensure proper stacking context */
    isolation: isolate;
    /* Prevent transform interference */
    transform: none !important;
}

/* Override any Astra theme styles that might break sticky positioning */
body.single .site,
body.single .site-content,
body.single .ast-container,
body.single .ast-article-single {
    position: static !important;
    transform: none !important;
    overflow: visible !important;
    height: auto !important;
    contain: none !important;
}

/* Ensure sidebar content wrapper works properly with sticky */
.modern-sidebar .sidebar-content-wrapper,
.sidebar-left .sidebar-content-wrapper,
.sidebar-right .sidebar-content-wrapper {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Ensure smooth scrolling */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}