/* =========================================================
   YOUTUBE VIDEO SECTION
========================================================= */

.youtube-section {

    width: 100%;

    padding:
        80px 0;

    background: linear-gradient(332deg, rgb(250, 251, 250) 27%, rgb(204, 229, 255) 72%);

}


.youtube-container {

    width: min(
        1200px,
        92%
    );

    margin:
        0 auto;

}


/* =========================================================
   HEADER
========================================================= */

.youtube-section-header {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 30px;

    margin-bottom: 35px;

}


.youtube-heading {

    max-width: 650px;

}


.youtube-eyebrow {

    display: inline-flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 10px;

    color: #ff0000;

    font-family:
        "Poppins",
        sans-serif;

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 1px;

}


.youtube-eyebrow i {

    font-size: 17px;

}


.youtube-heading h2 {

    margin:
        0 0 10px;

    color: #171717;

    font-family:
        "Poppins",
        sans-serif;

    font-size:
        clamp(
            1.8rem,
            4vw,
            2.7rem
        );

    line-height: 1.2;

}


.youtube-heading p {

    margin: 0;

    color: #777;

    font-family:
        "Noto Sans",
        sans-serif;

    font-size: 14px;

    line-height: 1.7;

}


/* =========================================================
   CHANNEL BUTTON
========================================================= */

.youtube-channel-btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    flex-shrink: 0;

    min-height: 45px;

    padding:
        10px 18px;

    border-radius: 25px;

    background: #ff0000;

    color: #fff;

    font-family:
        "Poppins",
        sans-serif;

    font-size: 13px;

    font-weight: 600;

    text-decoration: none;

    transition:
        transform .25s ease,
        background .25s ease,
        box-shadow .25s ease;

}


.youtube-channel-btn:hover {

    background: #d90000;

    color: #fff;

    transform:
        translateY(-2px);

    box-shadow:
        0 10px 25px
        rgba(255, 0, 0, .18);

}


/* =========================================================
   VIDEO WRAPPER
========================================================= */

.youtube-video-wrapper {

    position: relative;

}


.youtube-video-list {

    display: flex;

    gap: 20px;

    overflow-x: auto;

    scroll-behavior: smooth;

    scrollbar-width: none;

    padding:
        5px 3px 15px;

}


.youtube-video-list::-webkit-scrollbar {

    display: none;

}


/* =========================================================
   VIDEO CARD
========================================================= */

.youtube-video-card {

    position: relative;

    flex:
        0 0 330px;

    overflow: hidden;

    border-radius: 18px;

    background: #fff;

    box-shadow:
        0 8px 30px
        rgba(0, 0, 0, .08);

    transition:
        transform .3s ease,
        box-shadow .3s ease;

}


.youtube-video-card:hover {

    transform:
        translateY(-5px);

    box-shadow:
        0 15px 40px
        rgba(0, 0, 0, .13);

}


/* =========================================================
   THUMBNAIL
========================================================= */

.youtube-thumbnail {

    position: relative;

    display: block;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #eee;

}


.youtube-thumbnail img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transition:
        transform .4s ease;

}


.youtube-video-card:hover
.youtube-thumbnail img {

    transform:
        scale(1.05);

}


/* =========================================================
   PLAY BUTTON
========================================================= */

.youtube-play {

    position: absolute;

    top: 50%;

    left: 50%;

    width: 58px;

    height: 58px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        rgba(255, 0, 0, .95);

    color: #fff;

    font-size: 22px;

    transform:
        translate(-50%, -50%);

    box-shadow:
        0 8px 25px
        rgba(0, 0, 0, .25);

    transition:
        transform .25s ease;

}


.youtube-video-card:hover
.youtube-play {

    transform:
        translate(-50%, -50%)
        scale(1.1);

}


/* =========================================================
   VIDEO INFORMATION
========================================================= */

.youtube-video-info {

    padding:
        17px 18px 19px;

}


.youtube-video-channel {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 9px;

    color: #777;

    font-size: 11px;

    font-weight: 600;

}


.youtube-video-channel img {

    width: 24px;

    height: 24px;

    flex-shrink: 0;

    border-radius: 50%;

    object-fit: cover;

}


.youtube-video-title {

    display: -webkit-box;

    margin: 0;

    overflow: hidden;

    color: #222;

    font-family:
        "Poppins",
        sans-serif;

    font-size: 15px;

    font-weight: 600;

    line-height: 1.45;

    text-decoration: none;

    -webkit-line-clamp: 2;

    -webkit-box-orient: vertical;

}


.youtube-video-date {

    display: block;

    margin-top: 9px;

    color: #999;

    font-family:
        "Noto Sans",
        sans-serif;

    font-size: 11px;

}


/* =========================================================
   SCROLL BUTTONS
========================================================= */

.youtube-scroll-btn {

    position: absolute;

    top: 42%;

    z-index: 5;

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border:
        1px solid #eee;

    border-radius: 50%;

    background: #fff;

    color: #333;

    cursor: pointer;

    box-shadow:
        0 7px 20px
        rgba(0, 0, 0, .12);

    transform:
        translateY(-50%);

    transition:
        transform .25s ease,
        background .25s ease;

}


.youtube-scroll-btn:hover {

    background: #ff0000;

    color: #fff;

    transform:
        translateY(-50%)
        scale(1.05);

}


.youtube-scroll-left {

    left: -20px;

}


.youtube-scroll-right {

    right: -20px;

}


/* =========================================================
   BOTTOM
========================================================= */

.youtube-bottom {

    margin-top: 25px;

    text-align: center;

}


.youtube-bottom a {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: #ff0000;

    font-family:
        "Poppins",
        sans-serif;

    font-size: 13px;

    font-weight: 600;

    text-decoration: none;

}


.youtube-bottom a:hover {

    text-decoration: underline;

}


/* =========================================================
   LOADING
========================================================= */

.youtube-loading {

    display: flex;

    gap: 20px;

    overflow: hidden;

}


.youtube-skeleton {

    flex:
        0 0 330px;

    height: 300px;

    border-radius: 18px;

    background:
        linear-gradient(
            90deg,
            #eeeeee 25%,
            #f7f7f7 50%,
            #eeeeee 75%
        );

    background-size:
        200% 100%;

    animation:
        youtubeSkeleton 1.5s infinite;

}


@keyframes youtubeSkeleton {

    0% {

        background-position:
            200% 0;

    }

    100% {

        background-position:
            -200% 0;

    }

}


/* =========================================================
   ERROR
========================================================= */

.youtube-error {

    padding:
        45px 20px;

    border-radius: 18px;

    background: #fff;

    text-align: center;

}


.youtube-error i {

    margin-bottom: 12px;

    color: #ff0000;

    font-size: 35px;

}


.youtube-error p {

    margin:
        0 0 15px;

    color: #777;

    font-size: 14px;

}


.youtube-error button {

    padding:
        9px 18px;

    border: none;

    border-radius: 20px;

    background: #ff0000;

    color: #fff;

    cursor: pointer;

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .youtube-section {

        padding:
            55px 0;

    }


    .youtube-container {

        width:
            calc(100% - 28px);

    }


    .youtube-section-header {

        flex-direction: column;

        align-items: flex-start;

        gap: 18px;

        margin-bottom: 25px;

    }


    .youtube-heading h2 {

        font-size: 1.8rem;

    }


    .youtube-heading p {

        font-size: 13px;

    }


    .youtube-channel-btn {

        width: 100%;

    }


    .youtube-video-list {

        gap: 14px;

        padding-left: 0;

        padding-right: 0;

    }


    .youtube-video-card {

        flex-basis:
            min(
                82vw,
                320px
            );

        border-radius: 15px;

    }


    .youtube-video-info {

        padding:
            14px 15px 16px;

    }


    .youtube-video-title {

        font-size: 14px;

    }


    .youtube-scroll-btn {

        display: none;

    }


    .youtube-loading {

        gap: 14px;

    }


    .youtube-skeleton {

        flex-basis:
            min(
                82vw,
                320px
            );

    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 400px) {

    .youtube-container {

        width:
            calc(100% - 20px);

    }


    .youtube-heading h2 {

        font-size: 1.55rem;

    }


    .youtube-video-card {

        flex-basis:
            86vw;

    }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.youtube-channel-btn:focus-visible,
.youtube-scroll-btn:focus-visible,
.youtube-bottom a:focus-visible,
.youtube-error button:focus-visible {

    outline:
        3px solid
        rgba(255, 0, 0, .25);

    outline-offset: 3px;

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .youtube-video-list {

        scroll-behavior: auto;

    }


    .youtube-video-card,
    .youtube-thumbnail img,
    .youtube-play,
    .youtube-channel-btn,
    .youtube-scroll-btn {

        transition: none;

    }


    .youtube-skeleton {

        animation: none;

    }

}


/* =========================================================
   HIDDEN ELEMENTS
========================================================= */

.youtube-loading[hidden],
.youtube-video-wrapper[hidden],
.youtube-error[hidden] {
    display: none !important;
}




/* =========================================================
   VIDEO CARD BUTTON RESET
========================================================= */

.youtube-thumbnail {
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
}


.youtube-video-title {
    display: -webkit-box;

    width: 100%;

    padding: 0;
    margin: 0;

    border: 0;

    background: transparent;

    color: #222;

    font-family:
        "Poppins",
        sans-serif;

    font-size: 15px;

    font-weight: 600;

    line-height: 1.45;

    text-align: left;

    cursor: pointer;

    text-decoration: none;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


.youtube-video-title:hover {
    color: #ff0000;
}


/* =========================================================
   YOUTUBE PLAYER MODAL
========================================================= */

.youtube-player-modal {

    position: fixed;

    inset: 0;

    z-index: 999999;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    visibility: hidden;

    opacity: 0;

    transition:
        opacity .25s ease,
        visibility .25s ease;

}


.youtube-player-modal.active {

    visibility: visible;

    opacity: 1;

}


/* =========================================================
   DARK OVERLAY
========================================================= */

.youtube-player-overlay {

    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, .82);

    backdrop-filter:
        blur(4px);

}


/* =========================================================
   PLAYER DIALOG
========================================================= */

.youtube-player-dialog {

    position: relative;

    z-index: 2;

    width:
        min(
            950px,
            95vw
        );

    overflow: hidden;

    border-radius: 18px;

    background: #111;

    box-shadow:
        0 30px 100px
        rgba(0, 0, 0, .45);

    transform:
        scale(.94)
        translateY(15px);

    transition:
        transform .3s ease;

}


.youtube-player-modal.active
.youtube-player-dialog {

    transform:
        scale(1)
        translateY(0);

}


/* =========================================================
   VIDEO CONTAINER
========================================================= */

.youtube-player-container {

    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    background: #000;

}


.youtube-player-container iframe {

    position: absolute;

    inset: 0;

    display: block;

    width: 100%;

    height: 100%;

    border: 0;

}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.youtube-player-close {

    position: absolute;

    top: 12px;

    right: 12px;

    z-index: 10;

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 0;

    border-radius: 50%;

    background:
        rgba(0, 0, 0, .7);

    color: #fff;

    font-size: 19px;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease;

}


.youtube-player-close:hover {

    background: #ff0000;

    transform:
        scale(1.08);

}


/* =========================================================
   PLAYER INFORMATION
========================================================= */

.youtube-player-information {

    padding:
        18px 22px 20px;

    background: #111;

}


.youtube-player-information h2 {

    margin: 0 0 5px;

    color: #fff;

    font-family:
        "Poppins",
        sans-serif;

    font-size:
        clamp(
            1rem,
            2vw,
            1.3rem
        );

    line-height: 1.4;

}


.youtube-player-information span {

    color: #aaa;

    font-family:
        "Noto Sans",
        sans-serif;

    font-size: 12px;

}


/* =========================================================
   PREVENT BACKGROUND SCROLL
========================================================= */

body.youtube-modal-open {

    overflow: hidden !important;

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.youtube-player-close:focus-visible {

    outline:
        3px solid
        rgba(255, 255, 255, .8);

    outline-offset: 3px;

}


.youtube-play-trigger:focus-visible {

    outline:
        3px solid
        #ff0000;

    outline-offset: 3px;

}


/* =========================================================
   MOBILE PLAYER
========================================================= */

@media (max-width: 700px) {

    .youtube-player-modal {

        padding: 10px;

    }


    .youtube-player-dialog {

        width: 100%;

        border-radius: 12px;

    }


    .youtube-player-close {

        top: 8px;

        right: 8px;

        width: 38px;

        height: 38px;

        font-size: 17px;

    }


    .youtube-player-information {

        padding:
            14px 16px 17px;

    }


    .youtube-player-information h2 {

        font-size: 14px;

    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .youtube-player-modal,
    .youtube-player-dialog,
    .youtube-player-close {

        transition: none;

    }

}