/* PelisVidHD · página de detalle (/pelicula/.. y /serie/..)
   Mismos valores visuales que el player (logo, pestañas, reparto, episodios, trailer),
   como reglas propias para no chocar con el CSS del inicio que ya carga la página. */

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 4vw 10px;
  max-width: 900px;
  margin: 0 auto;
}

.detail-backdrop {
  position: fixed;
  inset: 0 0 auto 0;
  height: 70vh;
  z-index: -1;
  background-size: cover;
  background-position: center top;
  opacity: .35;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 90%);
}

.detail-poster {
  width: 140px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px #0009;
  margin-bottom: 18px;
}

.detail-logo {
  max-width: min(420px, 80vw);
  max-height: 110px;
  object-fit: contain;
  margin-bottom: 10px;
}

.detail-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -.7px;
  line-height: 1.1;
  margin-bottom: 10px;
}

/* Cuando hay logo, el <h1> sigue en el HTML para SEO y lectores de pantalla, pero no se ve */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.detail-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.detail-meta span + span::before { content: " · "; }

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-genres span {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: #ccc;
}

.detail-overview {
  color: #ddd;
  font-size: 14px;
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 22px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.detail-actions a.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 44px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.detail-actions a.primary {
  background: rgb(var(--dyn));
  color: #fff;
}

.detail-actions a.secondary {
  background: #ffffff10;
  border: 1px solid var(--line);
  color: #fff;
}

/* Datos: presupuesto, ingresos, país, idioma, productoras... */
.detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  max-width: 1000px;
  margin: 0 auto 36px;
  padding: 0 4vw;
}

.detail-info .card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .02);
}

.detail-info .card small {
  display: block;
  margin-bottom: 5px;
  color: #6f6f6f;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.detail-info .card span {
  display: block;
  color: #ddd;
  font-size: 12.5px;
  line-height: 1.4;
}

/* Plataformas donde está disponible (TMDB watch/providers) */
.detail-providers {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0 4vw;
}

.detail-providers h2,
.detail-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.detail-providers .logos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-providers .logos img {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--line);
}

/* Secciones que carga JS (trailer, reparto, episodios) */
.detail-section {
  max-width: 1000px;
  margin: 0 auto 44px;
  padding: 0 4vw;
}

.detail-section .empty-section {
  color: #777;
  font-size: 13px;
  padding: 18px 0;
}

.trailer-box {
  width: min(900px, 100%);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #000;
}

.trailer-box iframe {
  width: 100%;
  height: 100%;
}

.cast-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.cast-card {
  flex: 0 0 125px;
  scroll-snap-align: start;
}

.cast-card img {
  width: 125px;
  height: 162px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.cast-card .name {
  margin-top: 8px;
  color: #eee;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.cast-card .role {
  margin-top: 2px;
  color: #6f6f6f;
  font-size: 11px;
  line-height: 1.25;
}

/* Temporadas y episodios */
.season-select {
  margin-bottom: 14px;
}

.season-select select {
  background: #ffffff0d;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-row {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff08;
  text-decoration: none;
  color: inherit;
  transition: transform .25s var(--ease), border-color .25s;
}

.episode-row:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--dyn) / .45);
}

.ep-thumb {
  position: relative;
  flex: 0 0 160px;
  max-width: 160px;
  aspect-ratio: 16 / 9;
  align-self: flex-start;
  overflow: hidden;
  border-radius: 10px;
  background: #101010;
}

.ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-body {
  flex: 1;
  min-width: 0;
}

.ep-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
}

.ep-meta {
  margin-top: 5px;
  font-size: 11.5px;
  color: #a8a8a8;
}

.ep-overview {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #8f8f8f;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 760px) {
  .detail-poster { width: 110px; }
  .detail-logo { max-height: 80px; }
  .ep-thumb { flex-basis: 110px; max-width: 110px; }
  .cast-card { flex-basis: 100px; }
  .cast-card img { width: 100px; height: 130px; }
}
