@import url("https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:wght@400;700&family=Montserrat:wght@400;700&display=swap");

:root {
  --c-light-brown: #f7f3ee;
  --c-medium-brown: #daaa63;
  --c-dark-brown: #2c1810;
  --c-white: #fff;
  --c-grey: #b0aaa7;
  --c-off-white: rgba(255, 255, 255, 0.62);
  --c-medium-dark-brown: #3f302a;
  --c-red: #b22d2d;
  --c-more-red: #da2121;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48;
}

h1 {
  font-family: "Libre Caslon Text", serif;
  font-weight: normal;
  color: var(--c-medium-dark-brown);
}

body {
  display: flex;
  justify-content: center;
}

.main-wrapper {
  font-family: "Montserrat", sans-serif;
  display: grid;
  grid-template-rows: 50px calc(100dvh - 50px - 80px) 80px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "header"
    "main"
    "footer";
  color: var(--c-medium-dark-brown);
  max-width: 480px;
  max-height: 900px;
  width: 100vw;
  height: 100vh;
}

header {
  background-color: var(--c-light-brown);
  grid-area: header;
}

.main-wrapper > section {
  background-color: var(--c-light-brown);
  /*border-radius: 0 0 50px 50px;*/
  box-shadow: 0 1em 1em -1em rgba(0, 0, 0, 0.25);
}

section.main {
  grid-area: main;
}

section.main > :not(.visible) {
  display: none;
}

footer {
  background-color: var(--c-medium-brown);
}

footer nav {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

footer nav .material-symbols-outlined {
  color: var(--c-off-white);
  font-size: 2rem;
}

footer nav .material-symbols-outlined.active,
footer nav .material-symbols-outlined:hover {
  color: var(--c-white);
  transform: scale(1.2);
}

.list-books-wrapper {
  position: relative;
}

.list-books-wrapper .books-counter {
  position: absolute;
  background-color: var(--c-more-red);
  color: var(--c-white);
  border-radius: 50%;
  padding: 1px 5px;
  font-size: 10px;
  top: -5px;
  right: -5px;
  z-index: 10;
}

input {
  border: 0;
  background-color: var(--c-white);
  border-radius: 20px;
  padding: 10px 50px;
}

.main {
  display: grid;
  overflow: auto;
}

.main section {
  visibility: hidden;
}

.main section.visible {
  visibility: visible;
}

.add-book {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 20px;
}

.add-book-bto-wrapper {
  align-self: flex-end;
}

button {
  border: 0;
  border-radius: 20px;
  padding: 10px 20px;
  background-color: var(--c-medium-brown);
}

.add-book-bto {
  color: var(--c-white);
}

.input-wrapper {
  position: relative;
}

.input-wrapper > * {
  width: 100%;
}

.input-wrapper.read {
  padding-left: 10px;
}

.input-wrapper.read input {
  width: auto;
}

.input-wrapper .material-symbols-outlined {
  position: absolute;
  padding: 10px;
  width: min-content;
  color: grey;
}

.input-wrapper input.error {
  /* this prevents borders from adding space */
  /* and pushing the content down */
  border-color: transparent;
  box-shadow: 0 0 0 1px var(--c-red);
}

.input-wrapper .error-message {
  font-size: 0.8rem;
  color: var(--c-red);
  position: absolute;
  top: 50px;
  left: 10px;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
  padding: 0 20px;
}

.list-books > h1 {
  margin-left: 30px;
}

.book-record {
  display: grid;
  grid-template-columns: 1fr 3fr;
  grid-template-areas:
    "book-record-image book-record-title"
    "book-record-image book-record-author"
    "book-record-image book-record-pages"
    "book-record-image book-record-read"
    "book-record-image book-record-actions";
  grid-column-gap: 20px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8rem;
  color: var(--c-grey);

  background-color: white;
  padding: 20px;
  border-radius: 10px;

  box-shadow: 0 3px 10px rgb(0, 0, 0, 0.2);
}

.book-record > * {
  display: flex;
  gap: 10px;
  align-items: center;
}

.book-record .material-symbols-outlined {
  font-size: 2rem;
}

.book-record .image {
  grid-area: book-record-image;
  box-shadow: 3px 3px 10px 0 rgb(0 0 0 / 25%);
}

.book-record .title {
  grid-area: book-record-title;
  font-family: "Libre Caslon Text", serif;
  text-transform: capitalize;
  color: var(--c-medium-dark-brown);
}

.book-record .author {
  grid-area: book-record-author;
}

.book-record .pages {
  grid-area: book-record-pages;
}

.book-record .actions {
  grid-area: book-record-actions;
  text-align: right;
  display: grid;
  justify-items: right;
}

.book-record .actions .delete-book {
  cursor: pointer;
}