/* ========================================================
   کتابخانه طراحی محصول - آکادمی پیکس‌پا
   نسخه ۳.۰ – استایل‌های کامل شامل گوتنبرگ، TOC، یادداشت‌ها
   ======================================================== */

/* ---------- بخش قدیمی (سازگاری با قالب‌های قبلی) ---------- */
.book-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}
.book-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.book-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.book-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.book-card-body {
    padding: 15px;
    flex-grow: 1;
}
.book-card-body h2 {
    font-size: 1.1rem;
    margin: 0 0 8px;
    color: #000;
}
.book-card-body .book-author {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.book-card-body .download-link {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    margin-top: auto;
}
.book-card-body .download-link:hover {
    background: #0170ff;
}

/* Single Book (سبک‌های قدیمی) */
.single-book-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    color: #000;
}
.book-header {
    text-align: center;
    margin-bottom: 30px;
}
.book-header img {
    max-width: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.book-meta {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 15px 20px;
}
.book-meta li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}
.book-meta li:last-child {
    border-bottom: 0;
}
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    margin: 10px 0;
    border: none;
    cursor: pointer;
}
.btn-download {
    background: #0170ff;
    color: #fff;
}
.btn-download:hover {
    background: #005bb5;
}
.btn-purchase {
    background: #000;
    color: #fff;
}
.btn-purchase:hover {
    background: #333;
}
.btn-translation {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}
.btn-translation:hover {
    background: #000;
    color: #fff;
}
.register-note {
    background: #f0f0f0;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-top: 10px;
}
.register-note a {
    color: #0170ff;
    font-weight: bold;
}
.translation-explanation {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0 5px;
}

/* Toast micro-interaction */
.pixpa-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.pixpa-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.pixpa-toast .check-icon {
    color: #4CAF50;
    font-weight: bold;
}

/* ========================================================
   استایل‌های محتوای گوتنبرگ (طبق درخواست)
   ======================================================== */
.post-article h1 {
    font-family: 'IRANSans','YekanBakh',system-ui,sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.dark .post-article h1 {
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.post-article .prose h2 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
    scroll-margin-top: 6rem;
}
.dark .post-article .prose h2 {
    color: #f1f5f9 !important;
    border-bottom-color: #334155;
}

.post-article .prose h3 {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    scroll-margin-top: 6rem;
    margin-top: 1rem;
}
.dark .post-article .prose h3 {
    color: #e2e8f0 !important;
}

/* متغیرهای مربوط به TOC و نشانگر ماوس */
:root {
    --toc-width: 260px;
    --progress-color: #0170ff;
    --progress-ring-size: 60px;
    --mouse-ring-size: 44px;
}

/* ---------- TOC دسکتاپ ---------- */
.toc-desktop {
    position: fixed;
    top: 6rem;
    right: 2rem;
    width: var(--toc-width);
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 1rem;
    padding: 1.25rem;
    font-size: 0.875rem;
    z-index: 40;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.dark .toc-desktop {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}
.toc-desktop.hidden {
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
}

.toc-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}
.dark .toc-title {
    color: #f1f5f9;
}
.toc-close {
    margin-right: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    padding: 0 4px;
}
.toc-close:hover {
    opacity: 0.7;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-list li {
    margin-bottom: 0.15rem;
}
.toc-list a {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    line-height: 1.6;
}
.dark .toc-list a {
    color: #cbd5e1;
}
.toc-list a:hover,
.toc-list a.active {
    background: rgba(1, 112, 255, 0.12);
    color: var(--progress-color);
    font-weight: 600;
}

.toc-sublist {
    list-style: none;
    padding-left: 1rem;
    margin: 0.25rem 0 0.5rem;
    border-left: 2px solid #e2e8f0;
}
.dark .toc-sublist {
    border-left-color: #334155;
}
.toc-sublist a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}

/* ---------- نشانگر ماوس (Mouse Indicator) ---------- */
.mouse-indicator {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: var(--mouse-ring-size);
    height: var(--mouse-ring-size);
    transform: translate(-50%, -50%);
    transition: opacity 0.25s;
    opacity: 0;
}
.mouse-indicator.visible {
    opacity: 0.85;
}
.mouse-indicator svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.mouse-indicator .mouse-bg {
    fill: none;
    stroke: rgba(1, 112, 255, 0.12);
    stroke-width: 3;
}
.mouse-indicator .mouse-progress {
    fill: none;
    stroke: var(--progress-color);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(1, 112, 255, 0.6));
    transition: stroke-dashoffset 0.08s linear;
}

/* ---------- دکمه موبایل TOC ---------- */
.toc-mobile-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #0170ff;
    color: white;
    box-shadow: 0 8px 20px rgba(1, 112, 255, 0.35);
    z-index: 60;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s, opacity 0.3s, background 0.2s;
    border: none;
    font-size: 1.4rem;
    opacity: 0;
    pointer-events: none;
}
.toc-mobile-btn:hover {
    transform: scale(1.1);
    background: #015fcc;
}
.toc-mobile-btn.show {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- اوورلی TOC موبایل ---------- */
.toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 70;
    opacity: 0;
    transition: opacity 0.3s;
}
.toc-overlay.show {
    opacity: 1;
}

/* ---------- دراور TOC موبایل ---------- */
.toc-mobile-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 1.8rem 1.8rem 0 0;
    padding: 1.8rem 1.5rem 2rem;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 71;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.12);
}
.dark .toc-mobile-drawer {
    background: #1e293b;
    color: #f1f5f9;
}
.toc-mobile-drawer.open {
    transform: translateY(0);
}
.toc-mobile-drawer .toc-close-btn {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: #334155;
    transition: background 0.2s;
}
.dark .toc-mobile-drawer .toc-close-btn {
    background: #334155;
    color: #cbd5e1;
}

/* ---------- واکنش‌گرایی TOC ---------- */
@media (max-width: 768px) {
    .toc-mobile-btn {
        display: flex;
    }
    .toc-desktop {
        display: none;
    }
    .progress-ring-left {
        display: none;
    }
    .mouse-indicator {
        display: none;
    }
}

/* ========================================================
   استایل‌های بلاک‌های گوتنبرگ
   ======================================================== */

/* پاراگراف */
.wp-block-paragraph {
    line-height: 2;
    text-align: justify;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

/* زیرنویس تصویر */
.wp-element-caption {
    font-size: small;
    color: #4c526e;
}

/* نقل‌قول */
.wp-block-quote {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.8rem 2.5rem;
    background: #f9fafb;
    border-right: 5px solid #3b82f6;
    border-radius: 0 6px 6px 0;
    direction: rtl;
    text-align: right;
    color: #1e293b;
    transition: box-shadow 0.2s ease;
}
.wp-block-quote:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.wp-block-quote .wp-block-paragraph:first-child {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.9;
    margin: 0 0 0.5rem 0;
    color: #0f172a;
    letter-spacing: 0.01em;
}
.wp-block-quote .wp-block-paragraph:last-child {
    font-size: 0.95rem;
    font-weight: 400;
    color: #64748b;
    margin: 0.75rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    letter-spacing: 0.02em;
}
.wp-block-quote::before {
    content: '\201C';
    position: absolute;
    top: -0.2rem;
    right: 0.5rem;
    font-size: 4.5rem;
    font-weight: 700;
    color: #3b82f6;
    opacity: 0.12;
    line-height: 1;
    pointer-events: none;
}
@media (max-width: 640px) {
    .wp-block-quote {
        padding: 1.2rem 1.5rem;
        margin: 1.5rem 0;
    }
    .wp-block-quote .wp-block-paragraph:first-child {
        font-size: 1.2rem;
        line-height: 1.7;
    }
    .wp-block-quote .wp-block-paragraph:last-child {
        font-size: 0.85rem;
    }
    .wp-block-quote::before {
        font-size: 3rem;
        top: -0.1rem;
        right: 0.3rem;
    }
}

/* لیست‌ها */
.wp-block-list {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    font-family: 'IRANSans', 'Segoe UI', system-ui, sans-serif;
    color: #1e293b;
}
.wp-block-list li {
    position: relative;
    padding: 0.9rem 2.2rem 0.9rem 0;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
    line-height: 1.8;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}
.wp-block-list li:last-child {
    border-bottom: none;
}
.wp-block-list li::before {
    content: '';
    position: absolute;
    right: 0.2rem;
    top: 1.8rem;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    opacity: 0.6;
    transform: translateY(-50%);
}
.wp-block-list li strong {
    color: #0f172a;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: #f8fafc;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.95em;
}
.wp-block-list li span,
.wp-block-list li .wp-block-paragraph {
    color: #475569;
    font-weight: 350;
}
.wp-block-list li:hover {
    background: #fafbfc;
    border-radius: 4px;
}

/* لیست با سایز کوچک (مانند فهرست منابع) */
.wp-block-list.has-small-font-size {
    margin-top: -1rem;
    margin-bottom: 1rem;
    padding: 0;
}
.wp-block-list.has-small-font-size li {
    padding: 0.35rem 1.6rem 0.35rem 0;
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    border-bottom: none;
    background: transparent;
    transition: none;
}
.wp-block-list.has-small-font-size li::before {
    content: '';
    position: absolute;
    right: 0.1rem;
    top: 0.9rem;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 2px;
    opacity: 0.8;
    transform: none;
}
.wp-block-list.has-small-font-size li strong {
    background: none;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    color: #0f172a;
}
.wp-block-list.has-small-font-size li span,
.wp-block-list.has-small-font-size li .wp-block-paragraph {
    color: #475569;
}
.wp-block-list.has-small-font-size li:hover {
    background: transparent;
    border-radius: 0;
}
.wp-block-list.has-small-font-size li a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px dotted #3b82f6;
}
.wp-block-list.has-small-font-size li a:hover {
    border-bottom: 1px solid #3b82f6;
}
@media (max-width: 640px) {
    .wp-block-list {
        margin: 1.2rem 0;
    }
    .wp-block-list li {
        padding: 0.7rem 1.8rem 0.7rem 0;
        font-size: 0.95rem;
        line-height: 1.7;
    }
    .wp-block-list li::before {
        width: 6px;
        height: 6px;
        right: 0.1rem;
        top: 1.1rem;
    }
    .wp-block-list.has-small-font-size li {
        padding: 0.3rem 1.4rem 0.3rem 0;
        font-size: 0.8rem;
        line-height: 1.5;
    }
    .wp-block-list.has-small-font-size li::before {
        width: 5px;
        height: 5px;
        top: 0.55rem;
        right: 0.05rem;
    }
}

/* کد بلاک */
.wp-block-code {
    position: relative;
    margin: 2.2rem 0;
    padding: 1.8rem 0 1.8rem 0;
    background: #1e1e2e;
    border-radius: 12px;
    border: 1px solid #313244;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    direction: ltr;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wp-block-code:hover {
    border-color: #585b70;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}
.wp-block-code .code-container {
    display: flex;
    align-items: flex-start;
    padding: 0 1.5rem;
    gap: 1rem;
}
.wp-block-code .line-numbers {
    flex-shrink: 0;
    padding: 0.2rem 0.5rem 0.2rem 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: #6c7086;
    text-align: right;
    user-select: none;
    border-right: 1px solid #313244;
    min-width: 2.2rem;
}
.wp-block-code .code-content {
    flex: 1;
    padding: 0.2rem 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: #cdd6f4;
    white-space: pre;
    tab-size: 2;
}
.wp-block-code code {
    display: block;
    background: transparent !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    color: deepskyblue !important;
    border: none !important;
    white-space: pre;
    tab-size: 2;
}
.wp-block-code .copy-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a6adc8;
    font-size: 0.7rem;
    font-family: 'IRANSans', 'Segoe UI', sans-serif;
    padding: 0.25rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    letter-spacing: 0.02em;
}
.wp-block-code:hover .copy-btn {
    opacity: 1;
    pointer-events: auto;
}
.wp-block-code .copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: #89b4fa;
}
.wp-block-code .copy-btn.copied {
    background: #2b5e3b;
    border-color: #49b86c;
    color: #a6e3a1;
}
@media (max-width: 640px) {
    .wp-block-code {
        margin: 1.5rem 0;
        padding: 1.2rem 0;
        border-radius: 8px;
    }
    .wp-block-code .code-container {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    .wp-block-code .line-numbers {
        font-size: 0.7rem;
        min-width: 1.8rem;
        padding-right: 0.3rem;
    }
    .wp-block-code .code-content,
    .wp-block-code code {
        font-size: 0.7rem;
        line-height: 1.6;
    }
    .wp-block-code .copy-btn {
        font-size: 0.6rem;
        padding: 0.15rem 0.5rem;
        top: 8px;
        right: 8px;
    }
}

/* پیش‌فرمت‌شده */
.wp-block-preformatted {
    position: relative;
    margin: 2rem 0;
    padding: 1rem 1.8rem;
    background: transparent !important;
    border: none !important;
    border-right: 3px solid #d1d5db;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'IRANSans';
    font-size: 1.2rem;
    font-weight: 200;
    line-height: 2;
    color: #1e293b;
    text-align: right;
    direction: rtl;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    transition: border-color 0.2s ease;
}
.wp-block-preformatted:hover {
    border-right-color: #94a3b8;
}
.wp-block-preformatted code {
    background: transparent !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    border: none !important;
    direction: rtl;
    text-align: right;
    display: block;
    white-space: pre-wrap;
}
@media (max-width: 640px) {
    .wp-block-preformatted {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        line-height: 1.8;
        margin: 1.2rem 0;
        border-right-width: 3px;
    }
}

/* هایلایت (mark) */
.prose mark,
.post-article mark {
    padding: 0.15em 0.45em;
    border-radius: 0.3rem;
    font-weight: 500;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* ========================================================
   استایل‌های بخش یادداشت‌های مرتبط
   ======================================================== */
.related-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.related-notes-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.related-notes-list li:last-child {
    border-bottom: none;
}
.related-notes-list .note-type {
    display: inline-block;
    background: #0170ff;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}
.related-notes-list .note-link {
    color: #0170ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.related-notes-list .note-link:hover {
    color: #005bb5;
    text-decoration: underline;
}

/* ========================================================
   موکاپ حرفه‌ای کتاب سه‌بعدی
   ======================================================== */

/* کانتینر اصلی موکاپ */
.book-mockup-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(145deg, #f0f2f5 0%, #e8ecf1 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* افکت پس‌زمینه‌ی ظریف */
.book-mockup-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 40%, rgba(1,112,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* موکاپ اصلی با پرسپکتیو */
.book-mockup {
    display: flex;
    max-width: 340px;
    width: 100%;
    perspective: 1200px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.book-mockup:hover {
    transform: rotateY(-2deg) rotateX(2deg) translateY(-6px);
}

/* ---------- عطف (Spine) حرفه‌ای ---------- */
.book-spine {
    width: 38px;
    min-width: 38px;
    background: linear-gradient(135deg, #1a2634 0%, #2c3e50 40%, #3a4f63 100%);
    border-radius: 6px 0 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 4px;
    position: relative;
    box-shadow: 
        inset -3px 0 12px rgba(0,0,0,0.4),
        inset 1px 0 4px rgba(255,255,255,0.08),
        -2px 0 10px rgba(0,0,0,0.15);
    transform: translateZ(0);
    transition: background 0.3s ease;
}

/* شیارهای عطف (خطوط تزئینی) */
.book-spine::before,
.book-spine::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 1px;
}
.book-spine::before {
    top: 20%;
}
.book-spine::after {
    bottom: 20%;
}

/* شیارهای عمودی ظریف */
.spine-grooves {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to right,
        transparent 0px,
        transparent 6px,
        rgba(0,0,0,0.05) 6px,
        rgba(0,0,0,0.05) 7px,
        transparent 7px,
        transparent 12px
    );
    pointer-events: none;
    border-radius: 6px 0 0 6px;
}

/* عنوان روی عطف */
.spine-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'IRANSans', 'YekanBakh', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255,255,255,0.92);
    letter-spacing: 3px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    line-height: 1.5;
    word-break: break-word;
    text-align: center;
    padding: 8px 0;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* ---------- جلد (Cover) حرفه‌ای ---------- */
.book-cover {
    flex: 1;
    position: relative;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 
        4px 0 20px rgba(0,0,0,0.12),
        0 8px 32px rgba(0,0,0,0.10),
        inset 0 0 0 1px rgba(255,255,255,0.1);
    transform: translateZ(2px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.book-cover:hover {
    box-shadow: 
        4px 0 24px rgba(0,0,0,0.18),
        0 12px 40px rgba(0,0,0,0.15),
        inset 0 0 0 1px rgba(255,255,255,0.15);
}

/* تصویر جلد */
.cover-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0 8px 8px 0;
    transition: transform 0.5s ease;
    filter: brightness(0.98) saturate(1.02);
}

.book-cover:hover .cover-image {
    transform: scale(1.02);
}

/* حالت بدون جلد */
.no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    background: linear-gradient(145deg, #e8ecf1, #d5d9e0);
    color: #8a8f9a;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0 8px 8px 0;
}

/* ---------- افکت‌های نور و سایه روی جلد ---------- */
.cover-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.12) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0,0,0,0.04) 100%
    );
    pointer-events: none;
    border-radius: 0 8px 8px 0;
    z-index: 2;
}

.cover-shadow-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0,0,0,0.08), transparent);
    pointer-events: none;
    border-radius: 0 0 8px 0;
    z-index: 2;
}

.cover-shadow-edge {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(to left, rgba(0,0,0,0.06), transparent);
    pointer-events: none;
    border-radius: 0 8px 8px 0;
    z-index: 2;
}

/* ---------- واترمارک حرفه‌ای ---------- */
.watermark {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-family: 'IRANSans', 'YekanBakh', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 900;
    color: rgba(255,255,255,0.35);
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    transform: rotate(-6deg) scale(0.95);
    pointer-events: none;
    user-select: none;
    z-index: 3;
    background: rgba(0,0,0,0.08);
    padding: 4px 14px;
    border-radius: 6px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.book-cover:hover .watermark {
    transform: rotate(-4deg) scale(1);
    opacity: 0.9;
}

/* ---------- سایه‌ی زیر موکاپ ---------- */
.book-shadow {
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.10) 0%, transparent 70%);
    filter: blur(12px);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.4s ease;
}

.book-mockup:hover ~ .book-shadow,
.book-mockup-wrapper:hover .book-shadow {
    bottom: -16px;
    opacity: 0.6;
    transform: scale(1.1);
}

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 768px) {
    .book-mockup-wrapper {
        padding: 30px 16px;
    }
    .book-mockup {
        max-width: 260px;
    }
    .book-spine {
        width: 28px;
        min-width: 28px;
        padding: 12px 2px;
    }
    .spine-title {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }
    .watermark {
        font-size: 0.7rem;
        bottom: 10px;
        right: 10px;
        padding: 2px 10px;
    }
    .book-spine::before,
    .book-spine::after {
        width: 40%;
    }
    .no-cover {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .book-mockup {
        max-width: 200px;
    }
    .book-spine {
        width: 22px;
        min-width: 22px;
        padding: 8px 2px;
    }
    .spine-title {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }
    .watermark {
        font-size: 0.6rem;
        bottom: 6px;
        right: 6px;
        padding: 2px 8px;
    }
    .book-mockup-wrapper {
        padding: 20px 10px;
    }
    .no-cover {
        min-height: 150px;
        font-size: 0.75rem;
    }
}