// What is this?
// -------------
// This is typography for the Electric Book template
// (see http://ebw.co/template).
// It is built with Sass. (See http://sass-lang.com,
// and http://jekyllrb.com/docs/assets for how Jekyll implements Sass.)
// It sets defaults that can be overridden in each book's
// own stylesheets, where the variables here are duplicated.
// 
// How to use it
// -------------
// Edit the default variables below.
// Comment/uncomment or add font imports below.
// Add your own custom CSS at the bottom.

// -------------
// Set variables
// -------------

// Provide a variable for site output
$output-format: "epub" !default;

// Custom variables
@import "custom/colors";
@import "colors";
@import "custom/epub-variables";

// Edition suffix: identifies this edition in certain classes
// (e.g. in _epub-layout-utilities.scss).
$edition-suffix: null !default;

// The path to the project root, for setting paths
// to fonts and colour profiles.
// Override this for translations, which need an extra leading ../
$path-to-root-directory: "../.." !default;

// We name font variables for two categories:
// - 'text' fonts are used for body text and some page features;
// - 'display' fonts are used for headings and similar short-string features.
// For each category, we set a main font and a secondary font,
// allowing up to four fonts.
// Finally, we set a fifth, monospace font for elements like computer code.
$font-text-main: serif !default;
$font-text-secondary: sans-serif !default;
$font-display-main: sans-serif !default;
$font-display-secondary: serif !default;
$font-code: monospace !default;

// Set font size and line-height in ems or px.
// These values, especially $line-height-default,
// are used to compute vertical rhythm
// for many features in this design. So do not use a unitless value
// for line-height, and don't use percentages,
// which will break layouts computed by multiplying this value.
$font-size-default: 1rem !default;
$line-height-default: 1.5rem !default;
$font-size-smaller: 0.8 !default; // How much smaller than font-size-default for features like sidenotes and footers?
$font-size-bigger: 2 !default; // How many times bigger than font-size-default for features like headings and pullquotes?

// Do you want space between paragraphs, rather than a text-indent?
// true or false
$spaced-paras: false !default;
// If not spacing paras, how large is the first-line indent on paragraphs?
$paragraph-indent: 1em !default;

// Extra margin
// Some epub readers don't add any margin to their viewport.
// You can add your own here to force a margin.
// Use CSS margin syntax: a single value sets all sides,
// two values set top/bottom and then left/right,
// four values set top, right, bottom, left respectively.
$epub-margin: 0.5em !default;

// Rounded corners
$button-border-radius: 0.1rem !default; // Roundness of button corners
$box-border-radius: 0.1rem !default; // Roundness of box corners

// Rules, lines
$rule-thickness: 1px !default;

// Colours
$color-text-main: initial !default;
$color-text-secondary: initial !default;
$color-background: transparent !default;
$color-light: $grey-light !default;
$color-mid: $grey-mid !default;
$color-accent: $template-green !default;
$color-links: $template-blue !default;
$color-buttons: $color-accent !default;
$color-buttons-hover: darken( $color-buttons, 20% ) !default;
$color-highlight: $template-yellow !default;
$color-notification-low-text: $color-light !default;
$color-notification-medium-text: $color-light !default;
$color-notification-high-text: $color-light !default;
$color-notification-low-background: $template-green !default;
$color-notification-medium-background: $template-yellow !default;
$color-notification-high-background: $template-orange !default;

// Set the default start-depth of pages.
// This is the distance from the top of the page
// to the first element on the first page.
$start-depth: $line-height-default * 2 !default;

// Set the height of the opener image
$opener-image-height: $line-height-default * 10 !default;

// Hyphenation
// Variables here apply to p, ul, ol, dl.
// Note: Most browsers and ereaders do not support hyphenation rules.
// Can be auto, none, or manual (only breaks on hyphens and soft hyphens)
$hyphenation: manual !default;

// Path to dictionary file, relative to `/book/styles`. E.g. "../../assets/hyph.dic".
$hyphenation-dictionary: "" !default;

// Whether your dictionary adds to or replaces
// the built-in Prince dictionaries. Use add or replace.
$hyphenation-custom: add !default;

// Minimum letters on new line after hyphen
$hyphenate-after: 3 !default;

// Minimum letters at end of line before hyphen
$hyphenate-before: 3 !default;

// Maximum number of consecutive lines ending with hyphens
$hyphenate-lines: 1 !default;

// Text dividers
// Some ereaders can display a character as a text divider.
// For breaks created with *** in markdown.
// If using an image, set $text-divider-image in CSS URL syntax, e.g.
// $text-divider-image: url('../images/epub/text-divider.jpg');
$text-divider-text: "" !default; // Empty leaves space. \2022 is a bullet
$text-divider-image: "" !default;
$text-divider-image-width: $line-height-default !default;

// Title page
$title-page-logo-width: 5rem !default;
$title-page-logo-font: $font-text-main !default;
$title-page-logo-font-size: 0.8rem !default;

// Elements that float. When these are surrounded by paragraphs,
// the following paragraph should be indented when we are not
// using $spaced-paras.
$floated-element-classes: sidenote !default;

// ---------------------------------
// Set to false to turn partials off
// ---------------------------------

// Declare namespaces
$epub-namespaces: true !default;

// Reset ereader CSS as best we can
$epub-css-reset: true !default;

// Structural HTML components
$epub-wrappers: true !default;

// Conventional helper classes
$epub-helpers: true !default;

// Default typography
$epub-base-typography: true !default;

// Book parts
$epub-cover: true !default;
$epub-previous-publications-page: true !default;
$epub-title-pages: true !default;
$epub-copyright-page: true !default;
$epub-dedications: true !default;
$epub-epigraphs: true !default;
$epub-toc: true !default;

// Book-feature classes
$epub-bibliographies: true !default;
$epub-boxes: true !default;
$epub-buttons: true !default;
$epub-code: true !default;
$epub-dialogue: true !default;
$epub-figures: true !default;
$epub-glossaries: true !default;
$epub-highlighter: true !default;
$epub-index: true !default;
$epub-maths: true !default;
$epub-notes: true !default;
$epub-openers: true !default;
$epub-pullquotes: true !default;
$epub-qr-codes: true !default;
$epub-slides: true !default;
$epub-sources: true !default;
$epub-tables: true !default;
$epub-letters: true !default;
$epub-verse: true !default;
$epub-video: true !default;
$epub-questions: true !default;
$epub-select-questions: true !default;

// Type-control classes
$epub-smallcaps: true !default;
$epub-layout-utilities: true !default;

// Logic (if this then that)
$epub-reset-sequences: true !default;

// ------------------
// Declare namespaces
// ------------------

// This must come before other rules,
// after @charset and @import.
@import "template/partials/epub-namespaces";

// ----------------------------------------------------
// Import font files (@font-face) for fonts you specify
// ----------------------------------------------------

// Custom imports
@import "custom/epub-imports";

// ---------------------
// Template modules
// ---------------------

// Reset ereader CSS as best we can
@import "template/partials/epub-css-reset";

// Load general-purpose mixins
@import "template/partials/epub-mixins--buttons";
@import "template/partials/epub-mixins--sidenotes";
@import "template/partials/epub-mixins--show-url";

// Structural HTML components
@import "template/partials/epub-wrappers";

// Conventional helper classes
@import "template/partials/epub-helpers";

// Default typography
@import "template/partials/epub-base-typography";

// Book parts
@import "template/partials/epub-cover";
@import "template/partials/epub-previous-publications-page";
@import "template/partials/epub-title-pages";
@import "template/partials/epub-copyright-page";
@import "template/partials/epub-dedications";
@import "template/partials/epub-epigraphs";
@import "template/partials/epub-toc";

// Book-feature classes
@import "template/partials/epub-bibliographies";
@import "template/partials/epub-boxes";
@import "template/partials/epub-buttons";
@import "template/partials/epub-code";
@import "template/partials/epub-dialogue";
@import "template/partials/epub-figures";
@import "template/partials/epub-glossaries";
@import "template/partials/epub-highlighter";
@import "template/partials/epub-index";
@import "template/partials/epub-maths";
@import "template/partials/epub-notes";
@import "template/partials/epub-openers";
@import "template/partials/epub-qr-codes";
@import "template/partials/epub-pullquotes";
@import "template/partials/epub-sources";
@import "template/partials/epub-tables";
@import "template/partials/epub-letters";
@import "template/partials/epub-verse";
@import "template/partials/epub-video";
@import "template/partials/epub-questions";
@import "template/partials/epub-select-questions";
@import "template/partials/epub-slides";

// Type-control classes
@import "template/partials/epub-smallcaps";
@import "template/partials/epub-layout-utilities";

// Logic (if this then that)
@import "template/partials/epub-reset-sequences";

// Custom rules
@import "custom/epub-rules";
