/* Custom Elementor Widget: Banner & Gallery & YouTube Grid */

.t888-bg-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.t888-bg-banner {
  width: 100%;
  margin-bottom: 20px;
  border-radius: 20px;
  overflow: hidden;
}

.t888-bg-banner a {
  display: block;
}

.t888-bg-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.t888-bg-rows {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.t888-bg-row.is-hidden {
  display: none;
}

.t888-bg-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.t888-bg-reveal {
  opacity: 0;
  transform: translate3d(0, 90px, 0);
  will-change: transform, opacity;
}

.t888-bg-reveal.in-view {
  opacity: 1;
  transform: none;
  transition:
    transform 1.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 1.4s ease-out;
}

.t888-bg-rows > .t888-bg-row.t888-bg-reveal:nth-child(even).in-view {
  transition-delay: 0.1s;
}

.t888-bg-gallery-item,
.t888-bg-youtube-item {
  width: 100%;
  /* border-radius: 16px; */
  overflow: hidden;
  /* background: #000; */
}

.t888-bg-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.t888-bg-image-wrapper,
.t888-bg-video-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}

.t888-bg-video-wrapper {
  background: #d9d9d9;
}

.t888-bg-video-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #d9d9d9;
  opacity: 1;
  transition: opacity 0.28s ease;
  pointer-events: none;
  z-index: 2;
}

.t888-bg-aspect-square {
  aspect-ratio: 1/1;
}

.t888-bg-aspect-classic {
  aspect-ratio: 4 / 3;
}

.t888-bg-aspect-standard,
.t888-bg-video-aspect-standard {
  aspect-ratio: 16/9;
}

.t888-bg-aspect-auto {
  aspect-ratio: auto;
  min-height: 320px;
}

.t888-bg-aspect-auto img {
  position: static;
  height: auto;
  min-height: 320px;
}

.t888-bg-video-aspect-square {
  aspect-ratio: 1/1;
}

.t888-bg-video-aspect-classic {
  aspect-ratio: 4/3;
}

.t888-bg-video-aspect-auto {
  aspect-ratio: auto;
  min-height: 320px;
}

.t888-bg-image-wrapper img,
.t888-bg-video-wrapper iframe {
  /* position: absolute; */
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.t888-bg-image-wrapper img {
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1) translateZ(0);
}

.t888-bg-youtube-iframe {
  position: relative;
  z-index: 1;
  background: transparent;
}

.t888-bg-video-wrapper.is-loaded::after {
  opacity: 0;
  visibility: hidden;
}

.t888-bg-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.18) 55%,
    rgba(0, 0, 0, 0.06) 100%
  );
  transition:
    opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
}

.t888-bg-image-content {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  color: #fff;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.t888-bg-image-title {
  margin: 0;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.t888-bg-image-text {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  line-height: 1.5;
}

.t888-bg-gallery-item:hover img {
  transform: scale(1.1) translateZ(0);
}

.t888-bg-gallery-item:hover .t888-bg-image-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.3) 55%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.t888-bg-gallery-item:hover .t888-bg-image-content {
  opacity: 1;
  transform: translateY(0);
}

.t888-bg-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.t888-bg-load-more-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  background: #143687;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease;
}

.t888-bg-load-more-btn:hover {
  background: #0948ab;
  transform: translateY(-1px);
}

.t888-bg-load-more-btn:focus-visible {
  outline: 2px solid #0d5bd7;
  outline-offset: 3px;
}

@media (max-width: 991px) {
  .t888-bg-row {
    grid-template-columns: 1fr;
  }

  .t888-bg-image-title {
    font-size: 24px;
  }

  .t888-bg-image-text {
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  /* .t888-bg-banner,
  .t888-bg-gallery-item,
  .t888-bg-youtube-item {
    border-radius: 16px;
  } */

  .t888-bg-image-content {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }

  .t888-bg-image-title {
    font-size: 20px;
  }

  .t888-bg-image-text {
    margin-top: 8px;
    font-size: 15px;
  }

  .t888-bg-load-more-btn {
    width: 100%;
    max-width: 240px;
  }
}
