:root {
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
}
body {
  margin: 0;
  width:inherit;
  box-sizing: border-box;
  padding: 0 50px;
  font: 18px "Lucida Grande", Helvetica, Arial, sans-serif;
  color: rgb(228, 216, 216);
  background-color: rgb(32, 30, 30);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
p{
  line-height: 1.5em;
}
#navigation-under-chapter.visible{
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.visible {
  display: flex !important;
  flex-direction: column !important;
}
.hidden {
  display: none !important;
}
.grid-container-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  gap: 10px;
}
.grid-container-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  gap: 10px;
}


.header {
  box-sizing: border-box;
  width: inherit;
  height: 60px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 0 25px;
  border-bottom: 1px solid rgb(131, 130, 130);
  background-color: rgba(90, 87, 87, 0.25);
}
.header > * {
  margin: 0;
  height: inherit;
  display: flex;
  align-items: center;
}
.header img {
  height: inherit;
}

.header button {
  height: 35px;
  margin: 0;
}

.width-stretch {
  width: -webkit-fill-available;
  width: -moz-available;
}
.height-stretch {
  height: -webkit-fill-available;
  height: -moz-available;
}


button {
  align-items: center;
  appearance: none;
  background-color: #cfc8c8;
  border-radius: 12px;
  border-style: none;
  box-sizing: border-box;
  color: #2b2d2f;
  cursor: pointer;
  display: inline-flex;
  fill: currentcolor;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  height: 24px;
  justify-content: center;
  letter-spacing: .25px;
  line-height: normal;
  max-width: 100%;
  overflow: visible;
  padding: 2px 12px;
  position: relative;
  text-align: center;
  text-transform: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  width: auto;
  will-change: transform, opacity;
  z-index: 0;
}
@media (width > 500px) {
  button {
  font-size: 25px;
  font-weight: 800;
  height: 50px;
  padding: 4px 24px;
  border-radius: 24px;
  }
    p {
      line-height: 3em;
    }
}


button:hover {
  background: #a2a8b2;
  color: #124392;
}

button:active {
  /* box-shadow: 0 4px 4px 0 rgb(60 64 67 / 30%), 0 8px 12px 6px rgb(60 64 67 / 15%); */
  outline: none;
}

button:focus {
  outline: none;
  border: 2px solid #4285f4;
}

a {
  color: #00B7FF;
}
.flex-row {
  display: flex;
}
.flex-column {
  display: flex;
  flex-direction: column;
}
.gap-half-em{
  gap: 0.5em;
}

.navbar{
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}
.navbar .chapter-selection {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.navbar button {
  height: 30px;
  padding: 2px 12px ;
}

input,select{
  width: fit-content;
  background-color: #e3e0e0;
  border-radius: 5px;
}

.bookmarks-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5em;
  width: 100%;
  max-width: 1200px;
  margin-top: 1em;
}

.bookmark-card {
  background-color: #3b3737;
  border-radius: 16px;
  padding: 20px;
  width: 350px;
  max-height: 600px;
  display: grid;
  grid-template-areas:
          'header'
          'synopsis'
          'actions';
  grid-template-rows: 20fr 65fr 15fr;
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.bookmark-card:hover {
  transform: translateY(-4px);
  background-color: #4a4545;
}

.bookmark-header{
  grid-area: header;
  display: flex;
  flex-direction: column;
}

.bookmark-synopsis {
  grid-area: synopsis;
  overflow-x: hidden;
  overflow-y: scroll;
}

.bookmark-title {
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 8px;
}

.bookmark-author {
  font-size: 16px;
  color: #cfc8c8;
  margin-bottom: 16px;
}
.bookmark-synopsis h3{
  font-weight: bold;
}

.bookmark-synopsis p {
  font-size: 15px;
  color: #cfc8c8;
  line-height: 1.5em;
  padding: 0 15px;
  text-align: justify;
}

.bookmark-meta {
  font-size: 14px;
  color: #a7a2a2;
  margin-bottom: 1em;
}

.bookmark-actions {
  grid-area: actions;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5em;
}
.bookmark-actions button {
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .25px;
  line-height: normal;
  padding: 2px 12px;
  display: flex;
}

#chapter-content p {
  margin: 1em 0;
  line-height: 2em;
}
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: #888; /* grey */
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#backToTop:hover {
  background-color: #555; /* darker grey on hover */
}