/* CSS Reset */
/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  font: inherit;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

#root,
#__next {
  isolation: isolate;
}

input[type=submit],
input[type=reset],
input[type=button],
button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: normal;
  overflow: visible;
  padding: 0;
  -moz-appearance: button;
  appearance: button;
  -webkit-appearance: button; /* for input */
  user-select: none;
  -webkit-user-select: none; /* for button */
  -moz-user-select: none;
  -ms-user-select: none;
}

input::-moz-focus-inner,
button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* Make `a` like a button */
[role=button] {
  color: inherit;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  white-space: pre;
  -moz-appearance: button;
  appearance: button;
  -webkit-appearance: button; /* for input */
  user-select: none;
  -webkit-user-select: none; /* for button */
  -moz-user-select: none;
  -ms-user-select: none;
}

:root {
  --fs-900: 3.75rem;
  --fs-800: 2.25rem;
  --fs-700: 1.75rem;
  --fs-600: 1.125rem;
  --fs-500: 1.125rem;
  --fs-400: 1rem;
  --fs-300: 0.925rem;
  --fs-200: 0.875rem;
}

@media (width > 768px) {
  :root {
    --fs-900: 3.75rem;
    --fs-800: 3rem;
    --fs-700: 1.75rem;
    --fs-600: 1.3125rem;
    --fs-500: 1.125rem;
    --fs-400: 1rem;
    --fs-300: 0.925rem;
    --fs-200: 0.875rem;
  }
}
:root {
  --size-1: 0.25rem;
  --size-2: 0.5rem;
  --size-3: 0.75rem;
  --size-4: 1rem;
  --size-5: 1.25rem;
  --size-6: 1.5rem;
  --size-7: 1.75rem;
  --size-8: 2rem;
  --size-9: 2.25rem;
  --size-10: 2.5rem;
  --size-11: 2.75rem;
  --size-12: 3rem;
  --size-13: 3.25rem;
  --size-14: 3.5rem;
  --size-15: 3.75rem;
  --size-16: 4rem;
  --size-17: 4.25rem;
  --size-18: 4.5rem;
  --size-19: 4.75rem;
  --size-20: 5rem;
  --size-21: 5.25rem;
  --size-22: 5.5rem;
  --size-23: 5.75rem;
  --size-24: 6rem;
  --size-25: 6.25rem;
  --size-26: 6.5rem;
  --size-27: 6.75rem;
  --size-28: 7rem;
  --size-29: 7.25rem;
  --size-30: 7.5rem;
}

.container {
  --_max-size: 1280px;
  width: min(100% - 4rem, var(--_max-size));
  margin-inline: auto;
}
.container--small {
  --_max-size: 1028px;
}

/* Required for Google Icons : Default font size = 24px */
body[data-theme=light] {
  --text: hsl(60, 20%, 1%);
  --background: hsl(0, 0%, 100%);
  --primary: hsl(80, 2%, 30%);
  --secondary: hsl(90, 2%, 82%);
  --accent: hsl(90, 2%, 42%);
  --danger: hsl(347, 90%, 96%);
  --text-value: 60, 20%, 1%;
  --background-value: 0, 0%, 100%;
  --primary-value: 80, 2%, 30%;
  --secondary-value: 90, 2%, 82%;
  --accent-value: 90, 2%, 42%;
  --danger-value: 347, 90%, 96%;
}

body[data-theme=dark] {
  --text: hsl(216, 33%, 97%);
  --background: hsl(240, 19%, 5%);
  --primary: hsl(219, 97%, 38%);
  --secondary: hsl(219, 30%, 9%);
  --accent: hsl(218, 30%, 49%);
  --danger: hsl(348, 86%, 43%);
  --text-value: 216, 33%, 97%;
  --background-value: 240, 19%, 5%;
  --primary-value: 219, 97%, 38%;
  --secondary-value: 219, 30%, 9%;
  --accent-value: 218, 30%, 49%;
  --danger-value: 348, 86%, 43%;
}

.button {
  padding: var(--size-2);
  background-color: var(--background);
  color: var(--text);
}
.button--primary {
  background-color: var(--primary);
  color: var(--background);
}
.button--danger {
  background-color: var(--danger);
  color: 348, 86%, 43%;
}
.button--secondary {
  background-color: var(--secondary);
}
.button--center {
  display: flex;
  justify-content: center;
  align-items: center;
}

body[data-theme=dark] .button--primary {
  color: var(--text);
}
body[data-theme=dark] .button--accent {
  background-color: var(--accent);
  color: var(--background);
}
body[data-theme=dark] .button--danger {
  color: var(--text);
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--background);
  color: var(--text);
}

.header {
  background-color: var(--secondary);
  padding-block: var(--size-8);
}
.header--wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header__logo {
  display: flex;
  align-items: center;
  gap: var(--size-4);
}
.header__logo_img {
  height: 3rem;
  aspect-ratio: 1;
}
@media (width > 768px) {
  .header__logo_img {
    height: 5rem;
  }
}
.header__logo_title {
  font-size: var(--fs-700);
  font-weight: 900;
}
@media (width > 768px) {
  .header__logo_title {
    font-size: var(--fs-900);
  }
}
.header__theme {
  border: 1px solid var(--text);
  border-radius: var(--size-1);
  background-color: var(--background);
  font-size: var(--size-6);
}

.main__header--wrapper {
  display: flex;
  gap: var(--size-4);
  padding-block: var(--size-4);
  flex-direction: column;
  align-items: center;
  border-bottom: 2px solid var(--text);
}
@media (width > 768px) {
  .main__header--wrapper {
    position: relative;
    flex-direction: row;
    justify-content: space-between;
    padding-block: var(--size-8);
  }
}
.main__heading {
  font-size: var(--fs-700);
  font-weight: 700;
}
@media (width > 768px) {
  .main__heading {
    font-size: var(--fs-500);
  }
}
.main__buttons {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  flex-wrap: wrap;
  flex: 0 0 auto;
  font-size: var(--size-4);
}
.main__buttons .buttons__sort {
  display: grid;
  grid-auto-flow: column;
  gap: 0.125rem;
  border-radius: var(--size-2);
  flex-grow: 1;
  order: 1;
}
@media (width > 768px) {
  .main__buttons .buttons__sort {
    order: 0;
  }
}
.main__buttons .buttons__sort .button:first-child {
  border-radius: var(--size-2) 0 0 var(--size-2);
  padding-right: var(--size-2);
}
.main__buttons .buttons__sort .button:last-child {
  padding-left: var(--size-2);
  border-radius: 0 var(--size-2) var(--size-2) 0;
}
.main__button {
  height: 3rem;
  padding: var(--size-4);
  border-radius: var(--size-2);
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.main__button:hover {
  outline: 1px solid var(--text);
}
.main__addnew {
  display: flex;
  align-items: center;
  gap: var(--size-2);
}
.main__books--wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--size-8);
  padding-block: var(--size-8);
}
@media (width > 768px) {
  .main__books--wrapper {
    grid-auto-rows: 1fr;
  }
}
.main__warning {
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(600px, 90%);
  border: 2px solid var(--text);
  border-radius: var(--size-4);
  background-color: var(--background);
  color: var(--text);
}
.main__warning::-webkit-backdrop {
  background-color: hsla(0, 0%, 100%, 0.5);
}
.main__warning::backdrop {
  background-color: hsla(0, 0%, 100%, 0.5);
}
.main__warning_text {
  text-align: center;
  font-size: var(--fs-700);
  padding-block: var(--size-8);
  border-bottom: 2px solid var(--text);
}
.main__warning_buttons {
  margin-top: var(--size-8);
  display: flex;
  gap: var(--size-4);
  justify-content: center;
  font-size: var(--size-5);
}
@media (width > 415px) {
  .main__warning_buttons {
    justify-content: flex-end;
  }
}
.main__warning_buttons > * {
  padding: var(--size-5);
  width: var(--size-30);
  border-radius: var(--size-2);
}
.main__warning_buttons > *:focus, .main__warning_buttons > *:hover {
  outline: 1px solid var(--text);
}

.book {
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
  padding: var(--size-5);
  border-radius: var(--size-3);
  border: 1px solid var(--text);
  box-shadow: var(--size-1) var(--size-1) var(--size-2) hsla(var(--text-value), 0.15);
  font-size: var(--fs-500);
}
@media (width > 768px) {
  .book {
    padding: var(--size-8);
  }
}
.book__title {
  font-size: var(--size-6);
  font-weight: 700;
}
.book__title::before {
  content: open-quote;
}
.book__title::after {
  content: close-quote;
}
@media (width > 768px) {
  .book__title {
    font-size: var(--fs-700);
  }
}
@media (width > 768px) {
  .book__author {
    margin-top: auto;
  }
}
.book__author::before {
  content: "By ";
}
.book__pages::after {
  content: " pages";
}
.book__read {
  align-self: flex-end;
  display: flex;
  align-items: center;
}
.book__read input {
  scale: 0;
  opacity: 0;
}
.book__read input:checked ~ label {
  background-color: greenyellow;
}
.book__read input:checked ~ label::after {
  translate: calc(var(--_button-size) / 2);
}
.book__read label {
  cursor: pointer;
  display: inline-block;
  position: relative;
  z-index: 3;
  border: 1px solid var(--text);
  border-radius: 100vh;
  --_button-size: 3rem;
  width: var(--_button-size);
  height: calc(var(--_button-size) / 2);
  background-color: transparent;
}
.book__read label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 1.5rem;
  aspect-ratio: 1;
  background-color: var(--text);
  border-radius: 50%;
  transition: translate 250ms ease;
}
.book__button {
  padding-block: var(--size-4);
  border-radius: var(--size-2);
}
.book__button:hover {
  outline: 1px solid var(--text);
}

.newBook {
  position: fixed;
  z-index: 5;
  inset: 0;
  background-color: var(--background);
  transition: scale 350ms ease;
}
@media (width > 768px) {
  .newBook {
    position: absolute;
    inset: auto;
    top: calc(100% - var(--size-5));
    right: 0;
    border-radius: var(--size-3);
    border: 1px solid var(--text);
    transform-origin: right top;
    overflow: hidden;
  }
}
.newBook__heading {
  text-align: center;
  font-size: var(--fs-800);
  padding-block: var(--size-5);
  border-bottom: 2px solid var(--text);
  margin-top: 25%;
}
@media (width > 768px) {
  .newBook__heading {
    margin-top: auto;
    font-size: var(--fs-700);
  }
}
.newBook__form {
  padding: var(--size-6);
  display: grid;
  gap: var(--size-6);
  font-size: var(--fs-600);
}
@media (width > 768px) {
  .newBook__form {
    font-size: var(--fs-500);
  }
}
.newBook__inputGroupLine {
  position: absolute;
  height: 2px;
  background: var(--text);
  transition: translate 250ms ease;
  left: 0;
  width: 100%;
  top: 100%;
}
.newBook__inputGroup:not(:last-of-type) {
  display: grid;
  position: relative;
}
.newBook__inputGroup:last-of-type {
  display: flex;
  justify-content: space-between;
}
.newBook__checkbox {
  width: var(--size-5);
}
.newBook__input {
  padding: var(--size-2) var(--size-2) var(--size-1);
  border: none;
  background-color: var(--background);
  color: inherit;
}
.newBook__input:focus {
  outline: none;
}
.newBook__input:focus ~ .newBook__inputGroupLine {
  translate: 0 3px;
}
@media (width > 768px) {
  .newBook__input {
    width: 30ch;
  }
}
.newBook__submit {
  position: relative;
  height: 3rem;
  padding: var(--size-4);
  border-radius: var(--size-2);
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.newBook__submit:hover {
  outline: 1px solid var(--text);
}
.newBook__submitError {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  border: 1px solid var(--text);
  border-radius: var(--size-2);
  font-size: var(--fs-300);
  background-color: var(--danger);
  color: red;
  cursor: not-allowed;
  opacity: 0;
  scale: 0;
}
.newBook__close {
  position: relative;
  right: var(--size-6);
  top: var(--size-6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: var(--size-4);
  border-radius: 50%;
  aspect-ratio: 1/1;
}
.newBook__close:hover {
  outline: 1px solid var(--text);
}
.newBook__close span {
  font-size: var(--size-7);
}
.newBook[data-active=false] {
  scale: 0;
}
.newBook[data-active=true] {
  scale: 1;
}

@media (width > 768px) {
  .mobile-only {
    visibility: hidden;
    display: none;
  }
}

/*# sourceMappingURL=style.css.map */
