/**
 * CSS reset & clearfix
 */

* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-appearance: none; }
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, font, 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 { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; -webkit-appearance: none; -moz-appearance: none; }
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
:focus { outline: 0; }
ins { text-decoration: none; }
del { text-decoration: line-through; }
table { width: 100%; border-collapse: collapse; border-spacing: 0; }

.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clearfix { display: inline-block; }
.clearfix { display: block; }
.none { display: none; }

/**
 * Global styles
 */

body, input, textarea, select, button { font: normal 13px/20px -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif; }

body { line-height: 20px; overflow-y: scroll; background: #fff; color: #444; }

a { text-decoration: none; }

img { display: inline-block; vertical-align: top; max-width: 100%; height: auto; }

em { font-style: italic; }

input[type=text] { padding: 9px 14px; background: #fff; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; border-radius: 4px; }
input[type=text]:focus { border-color: #4d6eb8; }

button,
input[type=submit] { cursor: pointer; padding: 10px 15px; font-weight: 600; background: #4d6eb8; color: #fff; border: none; border-radius: 4px; border-radius: 4px; }
button:hover,
input[type=submit]:hover { background: #3e5da4; }

button { line-height: 40px; padding: 0 15px; }

/**
 * Layouts
 */

.container { width: 800px; margin: 0 auto; }

#main { padding: 30px 0; }

/**
 * Header
 */

#header { padding: 30px 0; border-bottom: 1px solid #eee; }

#header .site-info { float: left; }
#header .site-name { position: relative; top: 10px; margin: -6px 0 -4px 0; line-height: 30px; letter-spacing: -1px; font-size: 27px; font-weight: 600; }
#header .site-name a { color: #444; }
#header .site-name a:hover { color: #4d6eb8; }

#header .search-form { float: right; width: 100%; max-width: 400px; }
#header .search-form div { display: table; }
#header .search-form div p { display: table-cell; }
#header .search-form div p,
#header .search-form div p input[type=text],
#header .search-form div p input[type=submit] { width: 100%; }
#header .search-form div p input[type=text] { border-right: none; -webkit-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; }
#header .search-form div p input[type=submit] { -webkit-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }

/**
 * Page Title
 */

.page-title { margin: -5px 0 25px 0; line-height: 25px; letter-spacing: -0.25px; font-size: 20px; font-weight: 600; }

/**
 * Books Grid
 */

.books-grid { margin: -30px -30px 0 0; }

.books-grid .book { float: left; width: 25%; padding: 30px 30px 0 0; }
.books-grid .book .detail { margin: 10px 0 -5px 0; }
.books-grid .book .detail .title a { color: #444; }
.books-grid .book .detail .title a:hover { color: #4d6eb8; }
.books-grid .book .detail .author,
.books-grid .book .detail .rating { line-height: 19px; font-size: 12px; color: #999; }
.books-grid .book .detail .author a { color: #999; }
.books-grid .book .detail .author a:hover { color: #444; }
.books-grid .book .detail .rating .star { display: inline-block; position: relative; margin-right: 7.5px; width: 50px; height: 10px; background: url("../images/rating.png") no-repeat; }
.books-grid .book .detail .rating .star span { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url("../images/rating.png") 0 -10px no-repeat; }

/**
 * Page Content
 */

.page-content ol,
.page-content ul,
.page-content p { margin-bottom: 20px; }
.page-content ol:first-child,
.page-content ul:first-child,
.page-content p:first-child { margin-top: -5px; }
.page-content ol:last-child,
.page-content ul:last-child,
.page-content p:last-child { margin-bottom: -5px; }
.page-content a { font-weight: 600; color: #4d6eb8; }
.page-content a:hover { color: #444; }
.page-content ol { margin-left: 15px; list-style: decimal; list-style-position: inside; }
.page-content ul { margin-left: 15px; list-style: disc; list-style-position: inside; }

/**
 * Pagination
 */

.pagination { float: left; width: 100%; margin-top: 25px; }
.pagination a,
.pagination span { float: left; padding: 5px 10px; margin: 5px 5px 0 0; background: #eee; color: #444; -webkit-border-radius: 4px; border-radius: 4px; }
.pagination a:hover,
.pagination span { background: #4d6eb8; color: #fff; }

/**
 * Recent Search
 */

#recent-search { float: left; width: 100%; padding: 30px 0; border-top: 1px solid #eee; }

#recent-search .title { margin: -5px 0 20px 0; line-height: 22px; font-size: 16px; font-weight: 600; }

#recent-search .items a { float: left; padding: 5px 10px; margin: 5px 5px 0 0; background: #eee; color: #444; -webkit-border-radius: 4px; border-radius: 4px; }
#recent-search .items a:hover { background: #4d6eb8; color: #fff; }

/**
 * Footer
 */

#footer { padding: 30px 0; border-top: 1px solid #eee; }

#footer,
#footer .menu,
#footer .credit { float: left; width: 100%; }

#footer .menu { margin: -5px 0 25px 0; }
#footer .menu li { float: left; margin-right: 15px; }
#footer .menu li:last-child { margin-right: 0; }
#footer .menu li a { color: #444; }
#footer .menu li a:hover { color: #4d6eb8; }

#footer .credit { margin: -5px 0; line-height: 18px; font-size: 11px; color: #999; }

/**
 * Responsive
 */

@media (max-width: 860px) {
  .container { width: auto; margin: 0 30px; }
}

@media (max-width: 760px) {
  #header .site-info,
  #header .search-form { width: 100%; }

  #header .site-name { position: static; top: 0; }

  #header .search-form { float: left; margin-top: 30px; max-width: 100%; }
}

@media (max-width: 640px) {
  .books-grid .book { width: 33.33333333333333333%; }
}

@media (max-width: 480px) {
  .books-grid .book { width: 50%; }
}

@media (max-width: 360px) {
  .books-grid .book { width: 100%; }
}

/**
 * Retina
 */

@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-devicepixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx) {
  .books-grid .book .detail .rating .star,
  .books-grid .book .detail .rating .star span {
    background-image: url("../images/rating@2x.png");
    background-size: 50px 20px;
  }
}
