/* =============================================================================
   RESET & BASE STYLES
   ============================================================================= */

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

* {
  margin: 0;
  padding: 0;
  font-family: serif, sans-serif;
  font-style: italic;
  font-size: 1.25rem;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

p {
  font-size: 1rem;
}

a {
  display: inline-block;
  text-decoration: none;
  color: black;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.container {
  padding: 1rem;
  width: 100%;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.navigation {
  background-color: white;
  position: static;
  display: block;
  min-height: 64px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}

.nav-controls {
  float: right;
  vertical-align: center;
}

.nav-controls > a {
  padding: 1rem 0.5rem;
  height: 100%;
  font-size: 1rem;
}

.nav-controls:last-child {
  padding-right: 1rem;
}

/* =============================================================================
   SEARCH
   ============================================================================= */

.search-form {
  display: inline-block;
  height: 64px;
}

.search-form > label {
  position: relative;
}

.search-input {
  height: 100%;
  width: 100px;
  padding: 0.5rem 0.5rem 0.5rem 3rem;
  font-size: 1rem;
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
}

.search-form > label > .search-input {
  width: 100%;
}

.search-form > label > svg {
  position: absolute;
  top: 25%;
  left: 0.5rem;
  height: 1rem;
}

.search-input:focus {
  outline: none;
  box-shadow: none;
}

.search > form {
  padding: 1rem 0 0 1rem;
  display: block;
}

/* =============================================================================
   BOOK LIST
   ============================================================================= */

.book-list {
  list-style-type: none;
}

.book-item {
  padding: 1rem;
  white-space: nowrap;
}

.book-item a {
  width: 100%;
}

.book-list .book-item:not(:last-child),
.entry-links .book-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}

.book-cover {
  display: inline-block;
  height: 75px;
  margin-right: 1rem;
}

.book-info {
  display: inline-block;
  vertical-align: top;
  white-space: normal;
  max-width: calc(100% - 3rem - 75px);
}

.book-title {
  font-weight: 500;
  font-size: 1.25rem;
}

/* =============================================================================
   BOOK DETAILS PAGE
   ============================================================================= */

.book-details,
.entry-links {
  margin-top: 0;
}

.entry-links {
  list-style-type: none;
}

.book-details-cover {
  display: inline-block;
  margin-right: 1rem;
  max-width: 200px;
}

.book-details-info {
  display: inline-block;
  vertical-align: top;
  max-width: calc(100% - 1.5rem - 200px);
}

.book-summary {
  margin-top: 0.5rem;
  font-size: 1rem;
}

.link-type {
  font-style: normal;
  color: #666;
}

.entry-section {
  margin-top: 1rem;
}

.entry-section h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.entry-section .entry-links {
  margin-top: 0;
}

/* =============================================================================
   MEDIA QUERIES
   ============================================================================= */

/* 732px is Kobo Clara Width */
@media (max-width: 768px) {
  .navigation {
    height: auto;
    min-height: 64px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  }

  .search-form {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .search-input {
    width: 200px;
    max-width: 80%;
    border-right: none;
  }

  .nav-controls {
    float: none;
    clear: both;
    text-align: center;
    padding: 0.5rem;
  }

  .nav-controls > a {
    display: inline-block;
    padding: 0.5rem;
    font-size: 1rem;
    margin: 0 0.25rem;
  }
}

@media (max-width: 500px) {
  .search-input {
    width: 100%;
    max-width: 90%;
  }

  .nav-controls > a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .nav-controls > a:last-child {
    border-bottom: none;
  }
}
