/* ========== گوگل ترندز - استایل هماهنگ با قالب ========== */

/* کانتینر اصلی - حفظ استایل قالب */
.gti-archive,
.gti-single-trend {
    max-width: 100%;
    margin: 0 auto;
    font-family: inherit; /* استفاده از فونت قالب */
}

/* هدر آرشیو */
.gti-archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: transparent; /* شفاف برای هماهنگی با قالب */
    border-radius: 0;
}

.gti-archive-header h1 {
    font-size: 2.5rem;
    color: inherit; /* استفاده از رنگ قالب */
    margin-bottom: 10px;
}

.gti-archive-header p {
    font-size: 1.1rem;
    color: inherit;
    opacity: 0.8;
}

/* گرید کارت‌ها */
.gti-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* کارت ترند - هماهنگ با استایل کارت‌های وردپرس */
.gti-card {
    background: var(--wp--preset--color--background, #ffffff);
    border: 1px solid var(--wp--preset--color--border, #e1e4e8);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gti-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--wp--preset--color--primary, #667eea);
}

/* تصویر کارت */
.gti-card-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* نسبت 16:9 */
    overflow: hidden;
    background: #f5f5f5;
}

.gti-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.gti-card:hover .gti-card-image img {
    transform: scale(1.05);
}

/* محتوای کارت */
.gti-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gti-card-title {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 600;
}

.gti-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.gti-card-title a:hover {
    color: var(--wp--preset--color--primary, #667eea);
}

/* نشان AI - طراحی مینیمال */
.gti-ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff !important;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* تاریخ */
.gti-card-date {
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.6;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gti-card-date::before {
    content: '🕒';
    font-size: 0.8rem;
    opacity: 0.8;
}

/* کلمات کلیدی */
.gti-card-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
}

.gti-keyword {
    background: transparent;
    color: inherit;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid currentColor;
    opacity: 0.6;
    transition: all 0.2s;
}

.gti-keyword:hover {
    opacity: 1;
    background: var(--wp--preset--color--primary, #667eea);
    border-color: var(--wp--preset--color--primary, #667eea);
    color: #ffffff !important;
}

/* صفحه‌بندی */
.gti-pagination {
    text-align: center;
    margin-top: 50px;
}

.gti-pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 3px;
    border: 1px solid currentColor;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    opacity: 0.7;
    transition: all 0.2s;
}

.gti-pagination .page-numbers.current {
    background: var(--wp--preset--color--primary, #667eea);
    border-color: var(--wp--preset--color--primary, #667eea);
    color: #ffffff !important;
    opacity: 1;
}

.gti-pagination .page-numbers:hover {
    opacity: 1;
    background: var(--wp--preset--color--primary, #667eea);
    border-color: var(--wp--preset--color--primary, #667eea);
    color: #ffffff !important;
}

/* ========== صفحه تکی ========== */

.gti-single-trend {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* هدر صفحه تکی */
.gti-single-header {
    margin-bottom: 40px;
}

.gti-single-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 30px;
}

.gti-single-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* عنوان صفحه تکی */
.gti-single-title-wrapper {
    margin-bottom: 20px;
}

.gti-single-title {
    font-size: 2.2rem;
    line-height: 1.3;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.gti-single-title.enhanced {
    color: var(--wp--preset--color--primary, #667eea);
}

.gti-original-title {
    font-size: 1rem;
    opacity: 0.6;
    padding: 10px 0;
    border-top: 1px dashed currentColor;
    border-bottom: 1px dashed currentColor;
    margin-top: 15px;
}

.gti-original-title small {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* متا اطلاعات */
.gti-single-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px 0;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    opacity: 0.7;
    font-size: 0.9rem;
}

.gti-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gti-keyword-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.gti-keyword-link:hover {
    color: var(--wp--preset--color--primary, #667eea);
    border-bottom-color: var(--wp--preset--color--primary, #667eea);
}

/* محتوای بهبود یافته */
.gti-enhanced-content {
    background: transparent;
    border: 2px solid var(--wp--preset--color--primary, #667eea);
    border-radius: 20px;
    padding: 30px;
    margin: 40px 0;
    position: relative;
}

.gti-enhanced-content::before {
    content: '✨';
    position: absolute;
    top: -15px;
    right: 30px;
    background: var(--wp--preset--color--background, #ffffff);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 1rem;
    border: 1px solid var(--wp--preset--color--primary, #667eea);
}

.gti-badge {
    display: inline-block;
    background: var(--wp--preset--color--primary, #667eea);
    color: #ffffff !important;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* محتوای اصلی (کلیک‌خور) */
.gti-original-content {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    opacity: 0.8;
}

.gti-original-content summary {
    cursor: pointer;
    color: inherit;
    font-weight: 500;
    padding: 10px;
    list-style: none;
    position: relative;
    padding-right: 25px;
}

.gti-original-content summary::before {
    content: '▶';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

.gti-original-content details[open] summary::before {
    transform: translateY(-50%) rotate(90deg);
}

.gti-original-content summary::-webkit-details-marker {
    display: none;
}

/* اخبار مرتبط */
.gti-related-news {
    margin: 50px 0;
}

.gti-related-news h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    position: relative;
    padding-right: 20px;
}

.gti-related-news h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 30px;
    background: var(--wp--preset--color--primary, #667eea);
    border-radius: 5px;
}

.gti-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.gti-news-card {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    opacity: 0.9;
}

.gti-news-card:hover {
    transform: translateY(-5px);
    border-color: var(--wp--preset--color--primary, #667eea);
    opacity: 1;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.gti-news-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.gti-news-content {
    padding: 20px;
}

.gti-news-content h3 {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.gti-news-content h3 a {
    color: inherit;
    text-decoration: none;
}

.gti-news-content h3 a:hover {
    color: var(--wp--preset--color--primary, #667eea);
}

.gti-news-source {
    font-size: 0.85rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* دکمه‌های اشتراک‌گذاری */
.gti-share-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 40px 0;
    padding: 20px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50px;
    justify-content: center;
    flex-wrap: wrap;
}

.gti-share-title {
    opacity: 0.7;
    font-weight: 500;
}

.gti-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1.1rem;
}

.gti-share-btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.gti-telegram { background: #0088cc; }
.gti-whatsapp { background: #25D366; }
.gti-twitter { background: #1DA1F2; }
.gti-facebook { background: #1877F2; }
.gti-linkedin { background: #0077b5; }

/* ریسپانسیو */
@media (max-width: 992px) {
    .gti-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .gti-single-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .gti-grid {
        grid-template-columns: 1fr;
    }
    
    .gti-archive-header h1 {
        font-size: 2rem;
    }
    
    .gti-single-title {
        font-size: 1.5rem;
    }
    
    .gti-single-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .gti-share-buttons {
        border-radius: 20px;
        padding: 15px;
    }
    
    .gti-news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gti-card-content {
        padding: 15px;
    }
    
    .gti-card-title {
        font-size: 1.1rem;
    }
    
    .gti-enhanced-content {
        padding: 20px;
    }
    
    .gti-enhanced-content::before {
        right: 15px;
    }
}

/* حالت تاریک (اگر قالب از dark mode پشتیبانی کند) */
@media (prefers-color-scheme: dark) {
    .gti-card {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .gti-card-image {
        background: #2a2a2a;
    }
    
    .gti-keyword {
        border-color: #666;
    }
    
    .gti-news-card {
        border-color: #333;
    }
}

/* یکپارچه‌سازی با کلاس‌های وردپرس */
.wp-block-cover .gti-archive,
.wp-block-group .gti-archive {
    margin: 0;
    padding: 20px;
}

/* حل مشکل تداخل با قالب‌های مختلف */
.gti-card *,
.gti-single-trend * {
    box-sizing: border-box;
}

.gti-card a,
.gti-single-trend a {
    text-decoration: none;
}

.gti-card p,
.gti-single-trend p {
    margin: 0 0 1em 0;
}

/* استایل‌های مینیمال برای ویجت */
.gti-recent-widget {
    font-family: inherit;
}

.gti-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gti-recent-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid currentColor;
    opacity: 0.8;
}

.gti-recent-item:last-child {
    border-bottom: none;
}

.gti-recent-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.gti-recent-title {
    flex: 1;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.gti-recent-title:hover {
    color: var(--wp--preset--color--primary, #667eea);
}

.gti-recent-date {
    font-size: 0.8rem;
    opacity: 0.6;
}