/* =========================================
   PEANIR PINTEREST-STYLE SHARE MODAL
========================================= */

/* --- 1. محتوای مودال Share --- */
.pean-share-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.pean-comments-modal.hidden .pean-share-content {
    transform: scale(0.95);
}

.pean-share-body {
    padding: 20px;
    background: #ffffff;
    overflow-y: auto;
}

/* --- 2. تصویر شاخص پست در بالای مودال --- */
.pean-share-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.pean-share-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 12px;
}

.pean-share-preview h4 {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 3. چیدمان هوشمند دکمه‌های اشتراک‌گذاری --- */
.pean-share-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px 12px;
}

/* خنثی‌سازی کامل استایل‌های قالب و عرض‌دهی فلکس */
button.share-item,
a.share-item {
    all: unset !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    background-color: transparent !important;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex: 0 0 18% !important; /* 5 دکمه در یک ردیف در دسکتاپ */
}

/* خنثی کردن هاور مزاحم در تگ‌های button و a */
button.share-item:hover, 
button.share-item:focus, 
button.share-item:active,
a.share-item:hover, 
a.share-item:focus, 
a.share-item:active {
    background-color: transparent !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    text-decoration: none !important;
    color: inherit !important;
}

button.share-item::before,
button.share-item::after,
a.share-item::before,
a.share-item::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
}

/* دایره پس‌زمینه آیکون */
.share-item .icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f4f4f5 !important;
    color: #111 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.share-item svg {
    width: 22px;
    height: 22px;
}

.share-item span {
    font-size: 11px;
    font-weight: 600;
    color: #71717a;
    text-align: center;
}

/* افکت هاور اختصاصی */
.share-item:hover .icon-wrap {
    background: #e4e4e7 !important;
    transform: translateY(-2px);
}
.share-item:active .icon-wrap {
    transform: scale(0.9);
}

/* --- 4. حالت موبایل (Bottom Sheet) --- */
@media (max-width: 768px) {
    .pean-share-content {
        max-width: 100%;
        border-radius: 28px 28px 0 0;
        transform: translateY(0);
    }
    
    .pean-comments-modal.hidden .pean-share-content {
        transform: translateY(100%);
    }

    /* تغییر چیدمان به 3 تا در ردیف بالا و 2 تا در مرکز ردیف پایین */
    .pean-share-grid {
        gap: 20px 10px;
    }
    button.share-item,
    a.share-item {
        flex: 0 0 30% !important; 
    }
}