/*

File: ebook.css

Ebook styles for things other than book content.
See ebook_sb.css for book content.

Sections:
	General
	Page.js Locations
	Landing
	Index / My Books
	Table Of Contents
	TOC Bar
	Section
	Section Header
	Search
	Section Container / Body

*/

/**************************************
	General
**************************************/

/* TODO: Shouldn't this be in a master? */
#main-content ul,
#main-content ol {
	margin: 0;
}

@font-face {
	font-family: URWPalladioL;
	src: local("STIXGeneral");
}

.ebk-clear {
	clear: both;
}

.ebk-one-line {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ebk-relative {
	position: relative;
}

.ebk-pointer {
	cursor: pointer;
}

.ebk-center-button {
	cursor: pointer;
	text-align: center;
}

.ebk-left-button {
	cursor: pointer;
	float: left;
	padding-right: 8px;
}

.ebk-right-button {
	cursor: pointer;
	float: right;
	padding-left: 8px;
}

/* List from http://stackoverflow.com/questions/2032652/ */
.ebk-pre {
	font-family: Consolas, Monaco, Lucida Console, Liberation Mono,
		DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
}

/* TODO: Where should this go? */
.ebk-hard-symbol {
}

@media print {
	body.ebooks {
		background: initial !important;
	}
	body.ebooks > * {
		display: none !important;
	}
}

/**************************************
	Page.js Locations
**************************************/

#ebk-loc-index {
	width: 985px; /* main-content - sidebar - margin = 1230 - 237 - 8 */
	margin: 10px 0 10px 8px;
	float: left;
}

#ebk-loc-book {
	width: 1024px;
	margin: 10px auto;
}

/* Responsive design */

@media (max-width: 1270px) {
	#ebk-loc-index {
		width: 735px;
	}

	#ebk-loc-book {
		width: 960px;
	}
}

@media (max-width: 1020px) {
	#ebk-loc-index {
		width: 645px;
	}

	#ebk-loc-book {
		width: 870px;
	}
}

@media (max-width: 930px) {
	#ebk-loc-index {
		width: 555px;
	}

	#ebk-loc-book {
		width: 780px;
	}
}

@media (max-width: 840px) {
	#ebk-loc-index {
		width: 96%;
		width: calc(100% - 16px);
		margin-right: 8px;
	}

	#ebk-loc-book {
		width: 620px;
	}
}

@media (max-width: 640px) {
	#ebk-loc-book {
		width: 100%;
	}
}

/**************************************
	Landing
**************************************/

/* Based off of CSS in /m/store/views/default/online.phtml */

.ebk-landing h1 {
	margin: 0;
}

.ebk-landing-tab-wrapper {
	width: 100%;
}
.ebk-landing-tab-wrapper .ebk--tab {
	background-color: #61646d;
	color: white;
	margin: 0;
	padding: 3px 0px;
	text-align: center;
	box-sizing: border-box;
	cursor: pointer;
	height: 44px;
	line-height: 44px;
	border-bottom: 2px solid white;
	font-weight: bold;
}
.ebk-landing-tab-wrapper .ebk--tab:hover {
	background-color: #008345;
	opacity: 0.5;
}
.ebk-landing-tab-wrapper .ebk--tab.ebk--active {
	background-color: #008345;
}
.ebk--tab-contents {
	background-color: white;
	padding: 10px;
}
.ebk--tab-contents h3 {
	margin: 0;
	padding: 0;
}
@media (min-width: 769px) {
	.ebk-landing-tab-wrapper .ebk--tab {
		width: 33.3%;
		float: left;
		border-right: 2px solid white;
		line-height: inherit;
		height: auto;
	}
	.ebk-landing-tab-wrapper .ebk--tab:last-child {
		border-right-width: 0px;
	}
}

/**************************************
	Index / My Books
**************************************/

.ebk-index > .ebk--header {
	color: #009fad;
	font-size: 24pt;
	font-weight: bold;
}

.academy .ebk-index > .ebk--header {
	color: #61ad00;
}

.ebk-index-item {
	width: 100%;

	margin-top: 14px;
	margin-bottom: 36px;
}

.ebk-index-item-pending {
	opacity: 0.5;
	pointer-events: none;
}

.ebk-index-item-header {
	background-color: #1b365d;
	height: 36px;
	line-height: 36px;
	padding-left: 20px;
	padding-right: 10px;
}

/* Specificity wars... */
.store .ebk-index-item-header > h1,
.ebk-index-item-header > h1 {
	line-height: 36px;
	color: #fff;
	font-size: 18pt;
	font-weight: bold;
}

.ebk-index-item-header > .ebk-right-button {
	color: #fff;
	padding-left: 16px;
}

.ebk-index-item-main {
	background-color: #fff;
	padding: 20px 8px 8px 20px;
}

.ebk-index-item-main .ebk--left {
	width: 18%;
	float: left;
	margin-right: 16px;
	margin-bottom: 16px;
}
.ebk-index-item-main .ebk--left > a {
	display: block;
}

.ebk-index-item-main .ebk--left img.ebk--cover-image {
	width: 100%;
	height: auto;
	margin-bottom: 16px;
}

.ebk-index-item-main .ebk--by {
	color: #666;
	margin-bottom: 4px;
}

.ebk-index-item-main .ebk--chapter-column {
	width: 38%;
	display: inline-block;

	margin-bottom: 24px;
}

.ebk-index-item-main .ebk--chapter-column div {
	height: 24px;
	line-height: 24px;
}

.ebk-cancel-reason {
	width: 400px;
}

/**************************************
	Table of Contents
**************************************/

.ebk-toc-container {
	margin-bottom: 16px;
}

.ebk-toc-chapter {
	font-size: 14pt;
	font-weight: bold;
	margin: 12px 0 0;
	padding: 6px 0;
	border-top: 2px solid black;
}

.ebk-toc-chapter:first-child {
	margin: 0;
	border-top: 0px solid black;
}

.ebk-toc-section {
	padding-left: 16px;
	margin: 2px 0;
}

.ebk-toc-subsection {
	padding-left: 32px;
	margin: 2px 0;
}

/**************************************
	TOC Bar
**************************************/

.ebk-toc-bar {
	background-color: #eee;
	padding: 0 2px 2px 0;
}

.ebk-toc-bar.ebk--horiz {
	padding-bottom: 0;
	white-space: nowrap;
}

.ebk-toc-bar-item {
	position: relative;
	text-align: center;
	font-size: 9pt;
	font-weight: bold;

	margin: 2px 0 0 2px;
}

.ebk-toc-bar-item.ebk--horiz {
	display: inline-block;
	top: -2px;
	margin-top: 0;
}

.ebk-toc-bar-item.ebk--passed {
	background-color: #1b365d;
	color: #fff;
}

.ebk-toc-bar-item.ebk--current {
	background-color: #009fad;
	color: #fff;
}

.academy .ebk-toc-bar-item.ebk--current {
	background-color: #61ad00;
}

.ebk-toc-bar-item.ebk--later {
	background-color: #fff;
	color: #666;
}

.ebk-toc-bar-item .ebk--hover-tip {
	position: absolute;
	/* Position set/tweaked by JS */
	left: 26px;
	top: -36px;
	width: 144px;
	height: 30px;

	z-index: 100;

	background-color: #a0a0a0;
	color: #fff;
	border-radius: 6px;
	padding: 6px;

	text-align: center;
	font-weight: normal;
}

/* Speech bubble triangle - left */
.ebk-toc-bar-item .ebk--hover-tip:before {
	content: " ";
	position: absolute;
	left: -12px;
	top: 9px;
	width: 0px;
	height: 0px;

	z-index: 100;

	border: 6px solid transparent;
	border-right-color: #a0a0a0;
}

/* Speech bubble triangle - bottom */
.ebk-toc-bar-item.ebk--horiz .ebk--hover-tip:before {
	left: 66px; /* (width - 2*padding) / 2 = (144 - 2*6) / 2 */
	top: 30px;
	border-right-color: transparent;
	border-top-color: #a0a0a0;
}

.ebk-offline-mode .ebk-toc-bar {
	visibility: hidden;
}

/**************************************
	Main Book Widget
**************************************/

.ebk-book-main {
	width: 1024px;
	max-width: 1024px;
	margin: 0 auto 24px;
}

#ebk-loc-edge-book {
	width: 100%;
	margin: 10px auto;
}

.ebk-edge-book-main {
	width: 1024px;
	max-width: 1024px;
	margin-left: auto;

	border: 1px solid red;
	padding: 4px;
	background-color: #fff;
}

/* Responsive design */

@media (max-width: 1270px) {
	.ebk-book-main,
	.ebk-edge-book-main {
		width: 960px;
		max-width: 960px;
	}
}

@media (max-width: 1020px) {
	.ebk-book-main,
	.ebk-edge-book-main {
		width: 870px;
		max-width: 870px;
	}
}

@media (max-width: 930px) {
	.ebk-book-main,
	.ebk-edge-book-main {
		width: 780px;
		max-width: 780px;
	}
}

@media (max-width: 840px) {
	.ebk-book-main,
	.ebk-edge-book-main {
		width: 620px;
		max-width: 620px;
	}
	.ebk-toc-bar {
		display: none !important;
	}
}

@media (max-width: 640px) {
	.ebk-book-main,
	.ebk-edge-book-main {
		width: 100%;
		max-width: 100%;
	}
}

.ebk-admin-curr-sidebar,
.ebk-edge-sidebar {
	position: fixed;
	left: 1%;
	top: 76px;
	width: 20%;

	margin: 8px;
	padding: 8px;
	border: 2px solid red;

	background-color: #fdd;
	color: #400;
	font-weight: bold;

	z-index: 100;
}

.ebk-admin-curr-sidebar {
	width: 15%;
	text-align: left;
	font-size: 11pt;
}

@media (max-width: 1270px) {
	.ebk-admin-curr-sidebar,
	.ebk-edge-sidebar {
		position: static;
		width: auto;
	}
}

.ebk-edge-latex-main {
	position: fixed;
	left: 5px;
	top: 5px;
	width: 30%;

	margin: 8px;
	padding: 8px;
	border: 2px solid #662;

	background-color: #ffd;

	z-index: 1000000;
}
.ebk-edge-latex-main .ebk--old-latex {
	overflow-y: scroll;
	height: 80px;
}
.ebk-edge-latex-main .ebk--label {
	margin: 8px;
	font-weight: bold;
}
.ebk-edge-latex-find-buttons {
	text-align: center;
}
.ebk-edge-latex-find-buttons .btn {
	display: inline-block;
	width: 130px;
	margin: 8px 20px;
}
.ebk-edge-latex-fix-buttons .btn {
	display: block;
	width: 160px;
	margin: 8px auto;
}
.ebk-latex-fix-wrap-active {
	background-color: orange;
}
.ebk--new-latex {
	width: 100%;
}

/**************************************
	Book Header
**************************************/

.ebk-book-header {
	height: 75px;
	background-color: #1b365d;
}

.ebk-book-fake-header {
	height: 60px;
	background-color: #1b365d;
	color: white;
	font-size: 25px;
}

/* Don't style the custom fonts with variants or bold */
.ebk-book-header .aops-font {
	font-weight: normal !important;
	font-variant: normal !important;
}

.ebk-book-header .ebk--cover-image {
	min-width: 60px;
	float: left;
}

.ebk-book-header .ebk--cover-image img {
	height: 75px;
	width: auto;
}

.ebk-book-fake-header .ebk--cover-image img {
	height: 60px;
	width: auto;
}

.ebk-book-header-chapter {
	height: 41px;
	line-height: 40px;
	padding-right: 8px;
}

.ebk-book-header-section {
	height: 34px;
	line-height: 33px;
	background-color: #009fad;
	padding-right: 8px;
}

.academy .ebk-book-header-section {
	background-color: #61ad00;
}

.ebk-book-header .ebk--left {
	float: left;
	width: 48%;
	height: 100%;
	padding: 0 8px;
	border-right: 1px solid #fff;
	position: relative;
}

.ebk-book-header-chapter > .ebk-right-button {
	padding-left: 16px;
	color: #1b365d;
	height: 100%;
}

.ebk-book-header-section > .ebk-right-button {
	padding: 0 4px 0 20px;
	font-variant: small-caps;
	height: 100%;
}
.ebk-book-header-section > .ebk-right-button .ebk--text-caption {
	text-transform: lowercase;
}

/* Offline mode */

.ebk-offline-mode .ebk--nav,
.ebk-offline-mode .ebk--new-topic,
.ebk-offline-mode .ebk--community,
.ebk-offline-mode .ebk--alcumus,
.ebk-offline-mode .ebk-search-input {
	display: none;
}

/* Responsive design - remove captions from some buttons */

@media (max-width: 1020px) {
	.ebk-book-header-section .ebk--text-caption {
		display: none;
	}
}

/* Responsive design - remove feed at 700px */

@media (max-width: 1020px) {
	.ebk-book-header .ebk--new-topic,
	.ebk-book-header .ebk--community {
		display: none;
	}
}

.ebk-book-header-chapter,
.ebk-book-header-chapter a {
	color: #fff;
	font-size: 18pt;
	font-weight: bold;
}

.ebk-book-header-section,
.ebk-book-header-section a {
	color: #fff;
	font-size: 13pt;
	font-weight: bold;
}

.ebk-book-header-chapter a:hover,
.ebk-book-header-section a:hover {
	text-decoration: none;
}

.ebk-book-main .ebk-toc-bar {
	width: 24px;
	height: 100%;
}

/* Two-column layout trick from the Tables section here:
http://css-tricks.com/fluid-width-equal-height-columns/ */
.ebk-book-content-columns {
	display: table;
	table-layout: fixed;
	width: 100%;
}
.ebk-book-content-columns-inner {
	display: table-row;
	vertical-align: top;
}
.ebk-book-content-columns-inner > div {
	display: table-cell;
	vertical-align: top;
}

/**************************************
	Search
**************************************/

.ebk-search {
	float: right;
	position: relative;
	width: 25%;
}

.ebk-search,
.ebk-search a {
	color: black;
	font-size: 12pt;
	font-weight: normal;
}

.ebk-search-input {
	position: relative;
}
.ebk-search-input:before {
	content: "";
	display: block;
	width: 14px;
	height: 14px;
	background-image: url(../images/searchicon.png);
	position: absolute;
	top: 14px;
	left: 6px;
	z-index: 1000;
}
/* Tweak for My books page, not sure why needed but... */
.ebk-index-item-header .ebk-search-input:before {
	top: 11px;
}
.ebk-search-input input {
	width: 100% !important;
	padding-left: 24px !important;

	border: 1px solid #ddd !important;
	border-radius: 15px !important;
}

.ebk-search > div {
	display: inline-block;
	width: 100%;
}

.ebk-search-results,
.ebk-search ul.ui-menu {
	position: absolute;
	z-index: 50;

	/* width: 248px; /* 250 (input) - 2 (2*border) */
	padding: 0; /* Not sure what we're overriding, but needed */

	background-color: #eee;
	border: 1px solid #aaa;
	border-top-width: 0;
}
.ebk-search-results {
	left: 0px;
	top: 32px;
}

.ebk-search-results .ebk--item,
.ebk-search ul.ui-menu li {
	/* To get chosen-style background to work */
	margin: 2px;

	height: 26px;
	line-height: 26px;
	padding-left: 20px; /* 24 (input padding) - 4 (2*margin) */

	/* Copied from .ebk-one-line */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;

	cursor: pointer;
	list-style: none;
}

/* Ripped from chosen.css:165 to match bookstore chosen */
.ebk-search-results .ebk--item:hover,
.ebk-search ul.ui-menu li:hover {
	background-color: #3875d7;
	background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
	color: #fff;
}
.ebk-search-results .ebk--item:hover > a,
.ebk-search ul.ui-menu li:hover > a {
	color: #fff !important;
}

/**************************************
	Section Container/Body
**************************************/

/* Container has display: table-cell, so things like position: relative are unsafe. */
.ebk-section-container {
	/* width is computed automatically by display:table algorithms */
	background-color: #fff;
}

.ebk-section-container .error-box {
	margin: 10px;
}

.ebk-section-body .aops-loader {
	margin: 12px 0;
	text-align: center;
}

.ebk-section-body {
	padding: 0px 36px;
	position: relative;

	text-align: justify;
	/* font-family: STIX; */
	font-size: 15px;
	color: #000;
}

.ebk-section-body-gutter {
	left: 0px;
	top: 0px;
	width: 36px;
	height: 1px;
	position: absolute;
}

.ebk-section-body-par-anchor {
	position: absolute;
	text-align: center;
	width: 100%;
}

/*.ebk-section-body-par-anchor a {
	color: #AAA;
	font-weight: bold;
}*/

.ebk-book-main .ebk-section-container {
	margin-left: 30px; /* TOC width */
}

.ebk-section-body-footer {
	font-weight: bold;
	margin: 12px 0;
	font-size: 16pt;
}
.ebk-section-body-footer,
.ebk-section-body-footer a {
	color: #1b365d;
}

.ebk-fake-section-body-footer {
	font-weight: bold;
	margin: 12px 0;
	font-size: 16pt;
	color: #1b365d;
}

.ebk-offline-mode .ebk-section-body-footer,
.ebk-offline-mode .open-feed-btn,
.ebk-offline-mode .new-topic-btn {
	display: none !important;
}

.ebk-edge-book-main .ebk-section-body {
	margin: 12px auto;
}

.ebk-copy-text {
	width: 400px;
}
.ebk-copy-text input {
	width: 100%;
}

@media (max-width: 840px) {
	.ebk-section-body {
		text-align: left;
	}
}

@media print {
	body.ebooks:after {
		content: "Printing is disabled for Ebooks.";
		display: block;
		text-align: center;
		font-size: 24pt;
		margin: 24px;
	}
}
