/* کانتینر اصلی نوشته */
.saitima-single-universe {
    max-width: 1300px;
    margin: 120px auto 50px;
    padding: 0 5%;
    /* ❌ این دو خط را کاملاً پاک کنید: ❌ */
    /* perspective: 1500px; */
    /* transform-style: preserve-3d; */
}
.single-hero-3d {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    position: relative;
    z-index: 100;

    /* ✅ این دو خط را اضافه/جایگزین کنید ✅ */
    perspective: 1200px;
    transform-style: preserve-3d;
}
.hero-content-right {
    flex: 1;
    transform: translateZ(30px);

    /* این خطوط اضافه شوند تا کلیک‌پذیری جلو بیاید */
    transform-style: preserve-3d;
    position: relative;
    z-index: 99999 !important;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: #ff007a;
    margin-bottom: 15px;
}

.single-title {
    font-size: 2.2rem;
    line-height: 1.4;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.single-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
}

.toc-box-3d {
    background: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border-right: 4px solid #7a00ff;
    position: relative;
    z-index: 999;
    /* به جای سه‌بعدی، کمی سایه و استایل تخت‌تر بدهید که کلیک‌پذیری لینک‌ها عالی بماند */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toc-box-3d:hover {
    /* ترانسفورم دو بعدی بسیار امن‌تر است */
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(122,0,255,0.15);
}
.toc-box-3d h3 { margin-top: 0; font-size: 1.2rem; color: #ff007a; }
.toc-box-3d ul { list-style: none; padding: 0; margin: 0; }
.toc-box-3d li { margin-bottom: 8px; }
.toc-box-3d a { color: #444; text-decoration: none; transition: color 0.2s; }
.toc-box-3d a:hover { color: #7a00ff; }
.toc-item-h3 { padding-right: 15px; font-size: 0.9em; } /* تورفتگی تیترهای H3 */

/* تصویر شاخص سمت چپ */
.hero-image-left {
    flex: 1;
    perspective: 1000px;
}
.image-wrapper-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}
.hero-image-left:hover .image-wrapper-3d {
    transform: rotateY(-10deg) rotateX(10deg); /* چرخش تصویر موقع هاور */
}
.floating-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 20px;
    /*transform: translateZ(40px); !* معلق بودن تصویر *!*/
    box-shadow: -20px 20px 40px rgba(0,0,0,0.2);
}

/* ================== بدنه (محتوا + سایدبار) ================== */
.single-body-grid {
    display: flex;
    gap: 30px;
    margin-bottom: 60px;
    margin-top: 68px;

    /* این دو خط جایگزین قبلی‌ها شود */
    position: relative;
    z-index: 1 !important;
}

.single-content {
    flex: 3;
    padding: 40px;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}
.single-content h2, .single-content h3 { color: #1a1a2e; margin-top: 30px; }

.single-sidebar {
    flex: 1;
    perspective: 1000px;
}

.sidebar-widget-3d {
    position: sticky;
    top: 100px; /* شناور ماندن سایدبار موقع اسکرول */
    padding: 25px;
    transform: translateZ(20px);
    transition: transform 0.3s;
}
.sidebar-widget-3d:hover { transform: translateZ(40px); }

.sidebar-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    text-decoration: none;
    color: #444;
    transition: transform 0.2s;
}
.sidebar-post-item:hover { transform: translateX(-5px); color: #ff007a; }
.sidebar-post-item img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}
.sidebar-post-item h4 { font-size: 0.95rem; margin: 0; line-height: 1.4; }

/* ================== مقالات مرتبط سه‌بعدی ================== */
.related-grid-3d {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap; /* بسیار مهم: اگر جا نشدند، به خط بعد بروند */
}
.related-card-3d {
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
padding: 12px;
    /* 👇 این خط را اضافه کنید 👇 */
    width: calc(33.333% - 20px); /* تقسیم فضا به 3 قسمت با در نظر گرفتن gap */
}
.related-card-3d:hover {
    z-index: 10;
    transform: translateY(-10px) scale(1.02);
}
.card-img-3d img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    transform: translateZ(30px); /* پاپ‌آپ شدن عکس مقاله */
}
.card-content-3d { transform: translateZ(40px); margin-top: 15px; }
.card-content-3d h4 { margin-bottom: 15px; }
.card-content-3d a { color: #1a1a2e; text-decoration: none; }

@media (max-width: 768px) {
    .related-card-3d {
        width: 100%; /* در موبایل هر کارت تمام عرض را بگیرد */
        margin-bottom: 20px;
    }
}
/* =========================================
   Mobile Optimization for Single Post Page
========================================= */
@media (max-width: 768px) {
    /* زیر هم قرار دادن محتوای اصلی و سیدبار */
    .single-container, .post-layout, .main-wrapper {
        display: flex !important;
        flex-direction: column !important;
        padding: 30px 4% !important;
        gap: 35px !important;
        width: 100% !important;
    }

    /* عریض کردن بخش متن مقاله */
    .post-content, .main-content, .entry-content {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 1.05rem !important;
        line-height: 1.85 !important;
    }

    /* عریض کردن و انتقال سیدبار به پایین صفحه */
    .post-sidebar, .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 20px !important;
    }

    /* جلوگیری از بیرون زدن تصاویر داخل متن مقاله */
    .post-thumbnail img, .entry-content img, .wp-block-image img {
        width: 100% !important;
        height: auto !important;
        border-radius: 15px !important;
    }

    /* اصلاح تیتر غول‌پیکر مقاله */
    .post-title h1, .entry-title {
        font-size: 1.65rem !important;
        line-height: 1.5 !important;
        text-align: right !important;
        margin-bottom: 15px !important;
    }

    /* بهینه‌سازی باکس‌های گلس‌مورفیسم در صفحه مقاله */
    .single-glass-panel, .comment-respond {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #ffffff !important;
        padding: 20px !important;
        border-radius: 20px !important;
    }
}
