/* ---------- CUSTOM PROPERTIES --------------- */

:root {
  /* Add colors */
  --cl-header-bg: 0, 0%, 5%;
  --cl-main-bg: 0, 0%, 7%;
  --cl-text: 0, 0%, 100%;
  --cl-input-bg: 240, 1%, 18%;
  --cl-input-text: 0, 0%, 65%;
  --cl-btn-search-bg: 0, 0%, 29%;
  --cl-btn-add-hover: 40, 99%, 66%;
  --cl-btn-remove-hover: 355, 78%, 56%;
  --cl-bottom-line: 220, 13%, 91%;
  --cl-label-title: 240, 1%, 18%;
  --cl-label-title-problem: 0, 0%, 47%;
}

/* RESET */
/* CSS Reset https://andy-bell.co.uk/a-modern-css-reset/ */

*,
*::after,
*::before {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

/* Set up body */
body {
  color: hsl(var(--cl-text));
  background-color: hsl(var(--cl-main-bg));
  font-family: "Inter", sans-serif;
  font-weight: 400;
}

/* Make images easier to work with */
img {
  display: block;
  object-fit: cover;
}

/* ---------------- UTILITY CLASSES ------------------*/

.container {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
}

/* -------------- TYPOGRAPHY ------------------ */

h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -2px;
  text-transform: uppercase;
}

@media (width > 34rem) {
  h1 {
    line-height: 0.6;
  }
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.1;
}

@media (width > 34rem) {
  h3 {
    font-size: 1.125rem;
    line-height: 1.1;
  }
}

p {
  font-size: 0.875rem;
  line-height: 1.4;
}

@media (width > 27rem) {
  p {
    font-size: 0.75rem;
    line-height: 1.6;
  }
}

.label__title,
.label__title--problem {
  font-weight: 700;
}

.movie__genre {
  text-align: center;
}

.movie__description {
  font-size: 0.875rem;
  line-height: 1.2;
}

@media (width > 27rem) {
  .movie__description {
    line-height: 1.4;
  }
}

/* --------------- LINKS ------------------- */

a {
  color: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

@media (width > 34rem) {
  a {
    font-size: 0.875rem;
    line-height: 1.7;
  }
}

.header__link--my-watchlist:hover,
.header__link--my-watchlist:focus-visible,
.header__link--search-list:hover,
.header__link--search-list:focus-visible {
  padding: 0.675rem;
  margin: -0.675rem;
  border-radius: 0.5rem;
  color: hsl(var(--cl-main-bg));
  background-color: hsl(var(--cl-text));
}

/* ---------------- BUTTONS -------------------- */

button {
  font-family: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

.button--search {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 2;
  background-color: hsl(var(--cl-btn-search-bg));
  padding: 0.5rem 1rem;
}

@media (width > 22.5rem) {
  .button--search {
    font-size: 0.875rem;
    line-height: 1.7;
    padding: 0.375rem 2.125rem 0.375rem 2.4375rem;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
  }
}

.button--search:hover,
.button--search:focus-visible {
  color: hsl(var(--cl-btn-search-bg));
  background-color: hsl(var(--cl-text));
}

.button--add,
.button--remove {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.6;
}

.button--add:hover,
.button--add:focus-visible {
  color: hsl(var(--cl-btn-add-hover));
  text-decoration: underline;
}

.button--remove:hover,
.button--remove:focus-visible {
  color: hsl(var(--cl-btn-remove-hover));
  text-decoration: underline;
}

/* ----------------- INPUTS -------------------- */

input {
  color: hsl(var(--cl-input-text));
  background-color: inherit;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.7;
  border: none;
  max-width: 70%;
}

@media (width > 22.5rem) {
  input {
    max-width: none;
  }
}

.search-bar__input {
  display: flex;
  background-color: hsl(var(--cl-input-bg));
  width: 100%;
  padding: 0.75rem 0;
}

@media (width > 22.5rem) {
  .search-bar__input {
    padding: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
  }
}

.input__icon {
  padding: 0.375rem 0.5rem;
}

@media (width > 22.5rem) {
  .input__icon {
    padding: 0.625rem 0.5rem 0.625rem 1rem;
  }
}

/* ¨------------ IMAGES ------------------- */

.movie-card__poster {
  display: none;
}

@media (width > 27rem) {
  .movie-card__poster {
    display: block;
    width: 6.25rem;
    height: 9.125rem;
  }
}

/* ------------- LAYOUT ------------------- */

.header__container {
  position: relative;
  background-image: url("./images/header_bg.jpg");
  background-size: cover;
  background-position: 0px -7rem;
  background-color: hsl(var(--cl-header-bg));
  text-align: center;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2.5rem;
  padding: 5rem 2.5rem;
}

@media (width > 34rem) {
  .header__container {
    background-position: 0px -15rem;
    justify-content: space-between;
  }
}

.header__container::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: hsl(var(--cl-header-bg), 0.85);
  z-index: 0;
}

.header__container--watchlist {
  flex-direction: column;
  padding: 3.5rem 2.5rem;
}

@media (width >= 36rem) {
  .header__container--watchlist {
    flex-direction: row;
  }
}

@media (width >= 36rem) {
  .header__container,
  .header__container--watchlist {
    padding: 5.125rem 2.875rem 4.875rem 2.625rem;
  }
}

.header__title,
.header__link--my-watchlist,
.header__link--search-list {
  z-index: 1;
}

.search-bar {
  max-width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -1.125rem 0;
}

@media (width > 22.5rem) {
  .search-bar {
    padding: 0 2.75rem;
  }
}

.movies__container {
  background-color: hsl(var(--cl-main-bg));
  padding: 1.375rem 2.75rem 0;
}

.movies__container--label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 70vh;
}

.label__title,
.label__title--problem {
  color: hsl(var(--cl-label-title));
}

.label__title--problem {
  color: hsl(var(--cl-label-title-problem));
  width: 75%;
  text-align: center;
}

.movie-card {
  display: flex;
  padding: 1.5rem 0;
  border-bottom: 1.5px solid hsl(var(--cl-bottom-line));
}

.movie-card__info {
  display: grid;
  padding: 0;
  row-gap: 0.5rem;
}

@media (width > 27rem) {
  .movie-card__info {
    padding: 0 1.375rem;
    row-gap: 0;
  }
}

.info__grid-row-1,
.info__grid-row-2 {
  display: grid;
  grid-column: 1 / 3;
}

.info__grid-row-1 {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.movie__title {
  grid-column: 1;
}

.movie__rating {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 0.25rem;
  grid-column: 2;
}

.info__grid-row-2 {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.movie__genre {
  justify-self: center;
  grid-column: 2;
}

.button--add {
  justify-self: end;
  grid-column: 3;
}

.movie__description {
  grid-column: 1 / 4;
}
