/* =========================================================
   TERRY ADAIR - YOUTUBE VIDEOS SECTION
   ========================================================= */

.terry-youtube-section {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 80px 5.5%;
    box-sizing: border-box;
    background: #ffffff;
}

/* ---------- Heading ---------- */

.terry-youtube-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
    margin-bottom: 45px;
}

.terry-youtube-heading {
    margin: 0;
}

.terry-youtube-eyebrow {
    display: block;
    margin-bottom: 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #1c3154;
}

.terry-youtube-title {
    font-size: 54px;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;

/* ---------- Navigation ---------- */

.terry-youtube-navigation {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.terry-youtube-nav {
    width: 78px;
    height: 58px;
    border: 1px solid #d9d9d9;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
    padding: 0;
    position: relative;
    z-index: 5;
}

.terry-youtube-nav:hover {
    background: #17233a;
    border-color: #17233a;
}

.terry-youtube-nav span {
    font-size: 26px;
    line-height: 1;
    color: #17233a;
    transition: color .25s ease;
}

.terry-youtube-nav:hover span {
    color: #ffffff;
}

/* ---------- Slider ---------- */

.terry-youtube-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.terry-youtube-track {
    display: flex;
    gap: 34px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 2px 0 12px;
    cursor: grab;
}

.terry-youtube-track::-webkit-scrollbar {
    display: none;
}

.terry-youtube-track.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* ---------- Card ---------- */

.terry-youtube-card {
    flex: 0 0 calc((100% - 68px) / 3);
    min-width: 0;
    background: #ffffff;
    border-radius: 0 0 22px 22px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(20, 30, 50, .07);
    border: 1px solid #eeeeee;
    transition: transform .3s ease, box-shadow .3s ease;
}

.terry-youtube-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 45px rgba(20, 30, 50, .13);
}

/* ---------- Thumbnail ---------- */

.terry-youtube-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111111;
    cursor: pointer;
}

.terry-youtube-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .5s ease;
}

.terry-youtube-card:hover .terry-youtube-thumbnail img {
    transform: scale(1.04);
}

/* ---------- Play Button ---------- */

.terry-youtube-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(25, 142, 220, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .25);
    transition: transform .25s ease, background .25s ease;
}

.terry-youtube-play::before {
    content: "";
    margin-left: 5px;
    width: 0;
    height: 0;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid #ffffff;
}

.terry-youtube-card:hover .terry-youtube-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #168edb;
}

/* ---------- Card Content ---------- */

.terry-youtube-content {
    padding: 30px 32px 34px;
}

.terry-youtube-card-title {
    margin: 0 0 20px;
    font-size: 25px;
    line-height: 1.32;
    font-weight: 600;
    color: #10294d;
}

.terry-youtube-description {
    margin: 0;
    color: #6d6d6d;
    font-size: 17px;
    line-height: 1.75;
}

.terry-youtube-card-link {
    display: block;
    color: inherit;
    text-decoration: none !important;
}

/* IMPORTANT:
   Prevent old YouTube links from showing normal link behavior */
.terry-youtube-card-link:hover,
.terry-youtube-card-link:focus {
    text-decoration: none !important;
    color: inherit;
}

/* =========================================================
   VIDEO POPUP
   ========================================================= */

.terry-video-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .86);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
}

.terry-video-modal.active {
    display: flex;
}

.terry-video-modal-inner {
    width: min(900px, 94vw);
    position: relative;
    animation: terryPopupIn .25s ease;
}

@keyframes terryPopupIn {
    from {
        opacity: 0;
        transform: scale(.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.terry-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .5);
}

.terry-video-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* ---------- Close ---------- */

.terry-video-close {
    position: absolute;
    right: -15px;
    top: -55px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #17233a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    z-index: 10;
}

.terry-video-close:hover {
    background: #17233a;
    color: #ffffff;
}

/* ---------- Prevent body scrolling when popup open ---------- */

body.terry-video-open {
    overflow: hidden !important;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .terry-youtube-card {
        flex: 0 0 calc((100% - 34px) / 2);
    }

    .terry-youtube-title {
        font-size: 48px;
    }

}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .terry-youtube-section {
        padding: 55px 20px;
    }

    .terry-youtube-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 30px;
        gap: 25px;
    }

    .terry-youtube-eyebrow {
        font-size: 11px;
        letter-spacing: 3px;
        margin-bottom: 15px;
    }

    .terry-youtube-title {
        font-size: 45px;
        letter-spacing: -1.5px;
    }

    .terry-youtube-navigation {
        align-self: flex-end;
    }

    .terry-youtube-nav {
        width: 58px;
        height: 46px;
    }

    .terry-youtube-card {
        flex: 0 0 88%;
    }

    .terry-youtube-content {
        padding: 24px 22px 28px;
    }

    .terry-youtube-card-title {
        font-size: 21px;
    }

    .terry-youtube-description {
        font-size: 15px;
        line-height: 1.65;
    }

    .terry-youtube-play {
        width: 60px;
        height: 60px;
    }

    .terry-video-modal {
        padding: 20px;
    }

    .terry-video-close {
        right: 0;
        top: -55px;
    }
}