/************************************************************/
/*********             Template Styles                *******/
/************************************************************/

/* Section blocks */
section {
  padding: 4rem;
  margin: auto;
  text-align: center;
}

@media only screen and (max-width: 580px) {
  section { padding: 2rem; }
}

/* Used for Video Highlights and Gallery headings */
.section-title {
  display: inline-block;
  text-align: center;
  margin: 0 auto 2rem !important;
  border-width: 5px;
}
@media only screen and (max-width: 580px) {
  .section-title { text-align: center; margin-bottom: 20px; }
}

section.description-section p {
  text-align: center;
  margin: auto !important;
}

/* Used to style any custom WordPress Row to match section elements*/
.section-block {
  padding: 35px;
  margin: 0 auto;
  max-width: calc(1240px + 80px);
}
@media only screen and (max-width: 768px) {
  .section-block { padding: 30px; }
}
@media only screen and (max-width: 580px) {
  .section-block { padding: 20px; }
}

/* Utility spacing */
.pt-0 { padding-top: 0 !important; }
.pt-5 { padding-top: 40px !important; }
.pb-0 { padding-bottom: 0 !important; }
.mt-5 { margin-top: 40px !important; }

/************************************************************/
/*********               Header                       *******/
/************************************************************/
#header-section {
  padding: 0;
  margin: auto;
  max-width: 100% !important;
}
#header-banner {
  width: 100%;
  background-size: cover !important;
  background-repeat: no-repeat;
  background-position: center !important;
  box-shadow: 0 0 10px -5px grey;
}

/************************************************************/
/*********         Page Intro Section                 *******/
/************************************************************/
#page-intro {
  background: var(--tln-light-grey);
  box-shadow: inset 0 0 30px -8px #868686;
  max-width: 100%;
  margin: auto;
  text-align: center;
}
.page-intro-container {
  margin: 0 auto;
  max-width: 1240px;
}
.title-container { display: flex; justify-content: center; }
.page-title { margin: 35px 0; text-align: center; text-transform: uppercase; }
.page-description {
  max-width: 1240px;
  margin: auto;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 400;
}
@media only screen and (max-width: 768px) {
  .page-title { margin: 60px 0 35px; }
}
@media only screen and (max-width: 580px) {
  .breadcrumb { font-size: 1.2rem; text-align: center; }
  .page-title { margin: 0 0 1rem; }
}

/************************************************************/
/*********             Video Playlist                 *******/
/************************************************************/
.video-highlights-wrapper {
  max-width: 1240px;
  margin: auto;
}
#video-background {
  background: black;
  overflow: hidden;
  border-radius: .5rem;
  border: .3rem solid white;
  box-shadow: 0 0 15px -5px black;
}
#video-player { max-width: 1000px; margin: auto; }

#video-container {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 2rem;
}

.scroll-button {
  cursor: pointer;
  height: 140px;
  width: 40px;
  z-index: 2;
  background: #1edde4;
  filter: invert(1);
  background-size: 45%;
  background-repeat: no-repeat;
  background-position: center;
}
#scroll-left  { background-image: url(https://tln.ca/wp-content/fontawesome/svgs/solid/chevron-left.svg); }
#scroll-right { background-image: url(https://tln.ca/wp-content/fontawesome/svgs/solid/chevron-right.svg); }

#video-playlist-wrapper {
  width: 100%;
  overflow: hidden;
  overflow-y: clip;
  scroll-behavior: smooth;
  margin: -1rem;
}
#video-playlist {
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 1rem;
}
#video-playlist .playlist-link {
  cursor: pointer;
  width: 25%;
  min-width: 250px;
  text-decoration: none;
  text-align: center;
}
#video-playlist .playlist-link:hover { color: #e01e45; }
.playlist-link img {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border: .1rem solid white;
  overflow: hidden;
  border-radius: .5rem;
  box-shadow: 0 0 15px -5px black;
}
.playlist-link img:hover { border-color: #e01e45 !important; }
.video-title {
  display: inline-block;
  margin-top: 1rem;
  font-size: 1.8rem;
  font-weight: 500;
}

@media only screen and (max-width: 768px) {
  #scroll-left, #scroll-right { 
    display: none;
   }
  #video-playlist-wrapper { 
    width: 100%;
    margin-bottom: 0; }
  #video-playlist { 
    flex-direction: column;
  }
  .playlist-link {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100% !important;
    margin-right: 0 !important;
  }
  #video-playlist img { 
    max-width: 180px;
    height: 100%;
    box-shadow: 0 0 15px -10px black;

  }
  .video-title { margin: auto 0; padding-left: 10px; text-align: left; font-size: 1.4rem; }
}
@media only screen and (max-width: 580px) {
  #video-playlist img { max-width: 150px; }
}

/************************************************************/
/*********             Image Gallery                  *******/
/************************************************************/
/* Credit */
.credit-headline { text-align: left; font-weight: 700; margin: 0; }

/************************************************************/
/*********              Carousel                      *******/
/************************************************************/
.gallery-wrapper { margin: auto; max-width: 1240px; }
.carousel { position: relative; width: 100%; margin: 0 auto; }

.carousel__track__container { position: relative; overflow: hidden; }
.carousel__track {
  display: flex;
  transition: transform 250ms ease-in;
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding: 5px;
}
/* Tablet (4 per row) */
@media (max-width: 768px) {
  .carousel-slide { grid-template-columns: repeat(4, 1fr); }
  .carousel__button { display: none; }
  .zoom, .zoom:hover { transition: none; transform: none; }
}
/* Mobile (3 per row) */
@media (max-width: 580px) {
  .carousel-slide { grid-template-columns: repeat(3, 1fr); }
  .carousel__button { display: none; }
  .zoom, .zoom:hover { transition: none; transform: none; }
}

/* ✅ Square boxes inside slides (this is the authoritative rule) */
.carousel-slide .square-container {
  width: 100%;
  height: 0;
  padding-top: 100%;     /* square via padding hack */
  position: relative;
}

/* Images fill the square box */
.carousel-slide .square-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pagination */
.carousel__nav {
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 0;
  margin: auto;
  max-width: 100%;
}
.carousel-indicator {
  background-color: var(--tln-light-grey);
  border: .1rem solid #30393e26;
  box-shadow: 0 0 8px -4px black;
  height: 10px;
  width: 28px;
  padding: 0;
  border: none;
  cursor: pointer;
}
.carousel-indicator:hover { background-color: var(--tln-dark-grey); }
.active { background-color: var(--tln-dark-grey); }

/* Arrows */
.carousel__button {
  border: 0;
  background: transparent;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  z-index: 10;
}
.carousel__button--left  { left: -3.5%; }
.carousel__button--right { right: -3.5%; }
.carousel__button .carousel__button__icon { font-size: 40px; color: var(--tln-red); }

/************************************************************/
/*********              Lightbox                      *******/
/************************************************************/
/* ❗ Removed the old global .square-container size rule that conflicted with the grid */
/* Click affordance */
.gallery-image {
  border: 3px solid #fff;
  transition: transform 0.3s ease, border-color 0.2s ease;
  cursor: zoom-in;
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
}
.gallery-image:hover { border-color: #fbbe11; }
.zoom { transition: transform 0.2s; }
.zoom:hover { transform: scale(1.03); }

/* Overlay */
.lightbox-overlay {
  display: none;
  position: fixed;
  z-index: 2147483647;   /* ensure on top of everything */
  inset: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
  overscroll-behavior: contain;
}
.lightbox-overlay.show { display: flex; opacity: 1; }

/* Lightbox content */
.lightbox { text-align: center; position: relative; }
.lb-content-container { position: relative; }
.lightbox-content {
  max-width: 100%;
  max-height: 80vh;
  box-shadow: 0 0 10px #000;
  border: 4px solid #fff;
  border-radius: 3px;
  transition: opacity .3s ease-in-out;
}

/* Lightbox meta */
.lb-data-container { margin: 0 auto; padding-top: 5px; }
.lb-data { color: #ccc; text-align: center; }
.lb-data .lb-details {
  text-align: left;
  line-height: 1.1em;
  width: 90%;
  margin: 0 auto;
}
.lb-details .lb-caption { font-size: 13px; font-weight: 700; line-height: 1em; }
.lb-details .lb-number { display: block; padding-bottom: 1em; font-size: 12px; color: #999; }

/* Close + arrows */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.lightbox-nav.prev { left: 7.5%; }
.lightbox-nav.next { right: 7.5%; }

/* Click zones (no more debug opacity) */
.lightbox-zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 45%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}
.left-zone  { left: 5%; right: 50%; }
.right-zone { right: 5%; left: 50%; }

@media screen and (max-width: 580px) {
  .lightbox-nav { font-size: 2rem; }
}

/***************************************************************/
/*****                  Social Media Feed                   ****/
/***************************************************************/
#socialMediaTitle { border-color: #e01e45; }

/***************************************************************/
/*****                  Drivers                             ****/
/***************************************************************/
.driver-container {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.driver-btn {
  align-items: center;
  border-radius: 6px;
  border-style: solid;
  border-width: 1px;
  display: inline-flex;
  cursor: pointer;
  font-size: 16px;
  font-family: Lemonmilk;
  font-weight: 700;
  justify-content: center;
  padding: 16px 24px;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
}
.driver-btn--blue {
  background: var(--salsa-summer-blue);
  border-color: white;
  color: white;
}
.driver-btn--blue:hover {
  background: white;
  border-color: var(--salsa-summer-blue);
  color: var(--salsa-summer-blue);
  opacity: 1 !important;
}
.driver-btn--white {
  background: white;
  border-color: var(--salsa-summer-blue);
  color: var(--salsa-summer-blue);
}
.driver-btn--white:hover {
  background: var(--salsa-summer-blue);
  border-color: white;
  color: white;
  opacity: 1 !important;
}

/**************************************************/
/********* S P O N S O R  S E C T I O N ***********/
/**************************************************/
#sponsorship-section {
    position: relative;
    z-index: 1;
    padding: 1rem;
    background: var(--tln-white);
    box-shadow: 0px 0px 10px 0px black;
}
.sponsorship-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: auto;
    max-width: 1240px;
}
.sponsorship-link {
    display: block;
    width: 11%;
    text-decoration: none;
}
@media  only screen and (max-width: 1100px) {
    .sponsorship-link {
        width: 15%;
    }
}
@media  only screen and (max-width: 768px) {
    .sponsorship-wrapper {
      flex-wrap: wrap;
    }
    .sponsorship-link {
        width: 33%;
    }
}