/*
----------
CSS Reset
----------
*/

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

*:not(dialog) {
  margin: 0;
  padding: 0;
}

body {
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

input,
button {
  font: inherit;
}

html {
  font-size: 62.5%; /* 10px */
}

/*
----------
Fonts
----------
*/

/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on August 19, 2025 */

@font-face {
  font-family: 'robotobold';
  src: url('assets/fonts/roboto-bold-webfont.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'robotoregular';
  src: url('assets/fonts/roboto-regular-webfont.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'kingthings_trypewriter_2Rg';
  src: url('assets/fonts/kingthings_trypewriter_2-webfont.woff2')
    format('woff2');
  font-weight: normal;
  font-style: normal;
}

* {
  font-family: 'robotoregular', sans-serif;
  font-size: 1.6rem;
  color: #000;
}

h1 {
  font-size: 6rem;
  font-family: 'kingthings_trypewriter_2Rg', sans-serif;
}

h2 {
  font-size: 4rem;
}

h3 {
  font-size: 3.3rem;
  font-family: 'robotobold', sans-serif;
}

h4 {
  font-size: 2.8rem;
}

/*
----------
Layout
----------
*/

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr 70px;
}

header {
  display: grid;
  grid-template-columns: 2fr 1fr;
  justify-items: center;
  padding: 3rem;
  background-color: #f3f3f4;
  box-shadow: 5px 5px 5px #363537;
}

.add-book-btn-container {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.add-book-btn {
  padding: 1rem 2rem;
  border-radius: 30px;
  border: none;
  background-color: #ed7d3a;
  color: #fff;
  cursor: pointer;
}

.add-book-btn:hover {
  transform: translateY(-2px);
}

.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  grid-template-rows: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 5rem;
  padding: 5rem 10rem;

  /* these two are needed for background-image opacity */
  position: relative;
  isolation: isolate;
}

/* background image */
.library::after {
  background-image: url(assets/imgs/library.jpg);
  background-size: cover;
  background-position: center;
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.3;
}

.library h2 {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  place-self: center;
  text-align: center;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 3rem;
  background-color: #f3f3f4;
  border-left: 15px solid #03b5aa;
  border-radius: 30px;
  box-shadow: 0 0 10px 5px #363537;
}

.button-container {
  align-self: end;
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.button-container button {
  padding: 1rem 2rem;
  border-radius: 30px;
  border: none;
  cursor: pointer;
}

.button-container button:hover {
  transform: translateY(-2px);
}

.delete-btn {
  background-color: #6c1214;
  color: #fff;
}

.toggle-read-btn {
  background-color: #adadad;
}

.read-btn {
  background-color: #037971;
  color: #fff;
}

footer {
  background-color: #f3f3f4;
  text-align: center;
  align-content: center;
}

/*
----------
Form
----------
*/

dialog {
  padding: 5rem 7rem;
  border-radius: 30px;
  border: none;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

form {
  display: grid;
  gap: 3rem;
}

.form-group {
  display: grid;
}

input {
  border-radius: 30px;
  padding: 0.5rem 1rem;
  border: 2px solid #363537;
}

input:focus {
  outline-color: #ed7d3a;
}

dialog button {
  padding: 1rem;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  color: #fff;
}

.submit-btn {
  background-color: #037971;
}
.submit-btn:hover {
  transform: translateY(-2px);
}

.cancel-btn {
  background-color: #adadad;
}

.cancel-btn:hover {
  background-color: #525252;
}

/*
----------
Media Query
----------
*/
@media screen and (max-width: 777px) {
  header {
    grid-template-columns: 1fr;
  }
}
