:root {
  --primary-color: #2c3e50;
  --accent-color: #e67e22;
  --text-color: #333;
  --bg-color: #fafafa;
  --max-width: 1200px;
}

html {
    font-size: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text-color);
  background: #f9f9f9;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
}


a:hover {
  color: #c70039;
  text-decoration: none;
}

.arrow-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 95%;
  padding: 1rem;
  margin-left: auto;
  margin-right: auto;
}

.arrow {
  font-size: 2rem;
  color: rgba(0, 0, 0, 0.4);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}

.arrow:hover {
  color: rgba(0, 0, 0, 0.9);
}

/* Optional movement effect on hover */
.left-arrow:hover {
  transform: translateX(-5px);
}

.right-arrow:hover {
  transform: translateX(5px);
}

.previous-next {
    font-size: .75rem;
}

.web-attributes__rating-descriptor {
            display: inline-flex;
            white-space: nowrap;
            }
            
        .web-attributes__rating {
            align-items: center;
            display: flex;
            margin-top: -1px;
            border: #f9f9f9 1px solid;
            }
        
        .web-attributes__rating-badge {
            border-radius: 3px;
            font-family: Inter,Helvetica Neue,sans-serif;
            font-size: 13px;
            font-weight: 900;
            letter-spacing: 0;
            line-height: 16px;
            padding: 0 6px;
            }
            
        
hr {
  display: block;
  width: 90%;
  margin: 2em auto;
  border-style: inset;
  border-width: 1px;
}

body {
      font-family: Arial, sans-serif;
      margin: 0;
      background-color: #f9f9f9;
      color: #333;
    }
    
    img {
      max-width: 100%;
      height: auto;
      margin-bottom: 1rem;
    }
    .backdrops img {
      width: 48%;
      margin: 1%;
    }

    h1 {
        font-size: 2.5rem;
    }
    h2 {
      margin-top: 1.5rem;
    }
    

.poster-div {
    display: flex;
    height: 90%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.thumb-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: center;
      /* force the flex box to be only as wide as its contents: */
        width: -webkit-fit-content; /* Chrome/Safari */
  width: fit-content;         /* Firefox/modern browsers */

  margin: 2rem auto;      /* center that narrower “fit-content” box */
    }

    .thumb-grid img {
      width: 22%;
      cursor: pointer;
      border: 2px solid #ccc;
      border-radius: 4px;
      transition: transform 0.2s;
      justify-content: center;
    }

    .thumb-grid img:hover {
      transform: scale(1.03);
      border-color: #888;
    }

    .divider-span {
        text-decoration: none;
    }

    /* Modal */
    .modal {
      position: fixed;
      z-index: 1000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.8);
      align-items: center;
      justify-content: center;
    }

    .modal.open {
      display: flex;
    }

    .modal-content {
      position: relative;
      overflow: visible;
      max-width: 90%;
      max-height: 90%;
    }

    .modal-content img {
      width: 100%;
      height: auto;
      border-radius: 6px;
      max-height: 90vh;
      object-fit: contain;
    }

    .modal-close {
      position: absolute;
      top: -10px;
      right: -10px;
      font-size: 28px;
      background: #fff;
      border-radius: 50%;
      padding: 0 10px;
      cursor: pointer;
      border: 2px solid #444;
    }

.site-footer {
  background-color: #222;
  color: #fff;
  padding: 2rem 1rem;
  font-family: Arial, sans-serif;
  font-size: 0.9em
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column h3,
.footer-column h4 {
  margin-bottom: 0.75rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin: 0.4rem 0;
}

.footer-column a {
  color: #ddd;
  text-decoration: none;
}

.footer-column a:hover {
  color: #fff;
  text-decoration: underline;
}

.social-icons a {
  display: inline-block;
  line-height: 1;
  margin-right: 0.5rem;
  font-size: 1.5rem;
  color: #ddd;
}

.social-icons a:hover {
  color: #fff;
}

.footer-disclaimer {
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.header-info {
  display: block;
  color: white;
  text-align: center;
  margin: 0 auto;
}

main {
  display: inline;
  flex: 1;
  width: 90%;
  max-width: var(--max-width);
  margin: 2rem auto;
}

.poster {
  display: block;
  max-width: 300px;
  height: auto;
  box-shadow: 2.7px 5.4px 5.4px hsl(0deg 0% 0% / 0.42);
  margin-top: auto;
  margin-bottom: auto;
  margin-left: auto;
  margin-right: auto;
}

.images-div {
  display: flex;
  flex-wrap: wrap;
  max-width: 90%;
  gap: 1rem;
  align-items: flex-start;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
}

.details-container {
  flex: 1;
  min-width: 260px;
  max-width: 600px;
  margin: auto;

}

.infodiv {
  display: block;
  width: 85%;
  margin: 0 auto;
}

.movie-description {
  width: 90%;
  text-indent: 2%;
  margin: 0 auto;


}
.plot-cast-heading-container,
.cast-crew-heading {
  display: block;
  width: 100%;
  margin: 0 auto;
  padding-left: 1rem;
  box-sizing: border-box;
}

.plot-cast-heading {
  text-align: left;
  margin-bottom: 10px;
}

.watch-div {
    width: 85%;
    
}

.watch-heading-div {
    width: 87%;
    margin-left: auto;
    margin-right: auto;
}

.watch-links {
  width: 85%;
  max-height: 30px;
  margin: 0 auto;
}

.nav-links {
  text-align: center;
  margin: 1.5rem 0;
  text-decoration: none;
}
.nav-links a {
  margin: 0 0.5rem;
  text-decoration: none;
}
.link-separator {
  color: var(--text-muted);
}

.trailer-wrapper {
    max-height: 75%;
    text-align: center;
}

.trailer-wrapper-wc {
    max-width: 50%;
    text-align: center;
}

.trailer-wc {
    margin-left: auto;
    margin-right: auto;
}

/* Trailer styling fix */
.trailerdiv {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.trailerdiv iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Manual trailer fallback */
.manual-trailer {
  max-width: 800px;
  margin: 0 auto;
}
.manual-trailer iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

/* Grid layout */
.thumbnail-wrapper {
    max-width: 87%;
  text-align: center;   
  margin-left: auto;
  margin-right: auto;
}

.thumbnail-grid {
  display: flex;          /* block-level flex container */
  flex-wrap: wrap;
  justify-content: center;/* center the images inside the grid */
  gap: 1rem;

  /* force the flex box to be only as wide as its contents: */
  width: -webkit-fit-content; /* Chrome/Safari */
  width: fit-content;         /* Firefox/modern browsers */

  margin: 2rem auto;      /* center that narrower “fit-content” box */
}


.thumbnail-grid img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform .2s;
}
.thumbnail-grid img:hover {
  transform: scale(1.03);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal.open {
  display: flex;
}
.modal-content {
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  position: relative;
}
.modal-content img {
  display: block;
  max-width: 100%;
  max-height: 80vh;  /* never exceed 80% of the viewport height */
  width: auto;
  height: auto;
}

.modal-close {
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  background: rgba(255,255,255,0.9);
  padding: 0.3rem 0.7rem;
}

/* Movie cards */
.movie-grid {
  display: grid;
  gap: 1.5rem;
  /* make each column exactly 250px, fit as many as you can, wrap the rest */
  grid-template-columns: repeat(auto-fit, 250px);
  /* center the grid within its container when there’s extra space */
  justify-content: center;
  margin: 0 auto;
}

.movie-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.movie-card img {
      display: block;
  max-height: 250px;
  width: auto;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
}
.movie-card h2 {
  font-size: 1.1rem;
  text-align: center;
  margin: 0.75rem;
  color: var(--primary-color);
}
.movie-card a {
  text-decoration: none;
  color: inherit;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .images-div {
    flex-direction: column;
    align-items: center;
  }

  .details-container {
       flex: 1;
  min-width: 260px;
  max-width: 600px;
  margin: auto;
  align-self: flex-start; /* ensures this block sticks to top */
  }

  .movie-description,
  .infodiv {
    padding: 0 1rem;
    max-width: 100%;
    align-items: start;
    margin-left: auto;
    margin-right: auto;
  }

  .movie-card img {
    width: 80px;
  }
}
