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

body {
  overflow: hidden;
  background-color: #333;
}

header {
  height: 144px;
  background-color: #111;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow: 0px 0px 4px 2px black;
  position: relative; /*Allows us to use box-shadow*/
  gap: 6px;
}

header #add-book {
  border: none;
  background-color: #cc9;
  color: white;
  font-size: 1.2rem;
  padding: 12px 24px;
  border-radius: 100px;
}

.padding-wrapper {
  padding-bottom: 240px;
}

.main-container {
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  max-width: 1200px;
  overflow-y: auto;
}

#library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  padding: 24px;
  height: calc(100dvh - 206px);
}

.book {
  max-height: 440px;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #ffe;
  border-radius: 1px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  text-align: center;
  padding: 0px 12px 24px 12px;
  border-left: 8px #cc9 solid;
}

.book .top-row {
  display: flex;
  justify-content: end;
}

.book .bottom-info {
  display: flex;
  justify-content: space-around;
  color: gray;
  margin-top: 24px;
  font-size: 0.8rem;
}

.book .title {
  font-weight: bold;
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.book .author {
  font-style: italic;
  font-size: 1.2rem;
}

.book .close {
  margin-top: 8px;
  color: white;
  line-height: 0;
  width: 16px;
  height: 16px;
  border: none;
  background-color: #cc9;
  border-radius: 50%;
}

.book .close:hover,
.book .read:hover {
  cursor: pointer;
}

.dialog-container {
  display: none;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  position: absolute;
  background-color: rgba(0, 0, 0, 0.7);
}

dialog:open {
  margin: auto;
  padding: 24px;
  border-radius: 18px;
  border: none;
}

form {
  display: grid;
  gap: 16px 0px;
  grid-template-columns: 1fr 2fr;
  justify-items: start;
}

#button-row {
  grid-column: 2 / 3;
  padding-top: 12px;
  justify-self: end;
}

#button-row button {
  border: none;
  background-color: #cc9;
  color: white;
  border-radius: 100px;
  font-size: 1.1rem;
  padding: 6px 12px;
  margin-left: 12px;
}

.info {
  display: flex;
  width: 100%;
  justify-content: center;
  position: absolute;
  bottom: 0;
  text-align: right;
  color: #cc9;
  gap: 6px;
  padding: 24px;
  font-size: 0.8rem;
  opacity: 50%;
  z-index: 1;
}

.info a:link,
.info a:visited {
  font-style: italic;
  font-weight: bold;
  color: #cc9;
}

input:invalid {
  outline: 1px solid red;
  background-color: rgba(255, 60, 60, 0.2);
  /* background-color: salmon; */
}

@media (max-width: 512px) {
  #library {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
  }

  .book {
    height: 240px;
    width: 160px;
  }


.book .title {
  font-size: 1.4rem;
}

.book .author {
  font-size: 1rem;
}
}
