/* no IE11, no safari 9 or less, yes chrome 50+, yes firefox 50+, yes opera 40+, yes android 4.4+ */

* {
    box-sizing: border-box;
}

.app {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: 'Helvetica Neue', 'Lato', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
}

.app button {
    display: inline-block;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 5px;
    outline: 0;
    text-align: inherit;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-weight: inherit;
    text-decoration: none;
    vertical-align: middle;
}

.app button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.app button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app button:active {
    background: rgba(0, 0, 0, 0.1);
}

.app .readerBar {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    /* height: 44px; */
    /* line-height: 44px; */

    height: 5.5vh;
    line-height: 5.5vh;

    padding: 0 10px;
}

.app .readerBar > div {
    /* needed to remove to fix header centering as noted below */
    /* -webkit-flex: 0 0 auto; */
    /* flex: 0 0 auto; */
}

.app .readerBar .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0px;
    flex: 1;
    text-align: center;
}

.app .book {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: stretch;
    justify-content: stretch;
}

.app .book > div {
    -webkit-flex: 1;
    flex: 1;
    height: 100%;
    width: 100%;
}

.app .book .empty-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    -webkit-justify-content: center;
    justify-content: center;
}

.app .book .empty-wrapper .empty {
    display: block;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    text-align: center;
    padding-top: 60px;
}

.app .book .empty-wrapper .empty .app-name {
    display: block;
    font-size: 40px;
    font-weight: 300;
    margin-bottom: 20px;
}

.app .book .empty-wrapper .empty .big-button,
.app .book .empty-wrapper .empty .big-button:link,
.app .book .empty-wrapper .empty .big-button:visited {
    display: inline-block;
    width: 150px;
    max-width: 100%;
    font-size: 20px;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    margin: auto;
    color: inherit;
    text-decoration: none;
    margin: 20px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.app .book .empty-wrapper .empty .big-button:hover,
.app .book .empty-wrapper .empty .big-button:active {
    background: rgba(0, 0, 0, 0.1);
}

.app .book .empty-wrapper .empty .big-button:active {
    border: 1px solid rgba(0, 0, 0, 0.2);
}


.app .book .empty-wrapper .empty .message {
    display: block;
    max-width: 400px;
    margin: 0 auto;
}

.app .dictionary-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: center;
    justify-content: center;
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 200px;
    max-height: 50%;
    min-height: 150px;
    z-index: 500;
}

.app .dictionary-wrapper .dictionary {
    flex: 0 0 auto;
}

.app .dictionary {
    background: #fff;
    color: #000;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, .15);
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 450px;
    overflow-y: auto;
    overflow-x: hidden;
}

.app .dictionary .definition {
    display: block;
    padding: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.app .dictionary .definition:last-child {
    border-bottom: none;
}

.app .dictionary .definition .word {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.app .dictionary .definition .info {
    display: block;
    margin-bottom: 8px;
    font-style: italic;
}

.app .dictionary .definition .meanings {
    display: block;
}

.app .dictionary .definition .meaning {
    display: block;
    margin-bottom: 8px;
    text-indent: 10px;
}

.app .dictionary .definition .meaning:first-line {
    margin-left: -10px;
}

.app .dictionary .definition .meaning .text {
    display: block;
    margin-bottom: 2px;
}

.app .dictionary .definition .meaning .example {
    display: block;
    font-style: italic;
}

.app .dictionary .definition .credit {
    display: block;
    margin-top: 4px;
    font-style: italic;
    font-size: 12px;
}

.app .sidebar {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    /* width: 90%; */
    max-width: 300px;
    width: 300px;
    background: #fff;
    color: #000;
    z-index: 1001;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .2);
    font-family: 'Helvetica Neue', 'Lato', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.app .sidebar-wrapper-left {
    position: fixed;
    top: 0;
    left: 0;
    right: 300px;
    bottom: 0;
    background: rgba(0, 0, 0, 0.54);
    z-index: 1000;
    cursor: pointer;
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0);
    will-change: background-color;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);

}

.app .sidebar-wrapper {
    position: fixed;
    width: 300px;
    top: 0;
    /* left: 0; */
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.54);
    z-index: 1000;
    cursor: pointer;
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0);
    will-change: background-color;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.app .sidebar-wrapper .sidebar,
.app .sidebar-wrapper-left .sidebar {
    cursor: default;
}

.app .sidebar-wrapper,
.app .sidebar-wrapper .sidebar, 
.app .sidebar-wrapper-left,
.app .sidebar-wrapper-left .sidebar {
    will-change: transform, box-shadow;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.app .sidebar-wrapper.out, 
.app .sidebar-wrapper-left.out {
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
}
.app .sidebar-wrapper-left.out {
    display: none;
}

.app .sidebar-wrapper.out .sidebar {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
    box-shadow: none;
}

.app .sidebar .tab-list {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    -webkit-align-items: flex-end;
    align-items: flex-end;
    border-bottom: 1px solid #ddd;
    background: #fff;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, .15);
    z-index: 1000;
}

.app .sidebar .tab-list .reader-item,
.app .sidebar .tab-list .reader-item:link,
.app .sidebar .tab-list .reader-item:visited {
    -webkit-flex: 1;
    flex: 1;
    display: block;
    color: inherit;
    text-align: center;
    text-decoration: none;
    outline: 0;
    line-height: 50px;

/* bigger / responsive */
    line-height: 4rem;

    border-bottom: 2px solid transparent;
    cursor: pointer;
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0);
    transition: background .1s cubic-bezier(0.23, 1, 0.32, 1), color .15s cubic-bezier(0.23, 1, 0.32, 1), border .15s cubic-bezier(0.23, 1, 0.32, 1);
}

.app .sidebar .tab-list .reader-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .tab-list .reader-item:active {
    background: rgba(0, 0, 0, 0.1);
}

.app .sidebar .tab-list .reader-item.active {
    color: #1565C0;
    border-bottom: 2px solid #1565C0;
}

.app .sidebar .tab-list .reader-item .icon {
    display: inline-block;
    vertical-align: middle;
}

.app .sidebar .tab-container {
    -webkit-flex: 1;
    flex: 1;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f5f5f4;
}

.app .sidebar .toc-list {
    display: block;
}

.app .sidebar .toc-list .reader-item,
.app .sidebar .toc-list .reader-item:link,
.app .sidebar .toc-list .reader-item:visited {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: 0;
    line-height: 32px;
    padding: 0 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.app .sidebar .toc-list .reader-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .toc-list .reader-item.active {
    color: #1565C0;
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .search-bar {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    background: #fff;
    margin: 8px;
    border-radius: 4px;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .15);
    border: 1px solid #ddd;
}

.app .sidebar .search-bar .search-box {
    -webkit-flex: 1;
    flex: 1;
    padding: 0;
    margin: 0;
    color: inherit;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: inherit;
    min-width: 50px;
    padding: 4px;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    outline: 0;
}

.app .sidebar .search-bar .search-button {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    font-size: inherit;
    padding: 4px;
    border-top-right-radius: inherit;
    border-bottom-right-radius: inherit;
    outline: 0;
    border-left: 1px solid #ddd;
    width: 32px;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0); 
}

.app .sidebar .search-bar .search-button:hover {
    background: #eee;
}

.app .sidebar .search-bar .search-button .icon {
    vertical-align: middle;
}

.app .sidebar .search-results {
    display: block;
}

.app .sidebar .search-results .reader-item,
.app .sidebar .search-results .reader-item:link,
.app .sidebar .search-results .reader-item:visited {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: 0;
    line-height: 1.2;
    background: #fff;
    margin: 8px;
    border-radius: 4px;
    font-size: 12px;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .15);
}

.app .sidebar .search-results .reader-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .search-results .reader-item .text {
    display: block;
    padding: 4px;
}

.app .sidebar .info {
    display: block;
}

.app .sidebar .info .cover-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    margin: 24px auto;
    width: 80%;
    border-radius: 4px;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .15);
}

.app .sidebar .info .cover-wrapper .cover {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    display: block;
    width: 100%;
    border-radius: inherit;
}

.app .sidebar .info .title {
    display: block;
    text-align: center;
    font-size: 18px;
    margin-top: 8px;
    font-weight: bold;
}

.app .sidebar .info .series-info {
    display: block;
    text-align: center;
    font-size: 16px;
    margin-top: 4px;
}

.app .sidebar .info .author {
    display: block;
    text-align: center;
    font-size: 14px;
    margin-top: 4px;
}

.app .sidebar .info .description {
    display: block;
    text-align: justify;
    margin: 12px auto;
    padding-top: 12px;
    border-top: 1px solid #ccc;
    max-width: 80%;
    width: 100%;
    line-height: 1.6;
}

.app .sidebar .setting {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid #ccc;
}

.app .sidebar .setting .setting-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.app .sidebar .settings .setting-content {
    display: block;
}

.app .sidebar .settings .chips {
    display: block;
}

.app .sidebar .settings .chips .chip {
    display: inline-block;
    vertical-align: middle;
    border-radius: 32px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    text-align: center;
    margin: 4px;
    padding: 4px 8px;

    /* ionic over-rides the normalize.css setting */
    line-height: 1.15;
}

.app .sidebar .settings .chips .chip:hover,
.app .sidebar .settings .chips .chip.active {
    border: 1px solid rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.15);
}

.app .sidebar,
.app .sidebar-wrapper,
.app .top-bar,
.app .bottom-bar {
    -ms-user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    user-select: none;
}

.app .error {
    display: block;
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 28px 32px;
}

.app .error .error-title {
    display: block;
    margin-bottom: 16px;
    color: red;
    font-weight: 300;
    font-size: 32px;
    line-height: 1;
}

.app .error .error-description,
.app .error .error-info {
    display: block;
    margin-bottom: 8px;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.4;
}

.app .error .error-dump {
    display: block;
    background: rgba(0, 0, 0, 0.1);
    margin-top: 16px;
    padding: 8px;
    border-radius: 5px;
    font-family: monospace;
    word-wrap: break-word;
    word-break: break-all;
    font-size: 12px;
}

@media only screen and (max-width: 950px) {
    .app .readerBar {
        height: 46px;
        line-height: 46px;
        padding: 0 10px;
	margin-top: 10px;
    }
}

@media only screen and (max-width: 450px) {
    .app .readerBar .title {
        display: none !important;
    }
}

.app .hidden {
    display: none !important;
}

/*
 my additions to the original css for geek1011's reader 
  */

.button-bar > .button {
    padding: 0 10px !important;   /* this fixes button icons in the highlighting popover menu */
}

/* Icons */
.custom-icon {
    width: 26px;
    height: 26px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: -2px;
    opacity: 0.9;
}

.custom-icon-small {
    width: 14px;
    height: 14px;
    margin: 0px 5px -2px 5px;
    opacity: 0.9;
}

.ion-wikipedia {
    content: url(../images/WikipediaW.svg);
}

.ion-google {
    content: url(../images/Google__G__Logo.svg);
}
.ion-marker {
    content: url(../images/pencil_straight.svg);
}

.ionicon-x-large:before {
    font-size: x-large !important;
}

.annotation-indicator {
    fill: #1565C0;
    fill-opacity: 1.0;
}

.navbar-button {
    min-width: 5vh !important;
    text-align: center !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
}

/* bookmark tabs */

.bookmark-entry {
    padding-left: 5px;
}

.bookmark-item {
    padding-top: 5px;
    padding-bottom: 5px; 
    white-space: normal; 
    line-height: 1.4; 
    font-style: italic;
}

.bookmarks-hr {
    margin-left: 10px; 
    margin-right: 10px; 
    border-color: rgba(226, 226, 226, 0.25);
    margin: 10px 0 10px 0;
}

.button .icon .reader-big-button-icon:before, 
.button.icon.reader-big-button-icon:before, 
.button.icon-left.reader-big-button-icon:before, 
.button.icon-right.reader-big-button-icon:before {
    font-size: 4vh !important;
    line-height: 5vh !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
    padding-bottom: 5px;
}

.bookmark-pushed {
    color: #86F053 !important;
}

.action-sheet-wrapper {
    max-width: 20rem !important;
}

.bookmark-entry blockquote {
    margin: 5px 0 10px;
    padding: 5px 5px;
    border-left: 2px solid gray;
}


/* because I've introduced a second icon on the right of the header, the title doesn't center correctly. Fix that.  */
/* via https://stackoverflow.com/questions/22429003/how-to-right-align-flex-item */
.readerBarBox {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* make the title chunk bigger than the icon containers */
.title.readerBarBox {
    flex-grow: 5 !important;
}

.readerBarBox:first-child > button { margin-right: auto; }
.readerBarBox:last-child  > button {}

/* give some breathing room at top of mobile devices for the tabs */

.platform-ios .app .sidebar {
    top: 10px;
}
.platform-android .app .sidebar {
    top: 10px;
}

/* fix the notch on iPhoneX */
/* roughly via: https://github.com/ionic-team/ionic-v1/issues/343 to fix iPhone X */

.platform-ios .app, .app .sidebar {
    padding-top: calc(env(safe-area-inset-bottom));
}
