/*
 * تسک style_tab_creation_and_display (۲۰۲۶-۰۸-۱۹) -- استایل ۴ الگوی
 * نمایش رسانه در سینگل‌پیج. فایل مستقل شد (نه <style> اینلاین داخل
 * پارشیال سکشن) چون کشف شد رندرر سکشن‌های سینگل‌پیج تگ <style> را از
 * محتوای هر سکشن حذف/نادیده می‌گیرد (شاید یک لایهٔ sanitize روی محتوای
 * دینامیک) -- تگ‌های <style> هرگز در HTML نهایی ظاهر نمی‌شدند با اینکه
 * خودِ محتوای سکشن (div/a/h5 و غیره) درست رندر می‌شد.
 */
.iq-mstyle-title { font-size: 20px; margin-bottom: 16px; }
.iq-mstyle-badge { display: inline-block; font-size: 11px; background: #f0f3f4; color: #556; border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.iq-mstyle-date { font-size: 12px; color: #9aa7ab; }
.iq-mstyle-more-btn { text-decoration: none; padding: 8px 22px; border-radius: 999px; }

/* الگو ۱: مجله */
.iq-mag-layout { display: flex; gap: 16px; flex-wrap: wrap; }
.iq-mag-featured { flex: 1.2; min-width: 280px; position: relative; display: block; border-radius: 12px; overflow: hidden; min-height: 260px; background: #eef3f4; color: inherit; text-decoration: none; }
.iq-mag-featured img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.iq-mag-featured-icon { display: flex; align-items: center; justify-content: center; height: 260px; font-size: 40px; color: #b7c3c6; }
.iq-mag-featured-body { position: relative; z-index: 2; padding: 16px; background: linear-gradient(to top, rgba(0,0,0,.75), transparent); color: #fff; position: absolute; bottom: 0; right: 0; left: 0; }
.iq-mag-featured-body h4 { color: #fff; margin: 4px 0; font-size: 17px; }
.iq-mag-grid-wrap { flex: 2; display: flex; align-items: center; gap: 8px; min-width: 280px; }
.iq-mag-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: 1; overflow: hidden; }
.iq-mag-grid-item { border: 1px solid #e5e9eb; border-radius: 8px; padding: 10px; text-align: center; color: inherit; text-decoration: none; }
.iq-mag-grid-item img { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
.iq-mag-grid-item i { display: block; font-size: 22px; color: #b7c3c6; margin-bottom: 6px; }
.iq-mag-grid-item span { font-size: 12px; display: block; }
.iq-mstyle-arrow { background: #fff; border: 1px solid #e5e9eb; border-radius: 50%; width: 32px; height: 32px; flex-shrink: 0; }

/* الگو ۲: کارت افقی */
.iq-hcard-list { display: flex; flex-direction: column; gap: 12px; }
.iq-hcard-item { display: flex; gap: 14px; border: 1px solid #e5e9eb; border-radius: 10px; padding: 10px; color: inherit; text-decoration: none; }
.iq-hcard-img, .iq-hcard-icon { width: 110px; height: 80px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #f0f3f4; display: flex; align-items: center; justify-content: center; }
.iq-hcard-img img { width: 100%; height: 100%; object-fit: cover; }
.iq-hcard-body h5 { margin: 2px 0; font-size: 14px; }
.iq-hcard-body p { font-size: 12px; color: #667; margin-bottom: 4px; }

/* الگو ۳: فقط متن */
.iq-text-grid { display: grid; grid-template-columns: repeat(var(--iq-cols, 2), 1fr); gap: 12px; }
.iq-text-item { border: 1px solid #e5e9eb; border-radius: 10px; padding: 12px; color: inherit; text-decoration: none; display: block; }
.iq-text-item h5 { font-size: 13px; margin: 4px 0; }

/* الگو ۴: عکس بالا */
.iq-imgtop-grid { display: grid; grid-template-columns: repeat(var(--iq-cols, 4), 1fr); gap: 12px; }
.iq-imgtop-item { border: 1px solid #e5e9eb; border-radius: 10px; overflow: hidden; color: inherit; text-decoration: none; display: block; }
.iq-imgtop-cover { height: 110px; background: #f0f3f4; display: flex; align-items: center; justify-content: center; }
.iq-imgtop-cover img { width: 100%; height: 100%; object-fit: cover; }
.iq-imgtop-cover i { font-size: 24px; color: #b7c3c6; }
.iq-imgtop-body { padding: 10px; }
.iq-imgtop-body h5 { font-size: 13px; margin: 4px 0; }
.iq-imgtop-body p { font-size: 11px; color: #667; }

@media (max-width: 767px) {
    .iq-mag-layout { flex-direction: column; }
    .iq-mag-grid { grid-template-columns: repeat(2, 1fr); }
    .iq-text-grid, .iq-imgtop-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .iq-hcard-item { flex-direction: column; }
    .iq-hcard-img, .iq-hcard-icon { width: 100%; height: 140px; }
}
