/* shared by the movies & tv, music and games pages (and their movie / album / game pages) */

.movies-main {
  width: 100%;
  max-width: 1000px;
}

.movies-main > div > a:first-child {
  display: inline-block;
  margin-bottom: 12px;
  color: #444;
  font-weight: 600;
  text-decoration: none;
}

.movies-main > div > a:first-child:hover {
  color: black;
}

/* poster / cover grids */

.movie-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

.movie-tile {
  color: inherit;
  text-decoration: none;
}

.movie-tile img,
.poster-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  background: #eee;
}

.movie-tile h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
}

.movie-tile:hover h3 {
  text-decoration: underline;
}

.movie-meta {
  color: #666;
  font-size: 0.9rem;
}

/* the top of a movie / album / game page */

.movie-hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.movie-hero img {
  width: 180px;
  border-radius: 3px;
}

.movie-hero h1 {
  margin-top: 0;
}

/* buttons: black for a form's main action, outlined for everything else */

.movie-form button,
.movie-hero button,
#moreMovies,
#morePosts,
.music-more,
.game-more,
.music-section-heading button {
  padding: 9px 16px;
  border: 1px solid black;
  border-radius: 3px;
  background: white;
  color: black;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.movie-form button:not([type='button']) {
  align-self: flex-start;
  background: black;
  color: white;
}

.movie-hero button {
  margin: 4px 6px 4px 0;
  padding: 7px 12px;
  font-size: 0.9rem;
}

/* "add to favorites" shows as filled once it's on */
.movie-hero button[aria-pressed='true'] {
  background: black;
  color: white;
}

.movie-form button:disabled,
.movie-hero button:disabled,
#moreMovies:disabled,
#morePosts:disabled,
.music-more:disabled,
.game-more:disabled {
  opacity: 0.5;
  cursor: default;
}

#moreMovies,
#morePosts,
.music-more,
.game-more {
  display: block;
  margin: 20px auto;
}

#moreMovies[hidden],
#morePosts[hidden],
.music-more[hidden],
.game-more[hidden] {
  display: none;
}

/* reviews, status and post forms */

.movie-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid #e3e3e3;
}

.movie-form h2 {
  margin: 0;
  font-size: 1.1rem;
}

.movie-form label {
  font-weight: 600;
}

.movie-form textarea {
  min-height: 90px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font: inherit;
}

.movie-form select {
  align-self: flex-start;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: white;
  font: inherit;
}

.review-rating {
  margin-top: 12px;
  color: #c58c00;
  font-size: 1.15rem;
}

.review-rating span {
  color: #777;
  font-size: 0.8rem;
}

.review-locked {
  padding: 16px;
  border: 1px solid #e3e3e3;
  border-radius: 3px;
  background: #fafafa;
}

/* the community feed under each page */

.movie-community {
  max-width: 680px;
  margin: 32px auto 0;
}

.movie-discussion {
  padding: 16px 0;
  border-top: 1px solid #e3e3e3;
}

.movie-discussion p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-post {
  cursor: pointer;
}

.timeline-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.timeline-name {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.timeline-post time {
  color: #888;
  font-size: 0.75rem;
}

.timeline-post .username {
  display: block;
  text-decoration: none;
}

.timeline-post .post-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-like,
.timeline-replies {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* TMDB asks for this credit on pages that use its data */

.movie-attribution {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e3e3e3;
  color: #666;
  font-size: 0.8rem;
}

.movie-attribution img {
  display: block;
  width: 110px;
  margin-bottom: 8px;
}

.movie-attribution p {
  margin: 0;
}

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

@media (max-width: 600px) {
  .movie-hero {
    flex-direction: column;
  }

  .movie-hero img {
    width: 140px;
  }

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