/* variables */

html {
    scroll-behavior: smooth !important;
}

#rtVideo {
  --rtVideo-playlist-item-name-color:              rgba(238,238,238,1);
  --rtVideo-playlist-item-description-color:       rgba(51,51,51,1);
  --rtVideo-playlist-item-bkgd-color:              rgba(148,148,148,1);
  --rtVideo-playlist-item-bkgd-color0:             rgba(148,148,148,0);
  
  --rtVideo-playlist-item-bkgd-color-hover:        rgba(160,160,160,1);
  --rtVideo-playlist-item-bkgd-color-hover0:       rgba(160,160,160,0);
  
  --rtVideo-playlist-item-bkgd-color-active:       rgba(192,192,192,1);
  --rtVideo-playlist-item-bkgd-color-active0:      rgba(192,192,192,0);
  
  --rtVideo-name-color:               rgba(238,238,238,1);
  --rtVideo-name-shadow-color:        #000000;
  --rtVideo-description-color:        rgba(238,238,238,1);
  --rtVideo-description-shadow-color: #000000;
}

#rtShade:has(#rtVideo) {
    padding: 0;
}

#rtVideo * {
    box-sizing: border-box;
   -webkit-user-select: none; /* Safari */
   -ms-user-select: none;     /* Older IE and Edge */
    user-select: none;         /* Standard syntax for modern browsers */
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% auto;
}

/* console */

#rtVideo-console {
    display: grid;
    aspect-ratio: 7 / 3;
    grid-template-columns: 57.142857142857142857142857142857% 42.857142857142857142857142857143%;
    gap: 0;
    width: calc(100% - 40px);
    max-width: 1680px;
    margin: auto;
}

#rtShade:has(#rtVideo) > div.close {
    width: 5cqi;
    min-width: 24px;
    max-width: 64px;
    margin-top:   0.5cqi;
    margin-right: 1.25cqi;
    z-index: 10;
}

/* player */

#rtVideo-player {
    container-type: inline-size;
    position: relative;
}

#rtVideo-player figure {
    margin:  0;
    padding: 0;
    border:  0;
}    

/* caption */

#rtVideo-player figcaption {
    display: block;
    position: absolute;
    border: 0;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 50%);
    opacity: 1;
    transition: opacity 1s ease-in-out;
    padding: 10cqi;
    text-wrap: balance;
}

#rtVideo-plink {
    display: block;
    float: right;
    position: relative;
    top: -5.0cqi;
    right: 0cqi;
    padding: 2cqi 2cqi 2cqi 7.5cqi;
    margin-left: 2cqi;
    color: #eeeeee;
    background-color: rgba(128, 128, 128, 0.75);
    border: 2px solid #ffffff;
    border-radius: 5px;
    font-size: 2.85cqi;
    font-weight: 600;
    font-family: "Roboto Condensed";
    white-space: nowrap;
    text-align: right;
    text-decoration: none !important;
    background-position: 1.5cqi center;
    background-repeat: no-repeat;
    background-image: url(/images/ui/rtVideo.plink.svg);
    background-size: 4.25cqi auto;
}

#rtVideo-plink::after {
    content: "Product Page";
}

#rtVideo-player figcaption.hidden {
    opacity: 0;
}

#rtVideo-name {
    font-family: "Roboto Condensed";    
    font-weight: bold;
    font-size: 4.25cqi;
    line-height: 1.2em;
    
    color: var(--rtVideo-name-color);
    text-shadow: 0 0 4cqi var(--rtVideo-name-shadow-color);
}

#rtVideo-description {
    font-family: "Roboto";
    font-weight: normal;
    font-size: 3cqi;
    line-height: 1.25em;
    
    color: var(--rtVideo-description-color);
    text-shadow: 0 0 4cqi var(--rtVideo-description-shadow-color);

    border-top: 0.25cqi solid #d0d0d0;
    padding: 0.5em 0 0 0;
    margin-top: 0.5em;
}

/* video */

#rtVideo-video {
    display: block;
    aspect-ratio: 4 / 3;
    width: 100%;
}

/* playlist */

#rtVideo-playlist {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 #808080;
    height: 100%;
    container-type: inline-size;
    
    div.item {
        position: relative;
        display: grid;
        gap: 0;
        grid-template-columns: 25cqi auto;
        background-color: var(--rtVideo-playlist-item-bkgd-color);
        cursor: pointer;
        padding: 1.5cqi 2.5cqi;
        margin-bottom: 2px;
        margin-left: 2px;
        max-height: 33.333cqi;
        
        overflow-y: clip;
        
        div.name {
            font-family: "Roboto Condensed";
            font-size: 4.75cqi;
            font-weight: bold;
            line-height: 1.15em;
            color: var(--rtVideo-playlist-item-name-color);
        }
        
        div.description {
            font-size: 3.75cqi;
            margin-top: 0.3em;
            line-height: 1.2em;
            color: var(--rtVideo-playlist-item-description-color);
        }
        
        div.thumbnail {
            aspect-ratio: 4 / 3;
            margin-right: 2.5cqi;
            border: 1.25px solid #808080;
            border-radius: 2.5px;
        }
        
        ::after {
            content: "";
            display: block;
            background: linear-gradient(0deg,var(--rtVideo-playlist-item-bkgd-color) 0%, var(--rtVideo-playlist-item-bkgd-color0) 100%);
            float: left;
            position: absolute;
            bottom: 0;
            left: 0;
            width: calc(100cqi - 2px);
            height: 1.5cqi;
        }

    }
    
    div.item:last-child {
        margin-bottom: 0;
    }
    
    div.item:hover {
        background-color: var(--rtVideo-playlist-item-bkgd-color-hover);
        ::after { background: linear-gradient(0deg,var(--rtVideo-playlist-item-bkgd-color-hover) 0%, var(--rtVideo-playlist-item-bkgd-color-hover0) 100%); }
    }

    div.item.active,
    div.item:active {
        background-color: var(--rtVideo-playlist-item-bkgd-color-active);
        ::after { background: linear-gradient(0deg,var(--rtVideo-playlist-item-bkgd-color-active) 0%, var(--rtVideo-playlist-item-bkgd-color-active0) 100%);  }
    }

    ::-webkit-scrollbar {
        width:  8px;           /* Thickness of vertical scrollbar */
        height: 8px;           /* Thickness of horizontal scrollbar */
    }

    ::-webkit-scrollbar-track {
        background: transparent;   /* Background of the scrollbar track */
        border-radius: 4px;        /* Rounded track corners */
    }

    ::-webkit-scrollbar-thumb {
        background: #e0e0e0;    /* Color of the draggable handle */
        border-radius: 4px;     /* Rounded handle corners */
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #ffffff;    /* Color of handle on hover */
    }
        
}

@media only screen and (max-width: 1000px), (max-height: 500px) {
    #rtVideo-console {
        width: calc(100% - 20px);
    }
}

@media only screen and (min-aspect-ratio: 2/1) {
    #rtVideo-console:not(.single) {
        max-width: 100vw;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        width: auto;
        height: auto;
    }
    
    #rtShade:has(#rtVideo) #rtShadeInner {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }
}

@media only screen and (max-aspect-ratio: 1/1) {
    #rtVideo-console:not(.single) {
        display: block;
        aspect-ratio: auto;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: clip;
    }
    
    #rtVideo-playlist {
        height: auto;
        max-height: 33.333cqi;
        
        div.name {
            font-size: 4.0cqi !important;
        }
        
        div.description {
            font-size: 2.5cqi !important;
        }
    }
    
    #rtShade:has(#rtVideo) #rtShadeInner {
        max-height: 100vh;
        max-height: 100dvh;
    }
    
}


@media only screen and (max-aspect-ratio: 7/10) {
    #rtVideo-playlist {
        max-height: 50cqi;
    }
}

@media only screen and (max-aspect-ratio: 6/10) {
    #rtVideo-playlist {
        max-height: 66.666cqi;
    }
}



/* single mode: video only */

#rtVideo-console.single {
    aspect-ratio: 4 / 3;
    display: block;
    max-width: 960px;
    #rtVideo-playlist  { display: none; }
}

@media only screen and (min-aspect-ratio: 4/3) {
    #rtVideo-console.single {
        width: auto;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
    }
}


/*
    "EXTERNAL" ELEMENTS (preview link, carousel, categories, etc.)

*/

/* gen_video_link */

a.rtVideo-popup-link {
    box-sizing: border-box;
    background-repeat: no-repeat;
    background-position: 7px center;
    background-image: url(/images/creative/icon200_video@0.5x.png);
    background-size: 24px auto;
    color: #e74325 !important;
    text-decoration: none !important;
    font-weight: normal;
    display: inline-block;
    height: 32px;
    padding: 9px 9px 4px 38px;
    font-size: 15px;
    margin: 0px;
    border: 1px solid #e3e3e3;
    border-radius: 13px;
    text-decoration: none;
    line-height: 1em;
    cursor: pointer;
}

a.rtVideo-popup-link::before {
    content: "Video Preview";
}

/* gen_categories */

.rtVideo-categories {
    --rtVideo-categories-product-width: 180px;
    container-type: inline-size; 
}

.rtVideo-categories * {
    box-sizing: border-box;
}

.rtVideo-categories div.category {
    margin: auto;
}

.rtVideo-categories div.products {
    display: grid;
    grid-template-columns: repeat(5, var(--rtVideo-categories-product-width));
    gap: 40px;
    width: max-content;
    align-items: start;
    margin: 40px auto 40px auto;
}

.rtVideo-categories div.product {
    text-wrap: balance;
    cursor: pointer;
}

.rtVideo-categories div.product img {
    display: block;
    aspect-ratio: 4/3;
    width: var(--rtVideo-categories-product-width);
    margin: auto;
    border: 1px solid #c0c0c0;
    background: #c0c0c0;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
}

.rtVideo-categories div.id {
    display: none;
}

.rtVideo-categories div.name {
    font-family: "Roboto Condensed";
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    color: #505050;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

@media only screen and (max-width: 1319px) {
    .rtVideo-categories div.products {
        grid-template-columns: repeat(4, var(--rtVideo-categories-product-width));
    }
}

@media only screen and (max-width: 959px) {
    .rtVideo-categories div.products {
        grid-template-columns: repeat(3, var(--rtVideo-categories-product-width));
    }
}

@media only screen and (max-width: 799px) {
    .rtVideo-categories {
        --rtVideo-categories-product-width: 150px;
        div.products {
            grid-template-columns: repeat(3, var(--rtVideo-categories-product-width));
            gap: 25px;
            font-size: 15px;
        }
    }
}

@media only screen and (max-width: 619px) {
    .rtVideo-categories {
        --rtVideo-categories-product-width: 120px;
        div.products {
            font-size: 14px;
        }
    }
}

@media only screen and (max-width: 480px) {
    .rtVideo-categories {
        div.products {
            gap: 25px 15px;
        }
    }
}

@media only screen and (max-width: 479px) {
    .rtVideo-categories {
        --rtVideo-categories-product-width: calc(50cqi - 20px);
        div.products {
            grid-template-columns: repeat(2, var(--rtVideo-categories-product-width));
            gap: 20px;
        }
    }
}

/* gen_carousel */



div.rtVideo-carousel {
    display: grid;
    grid-template-columns: 20px auto 20px;
    gap: 10px;
    container-type: inline-size;
}

div.rtVideo-carousel {
    div.inner {
        container-type: inline-size;
        overflow: clip;
    }
    
    div.back,
    div.next {
        min-height: 40px;
        background-repeat: no-repeat;
        background-position: center 46px;
        background-size: 20px auto;
        cursor: pointer;
    }
    
    div.back.disabled,
    div.next.disabled {
        opacity: 0.25;
        cursor: default;
    }

    div.back {
        background-image: url(/images/ui/rtVideo.back.svg);
    }

    div.next {
        background-image: url(/images/ui/rtVideo.next.svg);
    }
}

div.rtVideo-carousel div.scroll {
    
    --rtVideo-carousel-product-width: 16.66667cqi;
    
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--rtVideo-carousel-product-width);
    gap: 0px;

    overflow-x: hidden;
    
    img {
        aspect-ratio: 4/3;
        width: 100%;
        border: 1px solid #c0c0c0;
        background: #c0c0c0;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
    }
    
    div.product {
        padding: 0 10px 0 10px;
        cursor: pointer;
    }
    
    div.name {
        font-family: "Roboto Condensed";
        font-weight: 600;
        font-size: 14px;
        text-align: center;
        color: #505050;
        margin-top: 0.5em;
        margin-bottom: 0.5em;
    }
}

@media only screen and (max-width: 1319px) {
    div.rtVideo-carousel {
        div.back,
        div.next {
            background-position: center 26px;
        }
    }
}

@media only screen and (max-width: 959px) {
    div.rtVideo-carousel div.scroll {
        --rtVideo-carousel-product-width: 20cqi;
    }
}

@media only screen and (max-width: 799px) {
    div.rtVideo-carousel div.scroll {
        --rtVideo-carousel-product-width: 25cqi;
    }
    
    div.rtVideo-carousel {
        div.back,
        div.next {
            background-position: center 26px;
        }
    }
}