/* =========================================================
   GENERAL
========================================================= */

* {
    box-sizing: border-box;
}

.container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
}


/* =========================================================
   VIDEOS PAGE
========================================================= */

.videos-page {
    padding-bottom: 70px;
}


/* =========================================================
   HERO
========================================================= */

.videos-hero {
    text-align: center;
    padding: 70px 20px 40px;
}

.hero-badge {
    display: inline-block;

    background: #e8f0fa;
    color: #1b4d8f;

    padding: 8px 20px;

    border-radius: 30px;

    margin-top: 40px;
    margin-bottom: 25px;

    font-size: 14px;
}

.videos-hero h1 {
    font-size: 40px;
    font-weight: 700;

    margin: 0 0 20px;

    color: #222;

    line-height: 1.7;
}

.videos-hero p {
    max-width: 700px;

    margin: 0 auto;

    line-height: 2;

    color: #666;
}


/* =========================================================
   VIDEO STATS
========================================================= */

.videos-stats {
    display: flex;

    justify-content: center;

    margin-top: 35px;
}

.stat {
    background: #fff;

    padding: 20px 45px;

    border-radius: 18px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);

    text-align: center;
}

.stat strong {
    display: block;

    font-size: 36px;

    color: #1b4d8f;
}

.stat span {
    display: block;

    margin-top: 8px;

    color: #666;
}


/* =========================================================
   SEARCH
========================================================= */

.videos-search {
    margin-top: 40px;
}

#video-search {
    width: 100%;
    max-width: 700px;

    display: block;

    margin: 0 auto;

    padding: 16px 22px;

    border-radius: 15px;

    border: 1px solid #ddd;

    font-size: 16px;

    font-family: inherit;

    outline: none;

    box-sizing: border-box;

    transition: 0.3s;
}

#video-search:focus {
    border-color: #1b4d8f;

    box-shadow:
        0 0 10px rgba(27, 77, 143, 0.2);
}


/* =========================================================
   CATEGORIES
========================================================= */

#category-list {
    display: flex;

    flex-wrap: wrap;

    gap: 12px;

    justify-content: center;

    margin: 30px 0;
}

.category-btn {
    border: none;

    background: #f1f1f1;

    padding: 10px 22px;

    border-radius: 30px;

    cursor: pointer;

    font-family: inherit;

    font-size: 15px;

    transition: 0.3s;
}

.category-btn:hover {
    background: #1b4d8f;

    color: #fff;
}

.category-btn.active {
    background: #1b4d8f;

    color: #fff;
}


/* =========================================================
   VIDEO GRID
========================================================= */

.videos-grid-section {
    margin-top: 40px;
}

.videos-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 30px;

    margin-top: 40px;

    align-items: stretch;
}


/* =========================================================
   VIDEO CARD
========================================================= */

.video-card {
    display: flex;

    flex-direction: column;

    height: 100%;

    min-width: 0;

    background: #fff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    text-decoration: none;

    color: inherit;
}

.video-card:hover {
    transform: translateY(-8px);

    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   VIDEO THUMBNAIL
========================================================= */

.video-thumb {
    position: relative;

    overflow: hidden;

    flex-shrink: 0;
}

.video-thumb img {
    width: 100%;

    height: 220px;

    object-fit: cover;

    display: block;

    transition: transform 0.4s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}


/* =========================================================
   PLAY ICON
========================================================= */

.play-icon {
    position: absolute;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);

    width: 70px;
    height: 70px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.87);

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 32px;

    color: #1b4d8f;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}

.video-card:hover .play-icon {
    background: #1b4d8f;

    color: #fff;

    transform:
        translate(-50%, -50%)
        scale(1.05);
}


/* =========================================================
   VIDEO CONTENT
========================================================= */

.video-content {
    padding: 18px;

    display: flex;

    flex-direction: column;

    flex: 1;

    min-width: 0;
}


/* =========================================================
   VIDEO TITLE
========================================================= */

.video-content h2 {
    margin: 0 0 15px;

    padding: 0;

    font-size: 20px;

    text-align: justify;

    font-weight: 700;

    line-height: 1.8;

    color: #222;

    /*
       ارتفاع ثابت برای تمام عنوان‌ها

       22px × 1.8 = حدود 40px
       3 خط = حدود 120px

       بنابراین عنوان‌های 2 خطی
       هم دقیقاً همین فضا را اشغال می‌کنند.
    */

    height: 120px;

    min-height: 120px;

    overflow: hidden;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 3;

    line-clamp: 3;
}

.video-content h2 a {
    background: none;

    color: #222;

    padding: 0;

    border-radius: 0;

    display: inline;

    text-decoration: none;

    transition: color 0.3s ease;
}

.video-content h2 a:hover {
    color: #1b4d8f;
}


/* =========================================================
   VIDEO DESCRIPTION
========================================================= */

.video-content p {
    margin: 0 0 18px;

    padding: 0;

    line-height: 2;

    color: #666;

    text-align: justify;

    font-size: 15px;

    /*
       توضیحات هم ارتفاع ثابت دارند
       تا META تمام کارت‌ها یکسان باشد.
    */

    height: 90px;

    min-height: 90px;

    overflow: hidden;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 3;

    line-clamp: 3;
}


/* =========================================================
   VIDEO META
========================================================= */

.video-meta {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-top: auto;

    padding-top: 15px;

    border-top: 1px solid #eee;

    color: #888;

    font-size: 14px;

    line-height: 1.5;
}


/* =========================================================
   VIDEO BUTTON
========================================================= */

.video-btn {
    display: inline-block;

    background: #1b4d8f;

    color: #fff;

    padding: 10px 18px;

    border-radius: 8px;

    text-decoration: none;

    transition: 0.3s;
}

.video-btn:hover {
    background: #0d3566;
}


/* =========================================================
   SINGLE VIDEO PAGE
========================================================= */

.single-video-page {
    padding: 70px 0;

    min-height: 600px;
}


/* =========================================================
   SINGLE VIDEO HEADER
========================================================= */

.single-video-header {
    text-align: center;

    margin-bottom: 40px;
}

.single-video-header h1 {
    font-size: 36px;

    font-weight: bold;

    margin-top: 20px;

    color: #222;

    line-height: 1.8;
}


/* =========================================================
   VIDEO PLAYER
========================================================= */

.single-video-player {
    width: 100%;

    max-width: 1000px;

    margin: 0 auto;
}

.video-iframe-wrapper {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    border-radius: 18px;

    background: #000;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.12);
}

.video-iframe-wrapper iframe {
    width: 100%;

    height: 100%;

    border: 0;
}


/* =========================================================
   VIDEO PLACEHOLDER
========================================================= */

.video-placeholder {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    border-radius: 18px;

    background: #111;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.12);
}

.video-placeholder img {
    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;
}

.video-placeholder-message {
    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    background:
        rgba(0, 0, 0, 0.35);

    color: #fff;

    text-align: center;
}

.video-placeholder-message span {
    width: 75px;

    height: 75px;

    border-radius: 50%;

    display: flex;

    justify-content: center;

    align-items: center;

    background:
        rgba(255, 255, 255, 0.87);

    color: #1b4d8f;

    font-size: 32px;

    margin-bottom: 20px;
}

.video-placeholder-message p {
    font-size: 18px;
}


/* =========================================================
   SINGLE VIDEO INFORMATION
========================================================= */

.single-video-info {
    max-width: 1000px;

    margin: 35px auto 0;
}

.single-video-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 15px;

    padding: 20px;

    background: #f7f7f7;

    border-radius: 12px;

    color: #666;
}

.single-video-description {
    margin-top: 35px;

    text-align: justify;
}

.single-video-description h2 {
    font-size: 24px;

    margin-bottom: 15px;

    color: #1b4d8f;
}

.single-video-description p {
    line-height: 2.2;

    color: #555;

    margin-bottom: 15px;
}


/* =========================================================
   TAGS
========================================================= */

.single-video-tags {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 25px;
}

.video-tag {
    display: inline-block;

    background: #e8f0fa;

    color: #1b4d8f;

    padding: 7px 15px;

    border-radius: 30px;

    font-size: 14px;
}


/* =========================================================
   BACK BUTTON
========================================================= */

.single-video-back {
    margin-top: 35px;
}

.single-video-back a {
    display: inline-block;

    background: #1b4d8f;

    color: #fff;

    padding: 12px 22px;

    border-radius: 8px;

    text-decoration: none;

    transition: 0.3s;
}

.single-video-back a:hover {
    background: #0d3566;
}


/* =========================================================
   ERROR
========================================================= */

.video-error {
    padding: 80px 20px;

    text-align: center;

    background: #f7f7f7;

    border-radius: 18px;
}

.video-error p {
    font-size: 20px;

    margin-bottom: 25px;
}

.video-error a {
    display: inline-block;

    background: #1b4d8f;

    color: #fff;

    padding: 12px 22px;

    border-radius: 8px;

    text-decoration: none;
}


/* =========================================================
   TABLET
========================================================= */

@media (min-width: 769px) and (max-width: 1100px) {

    .videos-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .container {
        width: 92%;
    }


    /* =========================
       HERO
    ========================= */

    .videos-hero {
        padding: 40px 15px 20px;
    }

    .hero-badge {
        margin-top: 20px;

        margin-bottom: 20px;
    }

    .videos-hero h1 {
        font-size: 28px;

        line-height: 1.7;
    }

    .videos-hero p {
        font-size: 15px;

        line-height: 2;
    }


    /* =========================
       GRID
    ========================= */

    .videos-grid {
        grid-template-columns: 1fr;

        gap: 25px;
    }


    /* =========================
       CARD
    ========================= */

    .video-card {
        height: auto;
    }

    .video-thumb img {
        height: 200px;
    }


    /* =========================
       TITLE
    ========================= */

    .video-content h2 {

        font-size: 21px;

        line-height: 1.8;

        /*
           موبایل:
           ارتفاع ثابت برای حداکثر 3 خط
        */

        height: 114px;

        min-height: 114px;

        -webkit-line-clamp: 3;

        line-clamp: 3;
    }


    /* =========================
       DESCRIPTION
    ========================= */

    .video-content p {

        font-size: 15px;

        line-height: 2;

        height: 90px;

        min-height: 90px;

        -webkit-line-clamp: 3;

        line-clamp: 3;
    }


    /* =========================
       CATEGORY
    ========================= */

    .category-btn {
        font-size: 14px;

        padding: 8px 16px;
    }


    /* =========================
       STATS
    ========================= */

    .stat {
        padding: 18px 30px;
    }

    .stat strong {
        font-size: 30px;
    }


    /* =========================
       SINGLE VIDEO
    ========================= */

    .single-video-page {
        padding: 40px 15px;
    }

    .single-video-header h1 {
        font-size: 27px;

        line-height: 1.8;
    }

    .single-video-meta {
        flex-direction: column;

        gap: 10px;
    }

    .video-placeholder-message p {
        font-size: 15px;
    }

    .video-placeholder-message span {
        width: 60px;

        height: 60px;

        font-size: 26px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .video-content {
        padding: 18px;
    }

    .video-content h2 {
        font-size: 20px;

        height: 108px;

        min-height: 108px;
    }

    .video-content p {
        font-size: 14px;

        height: 84px;

        min-height: 84px;
    }

    .video-thumb img {
        height: 190px;
    }

    .video-meta {
        font-size: 13px;
    }

}