:root {
  --primary: #428fd4;
  --bg: #fff;
  --shadow: 0 0 10px #0005;
  --warning: #c00;
  --green: #0c0;
}

body {
  background: var(--primary);

  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

header {
  background: var(--bg);
  display: flex;
  justify-content: end;
  padding: 1rem;
  box-shadow: var(--shadow);
}

button {
  border: none;
  border: solid 2px transparent;
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  width: max-content;

  &.btn-primary {
    background: var(--primary);
    color: #fff;
  }

  &.btn-delete {
    background: var(--warning);
    color: #fff;
  }

  &.btn-outline {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
  }
}

#library {
  display: flex;
  flex-wrap: wrap;
  padding: 2rem;
  gap: 1rem;
}

.card {
  &[data-read="true"] {
    & .mark-read {
      display: none;
    }
    & .mark-unread {
      display: block;
    }
  }
  &[data-read="false"] {
    .status {
      display: none !important;
    }
    & .mark-read {
      display: block;
    }
    & .mark-unread {
      display: none;
    }
  }

  position: relative;
  background: var(--bg);
  padding: 1rem;
  border-radius: 5px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 270px;
  width: fit-content;

  & .status {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    background: var(--green);
    padding: 0 0.5em;
    border-radius: 10px;
    position: absolute;
    top: -10px;
    right: -10px;
  }
  .title {
    font-weight: bold;
  }
}
.btn-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem 0.5rem;
}
dialog {
  border: none;
  padding: 0;
  background: transparent;
}
form#add-book-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg);
  width: 300px;
  height: fit-content;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: var(--shadow);

  input {
    background: #eee;
    border: none;
    border-radius: 2rem;
    padding: 0.25rem 1rem;
  }

  &[invalid] input:invalid {
    outline: solid 2px var(--warning);
  }

  & label:has(+ input[required]):after {
    content: "*";
    color: var(--warning);
  }

  div {
    display: flex;
    flex-direction: column;

    &.row {
      flex-direction: row;
      gap: 2rem;
    }
  }
  button {
    align-self: center;
  }
}
