/* Theme media block on home + /media gallery */

.theme-media {
  padding-top: 72px;
  padding-bottom: 72px;
}

.theme-media__head {
  margin-bottom: 32px;
  max-width: 920px;
}

.theme-media__player {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #0b1220;
}

.theme-media__video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  aspect-ratio: 16 / 9;
  background: #000;
}

.theme-media__more {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  margin-top: 28px;
}

.theme-media__more-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.theme-media__more-card {
  min-width: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.theme-media__more-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 70% 20%, rgba(87, 157, 255, 0.35), transparent 55%),
    linear-gradient(160deg, #13284a 0%, #0b1220 55%, #081018 100%);
}

.theme-media__more-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-media__more-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: rgba(4, 126, 254, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.theme-media__more-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
  transform: translate(-40%, -50%);
}

.theme-media__more-card:hover .theme-media__more-play,
.theme-media__more-card:focus-visible .theme-media__more-play {
  transform: scale(1.05);
}

.theme-media__more-card:focus-visible {
  outline: 2px solid #047efe;
  outline-offset: 3px;
  border-radius: 12px;
}

.theme-media__cta {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .theme-media__more {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .theme-media__more-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .theme-media__cta {
    justify-content: flex-start;
  }
}

.media-video-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 24, 0.78);
  backdrop-filter: blur(4px);
}

.media-video-dialog[hidden] {
  display: none !important;
}

.media-video-dialog__panel {
  position: relative;
  width: min(960px, 100%);
  background: #0b1220;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.media-video-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

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

.media-video-dialog__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

html.media-video-dialog-open,
html.media-video-dialog-open body {
  overflow: hidden;
}

.media-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.media-page__main {
  flex: 1 1 auto;
  padding: 48px 0 80px;
}

.media-page__head {
  margin-bottom: 40px;
  max-width: 720px;
}

.media-page__empty {
  margin-top: 8px;
  opacity: 0.85;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 720px) {
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.media-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.media-card__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
}

.media-card__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
