/* GLOBAL */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&display=swap');

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

:root {
    --font-heading: "Merriweather", serif;
    --font-body: "Inter", sans-serif;
    --fs-small: clamp(0.6rem, 0.5rem + 0.5vw, 1rem);
    --fs-medium: clamp(1rem, 0.5rem + 1vw, 1.5rem);
    --fs-large: clamp(1.5rem, 1rem + 1vw, 2.5rem);
    --fs-xl: clamp(2rem, 1.5rem + 1vw, 3rem);
    --color-aqua: #017371;
    --color-aqua-dark: #016361;
    --color-white: #fff;
    --color-grey-dark: #333;
    --color-grey-medium: #666;
    --color-shadow: #0009;
}

body {
    font-family: var(--font-body), sans-serif;
    font-size: 20px;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

button,
input,
select {
    font: inherit;
    border-radius: 0.25em;
    padding: 0.25em 0.5em;
}

button {
    background-color: var(--color-aqua);
    color: var(--color-white);
    border: none;
    transform: scale(1);
    transition: 0.1s ease;
}

button:hover {
    transform: scale(1.1);
}

button:active {
    background-color: var(--color-aqua-dark);
}

i {
    margin-right: 0.5em;
}

.container {
    display: flex;
    justify-content: center;
    padding: 1em;
    font-size: var(--fs-medium);
}

.content {
    font-family: var(--font-body);
    flex: 1;
    max-width: 75ch;
}

.shadow {
    box-shadow: 0px 0px 5px var(--color-shadow);
}

.page-title,
.book-title {
    letter-spacing: 0.1em;
}

/* HEADER */

.header {
    border-bottom: 2px solid var(--color-grey-medium);
}

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

.page-title {
    font-size: var(--fs-xl);
    margin-right: auto;
}

.page-title i {
    color: var(--color-aqua);
}

#new-book-button i {
    font-size: 0.8em;
}

/* DIALOG */

.new-book-dialog {
    border-radius: 0.25em;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(300px, 25vw, 600px);
    padding: 1em;
}

.new-book-form,
.new-book-form div:not(.dialog-buttons) {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.new-book-dialog .dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 1em;
}

.dialog-buttons button {
    flex: 1;
}

/* LIBRARY */

.library-heading {
    font-size: var(--fs-large);
}

.collection-details {
    color: var(--color-grey-dark);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0.5em 0;
}

.collection-details * {
    white-space: nowrap;
}

.books-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-items: center;
    gap: 1em;
}

.book {
    font-size: var(--fs-small);
    border-radius: 1em;
    width: clamp(200px, 100%, 350px);
    aspect-ratio: 1 / 2;
    display: flex;
    flex-direction: column;
    padding: 1em;
    transform: scale(1);
    transition: transform 0.1s ease;
}

.book:hover {
    transform: scale(1.025);
    box-shadow: 0px 0px 5px var(--color-aqua);
}

.book-cover-art {
    border-radius: 0.5em;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}

.book-cover-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-heading {
    margin: 0.5em 0;
}

.book-title {
    font-size: var(--fs-medium);
    white-space: normal;
    overflow-wrap: break-word;
}

.book-author {
    color: var(--color-aqua);
    margin-left: 1em;
}

.book-info {
    color: var(--color-grey-dark);
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5em;
}

.book-buttons {
    display: flex;
    justify-content: space-evenly;
}