﻿@font-face {
    font-family: 'farhang';
    src: url('farhang.ttf') format('truetype');
}body {
    margin: 0;
    font-family: 'farhang', sans-serif;
    background-image: url('/img/teaserbg.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.header {
    height: 33vh;
    position: relative;
}

    .header::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50px;
        background: linear-gradient(to bottom, transparent, #fff);
    }

.title {
    text-align: center;
    font-size: 2rem;
    margin: 20px 0;
}

.teasers-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.teaser {
    position: relative;
    cursor: pointer;
    overflow: hidden; 
    width: 100%; 
    aspect-ratio: 16/9; /* نسبت تصویر ثابت (اختیاری، در صورت نیاز به نسبت خاص) */
}

    .teaser img,
    .teaser video {
        width: 100%; /* عرض تصویر و ویدیو برابر با عرض تیزر */
        height: 100%; /* ارتفاع تصویر و ویدیو برابر با ارتفاع تیزر */
        object-fit: cover; /* پر کردن کادر بدون تغییر نسبت تصویر */
        position: absolute; /* قرارگیری در موقعیت یکسان */
        top: 0;
        left: 0;
        border-radius: 8px; /* گوشه‌های گرد */
    }

    .teaser img {
        z-index: 1; /* تصویر بالاتر از ویدیو باشد */
    }
    .teaser video {
        display: none; /* ویدیو به‌طور پیش‌فرض مخفی باشد */
        z-index: 2; /* ویدیو روی تصویر نمایش داده شود */

    }
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* پس‌زمینه نیمه‌شفاف */
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%; /* عرض مودال را 50 درصد صفحه تنظیم کنید */
    max-width: 600px; /* حداکثر عرض مودال */
    max-height: 90vh; /* حداکثر ارتفاع مودال */
    padding: 0; /* فاصله داخلی */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* سایه برای زیبایی */
}

.modal-video {
    flex: 3;
    position: relative;
    width: 100%;
}
    .modal-video video {
        width: 100%; /* ویدیو عرض مودال را پر کند */
        height: auto; /* ویدیو ارتفاع مودال را پر کند */
        display: block; /* اطمینان از نمایش صحیح ویدیو */
        object-fit: cover; /* پر کردن کامل فضای مودال */
        margin: 0; /* حذف هرگونه فاصله پیش‌فرض */
        border: none; /* حذف هرگونه حاشیه */
    }

.modal-description {
    margin-top: 10px; /* فاصله بین ویدیو و توضیحات */
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    text-align: center; /* متن توضیحات در مرکز قرار گیرد */
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 768px) {
    .teasers-container {
        grid-template-columns: repeat(2, 1fr); /* 2 ستون در حالت موبایل */
        gap: 10px; /* فاصله بین ستون‌ها کمتر شود */
    }
    .modal-content {
        width: 100%; /* عرض مودال در موبایل */
        height: auto; /* ارتفاع مودال در موبایل */
        max-width: 100%; /* حداکثر عرض مودال در موبایل */
        max-height: 100%; /* حداکثر ارتفاع مودال در موبایل */
        border-radius: 0; /* حذف گوشه‌های گرد */
    }

    .modal-video video {
        width: 100%; /* ویدیو عرض مودال را پر کند */
        height: 100%; /* ویدیو ارتفاع مودال را پر کند */
    }

    .modal-description {
        flex: none;
        width: 100%;
        padding: 10px;
    }
}
