html {
  font: 17px Mulish, sans-serif;
}

body, h1, h2, h3, p, ol, ul, table, th, td {
  margin: 0;
  padding: 0;
}

body {
  color: #424e66;
}

a {
  text-decoration: none;
  color: royalblue;
}


/* HEADER */

header {
  background: linear-gradient(#000066, #003399);
}

header > div {
  overflow: hidden; /* Contain floating elements. */
  max-width: 1024px;
  margin: auto;
  padding: 5px 15px;
}

a#logo {
  float: left;
  display: block;
  width: 110px;
  margin-left: -15px;
}

a#logo img {
  display: block;
  width: 100%;
}

div#company {
  float: right;
  text-align: right;
  text-transform: uppercase;
}

div#company h1 {
  font-size: 2.2em;
  margin-top: 0.25em;
  margin-right: -2px;
}

div#company h1 a {
  font-weight: 800;
  color: red;
}

div#company h2 {
  font-size: 0.85em;
  color: white;
}

div#company h2 span {
  font-weight: normal;
}

div#contact {
  float: left;
  margin-top: 1em;
  line-height: 1.25;
  font-size: 1.1em;
  font-weight: bold;
}

div#contact a {
  color: white;
}

div#contact a:hover {
  border-bottom: 1px solid #ccc;
}

@media (max-width: 799px) { /* Shrink header on small screens. */
  a#logo {
    float: none;
    margin: auto;
    width: 75px;
  }
  div#company {
    float: none;
    text-align: center;
  }
  div#company h1 {
    font-size: 1.6em;
  }
  div#company h2 {
    font-size: 0.75em;
  }
  div#contact {
    float: none;
    margin-top: 0.75em;
    margin-bottom: 0.25em;
    text-align: center;
    font-size: 1em;
  }
}


/* NAVIGATION */

nav {
  background: #d7d7d7;
  border-bottom: 2px solid #aaa;
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
  line-height: 2.75em;
}

div#phoneNav {
  color: darkblue;
  cursor: pointer;
}

nav ul {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

nav ul li {
  margin: 0;
  padding: 0;
  border-top: 1px solid #aaa;
}

nav ul li a {
  display: block;
  color: darkblue;
}

nav ul li a:hover {
  background: #eee;
}

@media (min-width: 800px) {
  div#phoneNav {
    display: none;
  }
  nav ul {
    display: flex;
  }
  nav ul li {
    flex: auto;
    border-top: none;
  }
}


/* MAIN CONTENT */

main {
  max-width: 1024px;
  margin: 0 auto;
  padding: 25px 15px;
}

main h1 {
  margin-bottom: 0.5em;
  font-size: 1.75em;
  color: darkblue;
}

main h2, sidebar h2 {
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  font-size: 1.25em;
  color: darkblue;
}

main h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-size: 1em;
  color: darkblue;
}

main p, sidebar p, main ol li, main ul li {
  margin-bottom: 0.5em;
  line-height: 1.4;
}

main ol, main ul {
  margin: 0.5em 0 0.5em 2.25em;
}

div#content a:hover {
  border-bottom: 1px solid royalblue;
}

@media (min-width: 720px) {
  main {
    display: flex; /* Switch to two columns i.e. put the sidebar in place. */
    flex-direction: row-reverse; /* Put the sidebar on the left. */
  }
  div#content {
    flex-basis: 1%;
    flex-grow: 1;
  }
}


/* SIDEBAR */

div#sidebar {
  text-align: center;
  margin-top: 2em;
}

div#carousel {
  max-width: 215px;
  margin: 0 auto 1.75em;
  background: #eee;
}

a#fsb {
  display: block;
  max-width: 150px;
  margin: 2em auto;
}

div#carousel img, a#fsb img {
  display: block;
  width: 100%;
}

div#social {
  margin-bottom: 1.25em;
}

div#social a {
  margin: 0 0.5em;
}

div#social a img {
  height: 32px;
}

a#fsb:hover, div#social a:hover {
  filter: brightness(1.5);
}

@media (min-width: 720px) { /* Flex now applies on <main>. */
  div#sidebar {
    width: 215px;
    margin-top: 0.4em;
    margin-right: 1.5em;
  }
}


/* FOOTER */

footer {
  background: #ccc;
}

footer div {
  max-width: 600px;
  margin: auto;
  padding: 15px;
  text-align: center;
  font-size: 12px;
  line-height: 14px;
}


/* HOME PAGE */

div#content ul#why-choose-writersworld {
  list-style-type: none;
  margin-left: 0;
  padding-left: 0;
}

div#content ul#why-choose-writersworld li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}

div#content ul#why-choose-writersworld li:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1em;
  height: 1em;
  background: center/contain url('../images/tick.png');
}


/* AUTHOR TESTIMONIALS */

div#content.testimonials section {
  overflow: hidden; /* Contain floated book cover image. */
  margin-top: 1.5em;
  padding-top: 1.5em;
  border-top: 2px solid silver;
}

div#content.testimonials section img {
  float: right;
  width: 140px;
  margin-left: 10px;
  margin-bottom: 5px;
}

div#content.testimonials section h3 {
  margin-top: 0;
}

div#content.testimonials a.read-more {
  margin-left: 0.5em;
}


/* SAMPLE BOOK COVERS */

div#covers {
  margin-top: 1.5em;
  text-align: center; /* The <figure>s are inline-block. */
}

div#covers figure {
  display: inline-block;
  vertical-align: top;
  width: 28%;
  margin: 0 2% 1.5em;
}

div#covers div {
  position: relative; /* There's an absolutely-positioned <img> inside. */
  padding-top: 100%; /* Perfect square. */
}

div#covers img { /* Horizontal + vertical centering trick. */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
}

div#covers figcaption {
  margin-top: 0.5em;
  font-size: 0.8em;
  color: darkblue;
}

@media (max-width: 900px) {
  div#covers figure {
    width: 45%;
  }
}

@media (max-width: 450px) {
  div#covers figure {
    width: 95%;
  }
}


/* BOOK SIZING SYSTEM */

div#bookSize h2 {
  margin-top: 1.5em;
  padding-bottom: 0.25em;
  border-bottom: 2px solid silver;
}

div#bookSize label {
  margin-right: 1em;
  cursor: pointer;
}

div#bookSize input, div#bookSize span {
  margin: 0 3px;
  vertical-align: middle;
  font: 17px Mulish, sans-serif;
}

div#bookSize input[type="radio"], div#bookSize input[type="button"] {
  cursor: pointer;
}

div#bookSize input[type="text"], div#bookSize input[type="button"] {
  padding: 5px;
}

div#bookSizeBlocks div {
  display: inline-block;
  padding: 4px;
  text-align: center;
}

div#bookSizeBlocks img {
  display: block;
  margin: 0 auto 10px;
  cursor: pointer;
}

div#bookSizeBlocks img#cov1 { height: 100px; }
div#bookSizeBlocks img#cov2 { height: 110px; }
div#bookSizeBlocks img#cov3 { height: 120px; }
div#bookSizeBlocks img#cov4 { height: 130px; }
div#bookSizeBlocks img#cov5 { height: 140px; }
div#bookSizeBlocks img#cov6 { height: 155px; }

div#bookSizeBlocks span.paperSize {
  margin: 5px 0;
  padding: 3px;
  border: 1px solid white;
  cursor: pointer;
}

div#bookSizeBlocks span.paperSize.on {
  color: #a40708;
  border: 1px solid #a40708;
}

div#bookSizeCalc {
  padding: 10px 0;
}

div#bookSize input#pageCount {
  width: 100px;
}

div#calculatedPages {
  padding: 10px 0;
  font-size: 1.3em;
  font-weight: bold;
  color: #a40708;
}


/* SELF-PUBLISHING GUIDE */

main ul#toc {
  columns: 2 300px;
}

main ul#toc li {
  margin-right: 2em;
  margin-bottom: 0.1em;
}

table#printing-costs-table {
  border-collapse: collapse;
}

table#printing-costs-table th, table#printing-costs-table td {
  width: 20%;
  padding: 0.75em 0.25em 0.75em 0;
  text-align: center;
}

table#printing-costs-table th:nth-child(1), table#printing-costs-table td:nth-child(1) {
  width: 40%;
  text-align: left;
}

table#printing-costs-table th {
  vertical-align: bottom;
}

table#printing-costs-table td {
  border-top: 1px solid silver;
}


/* ENQUIRY FORM (ALSO USED FOR CONTRACT FORM) */

form#enquiry {
  max-width: 500px;
}

form#enquiry label:not(.inline) {
  display: block;
  margin-bottom: 0.5em;
}

form#enquiry fieldset {
  margin-bottom: 1em;
  padding: 0;
  border: none;
}

form#enquiry input[type="text"], form#enquiry input[type="email"], form#enquiry input[type="tel"] {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin-bottom: 1em;
  padding: 5px;
  font: 17px Mulish, sans-serif;
}

form#enquiry input[type="radio"] {
  margin-right: 10px;
}

form#enquiry textarea {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 1em;
  padding: 5px;
  font: 17px Mulish, sans-serif;
}

form div.g-recaptcha {
  margin-bottom: 1em;
}

form#enquiry input[type="submit"] {
  padding: 0.5em 2em;
  font: 17px Mulish, sans-serif;
  cursor: pointer;
}


/* CONTRACT */

div#contract-wording {
  height: 530px;
  border: 5px solid silver;
}

/*div#declaration {
  padding: 20px;
  border: 5px solid silver;
  text-align: justify;
  margin-bottom: 1em;
}

#contractBlock {
  display: block;
  margin: 20px auto;
}

#declaration h1 {
  color: #424e66;
}

.declarationLine {
  margin: 10px 0;
}

.declarationLabel h1 {
  margin: 0;
  font-size: 1em;
}

.declarationLabel {
  clear: both;
  float: left;
  width: 175px;
  height: 24px;
  line-height: 24px;
}

.declarationArrow {
  width: 20px;
  float: left;
  height: 24px;
  line-height: 24px;
}

.declarationInput, .declarationRadios {
  width: 380px;
  margin: 0;
  padding: 1px;
  box-sizing: border-box;
  display: block;
  float: left;
  height: 24px;
  max-width: 100%;
}

.declarationRadios {
  height: auto;
}

.declarationTextArea {
  width: 380px;
  margin: 0;
  padding: 1px;
  box-sizing: border-box;
  display: block;
  float: left;
  height: 70px;
  max-width: 100%;
}

#declarationSubmit {
  padding: 8px 22px;
  margin-left: 175px;
  margin-bottom: 1em;
  font-size: 1em;
}*/


/* MISCELLANEOUS */

img#made-in-britain {
  float: right;
  height: 1.7em;
  margin-top: -0.25em;
}

img.press {
  float: right;
  max-width: 50%;
  padding: 0 0 0.5em 1em;
}

.red {
  font-weight: bold;
  color: #cf000b;
}


/* MISC RESPONSIVE */

@media (max-width: 510px) {
  img.press {
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0 0 0.5em;
  }
  .enquiryColon, .enquiryLabel {
    width: auto;
    float: none;
    margin-bottom: 10px;
    display: inline-block;
  }
  .enquiryInput, .enquiryText, .enquiryTextArea {
    width: 100%;
    float: none;
    box-sizing: border-box;
  }
}