@charset "utf-8"; /*! Blitz — CSS framework for reflowable eBooks Version 1.5.2 (C1C4 v7) by Jiminy Panoz Codename: Cool Under Heat License: MIT (https://opensource.org/licenses/MIT) Version Studio C1C4 */ /* NAMESPACES */ @namespace h "http://www.w3.org/1999/xhtml/"; @namespace epub "http://www.idpf.org/2007/ops"; /* if you need to style epub:type */ @namespace m "http://www.w3.org/1998/Math/MathML/"; /* if you need to style MathML */ @namespace svg "http://www.w3.org/2000/svg"; /* if you need to style SVG */ html { /* Don't use it for styling, used as selector which can take a punch if anything goes wrong above */ } /* Begin CSS */ /* RESET */ /* So here's the trick, we must reset to manage a number of problems once and for all: - HTML5 backwards compatibility (EPUB 3 file in EPUB 2 app); - user settings (e.g. line-height on Kobo and Kindle); - CSS bloat (DRY); - KFX for which a reset using `border: 0` seems to disable support; - etc. It all started as a normalize and became a reset given the magnitude of the task. */ div, h1, p { margin: 0; padding: 0; /* RS may apply vertical padding to el such as p */ font-size: 1em; /* Font size in pixel disable the user setting in legacy RMSDK */ line-height: inherit; /* Kindle ignores it, Kobo needs it. If you don’t use inherit, the user setting may be disabled on some Kobo devices */ text-indent: 0; font-style: normal; font-weight: normal; } /* This is absolutely necessary for backwards compatibility */ /* [Opinionated] Default to prevent RS from justifying all of these! */ h1 { text-align: left; } /* Following EPUB 3 spec by the letter (applies to RS but let’s make sure it is respected because we never know) */ /* Kindle does not follow the EPUB 3 spec. */ @media amzn-kf8, amzn-mobi { nav ol { list-style-type: none !important; } } /* [Opinionated] Default to prevent bloat in case linear="no" is rendered as linear="yes" */ b, i, span, strong, sup { font-size: inherit; vertical-align: baseline; font-style: inherit; /* Taking nesting of inline elements into account (e.g. sup nested in em) */ font-weight: inherit; /* Taking nestiog of inline elements into account (e.g. em nested in strong) */ color: inherit; text-decoration: none; } /* Trying to prevent blank page if element with margin-bottom at the end of xhtml */ body > :last-child { margin-bottom: 0; } /* PAGE LAYOUT */ @page { margin: 30px 30px 20px 30px; /* Recommended by Barnes & Noble in this old spec: https://simg1.imagesbn.com/pimages/pubit/support/pubit_epub_formatting_guide.pdf */ padding: 0; } body { font-size: 100%; line-height: 1.5; margin: 0; /* RS will override margins anyways */ padding: 0; widows: 2; /* iBooks and Kobo support widows and orphans */ orphans: 2; } /* TYPOGRAPHY */ h1, .align-center, .no-hyphens { adobe-hyphenate: none; /* proprietary for Legacy RMSDK */ -ms-hyphens: none; -moz-hyphens: none; -webkit-hyphens: none; -epub-hyphens: none; hyphens: none; } h1 { page-break-inside: avoid; break-inside: avoid; page-break-after: avoid; break-after: avoid; } @media amzn-kf8 { h1, h2, h3, h4, h5, h6, dt, hr { page-break-inside: auto; break-inside: auto; /* Fix blank bug because of page-break-inside: avoid… */ } } h1 { font-size: 1.4375em; line-height: 1.043478; margin-top: 0; margin-bottom: 2.086957em; } @media amzn-kf8 { h1 { line-height: 1.2; /* Minimum value Kindle supports */ } } @media amzn-mobi { h1 { font-size: xx-large; /* Keywords offer more precision for mobi 7*/ margin: 0 0 3em 0; /* mobi7 doesn’t support decimal values */ } } @media amzn-kf8 { h2 { line-height: 1.2; /* Minimum value Kindle supports */ } } @media amzn-mobi { h2 { font-size: x-large; margin: 2em 0 1em 0; } } @media amzn-mobi { h3 { font-size: large; margin: 1em 0; } } @media amzn-mobi { h4 { font-size: medium; margin: 1em 0 0 0; } } /*p { text-indent: 1em; }*/ /*.footnote { font-size: 0.9375em; line-height: 1.6; text-indent: 0; }*/ @media amzn-mobi { .footnote { font-size: medium; } } /*blockquote { margin: 1.5em 5%; } @media amzn-mobi { blockquote { margin: 1em 5%; } }*/ /*blockquote p { text-indent: 0; font-style: italic; } blockquote p i, blockquote p em, blockquote p cite { font-style: normal; }*/ /* MICRO TYPOGRAPHY */ a { text-decoration: underline; /* Note: KF8 will force this value unless you use "el.class a" */ /* font-weight: bold; /* color: inherit; /* -webkit-text-fill-color: inherit; /* iBooks override (iOS 9 + El Capitan in night mode) */ /* inherit = text color */ } i { font-style: italic; } /* Get back to normal when italic nested in italic */ b, strong { font-weight: bold; } @media amzn-mobi { small { font-size: small; } } /* Styling is improved to prevent sub from affecting line-height */ @media amzn-mobi { sub { font-size: x-small; } } /* Styling is improved to prevent sup from affecting line-height */ sup { font-size: 75%; line-height: 1.2; vertical-align: super; /* Fallback */ vertical-align: 33%; } @media amzn-mobi { sup { font-size: x-small; } } /* i18n */ /* Ruby text */ /* FIGURES + IMAGES */ @media amzn-kf8 { figure { page-break-inside: auto; break-inside: auto; /* Fix blank bug because of page-break-inside: avoid… */ } } img { width: auto; max-width: 100%; /* Note: KF8 doesn't support max-width hence "width: auto;" as fallback */ height: auto; object-fit: contain; vertical-align: bottom; /* Remove gap after the image */ } /* Note: portrait image styling + figcaption is a nightmare */ /* See https://github.com/jstallent/ImagesSingleFile for the css hack */ @supports (height: 99vh) { img.portrait { height: 99vh; } } /* LISTS */ @media amzn-mobi { ul, ol { margin: 1em 0; } } /* DEFINITION LISTS dl { margin: 1.5em 0 1.5em 5%; } @media amzn-mobi { dl { margin: 1em 5%; } } dt { margin: 1.5em 0 0 0; font-weight: bold; } @media amzn-mobi { dt { margin-top: 1em; } } dd { /* Styles } dt > dfn { font-style: normal; font-weight: bold; } /* HORIZONTAL RULES — CONTEXT BREAKS */ @media amzn-mobi { hr { margin: 1em 0; } } /* Blank-line context change */ /* Over-engineered asterism with an SVG background which is legacy RMSDK-compliant, reflows with text and is night-mode compatible (black asterisk + white border) */ /*hr.asterism { width: auto; border: none; margin: 1.5em 0; height: 1.5em; text-indent: 0; text-align: center; background: transparent url("../Images/asterism.svg") no-repeat center; /* Change url if you put asterism in a folder */ /* background-size: 2.5em 1.25em; /* RMSDK doesn't support -> won't scale but SVG viewport is OK for a wide range of font-sizes */ /* overflow: hidden; /* Fixes legacy RMSDK bug when contents before hr are invisible */ /* opacity: 0.7; /* Better border color match in night mode (less disruptive) */ /*}*/ /* TABLES */ @media amzn-mobi { table { margin: 0; } } /* CODE */ @media amzn-mobi { pre { margin: 1em 0; } } /* MEDIAS */ svg { width: auto; max-width: 100%; height: auto; } svg { object-fit: contain; } /* CONTAINERS — WRAPPERS */ /* Widths */ @media amzn-kf8 { .w-80 { width: 78%; /* Because Kindle developers… */ margin: 1.5em 11%; } } /* Heights */ @supports (height: 100vh) { /* Can be used for containers and images but Should be used in combination with .portrait if used for img */ .h-100 { height: 99vh; /* Trying to avoid blank page after */ } .h-90 { height: 90vh; } .h-80 { height: 80vh; } .h-70 { height: 70vh; } .h-60 { height: 60vh; } .h-50 { height: 50vh; } .h-40 { height: 40vh; } .h-30 { height: 30vh; } .h-20 { height: 20vh; } .h-10 { height: 10vh; } } /* Floats */ /* If there are too many floating elements in a XHTML file, performance of legacy RMSDK takes a huge hit (± 4 seconds to render page on eInk devices) */ @media amzn-mobi { .float-left { float: none; /* Mobi 7 doesn’t support float */ margin: 1em 0; text-align: center; } } @media amzn-mobi { .float-right { float: none; margin: 1em 0; text-align: center; } } /* UTILITIES */ /* Display */ /* May be useful for EPUB 3.1, warning .absolute in ePubCheck in EPUB 3.0.1 .relative { position: relative; } .absolute { position: absolute; } */ /* Clearings */ /* Bordered content */ /* Margins */ @media amzn-mobi { .margin-top-s { margin-top: 1em; } } .margin-top-m { margin-top: 1.5em !important; } @media amzn-mobi { .margin-top-m { margin-top: 2em; } } @media amzn-mobi { .margin-top-l { margin-top: 3em; } } @media amzn-mobi { .margin-top-xl { margin-top: 5em; } } @media amzn-mobi { .margin-top-xxl { margin-top: 6em; } } .margin-bottom-s { margin-bottom: 0.75em !important; } @media amzn-mobi { .margin-bottom-s { margin-bottom: 1em; } } @media amzn-mobi { .margin-bottom-m { margin-bottom: 2em; } } .margin-bottom-l { margin-bottom: 3em !important; } @media amzn-mobi { .margin-bottom-l { margin-bottom: 3em; } } @media amzn-mobi { .margin-bottom-xl { margin-bottom: 5em; } } @media amzn-mobi { .margin-bottom-xxl { margin-bottom: 6em; } } /* Font-stacks */ /* Text align */ .justified { /* Designed as a class for body — We don't enforce as user setting > author */ text-align: justify; adobe-hyphenate: auto; /* proprietary for Legacy RMSDK */ -ms-hyphens: auto; -moz-hyphens: auto; -webkit-hyphens: auto; -epub-hyphens: auto; hyphens: auto; /* before and after not in spec but iBooks support all three (-webkit-) */ -ms-hyphenate-limit-lines: 2; -moz-hyphenate-limit-lines: 2; -webkit-hyphenate-limit-lines: 2; hyphenate-limit-lines: 2; /* No support except Trident (Windows) */ -ms-hyphenate-limit-chars: 6 3 2; -moz-hyphenate-limit-chars: 6 3 2; -webkit-hyphenate-limit-before: 3; -webkit-hyphenate-limit-after: 2; hyphenate-limit-chars: 6 3 2; /* No support except Trident (Windows) */ -ms-hyphenate-limit-zone: 10%; -moz-hyphenate-limit-zone: 10%; -webkit-hyphenate-limit-zone: 10%; hyphenate-limit-zone: 10%; /* No support */ -ms-hyphenate-limit-last: always; -moz-hyphenate-limit-last: always; -webkit-hyphenate-limit-last: always; hyphenate-limit-last: always; } .align-center { text-indent: 0; /* Necessary as RS may define text-indent for p */ text-align: center !important; } /* Indents */ @media amzn-mobi { .hanging-indent { margin-left: 0; /* hack for negative text-indent */ } } /* Font sizes */ .fs-xs { font-size: 0.875em !important; } @media amzn-kf8 { .fs-xl { line-height: 1.2; /* Minimum value Kindle supports */ } } @media amzn-kf8 { .fs-xxl { line-height: 1.2; /* Minimum value Kindle supports */ } } @media amzn-kf8 { .fs-jumbo { line-height: 1.2; /* Minimum value Kindle supports */ } } /* Font styles */ /* Don't use that with span if b or strong can be used */ /* Don't use that with span if i, cite, dfn or em can be used */ @media amzn-mobi { .caps-to-small-caps { font-size: small; } } /* Misc */ /* PAGE BREAKS */ /* For some reason, after has better support than before (Google, Kobo, etc.) */ /* Let’s pretend it is supported (legacy RMSDK does, others not so much) */ /* Let’s pretend it is supported (legacy RMSDK does, others not so much) */ /* This one works in iBooks, useful for figure or to keep 2 elements together */ @media amzn-kf8 { .no-break-inside { page-break-inside: auto; break-inside: auto; /* Fix blank bug because of page-break-inside: avoid… */ } } /* End CSS */