/* ===== POST CARDS - CORE STYLES ===== */

/* Post Card Container */
.post-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 580px;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: slideInUp 0.5s ease-out;
}

.post-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--glow), var(--shadow-lg);
}

.post-card.featured {
    border: 2px solid var(--primary);
    background: var(--glass-primary);
}

/* Media Section - Fixed Height */
.post-media-section {
    position: relative;
    height: 250px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Badges */
.post-badges {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.type-badge {
    padding: 0.35rem 0.75rem;
    background: var(--glass-ultra-dark);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.type-badge.video {
    background: var(--error-soft);
    border-color: var(--error);
    color: var(--error-light);
}

.type-badge.carousel {
    background: var(--secondary-soft);
    border-color: var(--secondary);
    color: var(--secondary-light);
}

.type-badge.image {
    background: var(--info-soft);
    border-color: var(--info);
    color: var(--info-light);
}

.collection-badge {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* Image Container */
.image-container {
    width: 100%;
    height: 100%;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* No Media */
.no-media {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    color: var(--gray-500);
}

.no-media-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.no-media-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Post Content - Fixed Height */
.post-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    overflow: hidden;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.author-info {
    flex: 1;
    min-width: 0;
}

.author-name {
    font-weight: 700;
    color: var(--light);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.author-name .badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
}

.author-specialty {
    color: var(--gray-400);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.post-time {
    color: var(--gray-500);
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Post Text */
.post-text {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--gray-300);
    flex: 1;
    overflow: hidden;
    position: relative;
    font-size: 0.95rem;
}

.post-text.truncated {
    max-height: 4.2em;
    overflow: hidden;
}

.post-text.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(transparent, var(--glass));
}

.read-more-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s ease;
}

.read-more-btn:hover {
    color: var(--primary-light);
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.3rem 0.7rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--gray-400);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--glass-light);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Service Badge */
.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    background: var(--success-soft);
    border: 1px solid var(--success);
    border-radius: var(--radius-full);
    color: var(--success-light);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    align-self: flex-start;
}

/* Actions */
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--gray-400);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--glass-light);
    color: var(--light);
    transform: translateY(-1px);
}

.action-btn.liked {
    color: var(--error-light);
}

.action-btn.saved {
    color: var(--accent-light);
}

.action-btn i {
    font-size: 1rem;
}

.action-count {
    font-weight: 700;
    color: var(--light);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.share-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--gray-400);
    padding: 0.5rem 1rem;
}

.share-btn:hover {
    background: var(--glass-light);
    color: var(--primary-light);
    border-color: var(--primary);
}

/* Stats */
.post-stats {
    display: flex;
    gap: 1.25rem;
    color: var(--gray-500);
    font-size: 0.8rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 0.75rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stat i {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 640px) {
    .post-card {
        height: 540px;
    }

    .post-media-section {
        height: 220px;
    }

    .post-content {
        padding: 1rem;
    }

    .action-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}
/* Post Card Adjustments for Larger Media */
.post-card {
    height: 620px; /* Increased for better media display */
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.post-media-section {
    height: 340px; /* Increased to match larger media */
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-card {
        height: 580px;
    }

    .post-media-section {
        height: 300px;
    }
}

@media (max-width: 640px) {
    .post-card {
        height: 550px;
    }

    .post-media-section {
        height: 260px;
    }
}
/* ===== GOLDEN DETAILS BUTTON STYLES ===== */

/* دکمه طلایی اصلی */
.golden-details-btn {
    position: relative;
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg,
        #FFD700 0%,
        #FFEC8B 25%,
        #DAA520 50%,
        #B8860B 75%,
        #8B6914 100%);
    border: none;
    border-radius: var(--radius-xl);
    color: #2C1810 !important;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-width: 140px;
    box-shadow:
        0 4px 15px rgba(255, 215, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* جلوه نور */
.golden-details-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 20%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 80%
    );
    transform: rotate(30deg);
    transition: transform 0.8s ease;
    opacity: 0;
}

/* جلوه سایه داخلی */
.golden-details-btn::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.9) 0%,
        rgba(255, 236, 139, 0.9) 50%,
        rgba(218, 165, 32, 0.9) 100%);
    border-radius: calc(var(--radius-xl) - 2px);
    z-index: 1;
}

/* متن و آیکون */
.golden-details-btn span,
.golden-details-btn i {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* آیکون */
.golden-details-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

/* Hover Effects */
.golden-details-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 8px 25px rgba(255, 215, 0, 0.5),
        0 0 0 2px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #1A0F08 !important;
}

.golden-details-btn:hover::before {
    opacity: 1;
    transform: rotate(30deg) translate(20%, 20%);
}

.golden-details-btn:hover i {
    transform: translateX(3px) rotate(10deg);
}

/* Active/Pressed State */
.golden-details-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 2px 10px rgba(255, 215, 0, 0.4),
        0 0 0 1px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
}

/* Focus State */
.golden-details-btn:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(255, 215, 0, 0.5),
        0 4px 15px rgba(255, 215, 0, 0.3);
}

/* دکمه طلایی کوچکتر برای کارت پست */
.post-golden-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    min-width: 110px;
    border-radius: var(--radius-lg);
}

/* دکمه طلایی در هدر */
.header-golden-btn {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    min-width: 160px;
    border-radius: var(--radius-2xl);
}

/* انیمیشن پالس */
@keyframes golden-pulse {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(255, 215, 0, 0.3),
            0 0 0 1px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow:
            0 4px 25px rgba(255, 215, 0, 0.6),
            0 0 0 2px rgba(255, 215, 0, 0.4),
            0 0 20px rgba(255, 215, 0, 0.3);
    }
}

.golden-details-btn.pulsing {
    animation: golden-pulse 2s infinite ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .golden-details-btn {
        padding: 0.7rem 1.4rem;
        font-size: 0.85rem;
        min-width: 120px;
    }

    .post-golden-btn {
        padding: 0.5rem 1rem;
        min-width: 100px;
    }
}
/* ===== INSTAGRAM-STYLE ASPECT RATIO ===== */

/* تنظیم ابعاد اینستاگرامی 4:5 برای تمام مدیا */
.post-media-section {
    position: relative;
    height: auto; /* تغییر از ارتفاع ثابت */
    aspect-ratio: 4/5; /* ابعاد 4:5 اینستاگرامی */
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    background: #000;
}

/* برای حالت دسکتاپ بزرگتر */
@media (min-width: 1024px) {
    .post-media-section {
        aspect-ratio: 3/4; /* کمی کشیده‌تر در دسکتاپ */
    }
}

/* تنظیم ارتفاع کارت پست برای ابعاد جدید */
.post-card {
    height: auto; /* تغییر از ارتفاع ثابت */
    min-height: 650px; /* حداقل ارتفاع */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* تنظیم ابعاد برای انواع مدیا */
.video-container,
.carousel-container,
.image-container {
    width: 100%;
    height: 100%;
    aspect-ratio: 4/5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
}

/* تصاویر باید کل فضای مدیا را پر کنند */
.post-image,
.carousel-slide img,
.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* پلی‌بوتن را برای ابعاد جدید تنظیم کن */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--error), #dc2626);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow:
        0 8px 25px rgba(239, 68, 68, 0.5),
        0 0 0 6px rgba(239, 68, 68, 0.2);
}

/* تنظیم محتوای پست برای پر کردن فضای باقیمانده */
.post-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px; /* حداقل ارتفاع برای محتوا */
}

/* متن پست را بلندتر کن */
.post-text {
    flex: 1;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--gray-300);
    overflow: hidden;
    position: relative;
    font-size: 0.95rem;
    min-height: 80px; /* حداقل ارتفاع برای متن */
}

/* اکشن‌ها در پایین ثابت */
.post-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
    .post-media-section {
        aspect-ratio: 3/4; /* کمی مربعی‌تر در موبایل */
    }

    .post-card {
        min-height: 600px;
    }

    .post-content {
        min-height: 280px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .post-media-section {
        aspect-ratio: 1/1; /* مربعی کامل در موبایل کوچک */
    }

    .post-card {
        min-height: 550px;
    }

    .video-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* ===== ALTERNATIVE: 1:1.25 ASPECT RATIO ===== */
/* اگر می‌خواهید نسبت 1:1.25 داشته باشید */
/* ===== ALTERNATIVE: 1:1.25 ASPECT RATIO ===== */
/* استفاده از خط تیره به جای نقطه */
.post-media-section.aspect-1-1-25 {
    aspect-ratio: 1/1.25;
}

/* یا استفاده از نام توصیفی‌تر */
.post-media-section.instagram-ratio {
    aspect-ratio: 4/5; /* یا 1/1.25 */
}

.post-media-section.square-ratio {
    aspect-ratio: 1/1; /* مربع کامل */
}

.post-media-section.portrait-ratio {
    aspect-ratio: 2/3; /* پرتره */
}

.post-media-section.landscape-ratio {
    aspect-ratio: 16/9; /* لنداسکیپ */
}
/* ===== FIXES FOR UNIFORM HEIGHT ===== */

/* اطمینان از ارتفاع یکسان برای همه کارت‌ها */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    align-items: start; /* تغییر از stretch به start */
}

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* پر کردن ارتفاع */
}

/* ===== BADGE POSITION FIX ===== */

.post-badges {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 30; /* بالاتر از مدیا */
}

/* ===== LOADING STATE ===== */

.post-media-section.loading {
    background: linear-gradient(90deg,
        var(--glass) 25%,
        var(--glass-light) 50%,
        var(--glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ===== HOVER EFFECTS ===== */

.post-card:hover .post-media-section img,
.post-card:hover .video-thumbnail {
    transform: scale(1.03);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .post-media-section img,
    .video-thumbnail {
        transition: none;
    }

    .post-media-section.loading {
        animation: none;
    }
}
/* ===== CONTROLLED HEIGHT SYSTEM ===== */

/* Reset default heights */
.post-card {
    height: auto !important;
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

/* Section 1: Media Section - Fixed Ratio */
.post-media-section {
    flex: 0 0 auto !important; /* ارتفاع ثابت */
    aspect-ratio: 4/5;
    min-height: 400px;
    max-height: 450px;
    position: relative;
    overflow: hidden;
}

/* Section 2: Post Content - Controlled Sections */
.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem; /* فاصله یکسان بین سکشن‌ها */
}

/* Author Section - Fixed Height */
.post-author {
    flex: 0 0 auto;
    min-height: 70px;
    max-height: 80px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0;
}

/* Text Section - Flexible but Controlled */
.post-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    max-height: 180px;
    overflow: hidden;
}

.post-text {
    flex: 1;
    line-height: 1.6;
    color: var(--gray-300);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
}

/* Tags Section - Fixed Height */
.post-tags-container {
    flex: 0 0 auto;
    min-height: 40px;
    max-height: 60px;
    overflow: hidden;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0;
}

/* Actions Section - Fixed Height */
.post-actions {
    flex: 0 0 auto;
    min-height: 60px;
    max-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

/* Stats Section - Fixed Height (if visible) */
.post-stats {
    flex: 0 0 auto;
    min-height: 40px;
    max-height: 50px;
    display: flex;
    gap: 1.25rem;
    color: var(--gray-500);
    font-size: 0.8rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 0.75rem;
}

/* ===== HEIGHT CONSISTENCY FOR ALL POSTS ===== */

/* Ensure all cards have same structure */
.post-card > * {
    box-sizing: border-box;
}

/* Container for predictable layout */
.post-inner-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Media container within media section */
.post-media-section > * {
    height: 100%;
    width: 100%;
}

/* ===== READ MORE BUTTON HEIGHT CONTROL ===== */
.read-more-btn {
    flex: 0 0 auto;
    height: 30px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* ===== FIXED HEIGHT FOR ACTION BUTTONS ===== */
.action-btn {
    height: 36px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
}

/* ===== RESPONSIVE HEIGHT ADJUSTMENTS ===== */

@media (max-width: 768px) {
    /* کاهش ارتفاع‌ها در موبایل */
    .post-card {
        min-height: 600px;
    }

    .post-media-section {
        min-height: 350px;
        max-height: 400px;
    }

    .post-author {
        min-height: 65px;
        max-height: 75px;
    }

    .post-text-container {
        min-height: 100px;
        max-height: 160px;
    }

    .post-tags-container {
        min-height: 35px;
        max-height: 55px;
    }

    .post-actions {
        min-height: 55px;
        max-height: 65px;
    }

    .post-content {
        padding: 1.25rem;
        gap: 0.875rem;
    }
}

@media (max-width: 480px) {
    .post-card {
        min-height: 550px;
    }

    .post-media-section {
        min-height: 300px;
        max-height: 350px;
        aspect-ratio: 1/1;
    }

    .post-author {
        min-height: 60px;
        max-height: 70px;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .post-text-container {
        min-height: 90px;
        max-height: 140px;
    }

    .post-content {
        padding: 1rem;
        gap: 0.75rem;
    }
}

/* ===== FALLBACK FOR OLD BROWSERS ===== */
@supports not (aspect-ratio: 4/5) {
    .post-media-section {
        height: 400px;
    }
}

/* ===== DEBUG MODE (راه‌اندازی برای دیدن مرزها) ===== */
.debug-height .post-media-section {
    border: 2px solid #ff0000;
}

.debug-height .post-author {
    border: 2px solid #00ff00;
}

.debug-height .post-text-container {
    border: 2px solid #0000ff;
}

.debug-height .post-tags-container {
    border: 2px solid #ffff00;
}

.debug-height .post-actions {
    border: 2px solid #ff00ff;
}

.debug-height .post-stats {
    border: 2px solid #00ffff;
}

/* ===== HEIGHT UTILITY CLASSES ===== */

/* اگر نیاز به کنترل بیشتر دارید */
.height-fixed {
    flex: 0 0 auto !important;
}

.height-flexible {
    flex: 1 !important;
    min-height: 50px;
}

.height-auto {
    height: auto !important;
    flex: none !important;
}

/* Container for equal height cards */
.equal-height-container {
    display: flex;
    flex-direction: column;
}

.equal-height-container > * {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== FIX FOR OVERFLOW ISSUES ===== */

.post-text.truncated {
    max-height: 4.8em;
    overflow: hidden;
}

.post-text.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(transparent, var(--glass));
    pointer-events: none;
}

/* ===== SCROLLBAR FOR LONG CONTENT ===== */

.post-text-container.scrollable {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.post-text-container.scrollable::-webkit-scrollbar {
    width: 4px;
}

.post-text-container.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.post-text-container.scrollable::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

/* ===== MINIMAL HEIGHT GUARANTEE ===== */

/* تضمین حداقل ارتفاع برای هر بخش */
.post-card > * {
    min-height: 0; /* برای flexbox مهم است */
}

/* ===== PRINT STYLES ===== */
@media print {
    .post-card {
        min-height: auto;
        page-break-inside: avoid;
    }

    .post-media-section {
        height: 300px;
        aspect-ratio: auto;
    }
}
/* ===== FIX DETAILS BUTTON STYLES ===== */

.action-btn.details-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border: 1px solid var(--primary) !important;
    color: white !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

.action-btn.details-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark)) !important;
    border-color: var(--primary-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    color: white !important;
}

.action-btn.details-btn:active {
    transform: translateY(0);
}

.action-btn.details-btn .action-count {
    color: white !important;
    font-weight: 600;
}

.action-btn.details-btn i {
    color: white !important;
}

/* در حالت موبایل */
@media (max-width: 768px) {
    .action-btn.details-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}
/* ===== AUTHOR SEPARATOR LINE ===== */

.author-separator {
    flex: 0 0 auto;
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
    width: 100%;
}

/* تنظیم مجدد post-text-container */
.post-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    max-height: 180px;
    overflow: hidden;
    margin-top: 0.5rem; /* فاصله از خط */
}
/* ===== IMPROVED AUTHOR LAYOUT ===== */

/* تنظیم مجدد ساختور Author */
.post-author-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 70px;
    max-height: 80px;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

/* آواتار در سمت چپ */
.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    overflow: hidden;
    flex-shrink: 0;
    order: 1; /* آواتار اولین */
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* اطلاعات نویسنده در وسط */
.author-info {
    flex: 1;
    min-width: 0;
    order: 2; /* اطلاعات دومین */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 700;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

/* Badge کنار نام */
.author-name .badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    height: 18px;
    display: inline-flex;
    align-items: center;
}

/* اطلاعات زیر نام در یک خط */
.author-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-400);
    flex-wrap: wrap;
}

.author-specialty,
.post-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.author-specialty i,
.post-time i {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* زمان در سمت راست */
.author-time-container {
    order: 3; /* زمان سومین */
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gray-500);
    font-size: 0.8rem;
    white-space: nowrap;
}

.author-time-container i {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== SEPARATOR LINE ===== */
.author-separator {
    height: 1px;
    background: var(--glass-border);
    margin: 0.75rem 0;
    width: 100%;
}

/* ===== RESPONSIVE AUTHOR LAYOUT ===== */

@media (max-width: 768px) {
    .post-author-section {
        min-height: 65px;
        max-height: 75px;
        gap: 0.5rem;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
    }

    .author-name {
        font-size: 0.9rem;
    }

    .author-meta {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .author-time-container {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .post-author-section {
        flex-wrap: nowrap;
    }

    .author-meta {
        flex-direction: row;
        gap: 0.5rem;
    }

    .author-time-container {
        margin-left: 0.5rem;
    }
}

/* fixes.css - برای رفع مشکلات فوری */

/* 1. اصلاح Author Section */
.post-author-section {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    margin-bottom: 12px !important;
}

/* 2. حذف خط اضافی */
.author-separator {
    display: none !important;
}

/* 3. نمایش هشتگ‌ها */
.post-tags-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 12px 0 !important;
}

.post-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.tag {
    display: inline-block !important;
    padding: 4px 12px !important;
    background: #f0f0f0 !important;
    border-radius: 20px !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 13px !important;
}

/* 4. فیکس ساختار کلی */
.post-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.post-text-container {
    margin: 0 !important;
}

/* 5. حذف استایل‌های قدیمی */
.post-author {
    display: none !important;
}

/* ===== FIXED GLASS PLAY BUTTON WITH WAVES ===== */

.video-play-btn.glass {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(
        135deg,
        rgba(255, 0, 0, 0.95), /* قرمز یوتیوب */
        rgba(220, 0, 0, 0.95)
    );
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    box-shadow:
        0 8px 32px rgba(255, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* مثلث پخش */
.video-play-btn.glass::before {
    content: '';
    position: relative;
    left: 3px;
    width: 0;
    height: 0;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 24px solid white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

/* ===== WAVE ANIMATIONS ===== */

.video-play-btn .wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 0, 0, 0.6); /* قرمز */
    border-radius: 50%;
    opacity: 0;
}

/* Wave 1 - سریع‌تر */
.video-play-btn .wave-1 {
    animation: wavePulse1 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

/* Wave 2 - متوسط */
.video-play-btn .wave-2 {
    animation: wavePulse2 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite 0.4s;
    border-color: rgba(255, 51, 51, 0.5); /* قرمز روشن‌تر */
}

/* Wave 3 - کندتر */
.video-play-btn .wave-3 {
    animation: wavePulse3 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite 0.8s;
    border-color: rgba(255, 102, 102, 0.4); /* قرمز کمرنگ‌تر */
}

@keyframes wavePulse1 {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
        border-width: 2px;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes wavePulse2 {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
        border-width: 2.5px;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes wavePulse3 {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
        border-width: 3px;
    }
    100% {
        transform: scale(2.1);
        opacity: 0;
        border-width: 1px;
    }
}

/* ===== PULSE EFFECT ===== */

.video-play-btn.pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow:
            0 8px 32px rgba(255, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 8px 42px rgba(255, 0, 0, 0.5),
            0 0 0 8px rgba(255, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* ===== HOVER EFFECTS ===== */

.video-play-btn.glass:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: linear-gradient(
        135deg,
        rgba(255, 51, 51, 0.95), /* قرمز روشن‌تر */
        rgba(240, 0, 0, 0.95)
    );
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow:
        0 10px 40px rgba(255, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.video-play-btn.glass:hover::before {
    transform: scale(1.1);
    border-left-color: #f8f8f8;
}

.video-play-btn.glass:hover .wave-1 {
    animation-duration: 1.5s;
}

.video-play-btn.glass:hover .wave-2 {
    animation-duration: 2s;
}

.video-play-btn.glass:hover .wave-3 {
    animation-duration: 2.5s;
}

/* ===== STRONGER WAVES (پررنگ‌تر) ===== */

.video-play-btn.glass.strong-waves .wave-1 {
    border: 3px solid rgba(255, 0, 0, 0.8);
    animation: strongWave1 2s ease-out infinite;
}

.video-play-btn.glass.strong-waves .wave-2 {
    border: 3px solid rgba(255, 51, 51, 0.7);
    animation: strongWave2 2.5s ease-out infinite 0.3s;
}

.video-play-btn.glass.strong-waves .wave-3 {
    border: 3px solid rgba(255, 102, 102, 0.6);
    animation: strongWave3 3s ease-out infinite 0.6s;
}

@keyframes strongWave1 {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
        border-width: 3px;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
        border-width: 0.5px;
    }
}

@keyframes strongWave2 {
    0% {
        transform: scale(0.85);
        opacity: 0.8;
        border-width: 3px;
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-width: 0.5px;
    }
}

@keyframes strongWave3 {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
        border-width: 3px;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
        border-width: 0.5px;
    }
}

/* ===== LARGER SIZE (سایز بزرگ‌تر) ===== */

.video-play-btn.glass.large {
    width: 90px;
    height: 90px;
}

.video-play-btn.glass.large::before {
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 28px solid white;
}

.video-play-btn.glass.large .wave-1 {
    animation: waveLarge1 2s ease-out infinite;
}

.video-play-btn.glass.large .wave-2 {
    animation: waveLarge2 2.5s ease-out infinite 0.4s;
}

.video-play-btn.glass.large .wave-3 {
    animation: waveLarge3 3s ease-out infinite 0.8s;
}

@keyframes waveLarge1 {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.9); opacity: 0; }
}

@keyframes waveLarge2 {
    0% { transform: scale(0.85); opacity: 0.7; }
    100% { transform: scale(2.1); opacity: 0; }
}

@keyframes waveLarge3 {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(2.3); opacity: 0; }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .video-play-btn.glass {
        width: 70px;
        height: 70px;
    }

    .video-play-btn.glass::before {
        border-top: 14px solid transparent;
        border-bottom: 14px solid transparent;
        border-left: 21px solid white;
    }

    .video-play-btn.glass.large {
        width: 80px;
        height: 80px;
    }

    .video-play-btn.glass.large::before {
        border-top: 16px solid transparent;
        border-bottom: 16px solid transparent;
        border-left: 24px solid white;
    }
}

@media (max-width: 480px) {
    .video-play-btn.glass {
        width: 60px;
        height: 60px;
    }

    .video-play-btn.glass::before {
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        border-left: 18px solid white;
    }

    .video-play-btn.glass.large {
        width: 70px;
        height: 70px;
    }

    .video-play-btn.glass.large::before {
        border-top: 14px solid transparent;
        border-bottom: 14px solid transparent;
        border-left: 21px solid white;
    }
}

/* ===== DARK MODE ===== */

@media (prefers-color-scheme: dark) {
    .video-play-btn.glass {
        background: linear-gradient(
            135deg,
            rgba(255, 51, 51, 0.95),
            rgba(240, 20, 20, 0.95)
        );
        box-shadow:
            0 8px 32px rgba(255, 51, 51, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    .video-play-btn.glass:hover {
        background: linear-gradient(
            135deg,
            rgba(255, 71, 71, 0.95),
            rgba(255, 30, 30, 0.95)
        );
    }
}