:root {
  color-scheme: light dark;
  --accent-color: #bdae82;
  --primary-color: #22254b;
  --secondary-color: #373b69;

  --card-width: 15rem;
  --card-height: 20rem;
}

p {
  margin: 0.2rem 0;
}

html {
  width: 100%;
  background-color: var(--primary-color);
  font-size: 20px;
  color: #eee;
  overflow: hidden;
}

body {
  width: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
}

main {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  row-gap: 1rem;
  flex-grow: 1;
}

#title {
  width: inherit;
  background-color: var(--secondary-color);
  padding: 0.5rem;
}

#results {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: 1rem;
  margin-top: 1rem;
}

#total {
  font-size: 0.75rem;
  margin-top: 1rem;
  width: inherit;
  text-align: center;
}

header {
  box-sizing: border-box;
  width: 100%;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--secondary-color);
}

/* Search */
#search {
  margin: 0.5rem 1rem 0.5rem auto;
  width: 8rem;
  border-radius: 50px;
  border: 2px solid var(--primary-color);
  position: relative;
  transition: width 0.3s linear;
}
#search:has(input[name='request']:focus) {
  width: 16rem;
  background-color: var(--primary-color);
}
#search input[type='submit'] {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  box-sizing: border-box;
  width: 1.2rem;
  height: 1.2rem;
  background-image: url(./assets/search.svg);
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: none;
  cursor: pointer;
  transition: all 0.3s linear;
}
#search input[type='submit']:focus {
  border: none;
}
#search input[type='submit']:hover {
  filter: invert(26%) sepia(15%) saturate(638%) hue-rotate(7deg) brightness(92%) contrast(87%);
}
#search input[name='request'] {
  background-color: transparent;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  color: #fff;
  width: 4.5rem;
  border-radius: 50px;
  border: none;
  transition: width 0.3s linear;
}
#search input[name='request']::placeholder {
  color: #7378c5;
}
#search input[name='request']:focus {
  width: 12.5rem;
  outline: none;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  padding: 0 4rem;
  background-color: var(--secondary-color);
}

.author {
  display: flex;
  align-items: center;
  column-gap: 2rem;
}

a,
a:visited {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s linear;
}
a:hover {
  color: var(--accent-color);
}

.rss-logo {
  width: 5.4rem;
  height: 2rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url('./assets/rss.svg');
  transition: all 0.3s linear;
}
.rss-logo:hover {
  filter: invert(26%) sepia(15%) saturate(638%) hue-rotate(7deg) brightness(92%) contrast(87%);
}

/* Film card */
.card {
  position: relative;
  width: var(--card-width);
  height: calc(var(--card-height) + 3.4rem);
  background-color: var(--secondary-color);
  font-size: 0.75rem;
}
.card__poster {
  width: inherit;
  height: var(--card-height);
  background-size: cover;
}
.card__footer {
  box-sizing: border-box;
  width: inherit;
  height: 3.4rem;
  padding: 0.5rem;
}
.card__title_wrapper {
  display: flex;
  justify-content: space-between;
}
.card__title {
  font-weight: 600;
}
.card__year {
  color: var(--accent-color);
}
.card__rating {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--secondary-color);
  color: var(--accent-color);
  font-weight: 600;
  padding: 0.1rem;
}
.card__director {
  display: block;
}
