/* Sample style sheet for boom!, the book microformat              */
/* written  by Hakon Wium Lie and Bert Bos, November 2005          */
/* You may reuse this style sheet for any purpose without any fees */


html { 
  margin: 0;
  font: 12pt/1.34 "Baskerville", serif;
}

body { 
  margin: 0;
  padding: 5%;
}

h1, h2, h3, h4, h5, h6 { 
  margin: 2em 0 0.5em 0;
  page-break-after: avoid;
} 

h1 {
  padding: 2em 0 2em 0;
  font-size: 2.0em;
  font-weight: normal;
  text-align: center;
  page-break-before: right;
  page-break-after: always;
}

h2 { 
  margin-bottom: 2em;
  font-size: 1.3em;
  text-align: center;
  font-weight: bold;
}

h3 { 
  font-size: 1em;
  font-weight: bold;
  text-align: center;
}

h4 {
  font-size: 1em;
  text-align: right;
}

/* Fonts */

@font-face {
    font-family: Baskerville;
    font-style: normal;
    font-weight: normal;
    src: url("../fonts/baskerville/Baskerville.ttc")
}

@font-face {
    font-family: Baskerville;
    font-style: normal;
    font-weight: bold;
    src: url("../fonts/baskerville/Baskerville.ttc")
}

@font-face {
    font-family: Baskerville;
    font-style: italic;
    font-weight: normal;
    src: url("../fonts/baskerville/Baskerville.ttc")
}

@font-face {
    font-family: Baskerville;
    font-style: italic;
    font-weight: bold;
    src: url("../fonts/baskerville/Baskerville.ttc")
}

q::before {
  content: "\201C";
}

q::after {
  content: "\201D";
}

p { padding: 0 0 0 0; text-align: justify; hyphens: auto; }
.firstcharacter { float: left; font-size: 5.1em; line-height: 40px; padding-top: 13px; padding-right: 8px; padding-left: 3px }
p + p { text-indent: 1.3em }
p.sidenote + p, p.caption, p.art { text-indent: 0 }
p.quote, p.quote + p.quote { margin: 2em 2.5em 0 2.5em;}
div.imprint p { margin: 0; text-align: center;}

p.author {
  text-indent: 0;
  text-align: right;
}
p.image {text-align: center;}

pre {  margin: 1em 1.3em; }

a { text-decoration: underline; color: black }

h1::before {
  white-space: pre;
  margin-left: -2cm;
  font-size: 50%;
}

div.chapter h1::before { content: "Chapter " counter(chapter) " \A"; }

/* cross-references */

a.pageref::after { content: " on page " target-counter(attr(href), page); }
a.chapref::before { content: " Chapter " target-counter(attr(href), chapter) ", "; }
a.figref { content: " Figure " target-counter(attr(href), figure); }
a.tableref { content: " Table " target-counter(attr(href), figure); }

/* sidenotes */

.sidenote {
  float: left;
  clear: left;
  margin: 0 0 1em -41%;
  width: 37%;
  font-size: 0.9em;
  font-style: normal;
  text-indent: 0;
  text-align: right;
  page-break-inside: avoid;
}

/* which section uses which named page */

div.halftitlepage, div.titlepage, div.imprint, div.dedication, 
div.foreword, div.toc, div.preface { page: blank }


/* page breaks */
div.blankpage { page-break-before: always; page-break-after: always; page: blank;}
div.frontcover, div.halftitlepage, div.titlepage { page-break-before: right }
div.imprint { page-break-before: always }
div.dedication, div.foreword, div.toc, div.preface, div.chapter, div.reference, 
div.appendix, div.bibliography, div.glossary, div.index, div.colophon { 
  page-break-before: right 
}
div.backcover { page-break-before: left }

div.chapter, div.appendix { page: startchapter;}

/* the front cover; this code is probably not very reusable by other books */

div.frontcover { page: cover; }

div.frontcover img {
  position: absolute;
  width: 5.5in; height: 8.5in;
  left: 0; top: 0;
  z-index: -1;
}

div.frontcover h1 {
  position: absolute;
  left: 2cm; top: 1cm;
  color: white;
  font-size: 44pt;
  font-weight: normal;
}

div.frontcover h2 {
  position: absolute;
  right: 0; top: 5cm;
  color: black;
  background: white;
  font-size: 16pt;
  font-weight: normal;
  padding: 0.2em 5em 0.2em 1em;
  letter-spacing: 0.15em;
}

div.frontcover h3 {
  position: absolute;
  left: 2cm; top: 7cm;
  color: white;
  font-size: 24pt;
  font-weight: normal;
}

div.frontcover p {
  position: absolute;
  left: 2cm; bottom: 1.5cm;
  font-size: 24pt;
  color: black;
  font-weight: bold;
  text-transform: uppercase;
}

div.dedication {margin-top: 3in}
div.dedication p, div.dedication p + p {text-align: center; text-indent: 0; hyphens: none;}


/* titlepage, halftitlepage */

div.titlepage {text-align: center;}
div.titlepage h1, div.halftitlepage h1 { margin-bottom: 2em; }
div.titlepage h2, div.halftitlepage h2 { font-size: 3em; margin-bottom: 3em; font-weight: normal}
div.titlepage h3, div.halftitlepage h3 { font-size: 1.5em; margin-bottom: 2in; font-weight: normal}
div.titlepage p, div.halftitlepage p { 
  font-size: 1.4em;
  font-weight: bold;
  margin: 0; padding: 0;
  text-align: center;
}

/* imprint */
div.imprint {margin-top: -0.5in}
div.imprint p {
  font-size: .85em;
  text-indent: 0;
  margin-bottom: 1em;
  hyphens: none;
}
div.imprint img {
  width: 200px; height: 157px;
}

/* TOC */

ol.toc, ol.toc ol { 
  list-style-type: none;
  margin: 0; padding: 0;
}
ol.toc ol {
  margin-left: 1em;
  font-weight: normal;
}
ol.toc > li { 
  font-weight: bold;
  margin-bottom: 0.5em;
}
ol.toc a::after {
  content: leader('.') target-counter(attr(href), page);
  font-style: normal;
}
ol.toc > li.frontmatter a::after {
  content: leader('.') target-counter(attr(href), page, lower-roman);
  font-style: normal;
}
ol.toc > li.backmatter a::after {
  content: leader('.') target-counter(attr(href), page);
  font-style: normal;
}

/* chapter numbers */

div.chapter { counter-increment: chapter; }

div.frontcover h1::before, div.titlepage h1::before, div.halftitlepage h1::before {
  content: normal;                  /* that is, none */
}

h1 { string-set: header content();}
div.chapter h1 , div.appendix h1 { string-set: header content(); prince-page-group: start;}

/* index */

ol.index { 
  list-style-type: none;
  margin: 0; padding: 0;
  column-count: 2;
  column-gap: 1em;
}

ul.index a::after { content: ", " target-counter(attr(href), page); }


span.element, span.attribute {
  text-transform: uppercase;
  font-weight: bold;
  font-size: 80%;
}
span.property { font-weight: bold }
code, span.css, span.value, span.declaration {
  font: 90% "Lucida Console", "Lucida Sans Typewriter", monospace;
}


@media screen, handheld {
  html { margin: 1em; font: 14px "Gill Sans", sans-serif; }
  h1 { margin-bottom: 0.5em }
  div.frontcover, div.halftitlepage, 
  div.dedication, div.foreword, div.toc, div.index { display: none }
}