@font-face {
    font-family: 'Young Serif';
    src: url('./fonts/YoungSerif-Regular.woff2') format('woff2'),
        url('./fonts/YoungSerif-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --font-stack: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    line-height: 1.5;
    background-image: url(./images/background.jpeg);
    background-size: 350px;
}

.header {
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    border-bottom: 2px solid black;
}

h1 {
    font-family: "Young Serif", var(--font-stack);
    font-weight: 400;
}

.add-btn:hover {
    cursor: pointer;
}

.books-container:has(> p) {
    display: flex;
    justify-content: center;
    font-family: "Figtree", var(--font-stack);
    font-size: 1.3rem;
}

.books-container {
    display: grid;
    padding: 40px 60px;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.card {
    background-color: white;
    border: 2px solid black;
    border-radius: 15px;
    padding: 20px;
}

.card h2 {
    font-family: "Young Serif", var(--font-stack);
    font-weight: 400;
    font-size: 1.25rem;
}

.card p {
    font-family: "Figtree", var(--font-stack);
    margin-bottom: 12px;
}

.card button {
    font-family: "Figtree", var(--font-stack);
    border: 2px solid black;
    border-radius: 8px;
    background: none;
    padding: 12px 24px;
    width: 105px;
}

.card button:first-of-type {
    margin-right: 6px;
}

.card button:hover {
    cursor: pointer;
    background-color: #eee;
}

.card button.read {
    background-color: black;
    color: white;
}

.modal {
    padding: 35px;
    width: 350px;
    border-radius: 10px;
    margin: auto;
}

.modal .modal-header {
    margin-bottom: 18px;
}

.modal .modal-header .top{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal .modal-header h2 {
    font-family: "Young Serif", var(--font-stack);
    font-weight: 400;
    font-size: 2rem;
}

.modal .close-btn {
    cursor: pointer;
}

.modal:open {
    display: flex;
    flex-direction: column;
}

.modal form {
    display: flex;
    flex-direction: column;
    font-family: "Figtree", var(--font-stack);
}

.modal form label, .modal form input, .modal form div {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.modal form input:not(input[type="checkbox"]){
    background-color: #eee;
    padding: 6px;
    border: none;
    border-radius: 10px;
}

.modal form input + p {
    display: none;
}

.modal form input:user-invalid + p {
    display: block;
    margin-top: -6px;
    margin-bottom: 6px;
    color: #a80000;
}

.modal form div {
    margin-top: 16px;
}

.modal form div label {
    margin-right: 6px;
}

input[type="checkbox"]{
    appearance: none;
    position: relative;
    width: 25px;
    height: 25px;
    vertical-align: -22px;
    background-color: #eee;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
}

input[type="checkbox"]::before {
  content: url(./icons/check.svg);
  position: absolute;
  font-size: 1.2rem;
  right: 3px;
  top: 4px;
  visibility: hidden;
}

input[type="checkbox"]:checked::before {
  visibility: visible;
}

.modal button {
    background-color: black;
    border: none;
    font: inherit;
    font-size: 1.2rem;
    color: white;
    border-radius: 15px;
    padding: 6px 24px;
    cursor: pointer;
}