/**
 * COMPLETE Floating Card Blog Post Design CSS
 * WITH SIDEBAR OVERLAP FIXES
 */

/* Page Background - Light Cream */
body.single-post {
    background: var(--page-bg, #fefcf8);
    margin: 0;
    padding-top: 0;
}

/* Make the single-post-layout the flex container */
.single-post-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 100vh;
    background: var(--page-bg, #fefcf8);
    position: relative;
}

/* Hero Image Container */
.hero-image-container {
    width: 100%;
    height: 60vh;
    min-height: 500px;
    max-height: 700px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    z-index: 1;
    margin-top: 0;
    top: 0;
}

.hero-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-fallback {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
}

/* MAIN FLOATING CARD - Contains all content */
.floating-blog-card {
    background: var(--frame-bg, #ffffff);
    border-radius: 20px;
    max-width: 800px;
    margin: -50px auto 3rem auto;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 15; /* FIXED: Highest z-index to stay on top */
    text-align: center;
    box-sizing: border-box; /* FIXED: Ensure proper sizing */
    order: 1 !important; /* FIXED: Ensure it comes first */
}

/* Card Title */
.floating-blog-card .blog-card-title {
    font-family: var(--font-headline-feature, 'Merriweather', serif);
    font-size: var(--headline-size-feature, 3rem);
    font-weight: var(--font-weight-headline, 800);
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Card Summary/Excerpt */
.floating-blog-card .blog-card-summary {
    font-family: var(--font-subtitle-feature, 'Inter', sans-serif);
    font-size: var(--subtitle-size-feature, 1.25rem);
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-style: italic;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

/* Card Meta */
.floating-blog-card .blog-card-meta {
    font-family: var(--font-body-feature, 'Inter', sans-serif);
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}

.reading-time svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    width: 16px;
    height: 16px;
    stroke: #6b7280;
}

/* MAIN CONTENT INSIDE FLOATING CARD */
.floating-blog-card .blog-post-content {
    font-family: var(--font-body-feature, 'Inter', sans-serif);
    font-size: var(--body-size-feature, 1rem);
    line-height: var(--feature-line-height, 1.6);
    color: #333;
    margin-top: 2rem;
    text-align: left;
}

.floating-blog-card .blog-post-content h2 {
    font-family: var(--font-headline-feature, 'Merriweather', serif);
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--btn-bg, #144c80);
    padding-bottom: 0.5rem;
}

.floating-blog-card .blog-post-content h3 {
    font-family: var(--font-headline-feature, 'Merriweather', serif);
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.floating-blog-card .blog-post-content p {
    margin-bottom: 1.5rem;
    text-align: left;
}

.floating-blog-card .blog-post-content a {
    color: var(--btn-bg, #144c80);
    text-decoration: none;
    border-bottom: 1px solid var(--btn-bg, #144c80);
}

.floating-blog-card .blog-post-content a:hover {
    opacity: 0.8;
}

.floating-blog-card .blog-post-content img {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 100%;
    height: auto;
    display: block;
}

.floating-blog-card .blog-post-content blockquote {
    border-left: 4px solid var(--btn-bg, #144c80);
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.floating-blog-card .blog-post-content ul,
.floating-blog-card .blog-post-content ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.floating-blog-card .blog-post-content li {
    margin-bottom: 0.5rem;
}

/* TAGS AND CATEGORIES INSIDE FLOATING CARD */
.floating-blog-card .post-tags,
.floating-blog-card .post-categories {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: left;
}

.floating-blog-card .post-tags h4,
.floating-blog-card .post-categories h4 {
    font-family: var(--font-headline-feature, 'Merriweather', serif);
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.floating-blog-card .tags-list,
.floating-blog-card .categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.floating-blog-card .tag,
.floating-blog-card .category {
    background: #f1f5f9;
    color: var(--btn-bg, #144c80);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.floating-blog-card .tag:hover,
.floating-blog-card .category:hover {
    background: var(--btn-bg, #144c80);
    color: white;
}

/* SIDEBAR POSITIONING - FIXED OVERLAP ISSUE */
.main-content-wrapper {
    background: var(--page-bg, #fefcf8);
    padding: 0;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    z-index: 5;
}

.content-container {
    order: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 0 2rem; /* Add right padding for breathing room */
    display: grid;
    grid-template-columns: 100px 1fr 300px; /* ADJUSTED: More space for sidebar */
    gap: 1rem; /* INCREASED gap for better separation */
    align-items: start;
    position: relative;
    margin-top: -300px; /* FIXED: Reduced from -350px */
    z-index: 5;
}

/* LEFT SIDEBAR: Social Share - FIXED positioning */
.social-share-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 8;
    margin-top: 100px; /* FIXED: Reduced from 200px */
    margin-left: 1rem; /* FIXED: Add left margin */
}

.share-label {
    font-family: var(--font-body-feature, 'Inter', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-align: center;
}

.share-icons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.share-icon:hover {
    background: var(--btn-bg, #144c80);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 76, 128, 0.3);
}

.share-icon svg {
    width: 30px;
    height: 30px;
}

/* CENTER COLUMN: EMPTY (content is in floating card) */
.post-main-content {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
    position: relative;
    z-index: 10; /* FIXED: Higher z-index for floating card */
}

/* RIGHT SIDEBAR: Recent Posts - FIXED positioning */
.post-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 8;
    margin-top: 100px; /* FIXED: Reduced from 200px */
    margin-left: 1rem; /* FIXED: Add left margin */
    margin-right: 2rem; /* FIXED: Increased from 1rem to 2rem */
    padding: 2rem;
    margin-right: 2rem;  /* INCREASED from 1rem to 2rem to push further right */
    width: 320px; /* FIXED: Fixed width to prevent expansion */
    box-sizing: border-box; /* FIXED: Ensure proper sizing */
}

/* SEARCH FORM - FIXED width overflow */
.sidebar-search {
    background: var(--frame-bg, #ffffff);
    padding: 1.5rem; /* REDUCED from 1.5rem */
    border-radius: 16px; /* Slightly smaller radius */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Lighter shadow */
    border: 2px solid #f1f5f9;
    margin-bottom: 1.5rem;
    width: 320px; /* REDUCED from 320px */
    box-sizing: border-box;
}

.sidebar-search h4 {
    font-size: 1.1rem; /* Smaller heading */
    margin-bottom: 1rem;
}

/* SEARCH INPUT - Smaller */
.search-input-container {
    display: flex;
    border: 2px solid #e5e7eb;
    border-radius: 8px; /* Smaller radius */
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.search-input-container:focus-within {
    border-color: var(--btn-bg, #144c80);
    box-shadow: 0 0 0 3px rgba(20, 76, 128, 0.1);
}

.search-field {
    flex: 1;
    padding: 0.65rem 0.85rem; /* REDUCED padding */
    border: none;
    background: transparent;
    font-size: 0.85rem; /* REDUCED from 0.9rem */
    outline: none;
    font-family: var(--font-body-feature, 'Inter', sans-serif);
    min-width: 0;
}

.search-field::placeholder {
    color: #9ca3af;
}

.search-submit {
    background: var(--btn-bg, #144c80) !important;
    color: white !important;
    border: none !important;
    padding: 0.65rem 0.85rem !important; /* REDUCED padding */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 45px !important; /* REDUCED from 50px */
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.search-submit:hover {
    background: #1e5a8a !important;
}

.search-submit svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* RECENT POSTS - FIXED width overflow */
.sidebar-recent-posts {
    background: var(--frame-bg, #ffffff);
    padding: 1.5rem; /* REDUCED from 2rem */
    border-radius: 16px; /* Slightly smaller radius */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Lighter shadow */
    border: 2px solid #f1f5f9;
    width: 320px; /* REDUCED from 320px */
    box-sizing: border-box;
}

.sidebar-recent-posts h4 {
    font-family: var(--font-headline-feature, 'Merriweather', serif);
    color: #1a1a1a;
    margin-bottom: 1.25rem; /* REDUCED from 1.5rem */
    font-size: 1.1rem; /* REDUCED from 1.25rem */
}

.recent-posts-list {
    display: grid;
    grid-template-columns: 1fr; /* Single column of cards */
    gap: 1.5rem;
}

/* RECENT POST ITEMS - Slightly smaller */
.recent-post-item {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    background: #f8f9fa; /* Light background for each card */
    border-radius: 12px; /* Rounded corners */
    overflow: hidden; /* Ensure image doesn't overflow rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    padding: 0; /* Remove padding since we'll add it to content */
    border-bottom: none; /* Remove the old border-bottom */
}

.recent-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Image container - Full width at top */
.recent-post-image {
    width: 100%; /* Full width of card */
    height: 120px; /* Fixed height for consistency */
    flex-shrink: 0;
    border-radius: 0; /* No border radius since it's at top of card */
    overflow: hidden;
    margin: 0; /* Remove margins */
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.5rem;
}

/* Content container - Below image */
.recent-post-content {
    padding: 1rem; /* Add padding inside content area */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Date - First element after image */
.recent-post-date {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    order: 1; /* Ensure date comes first */
}

/* Title - Second element */
.recent-post-content h5 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    order: 2; /* Ensure title comes second */
}

.recent-post-content h5 a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
}

.recent-post-content h5 a:hover {
    color: var(--btn-bg, #144c80);
}

/* Summary - Third element (you'll need to add this to your HTML) */
.recent-post-summary {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
    order: 3; /* Ensure summary comes last */
    margin-top: 0.25rem;
}


/* MENU TAB */
.menu-tab {
    position: fixed;
    top: 15%;
    right: 0;
    transform: translateY(-50%);
    background: var(--btn-bg, #144c80);
    color: white;
    padding: 1rem 0.75rem;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    font-family: var(--font-body-feature, 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.menu-tab:hover {
    background: #1e5a8a;
    transform: translateY(-50%) translateX(-5px);
}

.menu-text {
    display: block;
}

.slide-out-menu {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    transition: right 0.3s ease;
    padding: 2rem;
    overflow-y: auto;
}

.slide-out-menu.open {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.menu-header h3 {
    margin: 0;
    color: var(--btn-bg, #144c80);
    font-size: 1.5rem;
}

.close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-menu:hover {
    color: var(--btn-bg, #144c80);
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-nav a {
    padding: 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.menu-nav a:hover {
    background: #f8f9fa;
    color: var(--btn-bg, #144c80);
}

.menu-nav a.menu-cta {
    background: var(--btn-bg, #144c80);
    color: white;
    text-align: center;
    margin-top: 1rem;
}

.menu-nav a.menu-cta:hover {
    background: #1e5a8a;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* POST NAVIGATION - Proper spacing from floating card */
.post-navigation {
    order: 2 !important;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    clear: both; /* Ensure it clears any floating elements */
    position: relative;
    z-index: 5; /* Lower than floating card */
    margin: 1rem auto !important;
    max-width: 900px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 1rem !important; /* REDUCED from default */
}

.nav-container {
    max-width: 800px; /* Match floating card width */
    margin: 0 auto;
}

.nav-arrows {
    background: var(--frame-bg, #ffffff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-arrow {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #1a1a1a;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-arrow:hover {
    background: var(--btn-bg, #144c80);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20, 76, 128, 0.2);
}

.nav-arrow.next-arrow {
    justify-content: flex-end;
    text-align: right;
}

.nav-text small {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.nav-text strong {
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-arrow svg {
    flex-shrink: 0;
}

/* PLACEHOLDER for missing prev/next posts */
.nav-arrow-placeholder {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    opacity: 0.3;
    border: 2px dashed #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.nav-arrow-placeholder::before {
    content: "No more posts";
}

/* COMMENTS SECTION - Floating Card Style */
.comments-section {
    order: 5 !important;
    padding: 0 !important;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    position: relative !important;
    z-index: 5 !important;
    margin: 2rem auto 0 auto !important;
    max-width: 800px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.comments-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--frame-bg, #ffffff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 2rem 2rem;
}

/* HIDE BUILT-IN RELATED POSTS - CSS FALLBACK */
.related-posts,
.related-posts-section,
.jetpack-related-posts,
.jp-relatedposts,
.wpcom-related-posts,
.related_posts,
.post-related,
.related-articles,
.similar-posts,
[id*="related"],
[class*="related-post"],
[class*="similar-post"] {
    display: none !important;
}

/* Add this CSS to ensure consistent ordering across all screen sizes */

/* CONSISTENT ORDERING FOR ALL SCREEN SIZES */
/* CONSISTENT ORDERING FOR ALL SCREEN SIZES */
.hero-image-container {
    order: 0 !important; /* Always first */
}

.floating-blog-card {
    order: 1 !important;
}

.post-navigation {
    order: 2 !important;
}

.main-content-wrapper {
    order: 3 !important; /* Contains social share and sidebar */
}

.comments-section {
    order: 4 !important;
}

/* Make sure the content container uses flex in all cases */
.content-container {
    display: flex !important;
    flex-direction: column !important;
}


/* COMPLETE RESPONSIVE SECTION - Replace everything from @media onwards */

/* LARGE SCREENS - Keep sidebars visible longer */
@media (max-width: 1600px) and (min-width: 1401px) {
    .content-container {
        grid-template-columns: 80px 1fr 280px;
        gap: 2rem;
        padding: 0 1.5rem 0 1.5rem; /* Left and right padding */
    }
    
    .post-sidebar {
        width: 260px;
        margin-right: 2rem; /* ADD: Space from right edge */
    }
    
    .sidebar-search,
    .sidebar-recent-posts {
        max-width: 260px;
    }

    .recent-posts-list {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Single column in sidebar */
        gap: 1.5rem !important;
    }

    .recent-post-item {
        flex-direction: column !important; /* Keep vertical card layout */
        background: #f8f9fa !important;
        border-radius: 12px !important;
        border: 1px solid #e5e7eb !important;
        border-bottom: 1px solid #e5e7eb !important; /* Override the removal */
        padding: 0 !important;
    }

    .recent-post-item:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .recent-post-image {
        width: 100% !important;
        height: 120px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .recent-post-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

}

/* MEDIUM LARGE SCREENS */
@media (max-width: 1500px) and (min-width: 1401px) {
    .content-container {
        grid-template-columns: 80px 1fr 280px;
        gap: 2.5rem;
        padding: 0 1.5rem 0 1.5rem; /* Left and right padding */
    }
    
    .post-sidebar {
        width: 240px;
        margin-right: 2rem; /* ADD: Space from right edge */
    }
    
    .sidebar-search,
    .sidebar-recent-posts {
        max-width: 240px;
    }

    .recent-posts-list {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Single column in sidebar */
        gap: 1.5rem !important;
    }

    .recent-post-item {
        flex-direction: column !important; /* Keep vertical card layout */
        background: #f8f9fa !important;
        border-radius: 12px !important;
        border: 1px solid #e5e7eb !important;
        border-bottom: 1px solid #e5e7eb !important; /* Override the removal */
        padding: 0 !important;
    }

    .recent-post-item:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .recent-post-image {
        width: 100% !important;
        height: 120px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .recent-post-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* TABLET AND SMALLER DESKTOP - Transform sidebars to horizontal cards */
/* CONSOLIDATED @media (max-width: 1400px) - Replace the entire section */

/* Replace the @media (max-width: 1400px) section with this fixed version */

@media (max-width: 1400px) {
    /* KEEP HERO IMAGE AND FLOATING CARD OVERLAP */
    .hero-image-container {
        order: 0 !important;
        width: 100%;
        height: 60vh;
        min-height: 500px;
        max-height: 700px;
        overflow: hidden;
        position: relative;
        margin-bottom: 0;
        z-index: 1;
    }

    /* FLOATING CARD - Maintain overlap */
    .floating-blog-card {
        order: 1 !important;
        background: var(--frame-bg, #ffffff);
        border-radius: 20px;
        max-width: 800px !important; /* EXPLICIT width */
        width: 100% !important;
        margin: -80px auto 0 auto !important; /* REMOVED bottom margin */
        padding: 3rem;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        position: relative;
        z-index: 15 !important;
        text-align: center;
        box-sizing: border-box;
    }

        /* POST NAVIGATION - DIRECTLY under floating card */
    .post-navigation {
        order: 2 !important;
        background: transparent !important;
        margin: 2rem auto 2rem auto !important; /* REMOVED side margins, REDUCED top margin */
        padding: 0 !important; /* REMOVED padding */
        border-radius: 0 !important;
        box-shadow: none !important;
        position: relative !important;
        z-index: 10 !important;
        max-width: 800px !important; /* MATCH floating card exactly */
        width: calc(100% - 4rem) !important; /* Account for side margins */
        box-sizing: border-box !important;
    }
    
    .nav-container {
        max-width: 800px !important; /* MATCH floating card exactly */
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }
    
    .nav-arrows {
        background: var(--frame-bg, #ffffff) !important;
        border-radius: 20px !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
        padding: 3rem !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 2rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* MAIN CONTENT WRAPPER - Ensure proper flex order */
    .main-content-wrapper {
        order: 3 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 2rem !important; /* MOVED padding here to parent */
    }

    /* CONTENT CONTAINER - Contains floating card (ORDER 1) */
    .content-container {
        display: flex !important;
        flex-direction: column !important;
        max-width: 800px !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        position: relative;
        z-index: 5;
        gap: 2rem !important;
    }
    
    
    /* SOCIAL SHARE - After navigation (ORDER 3) */
    .content-container .social-share-sidebar {
        order: 1 !important;
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1rem !important;
        margin: 2rem auto 2rem auto !important; /* CONSISTENT with nav */
        max-width: 800px !important; /* MATCH floating card exactly */
        width: 100% !important;
        background: var(--frame-bg, #ffffff) !important;
        padding: 1.5rem 2rem !important;
        border-radius: 20px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
        z-index: 12 !important;
        box-sizing: border-box !important;
    }
    
    .share-label {
        margin-bottom: 0 !important;
        margin-right: 1rem !important;
        white-space: nowrap;
    }
    
    .share-icons {
        flex-direction: row !important;
        gap: 1rem !important;
    }
    
    /* POST SIDEBAR - After social icons (ORDER 4) */
    .content-container .post-sidebar {
        order: 2 !important;
        display: flex !important;
        position: static !important;
        flex-direction: column !important;
        gap: 2rem !important;
        margin: 0 auto !important; /* CONSISTENT with others */
        max-width: 800px !important; /* MATCH floating card exactly */
        width: 100% !important;
        padding: 0 !important;
        z-index: 12 !important;
        box-sizing: border-box !important;
    }
    
    /* SEARCH BAR - Full width, same as floating card */
    .sidebar-search,
    .sidebar-recent-posts {
        background: var(--frame-bg, #ffffff) !important;
        padding: 1.5rem !important;
        border-radius: 20px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
        border: 2px solid #f1f5f9 !important;
        max-width: 800px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex: none !important;
    }
    
    .sidebar-search {
        margin-bottom: 2rem !important;
    }

    /* RECENT POSTS LIST - Vertical layout */
    .recent-posts-list {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Keep single column */
        gap: 1.5rem !important;
    }
    
    .recent-post-item {
        flex-direction: column !important; /* Keep vertical card layout */
        background: #f8f9fa !important;
        border-radius: 12px !important;
        border: 1px solid #e5e7eb !important;
        border-bottom: 1px solid #e5e7eb !important; /* Override the removal */
        padding: 0 !important;
    }
    
    .recent-post-item:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    
    .recent-post-image {
        width: 100% !important;
        height: 120px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .recent-post-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .recent-post-content {
        padding: 1rem !important;
    }
    
    /* COMMENTS SECTION - Force consistent width */
    .comments-section {
        order: 4 !important;
        background: transparent !important;
        margin: 2rem auto 0 auto !important; /* CONSISTENT with others */
        padding: 0 !important; /* REMOVED padding */
        border-radius: 0 !important;
        box-shadow: none !important;
        position: relative !important;
        z-index: 10 !important;
        max-width: 800px !important; /* MATCH floating card exactly */
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .comments-container {
        max-width: 800px !important; /* MATCH floating card exactly */
        width: 100% !important;
        margin: 0 auto !important;
        background: var(--frame-bg, #ffffff) !important;
        border-radius: 20px !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
        padding: 3rem 2rem !important;
        box-sizing: border-box !important;
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {

    /* HERO IMAGE - Smaller on mobile */
    .hero-image-container {
        height: 40vh;
        min-height: 300px;
    }

    /* FLOATING CARD - Maintain overlap */
    .floating-blog-card {
        margin: -100px 1rem 0 1rem !important;
        padding: 2rem;
        position: relative !important;
        z-index: 15 !important;
    }

    body.single-post {
        margin: -100px 1rem 1rem 1rem !important;
        padding: 0 !important;
    }
    
    .floating-blog-card .blog-card-title {
        font-size: 2rem;
    }
    
    .floating-blog-card .blog-card-summary {
        font-size: 1.1rem;
    }
    .floating-blog-card .blog-post-content {
        font-size: 0.95rem;
    }
    .floating-blog-card .blog-post-content p {
        line-height: 1.6;
    }
    .floating-blog-card .blog-post-content h2 {
        font-size: 1.5rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    .floating-blog-card .blog-post-content h3 {
        font-size: 1.25rem;
        margin-top: 1.25rem;
        margin-bottom: 0.75rem;
    }
    .floating-blog-card .blog-post-content h4 {
        font-size: 1.1rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    .floating-blog-card .blog-post-content h5 {
        font-size: 1rem;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
    }
    .floating-blog-card .blog-post-content h6 {
        font-size: 0.9rem;
        margin-top: 0.5rem;
        margin-bottom: 0.25rem;
    }
    .floating-blog-card .blog-post-content ul,
    .floating-blog-card .blog-post-content ol {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-left: 1.5rem;
    }
    .floating-blog-card .blog-post-content blockquote {
        font-size: 1.1rem;
        line-height: 1.6;
        margin: 1.5rem 0;
        padding-left: 1rem;
        border-left: 4px solid #e5e7eb;
    }
    .floating-blog-card .blog-post-content pre {
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 8px;
        overflow-x: auto;
    }
    .floating-blog-card .blog-post-content code {
        font-size: 0.9rem;
        background: #f1f5f9;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
    }
    .floating-blog-card .blog-post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 1rem 0;
    }
    .floating-blog-card .blog-post-content a {
        color: var(--btn-bg, #144c80);
        text-decoration: underline;
    }
    .floating-blog-card .blog-post-content a:hover {
        color: #1e5a8a;
        text-decoration: none;
    }
    
    /* NAVIGATION AND COMMENTS */
    .post-navigation {
        background: transparent !important;
        margin: 2rem 1rem 0 1rem !important;
        width: calc(100% - 2rem) !important;
    }

    .nav-container{
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important; /* Remove padding to prevent double padding */
        display: flex;
        flex-direction: column; 
        align-items: center;
        justify-content: center;
    }

    .social-share-sidebar {
        display: flex !important;
        margin-left: 1rem !important;
        margin-right: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }

    /* SOCIAL SHARE - Mobile horizontal layout */
    .social-share-sidebar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1rem !important;
        margin: 1rem 1rem 2rem 1rem !important;
        padding: 1.25rem !important;
        position: relative !important;
        z-index: 12 !important;
    }

    /* POST SIDEBAR - Mobile vertical stack */
    .post-sidebar {
        flex-direction: column !important;
        margin: 1rem 1rem 2rem 1rem !important;
        gap: 1.5rem !important;
        position: relative !important;
        z-index: 12 !important;
    }
    
    .sidebar-search,
    .sidebar-recent-posts {
        max-width: 100% !important;
        min-width: auto !important;
        flex: none !important;
    }
    
    /* RECENT POSTS - Back to vertical list on mobile */
    .recent-posts-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .recent-post-item {
        flex-direction: row !important;
        text-align: left !important;
    }
    
    .recent-post-image {
        align-self: flex-start !important;
        height: 100px !important; /* Slightly shorter on mobile */
        width: 100px !important; /* Fixed width for consistency */
        margin-right: 1rem !important; /* Add space between image and text */
        margin-bottom: 0 !important;
    }

     .recent-post-content {
        padding: 0.75rem !important;
    }

    .comments-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0;
        padding: 0 1rem;
        display: flex;
        flex-direction: column;
    }
    
    .nav-arrows {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 2rem;
    }
    
    .nav-arrow.next-arrow {
        justify-content: flex-start;
        text-align: left;
    }
    
    .main-content-wrapper {
        padding: 0 1rem !important;
    }
    
    .comments-section {
        margin: 2rem 1rem 0 1rem !important;
        width: calc(100% - 2rem) !important;
    }
}

/* SMALL MOBILE RESPONSIVE */
@media (max-width: 480px) {
    /* FLOATING CARD - Ultra compact */
    .floating-blog-card {
        margin: -80px 0.5rem 1rem 0.5rem !important;
        padding: 1.5rem;
    }
    
    .floating-blog-card .blog-card-title {
        font-size: 1.75rem;
    }
    
    .post-navigation {
        margin: 2rem 0.5rem 0 0.5rem !important;
        width: calc(100% - 1rem) !important;
    }

    .social-share-sidebar,
    .post-sidebar {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .social-share-sidebar {
        padding: 1rem !important;
    }
    
    .share-icons {
        gap: 0.75rem !important;
    }
    
    .share-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .sidebar-search,
    .sidebar-recent-posts {
        padding: 1.25rem !important;
    }
    
    .nav-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important; /* Remove padding to prevent double padding */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .main-content-wrapper {
        padding: 0 0.5rem !important;
    }
    
    .comments-section {
        margin: 0 !important;
        max-width: calc(100% - 1rem) !important;
    }

    .comments-container {
        margin: 0;
        padding: 0;
    }
}

/* SMOOTH TRANSITIONS */
.social-share-sidebar,
.post-sidebar,
.sidebar-search,
.sidebar-recent-posts,
.floating-blog-card {
    transition: all 0.3s ease;
}

/* HIDE PROGRESS BARS */
.reading-progress-container,
.reading-progress-bar,
.reading-progress {
    display: none !important;
}

/* PRINT STYLES */
@media print {
    .social-share-sidebar,
    .post-sidebar {
        display: none !important;
    }

    .post-navigation {
        display: none !important;
    }

    .comments-section {
        display: none !important;
    }
    
    .content-container {
        grid-template-columns: 1fr !important;
    }
    
    .floating-blog-card {
        position: static !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        margin: 0 !important;
    }
}