﻿/* استایل‌های responsive برای parent_aparat و child_aparat (۲ ستونی/۱ ستونی) */
.parent_aparat {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* پیش‌فرض: ۲ ستون برای دسکتاپ/تبلت (>700px) */
    gap: 15px; /* فاصله مناسب بین childها */
    padding: 15px; /* فاصله از لبه‌ها */
    max-width: 100%;
    margin: 0 auto;
    direction: rtl; /* برای متن فارسی */
    box-sizing: border-box;
}

.child_aparat {
    background: #ece9e9; /* بک‌گراند روشن */
    border-radius: 10px;
    overflow: hidden; /* جلوگیری از overflow iframe */
    height: auto; /* دینامیک، بدون height ثابت */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* سایه ملایم */
    transition: box-shadow 0.3s ease; /* انیمیشن ساده hover */
    position: relative; /* برای positioning iframe */
    padding: 20px;
}

.child_aparat h3 {
text-align: center}

.child_aparat:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* سایه بیشتر روی hover */
}

/* Wrapper برای aspect-ratio 16:9 (رفع فضای سیاه) */
.child_aparat .video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio – height بر اساس width محاسبه می‌شه */
    background: #000; /* background سیاه برای letterbox طبیعی آپارات */
    border-radius: 8px;
    overflow: hidden;
}

.child_aparat iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* full height wrapper */
    border: none;
    display: block;
}

/* Media Query برای موبایل: ۱ ستون (کمتر از 700px) */
@media (max-width: 700px) {
    .parent_aparat {
        grid-template-columns: 1fr; /* ۱ ستون full-width */
        gap: 10px; /* فاصله عمودی کمتر */
        padding: 10px;
    }

    .child_aparat {
        border-radius: 8px; /* کمی کوچکتر برای موبایل */
    }

    .child_aparat .video-wrapper {
        padding-bottom: 75%; /* aspect-ratio کمی بلندتر برای portrait موبایل (4:3) */
    }
}

/* برای صفحه‌های خیلی کوچک (مثل portrait موبایل) */
@media (max-width: 480px) {
    .parent_aparat {
        padding: 5px;
        gap: 8px;
    }

    .child_aparat .video-wrapper {
        border-radius: 5px;
    }
}