/**
 * movie-details.css
 * Layout for the Movie Details page, including the full-screen
 * dynamic backdrop. The backdrop is fixed and sits behind the glass
 * content, at low opacity with a heavy blur so it reads as ambient
 * color rather than a distracting image — and stays readable under
 * text. It fades in on mount (anim-fade-in, GPU-friendly: only
 * opacity animates, no layout thrash) and is naturally replaced on
 * every navigation since the whole page re-renders per movie.
 */

.details-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center 20%;
  filter: blur(60px) brightness(0.5);
  opacity: 0.35;
  transform: scale(1.1); /* avoids blurred edge showing at viewport border */
  will-change: opacity;
}

.details-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.details-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  width: fit-content;
}

.details-header {
  display: flex;
  gap: var(--space-6);
}

.details-poster {
  width: 220px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-elevated);
}

.details-poster img { width: 100%; height: 100%; object-fit: cover; }

.details-title-block { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }

.details-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.details-genres {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.details-ratings {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.details-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.details-actions a, .details-actions button { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }

.details-section h3 {
  margin-bottom: var(--space-2);
}

.details-section p {
  color: var(--text-secondary);
}

.crew-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.crew-row {
  display: flex;
  gap: var(--space-2);
}

.crew-row .text-secondary { flex-shrink: 0; width: 90px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.gallery-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.inline-edit-field textarea {
  width: 100%;
  resize: vertical;
  margin-bottom: var(--space-2);
}

@media (max-width: 700px) {
  .details-header { flex-direction: column; }
  .details-poster { width: 160px; }
  .crew-row { flex-direction: column; gap: 2px; }
  .crew-row .text-secondary { width: auto; }
}
