/* =========================================================
   TMG AUTOMATIC YOUTUBE FEED
   VERSION 1.2.1
========================================================= */


/* =========================================================
   LATEST VIDEO
========================================================= */

.tmg-youtube-latest {
    width: 100%;
}

.tmg-youtube-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
    border-bottom: 5px solid #b31217;
}


/* =========================================================
   LIGHTWEIGHT CLICK-TO-PLAY PLAYER
========================================================= */

.tmg-youtube-lite {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
}

.tmg-youtube-play {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #000000;
    cursor: pointer;
}

.tmg-youtube-play img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tmg-youtube-play::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.18)
    );
    pointer-events: none;
}

.tmg-youtube-play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: flex;
    width: 76px;
    height: 54px;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    background: #c4121c;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    padding-left: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.tmg-youtube-play:hover .tmg-youtube-play-button {
    background: #e21c2a;
    transform: translate(-50%, -50%) scale(1.05);
}

.tmg-youtube-play:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: -4px;
}

.tmg-youtube-play:focus-visible .tmg-youtube-play-button {
    background: #e21c2a;
}


/* =========================================================
   ACTIVE IFRAME
========================================================= */

.tmg-youtube-lite iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000000;
}


/* =========================================================
   LATEST VIDEO TEXT
========================================================= */

.tmg-youtube-latest h2 {
    margin: 18px 0 6px;
    color: #ffffff;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
}

.tmg-youtube-date {
    margin: 0;
    color: #d6d6d8;
    font-size: 14px;
    line-height: 1.6;
}


/* Hide duplicate title/date on homepage featured player.
   The play button still carries the full accessible video name. */

.video-wrapper .tmg-youtube-latest > h2,
.video-wrapper .tmg-youtube-latest > .tmg-youtube-date {
    display: none !important;
}


/* =========================================================
   VIDEO GRID
========================================================= */

.tmg-youtube-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.tmg-youtube-card {
    overflow: hidden;
    background: #1b1b1f;
    border: 1px solid #34343a;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.tmg-youtube-card:hover {
    transform: translateY(-4px);
    border-color: #b31217;
}


/* =========================================================
   GRID THUMBNAILS
========================================================= */

.tmg-youtube-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111111;
}

.tmg-youtube-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.tmg-youtube-card:hover .tmg-youtube-thumb img {
    transform: scale(1.025);
}

.tmg-youtube-card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(179, 18, 23, 0.94);
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}


/* =========================================================
   GRID COPY
========================================================= */

.tmg-youtube-copy {
    padding: 20px;
}

.tmg-youtube-copy h3 {
    margin: 0 0 10px;
    color: #f4f4f4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    line-height: 1.2;
}

.tmg-youtube-copy h3 a {
    color: #f4f4f4;
    text-decoration: none;
}

.tmg-youtube-copy h3 a:hover {
    color: #ffffff;
}

.tmg-youtube-copy p {
    margin: 0;
    color: #c7c7cc;
    font-size: 14px;
    line-height: 1.6;
}


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

.tmg-youtube-error {
    padding: 16px;
    background: #2b1113;
    border-left: 4px solid #d61f26;
    color: #ffffff;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .tmg-youtube-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


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

@media (max-width: 600px) {

    .tmg-youtube-grid {
        grid-template-columns: 1fr;
    }

    .tmg-youtube-play-button {
        width: 70px;
        height: 50px;
        font-size: 24px;
    }
}