:root {
    --main-bg-color: #f0f1f3;
    --font-size: calc(16px + (18 - 14) * ((100vw - 300px) / (1600 - 300)));
    --form-element-padding: 12px;
    --text-color: #0d2b3e;
}

html, body {
    margin: 0;
    padding: 0;
    font-size: var(--font-size);
    font-family: Georgia, serif;
    height: 100%;
}

h1 {
    margin: 0 auto;
    max-width: 800px;
    padding: 50px 50px 0;
}

h1, h1 i {
    font-size: calc(32px + (32 - 14) * ((100vw - 300px) / (1600 - 300)));
}

.no-scroll {
    overflow-y: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: left;
    background-color: var(--main-bg-color);
    color: var(--text-color);
    font-family: Georgia, serif;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    justify-content: center;
    align-items: center;
}

#add-book-form {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0d2b3ed8;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 0 40px;
    overflow: auto;
    z-index: 100;
}

#add-book-form.is-visible {
    display: flex;
}

form {
    display: block;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    background: #ffffff;
    box-sizing: border-box;
    position: absolute;

}

form p.is-checkbox {
    display: flex;
    align-items: center;
}

form p:first-child { margin-top: 0; }

form label {
    display: block;
    font-size: 80%;
    margin-bottom: 4px;
    cursor: pointer;

}

form label.is-checkbox {
    cursor: pointer;
    display: inline-block;
    margin-bottom: 0;
}

form input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--text-color);
    padding: var(--form-element-padding);
    font-size: var(--font-size);
    font-family: Georgia, serif;
}

form input.is-checkbox {
    display: inline-block;
    width: auto;
}

form button {
    display: block;
    width: 100%;
    cursor: pointer;
    background: var(--text-color);
    color: #ffffff;
    border: none;
    padding: calc(var(--form-element-padding) + 4px);
    font-weight: bold;
    font-size: var(--font-size);
    font-family: Georgia, serif;
}

form button.is-secondary {
    background-color: #ffffff;
    border: 1px solid var(--text-color);
    margin-top: 16px;
    color: var(--text-color);
}

form p.error-message:empty {
    display: none;
}

form p.error-message {
    text-align: center;
    padding: 20px;
    color: rgb(236, 82, 82);
    border: 1px solid rgb(236, 82, 82);
}

#shelf {
    padding: 50px;
    margin: 0 auto;
    max-width: 800px;
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-gap: 20px;
}

.book {
    min-height: 200px;
    border: 2px solid var(--text-color);
    font-weight: bold;
    background: #ffffff;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(var(--form-element-padding) + 2px);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0px 3px 6px -2px rgba(50, 50, 93, 0.3), 0px 3px 7px -3px rgba(0, 0, 0, 0.3), inset 0px 0px 0px 2px #ffffff, inset 0px 0px 0px 3px var(--text-color);
}

.book:hover {
    transform: translateY(-6px);
    box-shadow: 0px 20px 24px -6px rgba(50, 50, 93, 0.20), 0px 6px 14px -3px rgba(0, 0, 0, 0.2), inset 0px 0px 0px 2px #ffffff, inset 0px 0px 0px 3px var(--text-color);
}

.book span {
    display: block;
    overflow: hidden;
    box-sizing: border-box;
    text-overflow: ellipsis;
}

.book small {
    font-family: "Helvetica Neue";
    border-top: 1px solid var(--text-color);
    margin-top: 8px;
    padding-top: 2px;
    font-weight: normal;
    display: inline-block;
    font-size: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book .delete-book-button {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s ease-in-out
}

.book .delete-book-button i {
    font-size: 32px;
    line-height: 32px;
}

.book:hover .delete-book-button {
    opacity: 1;
}

.book .mark-as-read {
    font-size: 70%;
    line-height: 70%;
    text-align: center;
    border: 1px solid var(--text-color);
    padding: 6px 0;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    border-radius: 2px;
}

.book .mark-as-read:hover {
    background: #ffffff;
}

.book .mark-as-read.is-not-read {
    opacity: 0.5;
}

.book.is-new {
    box-shadow: none;
    background: #e1e4e9;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book.is-new i {
    transition: opacity 0.1s ease-in-out;
    color: var(--text-color);
    opacity: 0.3;
    font-size: calc(32px + (32 - 14) * ((100vw - 300px) / (1600 - 300)));
}

.book:hover.is-new {
    transform: translateY(0);
}

.book:hover.is-new i {
    opacity: 1;
}