html,
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  color: white;
  box-sizing: border-box;
}

body {
  background: #1c1c1c;
}

/* layout styling */
header,
main {
      padding: 0 2.75em;
      margin: 0 auto;
      width: 100%;
}

main {
  background: #121212;
}

/* header content styling */
header {
  background: rgba(0, 0, 0, 0.8) url("./images/THJJRUhNlEc.png") center / cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 40vh;
}

header h1 {
  margin: 0;
  font-size: 2.625rem;
}

a {
  margin-top: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
}

a:hover {
  opacity: 0.7;
  cursor: pointer;
}

/* form styling */
form {
  display: flex;
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

form input[type="search"] {
  height: auto;
  padding: 1em 2.75em 1em;
  flex: 1;
  border: none;
  border-radius: 6px 0 0 6px;
  background: #2e2e2f;
  color: gray;
}

form input[type="search"]:autofill,
input[type="search"]:-webkit-autofill {
  background: #2e2e2f;
}

input[type="search"]::placeholder {
  color: gray;
}

form button {
  padding: 0 2em;
  border-radius: 0 6px 6px 0;
  border: 1px solid #4b4b4b;
  background: #4b4b4b;
  color: #fff;
}

/* search results styling */

.film-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  padding: 2.5em 0;
}

.film-result:last-of-type {
  padding-bottom: 2.5em;
}

.film-poster {
  border-radius: 2.5px;
  height: 200px;
  width: calc(200px * 5 / 7);
}

.film-info {
  display: flex;
  flex-direction: column;
  gap: 1rem
}

.film-info p,
.film-info h2 {
    margin: 0;
}

.title-rating {
    display: flex;
    align-items: center;
    gap: 1.25em;
}

.film-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.25em;
}

.placeholder {
    height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.placeholder h3,
.placeholder img {
    opacity: 0.3;
}

.placeholder img {
    height: 75px;
    width: auto;
}

.inner-loading {
  height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* modal styling */

.film-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5em;
    width: 50vw;
    height: 50vh;
    background: #121212;
    border: 1px solid gray;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

.film-modal > img {
    justify-content: center;
    align-items: center;
    margin: 10px auto;
    border-radius: 2.5px;
    height: 40vh;
    width: calc(40vh * 5 / 7);
}

.film-modal h3 {
    text-align: center;
}

.modal-content {
    display: inline-flex;
    position: absolute;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid blue;
}

.modal-close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 0.75rem;
    background-color: transparent;
    border: 1px solid transparent;
    color: whitesmoke;
    background: #4b4b4b;
    border-radius: 50%;
    padding: 0.75em 1em;
}

/* utilities */

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.yellow {
    color: #FEC654;
}

.divider {
    border: none;
    border-top: 1.5px solid #E5E7EB;
    margin: 1.25em 0;
}

.divider:last-of-type  {
    display: none;
}

@media (min-width: 390px) {

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .film-result {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1em;
    }
}

@media screen and (min-width: 600px) {
    header, main {
      width: 600px;
    }
}
