html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  margin: 0;
  padding: 0;
  background-color: #f0ede5;
}
body, input {
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-weight: 300;
}
textarea, kbd {
  font-family: "Consolas", "Menlo", "Courier", monospace;
}
a {
  color: #369;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img {
  max-width: 100%;
  max-height: 100%;
}
kbd {
  background-color: #ededed;
  border-color: #dddddd;
  color: #222222;
  border-style: solid;
  border-width: 1px;
  font-size: inherit;
  margin: 0;
  padding: 0.11111rem 0.22222rem 0;
  border-radius: 3px;
}
header {
  background-color: #333;
  text-align: center;
  padding: 10px;
}
header img {
  max-height: 30px;
}
#cover {
  padding: 10px;
  text-align: center;
}
#cover img {
  border: 6px solid white;
  /*width: 300px;*/
  max-height: 450px;
  border-radius: 4px;
  box-shadow: 1px 1px 4px 1px #ccc;
  -webkit-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}
#info {
  display: none;
}

/* Sliding menu */
#menu {
  position: fixed;
  bottom: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  -webkit-transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* easeInOutBack */
  -o-transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* easeInOutBack */
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* easeInOutBack */
}
#menu .menu-inner {
  margin: 0 5px;
  border-radius: 4px 4px 0 0;
  color: #333;
  height: 100%;
}
#menu.closed {
  top: 100%;
  margin-top: -40px;
}
#menu.open {
  top: 10px;
  margin-top: 0;
}

/* Menu header */
#menu .menu-header {
  background-color: rgba(111, 163, 214, 0.95);
  cursor: pointer;
  width: 100%;
  height: 40px;
  text-align: center;
  padding: 5px 0;
  border-radius: 4px 4px 0 0;
}
#menu .menu-header img {
  -webkit-transition: all 0.3s ease-in-out 0.6s;
  -o-transition: all 0.3s ease-in-out 0.6s;
  transition: all 0.3s ease-in-out 0.6s;
}
#menu.open .menu-header img {
  -webkit-transform: rotate(180deg);
  -ms-transform: rotate(180deg);
  -o-transform: rotate(180deg);
  transform: rotate(180deg);
}

/* Menu content */
#menu .menu-content {
  color: #333;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 12px;
  font-size: 0.8rem;
  height: 100%;
}
#menu .menu-content a.book-title {
  color: #333;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
}
#menu .menu-content .title {
  font-weight: bold;
}

/* Action buttons */
.buttons {
  margin: 15px 0;
}
a.button {
  display: block;
  padding: 9px 0 9px 36px;
  margin: 5px 0;
  color: white;
  background-color: rgba(111, 163, 214, 0.7);
  background-repeat: no-repeat;
  border: 1px solid #d7e1e3;
  border-radius: 3px;
  text-decoration: none;
}
a.button:hover {
  background-color: #6fa3d6;
  text-decoration: none;
}
a.button.download {
  background-image: url("download-icon.svg");
  background-position: 4px 2px;
  background-size: 30px;
}
a.button.openbook {
  background-image: url("book-icon-open.svg");
  background-position: 4px 4px;
  background-size: 30px;
}
a.button.buy {
  background-image: url("cart-icon.svg");
  background-position: 4px 5px;
  background-size: 30px;
  background-color: #07842e;
  border: 1px solid #27ae60;
}
a.button.buy:hover {
  background-color: #056e26;
}

/* Share buttons */
a.share-button {
  display: inline-block;
  float: left;
  margin-right: 4px;
  color: white;
  text-decoration: none;
}
a.share-button:last-child {
  margin-right: 0;
}
a.share-button.embed {
  display: inline-block;
  background: url("embed-icon.svg") #999 no-repeat;
  background-position: -6px -6px;
  background-size: 50px;
  height: 32px;
  padding: 9px 9px 0 36px;
  font-size: 0.8rem;
}
a.share-button.embed:hover {
  background-color: #888;
}
a.share-button.large-only {
  display: none;
}

/* Embed dialog */
#embed {
  background-color: #f0ede5;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  padding: 15px;
  -webkit-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}
#embed.open {
  left: 0;
}
#embed .embed-header {
  margin-bottom: 10px;
}
#embed .embed-text {
  margin: 10px 0;
}
#embed textarea.embed-code {
  width: 100%;
  margin: 10px 0;
  height: 80px;
}
#embed .embed-size {
  width: 100%;
  max-width: 300px;
  margin-bottom: 10px;
}
#embed .embed-size:before,
#embed .embed-size:after {
  display: table;
  line-height: 0;
  content: "";
}
#embed .embed-size div {
  display: inline-block;
  text-align: center;
  float: left;
  min-height: 34px;
  line-height: 34px;
}
#embed .embed-size .x {
  width: 10%;
}
#embed .embed-size .label {
  width: 20%;
  font-weight: bold;
}
#embed .embed-size .width,
#embed .embed-size .height {
  width: 35%;
}
#embed .embed-size input {
  width: 100%;
  padding: 4px 0;
  height: 34px;
  font-size: 1rem;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
#embed .embed-size input:focus {
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
  outline: none;
}
#embed .button.close {
  position: absolute;
  bottom: 10px;
  right: 15px;
  width: 120px;
  padding: 10px;
  text-align: center;
}

/* Wide widget styles */
@media (min-width: 481px) {
  header {
    text-align: left;
  }
  #cover {
    text-align: left;
    width: 25%;
    float: left;
  }
  #info {
    display: block;
    width: 75%;
    float: left;
    padding: 15px;
  }
  #info .buttons {
    margin-top: 15px;
  }
  #info a.button {
    display: block;
    width: 300px;
    max-width: 100%;
    font-size: 0.9rem;
  }
  #info a.share-button.embed .button-text {
    display: inline;
  }
  #menu {
    display: none;
  }
  a.share-button.large-only {
    display: inline-block;
  }
}