/**
 * ████████╗ ██████╗ ██╗     ██╗███╗   ██╗ ██████╗
 * ╚══██╔══╝██╔═══██╗██║     ██║████╗  ██║██╔═══██╗
 *    ██║   ██║   ██║██║     ██║██╔██╗ ██║██║   ██║
 *    ██║   ██║   ██║██║     ██║██║╚██╗██║██║   ██║
 *    ██║   ╚██████╔╝███████╗██║██║ ╚████║╚██████╔╝
 *    ╚═╝    ╚═════╝ ╚══════╝╚═╝╚═╝  ╚═══╝ ╚═════╝
 *
 * (c) Copyright 2021-present Rakuten Kobo Inc. (https://www.kobo.com)
 *
 */

/** ----------------------------------------------------------------------------
    Global styles
    ------------------------------------------------------------------------- */

/* Apply a natural box layout model to all elements
   http://www.paulirish.com/2012/box-sizing-border-box-ftw/ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  border: none;
  outline: 0;
}

/* A11y */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid black;
}

/* A11y: For the Dark and Charcoal modes, the focus ring should be white */
body.theme-tolino-dark :focus-visible,
body.theme-tolino-charcoal  :focus-visible,

body.theme-kobo-dark :focus-visible,
body.theme-kobo-charcoal :focus-visible,

body.theme-kobojp-dark  :focus-visible,
body.theme-kobojp-charcoal :focus-visible {
  outline: 2px solid white;
}

html,
body {
  /* We set a fixed font size to easier caluclate relative sizes, e.g. rem */
  font-size: 10px;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  user-select: none;
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  body {
    /* See theme colors for color definition */
    background-color: rgb(0, 0, 0);
  }
}

/* Helper classes to prevent flickering of the background if a theme is
   selected. See theme colors for color definitions. */
body.theme-tolino-light,
body.theme-kobo-light,
body.theme-kobojp-light {
  background-color: rgb(255, 255, 255);
}
body.theme-tolino-dark,
body.theme-kobo-dark,
body.theme-kobojp-dark {
  background-color: rgb( 0, 0, 0);
}
body.theme-tolino-sepia,
body.theme-kobo-sepia,
body.theme-kobojp-sepia {
  background-color: rgb(234, 221, 199);
}
body.theme-tolino-charcoal {
  background-color: rgb(72, 72, 74);
}
body.theme-kobo-charcoal,
body.theme-kobojp-charcoal {
  background-color: rgb(34, 34, 34);
}

#root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  width: 100%;
}


#splash-screen {
  align-items: center;
  background-color: white;  /* TODO: Theme handling */
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  left: 0;
  opacity: 1;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity .5s ease-in-out;
}

#splash-screen.invisible {
  opacity: 0;
  z-index: -1;
}

/** ----------------------------------------------------------------------------
    Animations
    ------------------------------------------------------------------------- */

@keyframes rotate360 {
  100% { transform: rotate(360deg); }
}


/**
 * -----------------------------------------------------------------------------
 * RX / EPUB READER
 * -----------------------------------------------------------------------------
 */

.rx-layout-center {
  left: 0;
  width: 100vw;
  height: 100%;
}

.rx-layout-left {
  left: 0;
  width: 50vw;
  height: 100%;
}

.rx-layout-right {
  left: 50vw;
  width: 50vw;
  height: 100%;
}

/* workaround to style images embedded into ToC entries */
.RXTableOfContents_container img,
.RXFooter_metaInfoChapterTitleHTML img {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  width: auto;
  height: 1em;
}

/**
 * -----------------------------------------------------------------------------
 * UR styles
 * -----------------------------------------------------------------------------
 */

#BookView {
}

ReadingOrderView {
  display: flex;
  flex: 0 0 auto;
/* margin-bottom: 8px;
  margin-top: 8px;
  opacity: 0;
  transition-property: opacity;
  transition-duration: 300ms;
*/
  overflow: hidden;
  position: relative;
  height: 100%;
  width: fit-content;
}

ReadingItem {
  display: flex;
  align-items: stretch;
  flex-direction: row;
  height: 100%;
}
