.videos-page {
  padding: 70px 0 90px;
  color: #003087;
  background: #fff;
  font-weight: 300;
}

.videos-shell {
  width: min(1170px, calc(100% - 60px));
  margin-inline: auto;
}

.videos-page h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 300;
  line-height: 1.35;
  text-align: center;
}

.videos-divider {
  display: flex;
  width: min(350px, 100%);
  height: 26.5px;
  align-items: center;
  margin: 5px auto 0;
}

.videos-divider::before,
.videos-divider::after {
  content: "";
  flex: 1;
  border-top: 3px solid #c8a977;
}

.videos-divider span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 4px double #fff;
  border-radius: 50%;
  background: #c8a977;
}

.videos-divider span::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(45deg);
}

.videos-intro {
  margin: 0 0 40px;
  font-size: 20px;
  line-height: 1.72;
  text-align: center;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.video-item {
  min-width: 0;
  container-type: inline-size;
}

.video-item[hidden],
.videos-actions [hidden],
.video-dialog [hidden] {
  display: none;
}

.video-thumbnail {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: round(down, calc(100cqi * 9 / 16), 1px);
  overflow: hidden;
  background: #111;
}

.video-thumbnail > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-hover {
  position: absolute;
  inset: 0;
  padding: 10px;
  color: #fff;
  background: rgb(0 0 0 / 60%);
  opacity: 0;
  transition: opacity 150ms ease;
}

.video-title {
  display: block;
  margin-bottom: 5px;
  font-size: 15.6px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.video-thumbnail:hover .video-hover,
.video-thumbnail:focus-visible .video-hover {
  opacity: 1;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 57px;
  height: 50px;
  transform: translate(-50%, -50%);
}

.video-play > span {
  position: absolute;
  top: 17px;
  left: 22px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 16px solid #fff;
}

.video-play svg {
  position: relative;
  width: 57px;
  height: 50.66px;
  color: #000;
  opacity: 0.75;
}

.videos-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 10.5px;
  padding-top: 5px;
}

.videos-load,
.videos-subscribe {
  display: inline-flex;
  min-height: 33.5px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 14px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: #333;
  font-size: 13px;
  font-weight: 300;
  line-height: 19.5px;
  text-align: center;
  cursor: pointer;
}

.videos-subscribe {
  background: #408bd1;
}

.videos-subscribe svg {
  width: 14px;
  height: 13px;
  flex: 0 0 14px;
}

.videos-load:hover {
  background: #555;
}

.videos-subscribe:hover {
  background: #2872b5;
}

.videos-page :focus-visible {
  outline: 3px solid #c8a977;
  outline-offset: 3px;
}

body.has-video-dialog {
  overflow: hidden;
}

.video-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 80px 60px 60px;
  margin: 0;
  overflow: auto;
  border: 0;
  color: #ccc;
  background: transparent;
}

.video-dialog::backdrop {
  background: rgb(0 0 0 / 90%);
}

.video-dialog-shell {
  position: relative;
  width: min(100%, calc((100dvh - 140px) * 16 / 9));
  margin-inline: auto;
}

.video-dialog-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-dialog-poster,
.video-dialog-player,
.video-dialog-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.video-dialog-player:empty {
  pointer-events: none;
}

.video-dialog-control,
.video-dialog-play {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.video-dialog-control img,
.video-dialog-play img {
  filter: invert(1);
  opacity: 0.7;
}

.video-dialog-control:hover img,
.video-dialog-play:hover img {
  opacity: 1;
}

.video-dialog-play img {
  width: 48px;
  height: 48px;
  opacity: 0.8;
}

.video-dialog-close {
  top: -48px;
  right: -8px;
}

.video-dialog-prev,
.video-dialog-next {
  top: calc(50% - 38px);
  width: 60px;
  height: 60px;
}

.video-dialog-prev {
  left: -60px;
}

.video-dialog-next {
  right: -60px;
}

.video-dialog-play {
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
}

.video-dialog-info {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px;
  font-size: 12px;
  line-height: 1.5;
}

.video-dialog-info a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 980px) {
  .videos-page {
    padding-top: calc(187px - var(--header-height));
    padding-bottom: 140px;
  }
}

@media (max-width: 640px) {
  .videos-page h1 {
    font-size: 34px;
  }

  .videos-divider {
    margin-top: -5px;
  }

  .videos-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-dialog {
    padding: 80px 30px 40px;
  }

  .video-dialog-shell {
    width: min(100%, calc((100dvh - 120px) * 16 / 9));
  }

  .video-dialog-prev,
  .video-dialog-next {
    width: 30px;
  }

  .video-dialog-prev {
    left: -30px;
  }

  .video-dialog-next {
    right: -30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-hover {
    transition: none;
  }
}
