body { widows: 2; orphans: 2; -webkit-hyphens: none !important; adobe-hyphenate: none; -moz-hyphens: none; hyphens: none; } /* Title page */ #cover-image {width: 100%; } /* Use the media query because Kindles don't support max-width */ @media not amzn-mobi, not amzn-kf8 { #cover-image img { max-width: 100%; } } /* If it's a small screen, table width is 90% */ @media (max-width: 480px) { table { width: 90% !important; } } /* If it's a Kindle, table width is 90% */ @media amzn-mobi, amzn-kf8 { table { width: 90% !important; } } div#text-cover h2 { page-break-before: avoid; } /* ToC page */ h2#toc { margin-top: 1em; font-variant: normal; font-family: sans-serif; } /* The "Guide" page */ nav#guide { display: none; } /* Book ToC */ ol.toc, ol.toc ol { padding: 0; margin: 0; } /* Chapters for ToC without Parts */ .toc.no-parts > li { margin-bottom: 0.5em; margin-top: 0.5em; font-size: 122%; } /* Sections for a ToC without parts */ .toc.no-parts > li > ol > li { font-size: 83%; } /* Sub-sections and below for a ToC without parts */ .toc.no-parts > li > ol > li > ol { font-size: 80%; } /* ToC with Parts */ .toc.has-parts > li { margin-bottom: 1em; margin-top: 1em; font-size: 120%; } /* Chapters for a ToC with parts */ .toc.has-parts > li > ol > li { font-size: 83%; } /* Sections and below for a ToC with parts */ .toc.has-parts > li > ol > li > ol { font-size: 80%; } .toc li { list-style: none; padding-left: 0; margin-left: 1em; } .section-number { font-weight: bold; } /* Dedication */ section.dedication-centered { text-align: center; } section.dedication { font-style: italic; margin-top: 10em; } /* headings */ h1#toc { text-align: left;} h1, h2, h3, h4, h5, h6 { font-family: sans-serif; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } /* Parts */ body.kramdown h1, body.markua h1.part { font-size: 2em; line-height: .8em; font-variant: small-caps; margin-top: 20%; text-align: center; padding: 0; font-weight: normal; } /* Chapters */ h1#toc, body.kramdown h2, body.markua h1.chapter { font-size: 1.5em; margin-top: 10%; margin-bottom: 1em; } /* Sections */ body.kramdown h3, body.markua h2.section { font-size: 1.17em; margin-top: 1em; margin-bottom: 0.25em; } body.kramdown h4, body.markua h3.subsection { margin-top: 1em; font-size: 1.12em; margin-bottom: 0.25em; } body.kramdown h5, body.markua h4.subsubsection { margin-top: 1em; font-size: 0.83em; margin-bottom: 0.25em; } body.kramdown h6, body.markua h5.subsubsubsection { font-size: 0.75em; margin: 0; } /* scene breaks */ hr.scene-break { width: 80%; margin-left: 10%; margin-right: 10%; margin-top: 1em; margin-bottom: 1em; } .scene-break.space { margin-top: 1em; } .scene-break.stars { margin-top: 1em; margin-bottom: 1em; width: 100%; text-align: center; } /* Tables */ table { margin: 10px auto 20px auto; border-collapse: collapse; page-break-inside: avoid; } table.markua-grid-table, table.markua-grid-table td, table.markua-grid-table th { border: thin solid; } thead { border-bottom: thin solid; } table.markua-grid-table thead { border-bottom: medium solid; } tbody { padding-bottom: 40px; } tfoot { border-top: medium solid; } tr { page-break-inside: avoid; } td, th { padding-right: 10px; } th { text-align: left; } /* Quizzes */ ol.quiz-questions > li { margin-top: 1em; } ol.quiz-questions ol.quiz-choices { padding-left: 1em; } ol.quiz-questions li p { text-indent: 0; } /* general text */ /* Try not to break paras between an inline figure and its following fake-para p.fake-para { page-break-before: avoid; } /* Try not to break pages between a paragraph and its following inline figure */ p + figure.inline { page-break-before: avoid; } p { text-indent: 0em; margin-top: 0.5em; } span.underline { text-decoration: underline; } span.strikethrough { text-decoration: line-through; } blockquote { margin: 1.5em 0em 1.5em 2em; } /* code blocks */ code.lineno, span.lineno { color: gray; font-size: 80%; } /* setting the display on a div to inline-block makes the epub reader try to fit the div on a single page. See http://www.pigsgourdsandwikis.com/2010/06/goodbye-widows-and-orphans-or-yes-you.html */ figure.code { margin-top: 1em; margin-bottom: 1.5em; margin-left: 0; font-size: 90%; } figure.code figcaption + .highlight { border-top: thin solid #c2c2c2; border-bottom: thin solid #c2c2c2; } code { -webkit-hyphens: none; } figure.code div.highlight { -webkit-hyphens: none; } /* captions for codeblocks and tables */ figure.code figcaption, table caption { page-break-after: avoid; margin-bottom: 0px; } table caption { text-align: center; } figure.code figcaption { margin-top: -10px; padding-top: -10px; text-indent: 0em; } table.with-caption { margin-top: 0px; padding-top: 0px; page-break-before: avoid; } .centered p { text-align: center; text-indent: 0em; } div.page-break { page-break-after: always; } /* asides */ aside { font-size: 0.9em; border-style: solid; background-color: rgb(255,255,255); border-color: rgb(200,200,200); border-width: thin; margin: 1em; padding: 1em 1.5em; } aside h1, aside h2, aside h3, aside h4 { margin-bottom: 0.5em; margin-top: 0em; text-align: left; } /* tips, warnings, etc */ aside.blurb { background-color: white; margin: 1em 1em 1em 0em; padding-left: 0; border-style: none; width: 80%; /* fallback */ width: calc(100% - 60px); display: inline-block; padding-left: 60px; background-repeat: no-repeat; background-position: 0% 1em; background-size: 40px 40px; } /* Use the media query because Kindles don't support overflow */ @media not amzn-mobi, not amzn-kf8 { aside.blurb { overflow: auto; } } aside.blurb { background-image: url("images/leanpub_warning.png"); } /* Endnotes page */ div.footnotes h1, div.footnotes h2 { text-align: left; } div.footnotes h1 { font-size: 1.5em; } div.footnotes h2 { font-size: 1.17em; } div.footnotes .endnote-number { padding-right: 0.5em; font-weight: bold; font-size: 1.2em; } /* force some space before and after code blocks */ pre { margin-top: 0.5em; margin-bottom: 0.5em; font-family: monospace; } /* white-space: pre-wrap causes missing lines on page-breaks in older Kindles */ @media not amzn-mobi7 { pre { white-space: pre-wrap; } } @media amzn-mobi7 { pre { white-space: pre; } } /* poems */ div.poem pre { font-family: serif; } body { } /* image equations */ img.inline-equation { height: 1em; vertical-align: baseline; } img.block-equation { margin-top: 0.5em; margin-right: auto; margin-bottom: 0.5em; margin-left: auto; text-align: center; display: block; } /* Lists */ ul, ol { margin-top: 1em; } /* nested lists should not have a margin */ ul ul, ul ol, ol ul, ol ol { margin-top: 0.1em; } ol.arabic { list-style-type: decimal; } ol.lower-roman { list-style-type: lower-roman; } ol.lower-alpha { list-style-type: lower-alpha; } ol.upper-alpha { list-style-type: upper-alpha; } /* Prevents overflow in non-iBooks epub readers */ /* Use the media query because Kindles don't support max-width */ @media not amzn-mobi, not amzn-kf8 { img { max-width: 100%; } } /* captions for images and tables */ p.caption, table caption, figure.image figcaption { font-size: 0.7em; font-weight: bold; } /* Figures */ figure.image { width: 90%; max-width: 90%; margin-inline-start: 0; margin-inline-end: 0; text-align: center; } figure.image img { display: inline-block; } figure figcaption { text-align: center; margin: 0em !important; padding: 0em !important; text-indent: 0em !important; page-break-before: avoid; } .figure-wrapper.center { text-align: center; } .figure-wrapper.floatleft figure { float: left; clear: left; margin-right: 1em; margin-left: 0; } .figure-wrapper.floatright figure { float: right; clear: right; margin-left: 1em; margin-right: 0; } .figure-wrapper.floatleft figure, .figure-wrapper.floatright figure { width: 50%; } .figure-wrapper.floatleft figure img, .figure-wrapper.floatright figure img { width: 100% !important; vertical-align: text-top; margin: .5em !important; } .figure-wrapper.floatleft figure figcaption, .figure-wrapper.floatright figure figcaption { width: 100%; } .figure-wrapper.alignright { text-align: right; } .figure-wrapper.alignleft { text-align: left; } .figure-wrapper.alignleft figure { margin-left: 0; } .figure-wrapper.alignright figure { margin-right: 0; } .figure-wrapper.alignright figure, .figure-wrapper.alignleft figure { text-align: center; } figure.alignright figcaption, figure.alignleft figcaption { text-align: center; } /* styles for inserted (uil) and deleted (udl) lines */ .udl { text-decoration: line-through; } .uil { font-weight: 900; } @media not amzn-mobi { figure.video, video, video p { display: inline-block; } figure.video-fallback-mobi { display: none; } } @media amzn-kf8 { figure.video, video, video p { display: none; } figure.video.video-fallback-mobi { display: inline-block; } } @media amzn-mobi7 { video { display: none; } .video-fallback-mobi { display: inline-block; } } figure.image, image, figure.audio, audio { display: inline-block; } /* NOTE: I replaced this line: * .err { border: 1px solid #FF0000 } * with this: * .err { color: #FF0000 } * to get rid of the ugly red boxes */ /* ============================================================================== */ /* everything below this line is generated by */ /* rake generate:pygments:styles[default] */ .hll { background-color: #ffffcc } .c { color: #408080; font-style: italic } /* Comment */ .err { color: #FF0000 } .k { color: #008000; font-weight: 600 } /* Keyword */ .o { color: #666666 } /* Operator */ .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .cp { color: #BC7A00 } /* Comment.Preproc */ .c1 { color: #408080; font-style: italic } /* Comment.Single */ .cs { color: #408080; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .gr { color: #FF0000 } /* Generic.Error */ .gh { color: #000080; font-weight: 600 } /* Generic.Heading */ .gi { color: #00A000 } /* Generic.Inserted */ .go { color: #888888 } /* Generic.Output */ .gp { color: #000080; font-weight: 600 } /* Generic.Prompt */ .gs { font-weight: 600 } /* Generic.Strong */ .gu { color: #800080; font-weight: 600 } /* Generic.Subheading */ .gt { color: #0044DD } /* Generic.Traceback */ .kc { color: #008000; font-weight: 600 } /* Keyword.Constant */ .kd { color: #008000; font-weight: 600 } /* Keyword.Declaration */ .kn { color: #008000; font-weight: 600 } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: 600 } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #7D9029 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: 600 } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #999999; font-weight: 600 } /* Name.Entity */ .ne { color: #D2413A; font-weight: 600 } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #A0A000 } /* Name.Label */ .nn { color: #0000FF; font-weight: 600 } /* Name.Namespace */ .nt { color: #008000; font-weight: 600 } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: 600 } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #BB6622; font-weight: 600 } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #BB6688; font-weight: 600 } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #BB6688 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .il { color: #666666 } /* Literal.Number.Integer.Long */