/* Movie Modal */
/* Lock the page while any modal is up — wheel/touch must not scroll the grid
   behind it, or the page lands somewhere else on close. */
body:has(.movie-modal) {
  overflow: hidden;
}

.movie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Film-detail modal: darker, blurred backdrop so the poster grid recedes.
   Excludes .about-orbit-modal — that one keeps its orbit visible on purpose. */
.movie-modal:not(.about-orbit-modal) {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.movie-modal-content {
  position: relative;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, var(--opacity-border));
  border-radius: 0;
  max-width: 1000px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* reaching the modal's scroll edge must not hand the wheel to the page behind */
  overscroll-behavior: contain;
  transform-origin: center center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* Box wrapper (film modal): sizing lives here so the × can anchor outside the
   scroll container — it never moves while the content scrolls. */
.movie-modal-box {
  position: relative;
  max-width: 1000px;
  width: 90%;
}
.movie-modal-box > .movie-modal-content {
  width: 100%;
  max-width: none;
}

@media (max-width: 820px) {
}

/* About "Read more" — long review policy in a full-screen sheet.
   position:fixed so it escapes the fixed-size About card (keeps all 3 tabs one size). */
.about-readmore-link {
  display: inline-block;
  margin-top: var(--spacing-md);
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
  color: rgba(255, 255, 255, var(--opacity-tertiary));
  cursor: pointer;
  transition: color 0.2s ease;
}
.about-readmore-link:hover {
  color: rgba(255, 255, 255, var(--opacity-primary));
}

.about-readmore-sheet {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 20);
  background: #000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.about-readmore-sheet[hidden] {
  display: none;
}
.about-readmore-sheet-panel {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #000;
}
.about-readmore-sheet .fa-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
}
.about-readmore-sheet-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px var(--page-gutter) 96px;
}
.about-readmore-sheet-inner > :first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Sheet type = the About card system, prose one notch up for arm's-length
   reading. ONLY reading paragraphs scale — overline, collapse summaries and
   label lists keep their card sizes (a blanket `p` rule here blew the
   overline up to heading size). */
.about-readmore-sheet-inner .about-text,
.about-readmore-sheet-inner .about-text p,
.about-readmore-sheet-inner > p,
.about-readmore-sheet-inner .about-collapse p {
  font-size: var(--font-size-compact); /* smaller again for hierarchy: match the card system (13) */
  line-height: var(--line-height-relaxed);
  color: rgba(255, 255, 255, var(--opacity-secondary));
}
/* paragraph air for bare paragraphs sitting directly in the sheet — the
   .about-section/.about-text wrappers break the panel's p + p rhythm rule */
.about-readmore-sheet-inner > p {
  margin-top: var(--spacing-md);
}

/* Container is focused on open to move focus into the dialog — it must not
   draw the global 2px focus ring around the whole modal. */
.movie-modal-content:focus,
.movie-modal-content:focus-visible {
  outline: none;
}

/* × anchored to the modal box, above the scroll container: no lane, no extra
   hairline, and it stays put while the content scrolls. */
.movie-modal-box > .modal-close-icon {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: 20;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, var(--opacity-border));
  color: rgba(255, 255, 255, var(--opacity-tertiary));
  font-size: var(--font-size-lg);
  font-weight: var(--font-light);
  width: 40px;
  height: 40px;
}

.movie-modal-box > .modal-close-icon:hover {
  color: rgba(255, 255, 255, var(--opacity-primary));
  border-color: rgba(255, 255, 255, var(--opacity-subtle));
}

.movie-modal-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--spacing-xl);
  padding: var(--spacing-2xl);
}

.movie-modal-details {
  display: flex;
  flex-direction: column;
}

/* Last section drops its bottom margin so the modal's bottom gutter matches
   the 32px top/side padding instead of stacking to 56px */
.movie-modal-details > :last-child {
  margin-bottom: 0;
}

/* Poster + trailer/letterboxd/share ride together in the right column so the
   actions sit under the poster and stay visible while the text scrolls. */
.movie-modal-aside {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  width: 320px;
}

.movie-modal-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  border: 1px solid rgba(255, 255, 255, var(--opacity-border));
  border-radius: var(--border-radius);
  overflow: hidden;
  flex-shrink: 0;
}

.movie-modal-poster picture,
.movie-modal-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Same title voice as the hybrid card it opens from */
.movie-modal-title {
  font-size: var(--font-size-2xl);
  color: rgba(255, 255, 255, var(--opacity-primary));
  font-weight: var(--font-regular);
  margin-bottom: var(--spacing-sm);
  letter-spacing: var(--letter-spacing-display-tight); /* one title tracking across views */
  line-height: var(--line-height-tight);
}

.movie-modal-meta {
  font-size: var(--font-size-sm); /* meta tier: matches hybrid/gallery card meta */
  color: rgba(255, 255, 255, var(--opacity-tertiary));
  margin-bottom: var(--spacing-2xl); /* header→body break: 2x the section interval */
  line-height: var(--line-height-base);
  letter-spacing: var(--letter-spacing);
}

.movie-modal-synopsis,
.movie-modal-recommendations,
.movie-modal-trivia,
.movie-modal-vibe,
.movie-modal-tags,

/* Rhythm: TAGS then CONTENT WARNING. The flex column never collapses margins,
   so the cluster takes NO top margin — the prose section above already supplies
   the lg (24px) gap. Inside the cluster, CW rides tight under tags. */
.movie-modal-warnings,
.movie-modal-tags {
  margin-top: 0;
  margin-bottom: var(--spacing-lg);
}

.movie-modal-tags + .movie-modal-warnings {
  margin-top: 0;
}

/* expanded tag chips sit under the ▸ TAGS toggle, matching the CW list gap */
.movie-modal-tags .tag-list {
  margin-top: var(--spacing-sm);
}

.movie-modal-synopsis strong,
.movie-modal-recommendations strong,
.movie-modal-trivia strong,
.movie-modal-vibe strong {
  font-weight: var(--font-regular);
  color: rgba(255, 255, 255, var(--opacity-tertiary)); /* eyebrow tier — matches TAGS / CW toggles */
  display: block;
  margin: 0 0 var(--spacing-sm);
  text-transform: uppercase;
  font-size: var(--font-size-sm); /* eyebrow tier: 12px everywhere */
  letter-spacing: var(--letter-spacing-label);
  line-height: var(--line-height-base);
}

.movie-modal-synopsis p,
.movie-modal-recommendations p,
.movie-modal-trivia p,
.movie-modal-vibe p {
  margin: 0;
  line-height: var(--line-height-relaxed); /* one body rhythm across views */
  color: rgba(255, 255, 255, var(--opacity-secondary));
  font-size: var(--font-size-base);
  letter-spacing: var(--letter-spacing-body);
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* reading measure — full-width lines read as crowding at modal width */
  max-width: 62ch;
}

.trailer-button {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-medium);
  letter-spacing: var(--letter-spacing-body);
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, var(--opacity-border));
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
  border-radius: var(--border-radius);
}

.trailer-button:hover {
  background: rgba(255, 255, 255, var(--opacity-border));
  border-color: rgba(255, 255, 255, var(--opacity-tertiary));
  color: #ffffff;
}
