.mtbsa-ytg {
  width: 100%;
}

.mtbsa-ytg__channel-title {
  margin: 0 0 20px;
}

.mtbsa-ytg__grid {
  display: grid;
  grid-template-columns: repeat(var(--mtbsa-ytg-cols, 3), minmax(0, 1fr));
  gap: var(--mtbsa-ytg-gap, 20px);
}

.mtbsa-ytg__item {
  min-width: 0;
  margin: 0;
}

.mtbsa-ytg__card {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mtbsa-ytg__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden !important;
  border-radius: var(--mtbsa-ytg-radius, 8px) !important;
  clip-path: inset(0 round var(--mtbsa-ytg-radius, 8px));
  background: #111;
}

.mtbsa-ytg__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit !important;
  transition: transform .3s ease, opacity .3s ease;
}

.mtbsa-ytg__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: rgba(0, 0, 0, .78);
  box-shadow: 0 3px 16px rgba(0, 0, 0, .2);
  transition: transform .2s ease, background .2s ease;
}

.mtbsa-ytg__play span {
  position: absolute;
  left: 25px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #fff;
}

.mtbsa-ytg__meta {
  display: block;
  padding-top: 10px;
}

.mtbsa-ytg__title {
  display: block;
  font-weight: 700;
  line-height: 1.35;
}

.mtbsa-ytg__date {
  display: block;
  margin-top: 5px;
  font-size: .875em;
  line-height: 1.4;
  opacity: .68;
}

@media (hover: hover) {
  .mtbsa-ytg__card:hover .mtbsa-ytg__thumb img {
    transform: scale(1.025);
    opacity: .94;
  }

  .mtbsa-ytg__card:hover .mtbsa-ytg__play {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(255, 0, 0, .92);
  }
}

.mtbsa-ytg__card:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
  border-radius: var(--mtbsa-ytg-radius, 8px);
}

.mtbsa-ytg__lightbox[hidden] {
  display: none !important;
}

.mtbsa-ytg__lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 54px 18px 26px;
  background: rgba(0, 0, 0, .94);
}

.mtbsa-ytg__dialog {
  position: relative;
  width: min(1120px, 100%);
  color: #fff;
}

.mtbsa-ytg__player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.mtbsa-ytg__player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.mtbsa-ytg__close {
  appearance: none;
  position: absolute;
  right: -4px;
  bottom: calc(100% + 5px);
  width: 46px;
  height: 46px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font: 400 42px/1 Arial, sans-serif;
  cursor: pointer;
}

.mtbsa-ytg__lightbox-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-top: 11px;
}

.mtbsa-ytg__lightbox-title {
  min-height: 24px;
  font-size: 14px;
  line-height: 1.45;
  opacity: .86;
}

.mtbsa-ytg__youtube-link {
  flex: 0 0 auto;
  color: #fff !important;
  font-size: 14px;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mtbsa-ytg__youtube-link:hover,
.mtbsa-ytg__youtube-link:focus {
  color: #fff !important;
  opacity: .78;
}

body.mtbsa-ytg-lightbox-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .mtbsa-ytg__grid {
    grid-template-columns: repeat(var(--mtbsa-ytg-cols-tablet, 2), minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .mtbsa-ytg__grid {
    grid-template-columns: repeat(var(--mtbsa-ytg-cols-mobile, 1), minmax(0, 1fr));
  }

  .mtbsa-ytg__play {
    width: 56px;
    height: 40px;
  }

  .mtbsa-ytg__play span {
    left: 23px;
    top: 12px;
    border-top-width: 8px;
    border-bottom-width: 8px;
    border-left-width: 14px;
  }

  .mtbsa-ytg__lightbox-footer {
    display: block;
  }

  .mtbsa-ytg__youtube-link {
    display: inline-block;
    margin-top: 5px;
  }
}
