/**
 * ترانه‌سراها Single Post Styles
 * نسخه 3.2 — استایل حرفه‌ای پست تکی (بازنویسی کامل)
 * شامل: گالری اینستاگرامی، سایدبار مدرن، ریسپانسیو، RTL
 * بهبود: استایل گزارش، ویرایش نظر، پاسخ، هشتگ، دکمه پرش به بالا
 */

/* ==================== لایه‌بندی اصلی ==================== */
.single-post-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

@media (max-width: 960px) {
    .single-post-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* مسیر بازگشت */
.back-navigation {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent);
}

/* ==================== مقاله پست ==================== */
.single-post {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: postFadeIn 0.3s ease;
}

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

.single-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.6;
    padding: 1.5rem 1.5rem 0;
    color: var(--text-primary);
}

/* ==================== هدر پست ==================== */
.post-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
}

.author-name a {
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.author-name a:hover {
    color: var(--accent);
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== آمار بازدید ==================== */
.post-stats {
    display: flex;
    gap: 8px;
    margin-right: auto;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.post-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 20px;
    transition: background 0.2s;
}

.post-stat-item:hover {
    background: var(--bg-tertiary);
}

.post-stat-item i {
    font-size: 13px;
    color: var(--accent);
}

.reading-time-badge {
    background: rgba(99, 102, 241, 0.1) !important;
}

.reading-time-badge i {
    color: #818cf8 !important;
}

/* ==================== تصویر شاخص ==================== */
.post-featured-image {
    position: relative;
    overflow: hidden;
    max-height: 520px;
}

.post-featured-image img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
}

/* ==================== گالری تصاویر — استایل اینستاگرامی ==================== */
.post-media {
    padding: 0 1.5rem;
}

.post-gallery-section {
    margin: 1.25rem 0;
}

.gallery-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.gallery-section-title i {
    color: var(--accent);
}

.gallery-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 8px;
}

.gallery-count-badge i {
    font-size: 10px;
    color: var(--text-secondary);
}

/* [T86eh] پیام ۸۳۳: گالری زیر پست — همهٔ بندانگشتی‌ها هم‌اندازه (از ۱ تا هر تعداد)،
   ردیف‌شکن با اندازهٔ ثابت؛ دیگر تصویر تک/دوتایی تمام‌عرض و بزرگ نمی‌شود */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1;
    width: 132px;
    height: 132px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    flex: 0 0 auto;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: #fff;
    font-size: 22px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

@media (hover: none) and (pointer: coarse) {
    .gallery-overlay {
        opacity: 0;
    }
    .gallery-item:active .gallery-overlay {
        opacity: 1;
    }
}

/* ==================== ویدیو و موزیک ==================== */
.video-section {
    margin: 0;
}

.video-player-wrapper {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-player-wrapper video {
    width: 100%;
    display: block;
}

.audio-playlist {
    margin: 0;
}

.music-player-wrapper {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 14px;
    padding: 18px;
    margin: 1rem 0;
}

.track-info {
    margin-bottom: 10px;
}

.track-name {
    color: #e2e8f0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.track-name i {
    color: #818cf8;
}

.audio-player-wrapper {
    width: 100%;
}

.music-player {
    width: 100%;
    border-radius: 8px;
}

.music-lyrics-box {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 20px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.music-lyrics h4 {
    margin-bottom: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lyrics-content {
    line-height: 2;
    white-space: pre-wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==================== محتوای پست ==================== */
.post-content {
    padding: 1.25rem 1.5rem;
}

.post-text {
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.post-text p {
    margin-bottom: 1rem;
}

.post-text img {
    max-width: 100%;
    border-radius: 8px;
}

.post-text a {
    color: var(--accent);
    text-decoration: none;
}

.post-text a:hover {
    text-decoration: underline;
}

/* ==================== باکس محصول ==================== */
.product-info-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    margin: 1rem 1.5rem;
}

.product-info {
    display: flex;
    flex-direction: column;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-price i {
    font-size: 1.1rem;
}

.product-price-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.specs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.spec-item {
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
}

.spec-label {
    color: var(--text-secondary);
    margin-left: 4px;
}

.spec-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ==================== تگ‌ها و دسته‌بندی ==================== */
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1.5px solid;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    position: relative;
    overflow: hidden;
}

/* پس‌زمینه روشن حالت عادی — ۱۰٪ از رنگ خود دسته‌بندی */
.category-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.08;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: inherit;
}

/* سایه گلو بیرونی */
.category-tag::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: currentColor;
    opacity: 0;
    filter: blur(14px);
    transition: opacity 0.35s ease;
    z-index: -1;
}

/* ---- هاور: پر رنگ‌تر ولی نه کاملاً سفید ---- */
.category-tag:hover {
    transform: translateY(-2px) scale(1.04);
    border-color: currentColor;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.1),
        0 0 18px rgba(0,0,0,0.05);
}

/* پس‌زمینه هاور: ۲۰٪ از رنگ خود دسته‌بندی (تیره‌تر ولی نه سفید) */
.category-tag:hover::before {
    opacity: 0.2;
}

/* سایه گلو در هاور */
.category-tag:hover::after {
    opacity: 0.3;
}

.category-tag:active {
    transform: translateY(0) scale(1.01);
    transition-duration: 0.1s;
}

.category-tag i,
.category-tag span {
    position: relative;
    z-index: 1;
}

/* حالت دارک مود دسته‌بندی */
body.dark-mode .category-tag::before {
    opacity: 0.12;
}

body.dark-mode .category-tag:hover::before {
    opacity: 0.28;
}

body.dark-mode .category-tag:hover {
    box-shadow:
        0 4px 16px rgba(0,0,0,0.25),
        0 0 22px rgba(0,0,0,0.12);
}

body.dark-mode .category-tag:hover::after {
    opacity: 0.4;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0.75rem 1.5rem;
}

.tag-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--accent);
    font-size: 0.8125rem;
    text-decoration: none;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
    transition: background 0.2s;
}

.tag-link:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* ==================== هشتگ در متن پست و نظرات ==================== */
.hashtag-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-block;
    margin: 0 2px;
}

.hashtag-link:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-hover, #4f46e5);
    text-decoration: none;
    transform: translateY(-1px);
}

.post-text .hashtag-link,
.comment-text .hashtag-link {
    font-size: 0.92em;
    line-height: 1.6;
}

[data-theme="dark"] .hashtag-link,
body.dark-mode .hashtag-link {
    background: rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .hashtag-link:hover,
body.dark-mode .hashtag-link:hover {
    background: rgba(129, 140, 248, 0.2);
}

/* ==================== دکمه‌های اکشن ==================== */
.post-actions {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.action-btn.liked,
.like-btn.liked {
    color: #ef4444;
}

.like-btn.liked i {
    animation: likeHeart 0.35s ease;
}

@keyframes likeHeart {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.action-btn.saved,
.bookmark-btn.saved {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    animation: bookmarkPop 0.4s ease;
}

.bookmark-btn.saved:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.bookmark-btn.saved i { color: #ffffff; }

@keyframes bookmarkPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes bookmarkBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.3) rotate(-8deg); }
    70%  { transform: scale(0.92) rotate(4deg); }
    100% { transform: scale(1) rotate(0); }
}

.report-post-btn {
    margin-right: auto;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.report-post-btn:hover {
    color: #ef4444;
}

/* ==================== بخش نظرات ==================== */
.comments-section {
    padding: 1.5rem;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.comments-title i {
    color: var(--accent);
}

/* ==================== فرم افزودن نظر ==================== */
.add-comment-form {
    margin-bottom: 1.5rem;
}

.add-comment-form form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    font-size: 0.8125rem;
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.comment-reply-cancel {
    margin-right: auto;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 50%;
    transition: background 0.2s;
}

.comment-reply-cancel:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.add-comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    min-height: 80px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.add-comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-emoji-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.comment-emoji-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s, transform 0.15s;
}

.comment-emoji-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.15);
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.captcha-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    direction: ltr;
}

.captcha-refresh {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.captcha-refresh:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.add-comment-form .btn-primary,
.add-comment-form button[type="submit"] {
    align-self: flex-start;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.1s;
}

.add-comment-form .btn-primary:hover,
.add-comment-form button[type="submit"]:hover {
    background: var(--accent-hover);
}

.add-comment-form .btn-primary:active,
.add-comment-form button[type="submit"]:active {
    transform: scale(0.97);
}

/* ==================== لیست نظرات ==================== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

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

.comment-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
}

.comment-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-color);
}

.comment-content,
.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.comment-author a {
    color: var(--text-primary);
    text-decoration: none;
}

.comment-author a:hover {
    color: var(--accent);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.edited-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.6875rem;
    color: var(--text-tertiary, #9ca3af);
    font-style: normal;
    font-weight: 400;
    opacity: 0.7;
}

.comment-text {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
}

/* ==================== نقل‌قول پاسخ ==================== */
.comment-quote {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border-right: 3px solid var(--accent);
    background: rgba(99, 102, 241, 0.06);
    cursor: pointer;
    transition: background 0.2s;
}

.comment-quote:hover {
    background: rgba(99, 102, 241, 0.1);
}

.comment-quote-header {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}

.comment-quote-header i {
    font-size: 10px;
}

.comment-quote-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ==================== اکشن‌های نظر ==================== */
.comment-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.comment-action-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    font-family: inherit;
    border-radius: 6px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
}

.comment-action-btn.active {
    color: var(--accent);
}

.comment-action-btn.comment-like-btn.active {
    color: #ef4444;
}

.comment-action-btn.comment-dislike-btn.active {
    color: #f59e0b;
}

.comment-action-btn.comment-reply-btn:hover {
    color: var(--accent);
}

.comment-action-btn.comment-edit-btn:hover {
    color: #3b82f6;
}

.comment-action-btn.comment-delete-btn:hover {
    color: #ef4444;
}

.comment-action-btn.comment-report-btn:hover {
    color: #f59e0b;
}

/* ==================== کامنت ترد (پاسخ‌ها) ==================== */
.comment-thread {
    margin-right: 18px;
    padding-right: 14px;
    border-right: 2px solid var(--border-color);
}

.reply-item {
    padding: 10px 0;
}

@media (max-width: 768px) {
    .comment-thread {
        margin-right: 10px;
        padding-right: 10px;
    }
}

/* ==================== نظر حذف‌شده ==================== */
.deleted-comment {
    opacity: 0.6;
}

.deleted-comment .comment-text {
    font-style: italic;
}

/* ==================== جعبه ویرایش نظر ==================== */
.edit-comment-box {
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 14px;
    margin: 8px 0;
    animation: editBoxFadeIn 0.2s ease;
}

@keyframes editBoxFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.edit-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.edit-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

.close-edit-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-edit-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.edit-comment-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    min-height: 70px;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.edit-comment-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-emoji-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.edit-emoji-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s, transform 0.15s;
}

.edit-emoji-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.15);
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.save-edit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.save-edit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.save-edit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cancel-edit-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.cancel-edit-btn:hover {
    background: var(--bg-tertiary);
}

/* ==================== Link Preview در نظرات ==================== */
.link-preview-card {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s;
    max-width: 320px;
}

.link-preview-card:hover {
    border-color: var(--accent);
}

.link-preview-image {
    width: 100%;
    max-height: 140px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 140px;
}

.preview-loading {
    width: 100%;
    height: 80px;
    background: linear-gradient(90deg, var(--bg-tertiary), var(--bg-secondary), var(--bg-tertiary));
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.link-preview-content {
    padding: 10px;
}

.link-preview-site {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.link-preview-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 0.6875rem;
    color: var(--accent);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
}

/* ==================== سایدبار ==================== */
.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: sidebarFadeIn 0.4s ease 0.1s both;
}

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

/* ==================== ویجت نویسنده ==================== */
.author-widget {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-widget-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.author-widget-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 2px;
}

.author-widget-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.author-widget-name a:hover {
    color: var(--accent);
}

.author-widget-username {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.author-widget-bio {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.author-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 14px;
}

.stat-item {
    text-align: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.stat-item:hover {
    background: var(--bg-secondary);
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.author-widget .follow-btn,
.author-widget .btn-primary,
.author-widget .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.author-widget .btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.author-widget .btn-primary:hover {
    background: var(--accent-hover);
}

.author-widget .btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.author-widget .btn-outline:hover {
    background: var(--bg-secondary);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--accent);
    text-decoration: none;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.view-all-link:hover {
    opacity: 0.8;
}

/* ==================== ویجت پست‌های اخیر ==================== */
.recent-posts-widget {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 12px 14px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.widget-title i {
    color: var(--accent);
    font-size: 0.8125rem;
}

.recent-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 3px;
}

.recent-posts-grid .recent-tile {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-tertiary);
}

.recent-posts-grid .recent-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.recent-posts-grid .recent-tile:hover img {
    transform: scale(1.06);
}

.recent-tile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.recent-posts-grid .recent-tile:hover .recent-tile-overlay {
    opacity: 1;
}

.recent-tile-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.recent-tile-stat i {
    font-size: 13px;
}

.recent-tile-text-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: var(--text-secondary);
    opacity: 0.35;
    z-index: 1;
    pointer-events: none;
}

/* ═════════════ [T65] سایدبار متنی — همهٔ فهرست‌ها بدون نیاز به تصویر ═════════════
   گزارش کاربر: بیشتر پست‌ها تصویر ندارند؛ گالری بندانگشتی جای خالی می‌سازد.
   حالا «پیشنهادی»، «آخرین پست‌ها» و «ذخیره‌شده‌ها» ردیف متنیِ عنوان + آمار هستند. */
.recent-rows {
    display: flex;
    flex-direction: column;
}
.recent-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background 0.15s ease;
}
.recent-row:last-child {
    border-bottom: 0;
}
.recent-row:hover {
    background: var(--bg-secondary);
}
.recent-row-title {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.recent-row:hover .recent-row-title {
    color: var(--accent);
}
.recent-row-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.recent-row-meta i {
    font-size: 0.68rem;
    opacity: 0.85;
}

/* ==================== نوار پیشرفت خواندن ==================== */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

.reading-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    border-radius: 0 2px 2px 0;
    transition: width 0.1s linear;
}

/* ==================== لایت‌باکس گالری — کاملاً RTL و بدون باگ ==================== */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;           /* حتماً none باشه */
    align-items: center;
    justify-content: center;
}

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

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.lb-img {
    position: relative;
    z-index: 1;
    max-width: 92%;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    user-select: none;
    transition: opacity 0.2s;
}

/* دکمه بستن — سمت چپ */
.lb-close {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(8px);
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* کانتینر دکمه‌های ناوبری */
.lb-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

/* دکمه قبلی — سمت راست */
.lb-prev {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #06b4eb;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(20px);
    pointer-events: auto;
}

.lb-prev:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* دکمه بعدی — سمت چپ */
.lb-next {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #06b4eb;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(20px);
    pointer-events: auto;
}

.lb-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lb-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    direction: ltr;
}

/* ==================== مودال حذف نظر ==================== */
.delete-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.delete-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.delete-modal-container {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.delete-modal-overlay.active .delete-modal-container {
    transform: scale(1) translateY(0);
}

.delete-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #ef4444;
    font-size: 24px;
}

.delete-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.delete-modal-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.delete-modal-warning {
    display: block;
    font-size: 0.8125rem;
    color: #f59e0b;
    margin-top: 6px;
}

.delete-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.delete-modal-cancel {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.delete-modal-cancel:hover {
    background: var(--bg-tertiary);
}

.delete-modal-confirm {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: #ef4444;
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.delete-modal-confirm:hover {
    background: #dc2626;
}

.delete-modal-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== مودال گزارش نظر ==================== */
.report-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.report-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.report-modal-container {
    background: var(--bg-primary);
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.report-modal-overlay.active .report-modal-container {
    transform: scale(1) translateY(0);
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.report-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.report-modal-title i {
    color: #f59e0b;
}

.report-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.report-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.report-modal-body {
    padding: 20px 22px;
}

.report-modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    margin-top: 0;
}

.report-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-reason-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.report-reason-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.report-reason-item:has(input:checked) {
    background: rgba(99, 102, 241, 0.06);
    border-color: var(--accent);
}

.report-reason-item input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.report-reason-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.report-reason-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 14px;
    flex-shrink: 0;
}

.report-reason-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-reason-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.report-reason-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.report-additional-details {
    margin-top: 12px;
}

.report-description {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.report-description:focus {
    outline: none;
    border-color: var(--accent);
}

.report-char-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: left;
    margin-top: 4px;
}

.report-modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.report-btn-cancel {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.report-btn-cancel:hover {
    background: var(--bg-tertiary);
}

.report-btn-submit {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: #f59e0b;
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.report-btn-submit:hover:not(:disabled) {
    background: #d97706;
}

.report-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== دکمه پرش به بالا ==================== */
.scroll-to-top-btn {
    position: fixed;
    bottom: 80px;
    left: 24px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-top-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.scroll-to-top-btn:active {
    transform: scale(0.92);
}

/* ==================== Toast ==================== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10002;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90vw;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.success i {
    color: #10b981;
}

.toast-notification.error i {
    color: #ef4444;
}

.toast-notification.info i {
    color: #3b82f6;
}

/* ==================== لودینگ نظرات ==================== */
.loading-comments {
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.loading-comments i {
    animation: spin 1s linear infinite;
    color: var(--accent);
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-comments {
    padding: 30px 0;
    color: var(--text-secondary);
}

.error {
    color: #ef4444;
}

.text-center {
    text-align: center;
}

/* ==================== ریسپانسیو ==================== */
@media (max-width: 960px) {
    .post-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .author-widget {
        flex: 1;
        min-width: 260px;
    }

    .recent-posts-widget {
        flex: 1;
        min-width: 260px;
    }
}

@media (max-width: 768px) {
    .single-post-wrapper {
        padding: 0.75rem;
    }

    .single-post-title {
        font-size: 1.25rem;
        padding: 1rem 1rem 0;
    }

    .post-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .post-stats {
        margin-right: 0;
        width: 100%;
    }

    .report-post-btn {
        margin-right: 0;
    }

    .post-content {
        padding: 1rem;
    }

    .post-actions {
        padding: 0.5rem 1rem;
        position: sticky;
        bottom: 0;
        z-index: 100;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        border-bottom: none;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    [data-theme="dark"] .post-actions,
    body.dark-mode .post-actions {
        background: rgba(15, 23, 42, 0.9);
    }

    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
    }

    .action-btn {
        padding: 8px 10px;
        font-size: 0.8125rem;
    }

    .image-gallery {
        gap: 6px;
    }

    .gallery-item {
        width: 104px;
        height: 104px;
        border-radius: 9px;
    }

    .comments-section {
        padding: 1rem;
    }

    .product-info-box {
        margin: 1rem;
    }

    .post-tags {
        padding: 0.5rem 1rem;
    }

    .post-sidebar {
        flex-direction: column;
    }

    .author-widget {
        min-width: unset;
    }

    .recent-posts-widget {
        min-width: unset;
    }

    .comment-actions {
        gap: 4px;
    }

    .comment-action-btn {
        padding: 3px 4px;
        font-size: 0.7rem;
    }

    .comment-thread {
        margin-right: 10px;
        padding-right: 10px;
    }

    .reading-progress-bar {
        height: 2px;
    }

    .scroll-to-top-btn {
        bottom: 70px;
        left: 16px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        gap: 5px;
    }

    .gallery-item {
        width: 92px;
        height: 92px;
        border-radius: 8px;
    }

    .post-featured-image {
        max-height: 300px;
    }

    .post-featured-image img {
        max-height: 300px;
    }

    .recent-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }

    .report-modal-container {
        border-radius: 12px;
    }

    .report-reason-content {
        padding: 10px 12px;
    }

    .report-reason-icon {
        width: 32px;
        height: 32px;
    }

    .report-modal-footer {
        flex-direction: column-reverse;
    }

    .report-btn-cancel,
    .report-btn-submit {
        width: 100%;
        justify-content: center;
        padding: 10px 18px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   [T31] — استایل توییتری صفحهٔ پست تکی
   (ردیف نویسنده، دکمه‌های دایره‌ای، مودال حذف در تم روشن،
    لینک منشن، دکمهٔ «نمایش نظرات بیشتر»)
   ═══════════════════════════════════════════════════════════════ */

/* — ردیف نویسنده: نام + @هندل · زمان — */
.author-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.author-handle { color: var(--ts, #8a92a3); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; }
.author-dot { color: var(--tt, #aab3c2); font-size: 0.8125rem; }
.author-meta-row .post-time { font-size: 0.8125rem; color: var(--ts, #8a92a3); }
.author-meta-row .post-time i { display: none; }

/* — متن پست: درشت‌تر و خواناتر مثل توییتر — */
.post-content .post-text { font-size: 1.0625rem; line-height: 1.8; }

/* — نوار اکشن با جداکننده و دکمه‌های دایره‌ای — */
.post-actions { border-top: 1px solid var(--b, #e3e8f0); border-bottom: 1px solid var(--b, #e3e8f0); padding: 6px 0; margin-top: 20px; }
.post-actions .action-buttons { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.post-actions .action-btn,
.post-actions .action-btn.comment-btn,
.post-actions .action-btn.share-btn,
.post-actions .action-btn.bookmark-btn,
.post-actions .action-btn.like-btn {
    padding: 8px 10px;
    border-radius: 9999px;
    min-height: 36px;
    font-size: 0.8125rem;
    gap: 6px;
    background: transparent;
}
.post-actions .action-btn:hover { background: var(--bg, #eef1f6); color: var(--t, #151a24); }
.post-actions .like-btn:hover, .post-actions .like-btn.liked { color: #f91880; background: rgba(249, 24, 128, 0.10); }
.post-actions .comment-btn:hover { color: #1d9bf0; background: rgba(29, 155, 240, 0.10); }
.post-actions .share-btn:hover { color: #00ba7c; background: rgba(0, 186, 124, 0.10); }
.post-actions .bookmark-btn:hover, .post-actions .bookmark-btn.saved { color: #1d9bf0; background: rgba(29, 155, 240, 0.10); }
body.dark-mode .post-actions .action-btn:hover, html[data-theme="dark"] .post-actions .action-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--t, #f2f4fa); }

/* — لینک منشن (@نام‌کاربری) — */
.mention-link {
    color: #1d9bf0;
    font-weight: 600;
    text-decoration: none;
    unicode-bidi: embed;
}
.mention-link:hover { text-decoration: underline; }
body.dark-mode .mention-link, html[data-theme="dark"] .mention-link { color: #6cc6ff; }
.comment-text .mention-link { unicode-bidi: embed; }

/* — دکمهٔ «نمایش نظرات بیشتر» — */
.cmt-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 14px 0 6px;
    padding: 11px 16px;
    border: 1px solid var(--b, #e3e8f0);
    border-radius: 9999px;
    background: var(--w, #ffffff);
    color: var(--t, #151a24);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.cmt-load-more:hover { background: var(--bg, #eef1f6); border-color: var(--b2, #d4dbe7); }
.cmt-load-more:disabled { opacity: 0.6; cursor: default; }
body.dark-mode .cmt-load-more, html[data-theme="dark"] .cmt-load-more {
    background: var(--w2, #171728);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--t, #f2f4fa);
}
body.dark-mode .cmt-load-more:hover, html[data-theme="dark"] .cmt-load-more:hover { background: #1e1e33; }

/* — بخش نظرات: جدایی نرم از پست — */
.comments-section { border-top: 1px solid var(--b, #e3e8f0); margin-top: 8px; padding-top: 6px; }
.comments-title { padding-top: 10px; }

/* ═══ مودال حذف نظر — اصلاح تم روشن (T31) ═══ */
.delete-modal-overlay { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(3px); }
.delete-modal-container {
    background: var(--w, #ffffff);
    border: 1px solid var(--b, #e3e8f0);
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.18);
    padding: 30px 26px;
}
.delete-modal-title { color: var(--t, #151a24); }
.delete-modal-message { color: var(--ts, #5c6472); }
.delete-modal-warning { color: #d97706; }
.delete-modal-cancel {
    background: var(--w2, #f7f9fc);
    border: 1px solid var(--b, #e3e8f0);
    color: var(--t, #151a24);
}
.delete-modal-cancel:hover { background: var(--bg, #eef1f6); }
body.dark-mode .delete-modal-container,
html[data-theme="dark"] .delete-modal-container {
    background: #1e1e33;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
body.dark-mode .delete-modal-title,
html[data-theme="dark"] .delete-modal-title { color: #f2f4fa; }
body.dark-mode .delete-modal-message,
html[data-theme="dark"] .delete-modal-message { color: #9aa0b4; }
body.dark-mode .delete-modal-cancel,
html[data-theme="dark"] .delete-modal-cancel {
    background: #171728;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f2f4fa;
}
body.dark-mode .delete-modal-cancel:hover,
html[data-theme="dark"] .delete-modal-cancel:hover { background: #26264a; }
/* پایان [T31] */

/* ==================== [T40] استاندارد موبایل صفحهٔ پست ==================== */
@media (max-width: 640px) {
  .btn-primary, .btn-outline { min-height: 40px; font-size: 0.9rem; }
  /* [T80] عرض/ارتفاع ثابت ۴۲px حذف شد — دکمه‌های دارای متن (اشتراک/شمارنده‌ها) سرریز می‌کردند
     و محتوایشان روی دکمهٔ کناری (ذخیره/نقل‌قول) نقاشی می‌شد؛ اکنون هدف لمسی با min تضمین می‌شود */
  .action-btn, .post-actions .action-btn { width: auto !important; height: auto !important; min-width: 42px !important; min-height: 42px !important; font-size: 1.05rem; }
  .post-actions { gap: 0.4rem; }
  .post-actions .action-buttons { align-items: center; }
  /* [T80] «اشتراک» در موبایل فقط‌آیکونی (هم‌سبک ذخیرهٔ [T61]) — متن برای صفحه‌خوان حفظ می‌شود */
  .post-actions .share-btn { gap: 0; }
  .post-actions .share-btn span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .like-btn, .comment-action-btn { min-width: 42px; min-height: 42px; font-size: 1rem; }
  .add-comment-form textarea, .edit-comment-textarea, .form-input { font-size: 16px; }
  .add-comment-form textarea { min-height: 96px; }
  .comment-actions .btn, .edit-actions .btn { min-height: 36px; font-size: 0.82rem; }
  .comments-title { font-size: 1rem; }
  .scroll-to-top-btn { width: 44px; height: 44px; }
}
/* پایان [T40] پست */

/* ═════════════ [T64] پشتیبان متغیرهای theme.css ═════════════
   کشف باگ: کامنت‌های قدیمی theme.css عبارت «themes/*/variables.css» داشتند؛
   دنبالهٔ «*/» کامنت را زودتر می‌بست، زبالهٔ CSS قبل از :root می‌ساخت و کل
   فایل در مرورگر خالی parse می‌شد؛ نتیجه‌اش مودال «گزارش پست» بدون پس‌زمینه
   بود. theme.css اصلاح شد؛ این بلوک پشتیبان است تا اگر آن فایل به هر دلیلی
   (خطای شبکه/کش خراب) بارگذاری نشد، مودال‌های این صفحه هرگز بدون زمینه نمانند.
   مقادیر دقیقاً همان نگاشت‌های theme.css هستند و در حالت عادی تغییری ایجاد نمی‌کنند. */
:root {
  --bg-primary: var(--gray-50, #f7f9fc);
  --bg-secondary: var(--gray-100, #f1f5f9);
  --bg-tertiary: var(--gray-200, #e5e9f0);
  --text-primary: var(--gray-900, #101828);
  --text-secondary: var(--gray-500, #667085);
  --text-muted: var(--gray-400, #98a2b3);
  --border-color: var(--gray-200, #e5e9f0);
  --border-light: var(--gray-300, #d0d5dd);
}
/* پایان [T64] */


/* ═══════════════════════════════════════════════════════════════
   [T86ed] بازطراحی رنگ دکمه‌های زیر پست — پیام ۷۹۷ مدیر
   پالت آرام و تفکیک‌شده: لایک گلبهی، نظر آبی، بازنشر سبز،
   اشتراک بنفش، ذخیره کهربایی (قبلاً ذخیره سه رنگ متفاوت داشت)
   ═══════════════════════════════════════════════════════════════ */
.post-actions .action-btn { color: var(--ts, #5b6472); }
.post-actions .like-btn:hover,
.post-actions .like-btn-guest:hover { color: #e0245e; background: rgba(224, 36, 94, .10); }
.post-actions .like-btn.liked { color: #e0245e; background: rgba(224, 36, 94, .12); }
.post-actions .like-btn.liked i { color: #e0245e; }
.post-actions .comment-btn:hover { color: #1d9bf0; background: rgba(29, 155, 240, .10); }
.post-actions .repost-btn:hover { color: #00a866; background: rgba(0, 168, 102, .10); }
.post-actions .repost-btn.reposted { color: #00a866; background: rgba(0, 168, 102, .12); }
.post-actions .share-btn:hover { color: #7c5cff; background: rgba(124, 92, 255, .10); }
.post-actions .bookmark-btn:hover,
.post-actions .bookmark-btn-guest:hover { color: #d97706; background: rgba(217, 119, 6, .10); }
.post-actions .bookmark-btn.saved,
.post-actions .bookmark-btn.saved:hover { color: #d97706; background: rgba(217, 119, 6, .12); box-shadow: none; }
.post-actions .bookmark-btn.saved i { color: #d97706; }
body.dark-mode .post-actions .like-btn.liked { color: #ff5c8a; background: rgba(224, 36, 94, .16); }
body.dark-mode .post-actions .repost-btn.reposted { color: #2fd18a; background: rgba(0, 168, 102, .16); }
body.dark-mode .post-actions .share-btn:hover { color: #9d85ff; background: rgba(124, 92, 255, .14); }
body.dark-mode .post-actions .bookmark-btn.saved { color: #f0a13c; background: rgba(217, 119, 6, .16); }

/* ═══════════ [T86es] پیام ۸۷۱ — ردیف فهرست پست‌ها با بندانگشتی ═══════════
   زنجیره: تصویر پست → آواتار نویسنده → آواتار پیش‌فرض. بندانگشتی ۴۸px
   سمت راست (RTL)، متن در ستون کنارش؛ ردیف‌ها مثل قبل خط‌جداشاینده دارند. */
.recent-row--thumb {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}
.recent-row-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
    box-shadow: inset 0 0 0 1px var(--border-color);
}
.recent-row--thumb .recent-row-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.recent-row--thumb .recent-row-title {
    line-height: 1.65;
}
.recent-row--thumb .recent-row-meta {
    gap: 12px;
}
@media (max-width: 480px) {
    .recent-row--thumb { gap: 10px; }
    .recent-row-thumb { width: 42px; height: 42px; border-radius: 9px; }
}
