/* Fonts */

@font-face {
  font-family: 'Inclusive Sans';
  src: url('assets/fonts/InclusiveSans-Regular.woff2') format('woff2'),
    url('assets/fonts/InclusiveSans-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inclusive Sans';
  src: url('assets/fonts/InclusiveSans-Bold.woff2') format('woff2'),
    url('assets/fonts/InclusiveSans-Bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

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;
}

p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

#root,
#__next {
  isolation: isolate;
}

/* Library */

body {
  font-family: Inclusive Sans, Arial, Helvetica, sans-serif;
  color: #111;
}

header {
  text-align: center;
  padding: 40px;
}

h1 {
  margin-bottom: 40px;
}

button {
  font-weight: bold;
  padding: 5px 10px;
  border: 2px solid #aaa;
  border-radius: 10px;
}

button:hover {
  border-color: #999;
}

button.primary {
  background-color: #1f883d;
  color: #fff;
}

button.primary:hover {
  background-color: #1c8139;
}

main {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px;
}

.card {
  position: relative;
  padding: 20px 20px 100px 20px;
  border: 1px solid #111;
  border-radius: 10px;
}

.card ul {
  padding-left: 20px;
}

.card .toggle-read,
.card .remove-book {
  position: absolute;
  right: 20px;
  text-decoration: underline;
}

.card .toggle-read {
  bottom: calc(1rem + 40px);
}

.card .toggle-read:hover {
  color: #0969da;
}

.card .remove-book {
  bottom: 20px;
}

.card .remove-book:hover {
  color: #d1242f;
}

/* Dialog */

body {
  position: relative;
  height: 100vh;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #111;
  opacity: 0.5;
}

.hidden {
  display: none;
}

dialog {
  position: absolute;
  top: 200px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid #111;
  border-radius: 10px;
  padding: 20px;
  width: 300px;
}

form h2 {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

form label {
  font-weight: bold;
  margin-bottom: 5px;
}

form input {
  border-radius: 10px;
  padding: 5px 10px;
}

form input:user-invalid {
  border-color: #d1242f;
}

form fieldset {
  position: relative;
  margin-top: calc(1rem + 35px);
  margin-bottom: 20px;
  border-radius: 10px;
  padding: 5px 10px;
}

form fieldset legend {
  font-weight: bold;
  position: absolute;
  top: calc(-1rem - 15px);
  left: 0;
}

form fieldset label {
  font-weight: normal;
}

button.add-to-library {
  width: 100%;
}
