html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.scroll-top.on {
    display: none !important;
}
.tmg-button {
    display: block;
    margin: 0 !important;
    padding: 0.8rem;
    font-weight: 700;
    border-radius: 0.5rem;
}
/*===========================================
******** S L I D E R  S E C T I O N *********
=============================================*/

/* Section wrapper */
#slider-section { 
    overflow: hidden;
    padding: 0 !important;
  }
  
  /* Relative container so arrows/progress/overlay can absolutely position */
  #slider-section .slider-wrapper { 
    position: relative; 
    width: 100%; 
  }
  
  #slider-section .slider-viewport {
    display: flex;
    gap: 0;
    will-change: transform;
    transition: transform 500ms;   /* JS may override */
    width: auto;                   /* sum of children */
    transform: translate3d(0,0,0);
  }
  
  /* One slide = one viewport width (direct child is <article class="slide">) */
  #slider-section .slider-viewport > .slide {
    flex: 0 0 100%;
    width: 100%;
    position: relative;            /* overlay positioning */
    box-sizing: border-box;
    aspect-ratio: 1920 / 560;      /* desktop hero height */
  }
  
  /* Anchor fills the slide’s box */
  #slider-section .slide-link {
    display: block;
    width: 100%;
    height: 100%;
  }
  @media (max-width: 1100px) {
    #slider-section .slider-viewport > .slide { 
      aspect-ratio: 1920 / 760;
    }
  }
  /* Small screens use a taller ratio */
  @media (max-width: 768px) {
    #slider-section .slider-viewport > .slide { 
      aspect-ratio: 800 / 1200;
    }
  }
  
  /* Images fill the frame */
  #slider-section .slide-link picture,
  #slider-section .slide-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right;
    margin: 0; 
    border: 0; 
    box-sizing: border-box;
  }
  
  /* Progress bar (JS-controlled width) */
  #slider-section .slider-bar {
    position: absolute; 
    left: 0; 
    right: 0; 
    bottom: 0;
    height: 4px; 
    background: #e5e5e5; 
    z-index: 3;
  }
  #slider-section .progress-timer {
    height: 100%;
    width: 0%;
    background: var(--tln-red, #c62828);  /* visible even if var missing */
  }
  
  /* Arrows */
  #slider-section .slider-previous,
  #slider-section .slider-next {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%);
    border: 0; 
    background: none; 
    color: var(--tln-white, #fff);
    font-size: 4rem; 
    padding: 1rem; 
    line-height: 1;
    cursor: pointer;
    filter: drop-shadow(0px 3px 5px black); 
    z-index: 4; /* above overlay */
  }
  #slider-section .slider-previous { left: 0 }
  #slider-section .slider-next     { right: 0 }
  #slider-section .slider-previous:focus-visible,
  #slider-section .slider-next:focus-visible { 
    outline: 2px solid #fff; 
    outline-offset: 2px; 
  }
  
  /* ======================================================
     Content overlay (for "slide--banner" with text fields)
     ------------------------------------------------------
     Desktop (>=1100px): left panel ~50% width, full height
     Mobile/Tablet: compact pill at bottom-left
     ====================================================== */
  
  /* Base overlay styles shared across breakpoints */
  #slider-section .slide-overlay {
    position: absolute;
    pointer-events: auto;        /* allows button/links inside overlay */
    color: #fff;
    z-index: 2;                  /* above image, below arrows */
  }
  
  /* Typography + spacing tokens */
  #slider-section .slide-tag {
      display: block;
      font-size: 2vw;
      font-weight: 400;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--tln-white);
      margin-bottom: 1rem;
  }
  #slider-section .slide-title {
    color: var(--tln-light-grey);
    font-weight: 800;
    font-size: 4vw;
    line-height: 1.1;
    margin: 0 !important;
    padding-right: .5rem;
    text-transform: capitalize;
  }
  #slider-section .slide-desc {
    font-size: clamp(.95rem, 1.4vw, 1.125rem);
    line-height: 1.4;
    opacity: .95;
  }
  #slider-section .slide-logo {
      width: 50vw;
      max-width: 250px;
      object-fit: contain;
      filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
  }
  
  /* CTA button (“View more”) */
  #slider-section .slide-cta {
    background: #004d64;
    border: 2px solid #004d64;
    color: var(--tln-white);
    text-decoration: none;
    width: fit-content;
  }
  #slider-section .slide-cta:hover {
    background: transparent;
  }
  
  /* Readability on busy art */
  #slider-section .slide-title,
  #slider-section .slide-desc {
    text-shadow: 0 1px 4px rgba(0,0,0,.35);
  }
  
  /* Clamp long text to keep overlays tidy */
  #slider-section .slide-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;     /* 2 lines max */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #slider-section .slide-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;     /* 3 lines max */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* DESKTOP — cover ~50% of the LEFT side, full height */
  @media (min-width: 768px) {
    #slider-section .slide-overlay {
      top: 0;
      bottom: 0;
      left: 0;
      right: auto;
      width: 50vw;
      padding: 4rem;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: flex-start;
      gap: 1rem;
      background: linear-gradient(90deg, rgba(5, 15, 23, 1), rgba(5, 15, 23, .80), rgba(5, 15, 23, .55), rgba(5, 15, 23, 0.01));
    }
  }
  
  /* MOBILE & TABLET — float as a small pill near bottom-left */
  @media (max-width: 767.99px) {
    #slider-section .slide-link picture,
    #slider-section .slide-link img {
      object-position: center;
    }
    #slider-section .slide-overlay {
      bottom: 0;
      left: 0;
      width: calc(100% - 60px);
      padding: 4rem 2rem;
      display: grid;
      gap: 1rem;
  
      background: linear-gradient(
        0deg,
        rgba(5, 15, 23, 1),
        rgba(5, 15, 23, .80),
        rgba(5, 15, 23, .55),
        rgba(5, 15, 23, 0.01)
      );
    }
    #slider-section .slide-logo {
        width: 25vw;
    }
    #slider-section .slide-tag {
      font-size: 3vw;
    }
    /* Tighten typography on small screens */
    #slider-section .slide-title {
      font-weight: 800;
      font-size: 6vw;
      line-height: 1.15;
    }
    #slider-section .slide-desc {
      font-size: clamp(.85rem, 3.8vw, .95rem);
      line-height: 1.3;
    }
    #slider-section .slide-cta {
      font-size: 3vw;
      padding: .5rem 2rem;
    }
  
    /* Optional: hide desc on very small phones to avoid obstruction */
    @media (max-width: 400px) {
      #slider-section .slide-desc { display: none; }
    }
  }
  
  @media (max-width: 580px) {
    #slider-section .slide-overlay {
      padding: 4rem 2rem ;
    }
    #slider-section .slide-tag {
        font-size: 4vw;
    }
    #slider-section .slide-title {
      font-size: 8vw;
    }
    #slider-section .slide-cta {
      font-size: 4vw;
    }
  
  }
  
  /* Accessibility & motion preferences */
  @media (prefers-reduced-motion: reduce) {
    #slider-section .slide-cta { transition: none !important; }
  }


/*************** Ad Section *****************/
.ad-section {
    width: 100%;
    margin: auto;
    background: #E6E7E8;
}
.desktop-ad div, .mobile-ad div {
    margin: 20px auto;
}
.desktop-ad {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: 728px;
  padding: 20px 0px;
  gap: 20px;
}
.mobile-ad {
    display: none;
    margin: auto;
    width: 300px;
    padding: 20px 0px;
    gap: 20px;
}
div#featured-ad-section {
    margin: auto -39px auto;
    width: 100vw;
}
@media screen and (max-width: 768px) {
    .desktop-ad {
        display: none;
    }
    .mobile-ad {
        display: flex;
  	flex-direction: column;
    }
}


/********* Whats on now **********/

#featured-section {
    padding: 60px 40px;
    margin: auto;
    background: #0279B5;
}
.programming-title {
    margin: auto auto 20px !important;
    text-align: center;
    font-size: 30px;
    font-weight: 600;
}
#schedule-container, #programming-container {
    width: 100%;
}
#category-Featured {
    display: none !important;
}

.thumbnail {
    display: none;
}

.info {
    border: none !important;
    padding-left: 0 !important;
    display: flex;
    flex-direction: column;
    text-decoration: none;    
}

.show-item p.show-time {
    width: 100%;
    background-color: #000;
    text-align: center;
    color: #fff !important;
}


/****Schedule Section****/
#schedule-container {
    position: relative;
    color: #fbfbff;
    text-align: center;
    max-width: 1240px;
    margin: auto;
}
#schedule-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.show-item {
    display: flex;
    flex-direction: column;
    width: 25%;
    cursor: pointer;
    background: #e6e7e8;
    height: 120px;
}
.show-item:hover {
  position: relative;
  top: -2px;
  left: -2px;
  box-shadow: 5px 5px 10px 5px #0000003b;
}
.thumbnail {
    padding-top: 67%;
    background-size: cover;
    background-position-x: center;
}
.info {
    height: 100%;
}
.show-item .show-title {
    font-size: 20px;
    text-transform: capitalize;
    color: #30393e;
    font-weight: 600;
    margin-bottom: 0 !important;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}
.show-item p.show-time {
    padding: 0px;
    font-size: 20px;
    border: none;
    margin-bottom: 0 !important;
    height: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/***FEATURED SECTION FONTS***/
.programming-title {
    color: #fbfbff;
}
h3.show-date {
    display: none;
}
@media screen and (max-width: 1100px) {
    /*******************/
    #schedule-container {
        padding: 0px;
        background: none;
    }
    #schedule-wrapper {
        width: 100%;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .show-item {
        flex-direction: row;
        position: relative;
        width: 100%;
        left: 0px;
        top: 0px;
        padding: 0px;
        box-shadow: 1px 2px 10px 0px #262626;
    }
    .thumbnail {
        width: 30%;
        padding-top: 19%;
        margin: auto;
        box-shadow: none;
    }
    .info {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
}
    #schedule-wrapper {
        width: 100%;
    }
    #schedule-wrapper .show-title {
        font-size: 1.4em !important;
        overflow: hidden;
	width: 70%;
}
    #schedule-wrapper .show-time {
        margin: 0px !important;
        font-size: 1.4em !important;
	width: 30%;
        height: 100%;
    }
}
@media screen and (max-width: 768px) {
    /****Featured Section****/
    .thumbnail {
        width: 40%;
        padding-top: 25%;
    }
    #schedule-wrapper .show-title {
      font-size: 1.1em !important;
      -webkit-line-clamp: 2;
    }
    #schedule-wrapper .show-time {
        font-size: 1.1em !important;
    }
    /*Programing Grid*/
    #programming-container {
        margin-top: 30px;
    }
    .prev-btn, .next-btn {
	    display: block !important;
    }
    #programming-wrapper .carousel-viewport {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .poster-collection {
        display: grid !important;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, auto);
        grid-auto-columns: calc(50% - 10px);
    }
}
@media only screen and (max-width: 580px) {
    .programming-title {
        font-size: 30px;
        margin: auto auto 20px !important;
    }
    /**************************/
    #featured-section {
        padding: 30px;
    }
    .info {
        display: flex;
        align-items: center;
    }
    #schedule-wrapper .show-title,  #schedule-wrapper .show-time {
        font-size: 1em !important;
    }
}
@media only screen and (max-width: 480px) {
  .programming-title {
    font-size: 26px;
  }
}


/***********************************/
.homepage-community{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 60px 40px;  
    background: #fff;
}
.homepage-community-title {
    font-size: 30px;
    color: #000;
    font-weight: 600;
    margin-bottom: 20px;
}
.videoContainer {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #004d64;
    height: 100%;
    cursor: pointer;
    /*max-height: 260px;*/
}

.view-port {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1240px;
    position: relative;
    gap: 10px;
    transition: all 0.25s ease-in;
    width: 100%;
}
.videoLink {
    text-decoration: none;
    transition: all 300ms ease;
}
.play-btn {
    position: absolute;
    top: 31%;
    left: 0;
    right: 0;
    margin: auto;
    padding-top: 17%;
    background-image: url(https://www.mediasetitalia.ca/wp-content/uploads/font-awesome/play.svg);
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0px 0px 5px white) invert(100);
    z-index: 10;
    opacity: 0;
    transition: all 300ms ease;
}
.videoLink:hover{
    filter: brightness(70%);
}

.videoLink:hover .play-btn {
    opacity: 1;
}
.videoThumbnail {
    display: block;
    width: 100%;
    height: auto;
}
.videoTitle {
    padding: 10px;
    min-height: 40px;
    background-color: #004d64;
    font-size: 15px;
    font-weight: 600;
    line-height: normal;
    text-align: center;
    color: #fff;
}
#videoGrid {
    display: flex;
    gap: 20px;
    transition: all 0.25s ease-in;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow: auto;
    scroll-snap-type: x mandatory;
    overflow-x: scroll;
    scroll-behavior: smooth;
}

#videoGrid::-webkit-scrollbar {
  display: none;
}

.prev-btn,
.next-btn {
  position: absolute;
  font-size: 34px;
  padding: 0;
  background-color: transparent;
  text-decoration: none !important;
  border: none;
  height: 26px;
  width: 30px;
  background-repeat: no-repeat;
}

#prev-btn {
    left: -26px;
    background-image: url(https://tln.ca/wp-content/fontawesome/svgs/solid/chevron-left.svg);
}
#next-btn {
    right: -38px;
    background-image: url(https://tln.ca/wp-content/fontawesome/svgs/solid/chevron-right.svg);
}

.videoLink {
    border-radius: 8px;
    min-width: calc((100% / 4) - 15px);
    scroll-snap-align: start;
}	

@media (max-width: 1100px) {
    .videoLink {
        min-width: calc((100% / 3) - 15px);
    }
}

@media (max-width: 768px) {
    .videoLink {
        min-width: calc((100% / 2) - 10px);
    }
}

@media (max-width: 580px) {
    .homepage-community {
    	padding: 30px;
    }    
    .videoLink {
        min-width: 100%;
    }
    #prev-btn {
        left: -25px;
    }
    #next-btn {
        right: -35px;
    }
}

/******* Lightbox ********/
.homepage-community .lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.homepage-community .lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
}

.homepage-community .lightbox iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}


/******* Where to find ********/

.home-findus {
    background: #415AA6;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-findus-header {
    font-size: 30px;
    font-weight: 600;
    color: #fff;
}

.home-findus-img-wrapper {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    max-width: 1240px;
}

.home-findus-logo {
    max-width: calc(100% / 4 - 10px);
    background-color: #e6e7e8;
}

.home-findus-logo > img {
    width: 100%;
}

.home-findus-btn {
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 300ms ease;
    background-color: #004D64;
    color: #fff;
    font-weight: 600;
    font-size: 21px;
    text-transform: capitalize;
    border: 2px solid #004D64;
    text-decoration: none !important;
    margin-top: 30px;
}

.home-findus-btn:hover {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

@media (max-width: 768px) {
    .home-findus {
        padding: 30px;
    }
    .home-findus-logo {
        max-width: calc(100% / 3 - 10px);
    }
}


@media (max-width: 480px) {
    .home-findus-header {
	font-size: 26px;
    }
    .homepage-community-title {
	font-size: 26px;
    }
    .home-findus-btn {
        font-size: 16px;
        padding: 8px 16px;
    }
}

@media (max-width: 768px) {
    .show-item {
	height: 75px;
	box-shadow: none;
    }
    .info {
	height: 75px;
        flex-direction: row;
        align-items: center;
    }
    #schedule-wrapper .show-time {
	width: 30%;
    	height: 100%;
    }
    .show-item .show-title {
	width: 71%;
    }
}

#videoGrid {
    display: flex;
    transition: transform 0.4s ease-in-out;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}


/* Basic layout for carousel slides */
.carousel-slide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* Automatically adjust columns */
    grid-auto-rows: 1fr;
    gap: 20px;
    flex: 0 0 100%;
    scroll-snap-align: start;
}

/* Video container styling */
.videoLink {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background-color: #004d64;
    cursor: pointer;
}

.videoThumbnail {
    width: 100%;
    height: auto;
}

.videoTitle {
    padding: 10px;
    text-align: center;
    color: #fff;
    background-color: #004d64;
}

@media (max-width: 1115px) {
.carousel-slide {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
}

@media (max-width: 1025px) {
.carousel-slide {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
}

@media (max-width: 595px) {
    .carousel-slide {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 496px) {
    .carousel-slide {
        grid-template-columns: 1fr; 
    }
    .videoLink {
        width: 100%;
    }
}