:root {
  --color-header-bg: #f5edd8;
  --color-card-bg: #fbf6ec;
  --color-accents: #c97a3a;
  --color-primary-text: #3d2508;
  --color-muted-text: #8b6040;
  --color-border: #e2c99a;
  --color-button-active: #d4b896;
  --font-size: clamp(1rem, 0.75rem + 1.5vw, 1.5rem);
  --image-width: clamp(80px, 12vw, 115px);
}

/* css reset from josh https://www.joshwcomeau.com/css/custom-css-reset/ */

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Increase line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* end css reset */

@font-face {
  font-family: Lora;
  src: url(Lora/static/Lora-Regular.ttf);
}
@font-face {
  font-family: lora-italic;
  src: url(Lora/Lora-Italic-VariableFont_wght.ttf);
}
@font-face {
  font-family: Inter;
  src: url(Inter/Inter-VariableFont_opsz_wght.ttf);
}

body {
  font-size: var(--font-size);
  margin: 0;
  background-color: #ede5c0;
}
.container {
  display: flex;
  flex-direction: column;
  background-color: var(--color-card-bg);
  min-height: 100vh;
  margin: 0 auto;
  max-width: 600px;
  font-family: Lora;
  color: var(--color-primary-text);
}

/*header styling*/
.container .header {
  display: flex;
  justify-content: space-between;
  padding: 0 15px;
  align-items: center;
  background-color: var(--color-header-bg);
  margin-bottom: 1rem;
  border: solid 0.5px var(--color-border);
  font-weight: 500;
  font-style: normal;
  position: sticky;
  top: 0;
  z-index: 10;
  /* box-shadow: 0 0.1px 3px rgba(0, 0, 0, 0.6); */
  top: 0;
  /* box-shadow: #3d2508; */
}
button {
  background-color: var(--color-card-bg);
  border-radius: 7px;
  border: solid 0.5px var(--color-border);
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;

  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
}

button:hover {
  background-color: var(--color-border);
  cursor: pointer;
  border: solid 0.5px var(--color-accents);
  transition:
    background-color 0.1s ease,
    transform 0.1s ease;
}

button:active {
  background-color: var(--color-button-active);
  border-radius: 7px;
  border: solid 0.5px var(--color-border);
  padding: 6px 14px;
  font-size: 13px;
  transform: scale(0.95);
}
/*outer book section*/
.book-section {
  display: flex;
  flex-direction: column;
  border: solid 0.5px var(--color-border);
  padding: 16px;
  background-color: var(--color-header-bg);
  margin-bottom: 16px;

  gap: 4px;
}
/*book item*/
.book {
  display: flex;
  align-items: flex-start;
  /*justify-content: space-around;*/
  gap: 16px;
  padding: 6px;
}

.book-meta {
  font-family: Inter;
  gap: 16px;
  align-items: flex-start;
}

.mark-as-read {
  padding: 6px 16px;
}
/*accent color to book author and num of pages*/
.book-author {
  color: #a85f28;
}

.book-pages {
  color: var(--color-muted-text);
}

.book-buttons {
  display: flex;

  width: 100%;
  gap: 8px;
  margin-top: 8px;
}

.book img {
  width: var(--image-width);
  height: auto;
  object-fit: cover;
}

.modal {
  --modal-border: 0.5px solid var(--color-border);
  border: var(--modal-border);

  /* background-color: rgb(61, 37, 8, 0.35); */

  background-color: var(--color-card-bg);
  padding: 0;
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-header-bg);
  margin: 0;
  border-bottom: 0.5px solid var(--color-border);
  font-size: 18px;
  color: var(--color-muted-text);
  padding: 14px 20px;
}
.modal-header h2 {
  font-family: "Lora", serif;
}

#close_book_dialog {
  background: none;
  border: none;
  font-size: 18px;
  color: #8b6040;
}
#close_book_dialog:hover {
  color: #3d2508;
}
.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;

  font-size: 8px;
  color: var(--color-muted-text);
  gap: 5px;
}
.field label {
  font-family: "Inter", sans-serif;
  font-size: 12px;
}
.field input {
  font-family: Inter, sans-serif;
  font-size: 13px;
  background-color: var(--color-header-bg);
  border: 0.5px solid var(--color-border);
  border-radius: 7px;
  padding: 8px 12px;
  outline: none;
  color: var(--color-muted-text);
}
.field input:focus {
  color: var(--color-accents);
}
.checkbox-row {
  display: flex;
  align-items: center;

  justify-content: flex-start;
  gap: 8px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: #5c3d1e;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--color-accents);
  width: 15px;
  height: 15px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 0.5px solid var(--color-border);
}
#cancel-btn #submit {
  font-family: Inter, sans-serif;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 7px;
  cursor: pointer;
}
#cancel-btn {
  background: #fbf6ec;
  color: #5c3d1e;
}
#submit {
}

#cancel-btn:hover {
  background: #ede0cc;
}
#submit {
  background: #c97a3a;
  color: #fff;
  border-color: #c97a3a;
}
#submit:hover {
  background: #b56828;
}
