:root {
  --page-max-width: 1280px;
  --white: #fff;
  --black: #17181c;
  --white100: #f6f7f9;
  --white200: #edeef3;
  --white300: #d5d6db;
  --primary: #3d50f5;
  --bg-danger: #ff0033;
}

body {
  font-size: 16px;
  font-family: "Figtree", sans-serif;
  background: var(--white);
  color: var(--black);

  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--white100);
  border-bottom: 1px solid var(--white200);
  position: sticky;
  top: 0;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  max-width: var(--page-max-width);
  padding: 16px;
  margin: 0 auto;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}

button {
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--white300);
  font-weight: 500;
}

.new-book-btn {
  background: var(--primary);
  color: var(--white);
}

button:hover {
  opacity: 0.7;
  cursor: pointer;
}

main {
  padding: 32px 16px;
  max-width: var(--page-max-width);
  width: 100%;
  margin: 0 auto;

  flex: 1;

  display: flex;
  flex-direction: column;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.book-list.empty {
  flex: 1;

  text-align: center;

  display: flex;
  justify-content: center;
  align-items: center;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white100);
  padding: 16px;
  border-left: 10px solid var(--primary);
  border-radius: 12px;

  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 4px;
  justify-items: start;
}

.title {
  grid-column: 1 / -1;
  font-weight: 600;

  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

select {
  padding-inline: 4px;
  border: 1px solid var(--white300);
  border-radius: 4px;
}

.remove-book-btn {
  margin-top: 8px;
  grid-column: 1 / -1;
  justify-self: end;
}

.remove-book-btn:hover {
  opacity: 1;
  background: var(--bg-danger);
  color: var(--white);
}

dialog {
  width: calc(100% - 32px);
  max-width: 420px;
  height: calc(100% - 32px);
  max-height: fit-content;
  overflow: auto;

  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background: var(--white);
  padding: 16px;
  border: 1px solid var(--white300);
  border-radius: 12px;
}

dialog h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

dialog label,
dialog input {
  display: block;
}

dialog label {
  font-weight: 500;
  margin-bottom: 4px;
}

dialog input,
dialog select {
  padding: 6px 10px;
  border: 1px solid var(--white300);
  border-radius: 8px;
  width: 100%;
}

dialog select {
  padding: 6px;
}

dialog form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

dialog button {
  margin-right: 8px;
}

.confirm-btn {
  background: var(--primary);
  color: var(--white);
}

footer {
  background: var(--white100);
  text-align: center;
  border-top: 1px solid var(--white200);
  padding: 16px;
}

a:hover {
  text-decoration: underline;
}

dialog,
.card {
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}
