/* Fix weird behavior
-------------------------------------------------------------------------------*/

/*
When using event delegation if the parent element has a click handler, when
the user touches anything inside this element, the whole region will gray
out (on iOS 5.1), or flicker (on iOS 6). */

* {
  -webkit-tap-highlight-color:transparent;
}

/* Clearfix solution */
.container:after {
  content:"";
  display:table;
  clear:both;
}

/* Article
-------------------------------------------------------------------------------*/

.article {
  height: 100%;
}

/* Surface specific styles */
.content-node {

}

.hidden {
  visibility: none;
}

.content-node .content {
  margin: 0px;
}

/* Main content panel
======================================================================= */

.article .document {
  line-height: 28.5px;
  font-size: 17px;
  position: relative;
  float: left;
  overflow: hidden;
  height: 100%;
  width: 50%;
  border-right: 1px solid #ddd;
}

.article .document .surface.content {
  position: absolute;
  top: 0px;
  bottom: 0px;
  right: 0px;
  left: 0px;
  overflow-y: scroll;
  overflow-x: hidden;

  /*overflow: auto;*/
  -webkit-overflow-scrolling: touch;
}

.article .document .surface.content .nodes {
  min-height: 100%;
  padding-left: 20px;
  padding-right: 0px;
  background: #FFFFFF;
  padding-bottom: 50px;
}


/* Back Navigation
=======================================================================*/





/* Context Toggles
=======================================================================*/

.article .panel.hidden {
  visibility: hidden;
}

.menu-bar {
  position: absolute;
  top: 0px;
  height: 40px;
  left: 0px;
  right: 0px;
  overflow: hidden;
  /*background: #444;*/
  color: #444;
  border-bottom: 1px solid #ddd;
  z-index: 20000;
}

.menu-bar .context-toggles {
}

.menu-bar .context-toggles a {
  display: block;
  float: left;
  font-size: 13px;
  font-weight: 600;
  line-height: 40px;
  color: rgba(0,0,0, 0.4);
  border-right: 1px solid #ddd;
  padding-right: 15px;
  padding-left: 15px;
}

.menu-bar .context-toggles a.context-toggle.hidden {
  display: none;
}

.menu-bar .context-toggles a:hover {
  /*color: #fff;*/
  color: rgba(0,0,0, 0.5);
  background: rgba(0,0,0, 0.03);
}

.menu-bar .context-toggles a.active {
  background: rgba(0,0,0, 0.05);
  color: #444;
  border-bottom: 3px solid #444;
}


/* Resources Panel
======================================================================= */

.article .resources {
  float: right;
  line-height: 25px;
  width: 50%;

  height: 100%;
  padding-left: 50px;
  padding-right: 50px;
  position: relative;
}

/* It's not exactly good to have the overflow-y: scroll for the container AND the surface.
   There should be just one overflowing container, if possible
*/

.article .resources .panel {
  position: absolute;
  top: 40px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  /*  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;*/
}

.article .resources .surface {
  position: absolute;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.article .nodes {
  padding-left: 50px;
  padding-right: 50px;
}

.article .resources .nodes {
  padding-left: 0px;
  padding-right: 20px;
}

.article .resources .nodes > .content-node {
  position: relative;
  background: #fff;
  border-bottom: 1px solid #ddd;
  border-left: 3px solid transparent;
  padding: 0px;
}

.article .resources .nodes > .content-node > .content {
  border-top: none;
}

/* Clickable header */
.article .resources .content-node .resource-header {
  padding-top: 15px;
  font-weight: 600;
  position: relative;
}

/* TOC View
----------------------------------------------------------------------- */

.article .resources .panel .toc {
  padding-left: 20px;
  padding-right: 20px;
  position: absolute;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  overflow: auto;
  padding-top: 30px;
  padding-bottom: 30px;
}

/* Info View
----------------------------------------------------------------------- */

.article .resources .surface.info {
}

/* Related Articles View
----------------------------------------------------------------------- */

.article .resources .surface.related_articles {
}

/* Consistent Resource Header for figures captions and person cards
----------------------------------------------------------------------- */

.article .resources .resource-header .name {
  display: block;
  min-height: 30px;
  font-size: 16px;
  line-height: 21px;
  padding: 0px 20px;
  padding-right: 200px;
}


.article .resources .content-node .reference-count {
  font-size: 13px;
  position: absolute;
  right: 20px;
  top: 40px;
  text-align: right;
}

/* Resource toggles */
.article .resources .content-node .resource-header .toggles {
  position: absolute;
  top: 0px;
  right: 0px;
  overflow: auto;
}

/* Resource toggle */
.article .resources .content-node .resource-header .toggle {
  float: left;
  font-size: 12px;
  font-weight: 600;
  bottom: 0px;
  text-align: center;
  line-height: 50px;
  color: rgba(0,0,0, 0.4);
  padding: 0px 20px;
}

.article .resources .content-node .resource-header .toggle i {
  padding-right: 5px;
}

.article .resources .figures .content-node.highlighted .resource-header .toggle.toggle-res,
.article .resources .math .content-node.highlighted .resource-header .toggle.toggle-res {
  color: rgba(145, 187, 4, 1);
}

.article .resources .citations .content-node.highlighted .resource-header .toggle.toggle-res {
  color: rgba(11, 157, 217, 1);
}

.article .resources .info .content-node.highlighted .resource-header .toggle.toggle-res {
  color: #5c6570;
}

.article .resources .content-node .resource-header .toggle:hover {
  color: rgba(0,0,0, 0.6);
}


#container .article .content-node.highlighted .fa.fa-eye-slash {
  display: inline;
}


/* Resource Fullscreen Mode
======================================================================= */

/* Styles for fullscreen toggle on resource cards */

.article .resources .figures .content-node.fullscreen .resource-header .toggle.toggle-fullscreen,
.article .resources .math .content-node.fullscreen .resource-header .toggle.toggle-fullscreen {
  color: rgba(145, 187, 4, 1);
}


#container .article .content-node.fullscreen {
  position: fixed;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  z-index: 100000;
  margin-bottom: 0px;
  margin-right: 0px;
  padding: 0px;
}


#container .article .content-node.fullscreen > .content {
  position: absolute;
  top: 80px;
  bottom: 0px;
  left: 0px;
  right: 0px;

  overflow: auto;
}

/* Info panel overrides
----------------------------------------------------------------------- */

#container .article .surface.info .content-node.caption .content {
  padding: 20px;
}


/* Annotations
----------------------------------------------------------------------- */

.article span.annotation {
/*  -webkit-transition-property: background, color;
  -moz-transition-property: background, color;
  transition-property: background, color;

  -webkit-transition-duration: 0.1s;
  -moz-transition-duration: 0.1s;
  transition-duration: 0.1s;*/
}

/* Small caps */
span.annotation.sc {
  font-variant: small-caps;
}

span.annotation.formula_reference, span.publication_reference {
  padding-left: 3px; padding-right: 3px;
}

.article span.emphasis, .article em {
  font-style: italic;
}

.article span.superscript, .article sup {
  vertical-align: super;
  font-size: 12px;
}

.article span.subscript, .article sub {
  vertical-align: sub;
  font-size: 12px;
}

.article .cover span.superscript, .article .cover span.subscript, .article .cover sup, .article .cover sub {
  font-size: inherit;
}

.article span.strong, .article strong {
  font-weight: bold;
}

.article span.underline {
  text-decoration: underline;
}

.article span.label {
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
  font-size: 12px;
  padding: 5px;
  font-weight: bold;
}

.content-node .idea { background-color: rgba(102, 182, 32, 0.3); }
.content-node .question { background-color: rgba(16, 167, 222, 0.3); }
.content-node .error { background-color: rgba(237, 96, 48, 0.3); }

.content-node .link { font-weight: bold; }
.content-node .link:hover, .content-node .link.highlighted { color: rgba(11, 157, 217, 1); }

/* Inline Code Annotations */

.content-node .code {
  font-family: Consolas, "Liberation Mono", Courier, monospace;
  background: #eee;
  font-size: 13px;
  padding: 2px 3px;
  -webkit-font-smoothing: subpixel-antialiased;
}

/* Highlighted states */
.content-node .idea.highlight { background-color: rgba(102, 182, 32, 0.6); }
.content-node .question.highlight { background-color: rgba(16, 167, 222, 0.6);}
.content-node .error.highlight { background-color: rgba(237, 96, 48, 0.6); }

/* Selected states */
.content-node .content span.selected { background: rgba(0,0,0,0.08); }
.content-node .content .idea.selected { background-color: rgba(102, 182, 32, 0.4); }
.content-node .content .question.selected { background-color: rgba(16, 167, 222, 0.4);}
.content-node .content .error.selected { background-color: rgba(237, 96, 48, 0.4); }

/* Em, Strong, Link */
.content-node .emphasis { font-style: italic; }
.content-node .strong { font-weight: bold; }

.content-node .figure_reference {
  background: rgba(145, 187, 4, 0.15);
  border-bottom: 1px solid rgba(145, 187, 4, 0.6);
  color: #495A11;
  cursor: pointer;
}

.content-node .contributor_reference {
  padding: 2px 1px;
  cursor: pointer;
}

.content-node .citation_reference {
  background: rgba(11, 157, 217, 0.075);
  color: #1B6685;
  border-bottom: 1px solid rgba(11, 157, 217, 0.4);
  cursor: pointer;
  padding-right: 3px;
  padding-left: 3px;
}

.content-node .cross_reference {
  background: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.content-node .definition_reference {
  font-style: italic;
  background: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* Hover states */
.content-node .figure_reference:hover { background-color: rgba(145, 187, 4, 0.35); }
.content-node .citation_reference:hover { background-color: rgba(11, 157, 217, 0.30); }
.content-node .contributor_reference:hover { background-color: rgba(0,0,0, 0.05); }
.content-node .definition_reference:hover { background-color: rgba(0,0,0, 0.1); }

/* Highlighted states */
.content-node .figure_reference.highlighted { background: rgba(145, 187, 4, 0.7); }
.content-node .citation_reference.highlighted { background: rgba(11, 157, 217, 0.6); }
.content-node .contributor_reference.highlighted { background-color: #5c6570; color: white; }
.content-node .definition_reference.highlighted { background-color: #5c6570; color: white; }

/* Cross Reference */
.content-node .cross_reference:hover {
  background-color: rgba(0, 0, 0, 0.10);
}

/* Reader-specific overrides for content nodes
======================================================================= */

/* For the main content area
----------------------------------------------------------------------- */

.surface.content .nodes > .content-node {
  padding-top: 10px;
  padding-bottom: 15px;
  padding-left: 30px;
  padding-right: 30px;
  word-wrap: break-word;
}

/* Some extra cover spacing */
.surface.content .nodes > .content-node.cover {
  padding-top: 20px;
}

/* For the resources panel
----------------------------------------------------------------------- */


.resources .content-node.image div img {
  width: auto;
}

.resources .content-node.paragraph .content-node.image div img {
  width: auto;
}

/* padding for the content */
.resources .nodes > .content-node > .content {
  padding: 20px;
  padding-top: 0px;
}

/* For the resources panel */
.resources .info .nodes > .content-node.paragraph > .content > .content-node {
  padding: 20px 0;
}

.article .document .surface.content::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

.article .document .surface.content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0);
}

.scrollbar-cover {
  position: absolute;
  top: 0px;
  bottom: 0px;
  right: 0px;
  width: 20px;
  overflow: hidden;
  background: #fff;
}

/* Disable native scrollbar for resources except TOC */

.article .resources .panel::-webkit-scrollbar,
.article .resources .surface::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

.article .resources .panel::-webkit-scrollbar-thumb,
.article .resources .surface::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0);
}


/* Resources Scrollbar */
/* ---------------------------------------*/

/* make it overlay the slider for now */
.surface-scrollbar .overlay {
  z-index: 3000;
}

.resources .surface-scrollbar {
  position: absolute;
  top: 0px;
  right: 0px;
  left: auto;
  bottom: 0px;
}

#container.touchable .resources .surface-scrollbar {
  right: 5px;
}

/* Responsiveness */
/* ---------------------------------------*/


/* Hide fullscreen toggle for small screens */
#container.touchable .toggle-fullscreen {
  display: none;
}

#container.touchable .article .document .surface.content {
  right: 20px;
}

/* Only hide for IOS devices because of scrolling issues! */
#container.touchable.ios .surface-scrollbar .visible-area {
  display: none;
}

#container.touchable .surface-scrollbar .node:hover {
  opacity: 0.15;
}

#container.touchable .surface-scrollbar .arrow {
  display: none;
}

.content-node.heading .top {
  display: none;
}




/* Shared styles for selected and mouseover states
----------------------------------------------------------------------- */

/* This shouldn't live in reader.css, but we'll modularize as soon
as we have a plugin concept for functionality / panels */
/* Not... still there is no idea how to 'export' css packages

/* Active resource */
.article .resources .content-node.highlighted .resource-header .name {
  /*color: #fff;*/
}

.article .resources .figures .content-node.highlighted {
  border-left: 3px solid rgba(145, 187, 4, 1);
}

/* active citation */
.article .resources .citations .content-node.highlighted {
  border-left: 3px solid rgba(11, 157, 217, 1);
}

/* active definition */
.article .resources .definitions .content-node.highlighted {
  border-left: 3px solid #5c6570;
}

/* active contributor */
.article .resources .info .content-node.highlighted {
  border-left: 3px solid #5c6570;
}

/* Table of contents */

/*
TOC
--------------------------------------- */

.resource-view.toc .heading-ref {
  cursor: pointer;
  display: block;
  color: rgba(0,0,0,0.8);
  font-weight: 600;
  font-size: 20px;
  padding: 4px 10px;
  line-height: 20px;
  margin-right: 10px;
  border: 1px solid transparent;
}

.resource-view.toc .heading-ref .label { display: inline; padding-right: 10px; }
.resource-view.toc .heading-ref .title, .resource-view.toc .heading .content .title .content { display: inline; }

.resource-view.toc .heading-ref.active {
  color: rgba(0,0,0,0.9);
  background: #fff;
  border: 1px solid #eee;
}

.resource-view.toc .heading-ref.level-2 {
  padding-left: 20px;
  font-size: 17px;
}

.resource-view.toc .heading-ref.level-3 {
  padding-left: 40px;
  font-size: 14px;
}

.resource-view.toc .heading-ref.level-4 {
  padding-left: 60px;
  font-size: 14px;
}

.resource-view.toc .heading-ref.level-5 {
  padding-left: 80px;
  font-size: 14px;
}

.resource-view.toc .heading-ref:hover {
  color: rgba(0,0,0,1);
}

/* Scrollbar
--------------------------------------- */

.surface-scrollbar {
  background: #eee;
  position: absolute;
  left: 0px;
  width:20px;
  top: 0px;
  bottom: 0px;
}

.surface-scrollbar .node.overlay {
  position: absolute;
  min-height: 2px;
}

.surface-scrollbar .visible-area {
  position: absolute;
  top: 40px;
  left: 0px;
  right: 0px;
  height: 80px;
  z-index: 4000;
  background-color: rgba(0,0,0, 0.2);
}

.surface-scrollbar.hidden .visible-area {
  display: none;
}

.surface-scrollbar:hover .visible-area {
  background-color: rgba(0,0,0, 0.25);
}

.surface-scrollbar .visible-area:hover {
  background-color: rgba(0,0,0, 0.3);
}

.surface-scrollbar .node {
  margin: 0 0px;
  width: 20px;
}

.surface-scrollbar .node:hover {
}


.surface-scrollbar .text {
}

.surface-scrollbar .heading {
}


.node.highlighted {
  background: #5c6570;
}

/* Colors for scroll-bar overlays */

.article .resources .figures .surface-scrollbar .highlighted,
.article .content .surface-scrollbar .highlighted.figure_reference,
.article .content .surface-scrollbar .highlighted.figure
 { background-color: rgba(145, 187, 4, 1); }
.article .content .surface-scrollbar .highlighted.figure.main-occurrence
 { border-right: 3px solid #5C6148; }

.article .resources .citations .surface-scrollbar .highlighted,
.article .content .surface-scrollbar .highlighted.citation_reference
 { background-color: rgba(11, 157, 217, 1); }

.article .resources .definitions .surface-scrollbar .highlighted,
.article .content .surface-scrollbar .highlighted.definition_reference
{ background-color: #5c6570; }


/* new FOCUS handles */

.panel.document  .nodes > .content-node > .focus-handle {
  display: none;
  position: absolute;
  top: 0px;
  bottom:2px;
  left: 0px;
  width: 30px;
  background: white;
  border-left: 3px solid #ccc;
  cursor: pointer;
}

.panel.document  .nodes > .content-node > .focus-handle:hover {
  border-left: 3px solid #bbb;
}


/* Footnote
=============================== */

.content-node.footnote {
  font-size: 13px;
  display: block !important;
  margin: 20px 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 20px;
}

.footnote-reference > a {
  vertical-align: super;
  padding: 0 2px;
  border: 1px solid #ddd;
  font-size: 13px;
}

.footnote-reference > a:hover {
  background: #eee;
}

.footnote-reference.sm-expanded > a {
  background: #ddd;
}

.footnote-reference > .footnote {
  display: none !important;
}

.footnote-reference.sm-expanded  >.footnote {
  display: block !important;
}
