.media-detail-view {
  width: 100%;
  margin: 0 auto;
  color: var(--text);
}

.media-detail-backdrop {
  height: clamp(260px, 40vh, 460px);
  margin: calc(var(--topbar-height) * -1) calc(var(--page-pad-x) * -1) 0;
  background-position: center center;
  background-size: cover;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.media-detail-content {
  display: grid;
  grid-template-columns: clamp(150px, 14vw, 250px) minmax(0, 1fr);
  gap: clamp(22px, 2.6vw, 46px);
  align-items: end;
  margin-top: clamp(-150px, -12vw, -96px);
  position: relative;
}


.media-detail-poster {
  aspect-ratio: 2 / 3;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  overflow: hidden;
}

.media-detail-artist .media-detail-poster {
  aspect-ratio: 1 / 1;
}

.media-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-detail-main {
  max-width: 980px;
  padding-bottom: 8px;
}

.detail-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-title {
  margin: 6px 0 8px;
  font-size: clamp(34px, 4.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.detail-meta {
  min-height: 20px;
  color: rgba(255,255,255,0.72);
  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 650;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.detail-actions button {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 10px 18px;
  cursor: pointer;
}

.detail-actions button:hover,
.detail-actions button:focus-visible {
  outline: none;
  border-color: var(--accent);
  color: var(--accent);
}

.detail-overview {
  max-width: 840px;
  margin: 0;
  color: rgba(255,255,255,0.80);
  font-size: clamp(14px, 1.02vw, 17px);
  line-height: 1.55;
}

.media-detail-rows {
  margin-top: clamp(34px, 4.2vw, 72px);
}

.detail-section-title {
  margin-bottom: 14px;
  color: rgba(255,255,255,0.86);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-album-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 10vw, 220px), 1fr));
  gap: clamp(18px, 1.8vw, 30px);
  padding-bottom: 44px;
}

.detail-album-card {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.detail-album-art {
  display: block;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
  background: rgba(0,0,0,0.35);
}

.detail-album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-album-title {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .media-detail-backdrop {
    height: 260px;
  }

  .media-detail-content {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    margin-top: -82px;
    align-items: end;
  }

  .detail-title {
    font-size: 32px;
  }

  .detail-actions {
    gap: 8px;
    margin: 16px 0 14px;
  }

  .detail-actions button {
    padding: 9px 12px;
  }

  .detail-overview {
    grid-column: 1 / -1;
  }

  .detail-album-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.detail-cast-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 8vw, 170px), 1fr));
  gap: clamp(16px, 1.45vw, 26px);
  padding-bottom: 20px;
}

.detail-cast-card {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.detail-cast-art {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(0,0,0,0.35);
}

.detail-cast-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-cast-name,
.detail-cast-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-cast-name {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 850;
}

.detail-cast-role {
  margin-top: 3px;
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  font-weight: 650;
}

@media (max-width: 760px) {
  .detail-cast-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .detail-cast-name {
    font-size: 12px;
  }

  .detail-cast-role {
    font-size: 11px;
  }
}

/* v0.0.106 — TV Backdrop Revert to Banner
   TV show backdrops should favor the top of the source image so heads/titles are not cropped off. */
.media-detail-series .media-detail-backdrop {
  background-position: center top;
}

@media (max-width: 760px) {
  .media-detail-series .media-detail-backdrop {
    background-position: center top;
  }
}

.artist-image-dialog {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.72);
}

.artist-image-panel {
  width: min(980px, 94vw);
  max-height: min(760px, 86vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(7, 12, 22, 0.96);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 28px 80px rgba(0,0,0,0.62);
}

.artist-image-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.artist-image-search {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  padding: 10px 12px;
}

.artist-image-search-button,
.artist-image-close {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font: inherit;
  font-weight: 850;
  padding: 10px 16px;
  cursor: pointer;
}

.artist-image-close {
  width: 44px;
  padding-left: 0;
  padding-right: 0;
  font-size: 22px;
  line-height: 1;
}

.artist-image-search-button:hover,
.artist-image-search-button:focus-visible,
.artist-image-close:hover,
.artist-image-close:focus-visible,
.artist-image-result:hover,
.artist-image-result:focus-visible {
  outline: none;
  border-color: var(--accent);
  color: var(--accent);
}

.artist-image-status {
  min-height: 20px;
  padding: 8px 14px 0;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 750;
}

.artist-image-results {
  overflow: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.artist-image-result {
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.artist-image-result-art {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(0,0,0,0.30);
}

.artist-image-result-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-image-result-title {
  display: block;
  padding: 9px 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
}

/* v0.0.564 — detail posters and readable detail text follow Web/TV Size. */
body:not(.shell-device-phone) .media-detail-content {
  grid-template-columns: clamp(var(--ninja-detail-poster-min, 150px), var(--ninja-detail-poster-fluid, 14vw), var(--ninja-detail-poster-max, 250px)) minmax(0, 1fr);
}

body:not(.shell-device-phone) .detail-title {
  font-size: clamp(var(--ninja-detail-title-min, 34px), var(--ninja-detail-title-fluid, 4.4vw), var(--ninja-detail-title-max, 76px));
}

body:not(.shell-device-phone) .detail-meta,
body:not(.shell-device-phone) .detail-overview,
body:not(.shell-device-phone) .detail-actions button,
body:not(.shell-device-phone) .detail-section-title,
body:not(.shell-device-phone) .detail-album-title {
  font-size: var(--ninja-detail-body-font, 14px);
}

/* v0.0.564 — valid fixed tokens for scaled detail text. */
body:not(.shell-device-phone) .detail-meta,
body:not(.shell-device-phone) .detail-overview,
body:not(.shell-device-phone) .detail-actions button,
body:not(.shell-device-phone) .detail-section-title,
body:not(.shell-device-phone) .detail-album-title {
  font-size: var(--ninja-detail-body-font, 14px);
}
