/* CSS reset */

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

a:link,
a:hover,
a:visited {
  text-decoration: none;
}

input {
  color: inherit;
}

/* colors */
:root {
  --primary-color: #c7a11a;
  --background-color: #e3d39a;
  --card-color: #f5e5ab;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #211b05;
    --card-color: #42360a;
  }

  .container h2,
  .container p,
  .menu-list,
  button,
  dialog {
    color: #ebe7e1;
  }

  button[type="submit"] {
    color: var(--background-color);
  }
}

/* variables */
:root {
  --abosolute-shadow: -3px 3px 8px -4px black;
  --radius: 4px;
}

/* fonts */
html {
  font-family: sans-serif;
  font-size: 1rem;
}

h1,
h2 {
  font-weight: bolder;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.2rem;
}

.author {
  font-style: italic;
}

/* styles */
body {
  background-color: var(--background-color);
}

.icon {
  height: 28px;
  padding: 2px;
  filter: brightness(0) saturate(100%) invert(54%) sepia(87%) saturate(414%)
    hue-rotate(10deg) brightness(100%) contrast(91%);
}

p {
  margin-top: 0.5em;
}

header {
  background-color: var(--primary-color);
}

.appbar {
  padding: 1em 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.appbar .icon,
.new-book-button .icon {
  filter: none;
}

.menu-list {
  background-color: var(--card-color);
  box-shadow: var(--abosolute-shadow);
  position: absolute;
  right: 8px;
  bottom: -60px;
  border-radius: var(--radius);
  display: none;

  padding: 1em;
  width: 100px;
}

#menu {
  appearance: none;
}

.menu-list:has(~ input:checked) {
  display: block;
}

.menu-list li:last-of-type {
  margin-top: 1em;
}

.container {
  max-width: 960px;
}

.books > p,
.container > p:first-of-type {
  margin-top: 12em;
}

.books > p,
.container > p {
  text-align: center;
}

.container,
.appbar {
  width: 90%;
  margin: 0 auto;
}

.new-book-button {
  border-radius: 50%;
  height: 40px;
  width: 40px;
  background-color: var(--primary-color);
  box-shadow: var(--abosolute-shadow);
  position: absolute;
  right: 20px;
  bottom: 48px;
}

dialog {
  border: none;
  border-radius: var(--radius);
  background-color: var(--card-color);
}

dialog::backdrop {
  backdrop-filter: blur(4px);
}

form button {
  padding: 0.4em 1.2em;
  border-radius: var(--radius);
}

form button[type="submit"] {
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

form .cancel {
  border: 1px solid var(--primary-color);
}

form p:last-of-type {
  margin-top: 2em;
  vertical-align: bottom;
}

label[class="text-input"] {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input {
  background-color: var(--card-color);
  border: solid var(--background-color);
}

input:focus {
  border: none;
  outline: 2px solid var(--primary-color);
}

.books ul {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 1em;
}

.book {
  background-color: var(--card-color);
  padding: 1em;
  border-radius: var(--radius);
  box-shadow: -4px 3px 4px -4px;

  display: grid;
  grid-template-rows: 120px 40px;
  grid-template-columns: 3fr 1fr;
}

.description {
  grid-row: 1 / 2;
  grid-column: 1;
}

.options {
  grid-row: 2;
  grid-column: 1;
}

.cover {
  height: 150px;
  width: 100px;

  grid-row: 1 / -1;
  grid-column: 2 / -1;
}

.status {
  display: block;
  margin-top: 0.5em;
  width: max-content;
  padding: 0.2em 1em;
  border-radius: 20px;
}

.read {
  border: 1px solid #039e5d;
  color: #039e5d;
  background-color: #73e6a7;
}

.unread {
  border: 1px solid #9e4403;
  color: #9e4403;
  background-color: #e69973;
}

.remove {
  margin-left: 1em;
}
