{{embed base}} html { background: #FFFFFF; } {{embed fonts}} .calibre > div, .calibre1 > div { position: static !important; } body { padding: 0 0 !important; } /* Themes */ {{embed colors}} /* End Themes */ @page { margin: 0 0 !important; } html { padding: 0 !important; -webkit-line-box-contain: block glyphs replaced; } html[__ibooks_writing_mode="vertical-rl"] { /* Vertical right -> left text gets a margin added to the top/bottom */ /* This 5px top/bottom margin necessitates the later TWO rules for height and min-height that use calc to reduce the height by 10. */ margin: 5px 0px !important; } html:not([__ibooks_writing_mode="vertical-rl"]) { /* NOT Vertical right -> left text gets a margin added to the left/right */ margin: 0px 5px !important; } p { widows: 2; orphans: 2; } /* margins */ {{if isScrollMode}} {{if scrollModeIsHorizontal}} /* unpaginated and paginated horizontal scroll */ body { /* left and right margins of chapters, also gaps for paginated content */ margin: 0 40px !important; } :root[__ibooks_writing_mode^="vertical-"] body { /* unpaginated vertical text needs to be constrained */ /* The 10px reduction is to account for our 5px of top+bottom margin introduced on the rule above for vertical-rl */ height: calc({{.pageHeight}}px - 10px) !important; } {{else}} /* unpaginated vertical scroll */ :root[__ibooks_writing_mode^="horizontal-"] body { {{if isPhone}} margin: 100px 0 50px 0 !important; /* iPhone */ {{else }} margin: 220px 0 100px 0 !important; /* iPad */ {{end isPhone}} } /* paginated vertical scroll; top/bottom margin is per-page */ :root[__ibooks_writing_mode^="vertical-"] body { margin: 60px 0 !important; } {{end scrollModeIsHorizontal}} {{else}} /* book mode */ body { -webkit-margin-start: 0px !important; -webkit-margin-end: 0px !important; -webkit-margin-before: 0 !important; -webkit-margin-after: 0 !important; } {{end isScrollMode}} {{if style}} td { max-width: {{.tdClamp}}px !important; } {{end style}} parsererror { white-space: normal !important; } /* Begin Ted */ img { max-height: 95% !important; max-width: 100% !important; box-sizing: border-box; object-fit: contain; page-break-inside: avoid; } svg { max-height: 95% !important; max-width: 100% !important; box-sizing: border-box; object-fit: contain; page-break-inside: avoid; } audio { max-height: 95% !important; max-width: 100% !important; box-sizing: border-box; object-fit: contain; page-break-inside: avoid; } video { max-width: 100% !important; box-sizing: border-box; object-fit: contain; page-break-inside: avoid; width: 300px; height: 150px; } /* End Ted */ [epub|type~="noteref"] { -webkit-tap-highlight-color: rgba(0,0,0,0); } aside[epub|type~="footnote"] { display: none !important; } ruby > rt, ruby > rp { -webkit-user-select: none; } /* centering hack to support Calibre-generated vertical centered documents */ :root:not([__ibooks_has_multiple_pages]) *[__ibooks_centering_hack^="horizontal-"] { /* This avoids extra blank pages. */ min-width: calc({{.pageWidth}}px - 10px); } :root:not([__ibooks_has_multiple_pages]) *[__ibooks_centering_hack^="vertical-"] { /* The 10px reduction is to account for our 5px of top+bottom margin introduced on the rule above for vertical-rl */ min-height: calc({{.pageHeight}}px - 10px); } /* fix documents that abuse inline-block */ :root[__ibooks_has_multiple_pages] *[__ibooks_has_inline_block] { display: block !important; } /* fix writing mode */ :root[__ibooks_has_multiple_pages] span[__ibooks_has_inline_block] { -webkit-writing-mode: inherit !important; }