/* Global */
body {
   padding-top: 49px;
}

h5 {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.well legend {
    border-bottom: 0;
    font-size: 18px;
}

/* Nav & Header */
.navbar {
    margin-bottom: 0;
}

.navbar-header {
    float: left;
}

.navbar-center {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.navbar-right {
    float: right !important;
}

.navbar-nav {
    margin-top: 0;
    margin-bottom: 0;
    height: 100%;
}

.navbar-nav .nav {
    float: left;
}

.navbar-nav li {
    float: left;
}

.navbar-nav li > a {
    padding-top: 15px;
    padding-bottom: 15px;
}

.navbar-inverse .navbar-brand {
    color: #eeeeee;
}

.navbar-search {
    display: inline-block;
}

/* Chapter listing */
#chapterListingOption {
    display: none;
    margin-left: 10px;
}

.chapter-listing {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    padding-left: 15px;
    background-color: #fff;
}

.chapter-listing h5 {
    display: inline-block;
    margin-left: 0.5em;
}

.chapter-listing-toggle {
    color: inherit;
}

.chapter-listing-toggle:hover {
    color: inherit;
    text-decoration: none;
}

.chapter-listing-toggle::before {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'FontAwesome';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\f150";
}

.chapter-listing-toggle-collapsed::before {
    content: "\e160";
}

.chapter-listing-section {
    display: block;
    position: relative;
    padding-left: 13px;
}

.chapter-listing-item {
    position: relative;
}

.chapter-listing-item > a {
    margin: 4px 0;
    padding: 0 0 0 10px !important;
    border-left: 3px solid white;
}

.chapter-listing-item > a:hover {
    border-left: 3px solid #2a6496;
    background-color: transparent;
}

.chapter-listing-item.active > a {
    border-left: 3px solid #0074a2;
}

.chapter-listing hr {
    margin: 10px 0;
}

.chapter-listing-nav {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Main content */
.chapter {
    margin-bottom: 2em;
    border-top: 1px solid #eee;
}

.chapter-index {
    display: none;
}

.chapter-heading {
    margin-top: 0;
    margin-left: -15px;
    margin-right: -15px;
    padding: 0.4em 0.5em;
    font-size: 18px;
    background-color: #0074a2;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0,0,0,.25);
}

.chapter-subheading {
    padding: 0.4em 0.5em 0.2em;
    border-bottom: 1px solid #bbb;
}

.note {
    color: #31708f;
}

.note::before {
    content: '(';
    color: #31708f;
}

.note::after {
    content: ')';
    color: #31708f;
}

.optional {
    color: #999;
}

.optional::before {
    content: '[';
    color: #999;
}

.optional::after {
    content: ']';
    color: #999;
}

.placeholder {
    border-bottom: 1px dashed #31708f;
}

.highlight {
    padding: 0 3px;
    background-color: #f7ec99;
    color: #524c20;
}

.related-chapters {
    border-top: 1px solid #ddd;
    padding-top: 1em;
    text-transform: uppercase;
    color: #333;
}

.related-chapters ul {
    display: inline;
    text-transform: none;
}

.list-inline > li {
    padding-right: 0;
}

.list-inline li::after {
    content: ',';
}

.list-inline li:last-of-type::after {
    display: none;
}

/* Search */
.search-results {
    list-style-type: none;
    padding-left: 0;
}

.search-results-item {
    position: relative;
    margin-bottom: 0.5em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5em;
}

.search-results-item-term {
    display: block;
}

.search-results-item-link {
    position: absolute;
    top: 0;
    right: 0;
}

/* Notifications pane */
.notifications {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    padding: 66px 15px 15px;
    background-color: #080808;
    color: #ddd;
    -webkit-box-shadow: -5px 0px 5px 0px rgba(50, 50, 50, 0.3);
    -moz-box-shadow: -5px 0px 5px 0px rgba(50, 50, 50, 0.3);
    box-shadow: -5px 0px 5px 0px rgba(50, 50, 50, 0.3);
}

.notifications h3:first-child {
    margin-top: 0;
}

.notifications h3 {
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notifications ul {
    padding-left: 25px;
    font-size: 13px;
}

.notifications ul.updates li {
    position: relative;
    margin-bottom: 10px;
    list-style-type: none;
}

.notifications ul.updates li::before {
    position: absolute;
    top: 3px;
    left: -17px;
    display: inline-block;
    font-family: 'FontAwesome';
    font-style: normal;
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\f133";
}

/* Footer */
footer {
    margin-top: 2em;
    background-color: #222;
    color: #fff;
}

.credits {
    margin: 0 auto;
    padding: 15px;
}

.credits *:first-child {
    margin-top: 0;
}

.credits *:last-child {
    margin-bottom: 0;
}

/* Modals */
.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body h5 {
    margin-top: 1.5em;
}

.modal-footer {
    position: relative;
    margin-top: 0;
}

.modal-footer-item-left {
    position: absolute;
    top: 15px;
    left: 15px;
}

/* Misc */
.browse-happy {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-top: 3px solid #ead872;
    padding: 0.8em 0;
    background: #ffef90;
    color: #000;
    font-size: 1em;
    text-align: center;
    z-index: 10;
}

.no-js {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding-top: 60px;
    background-color: #f2dede;
    text-align: center;
}

.no-js p {
    max-width: none;
}

/* Device overrides */
@media (max-width: 767px) {
    .navbar-search {
        display: none;
        top: 50%;
        left: auto;
        right: 1em;
        transform: translate(0, -50%);
        max-width: 60%;
    }
}

@media (min-width: 768px) {
    body {
       padding-top: 70px;
    }

    .navbar {
        margin-bottom: 20px;
    }

    .navbar-header {
        width: 250px;
    }

    .chapter-listing {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        padding-left: 0;
    }

    .chapter-heading {
        margin-left: 0;
        margin-right: 0;
    }

    .explanation {
        padding-right: 20%;
    }

    .dl-horizontal dt {
        width: 280px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dl-horizontal dt:hover {
        position: relative;
        width: auto;
        min-width: 280px;
        margin-right: 20px;
        background-color: white;
        overflow: visible;
        text-overflow: clip;
    }

    .dl-horizontal dd {
        margin-left: 300px;
    }

    footer {
        margin-top: 4em;
    }

    .credits {
        width: 750px;
    }
}

@media (min-width: 992px) {
    .explanation {
        padding-right: 35%;
    }

    .notifications {
        width: 40%;
    }

    .credits {
        width: 970px;
    }
}

@media (min-width: 1200px) {
    .notifications {
        width: 30%;
    }

    .credits {
        width: 1170px;
    }
}

/* Print overrides */
@media print {
    .editing-only {
        display: none;
    }

    body {
        padding-top: 0;
    }

    .notifications {
        display: none;
    }

    .navbar {
        display: block;
        position: relative !important;
        border-bottom-width: 2px !important;
    }

    body.print-colour .navbar {
        background-color: #666 !important;
        border-bottom-color: transparent !important;
    }

    .navbar-brand, .navbar-text {
        color: #111 !important;
    }

    body.print-colour .navbar-brand, body.print-colour .navbar-text {
        color: #fff !important;
    }

    .navbar-text {
        position: absolute;
        right: 10px;
    }

    #chapter-container {
        width: 100%;
    }

    .chapter {
        border-top: none;
        border-bottom: 1px solid #222;
        margin-bottom: 1em;
        page-break-inside: avoid;
    }

    body.print-chapter-listing #chapter-list-container {
        display: block !important;
        width: 100%;
        page-break-after: always;
    }

    .chapter-listing-toggle {
        display: none;
    }

    .chapter-listing-item a, .chapter-listing strong {
        padding-left: 0;
    }

    .chapter-listing-item.active>a {
        border-left-color: transparent;
    }

    body.print-all-chapters .chapter.hidden {
        display: block !important;
        visibility: visible !important;
    }

    body.print-page-breaks .chapter {
        border-bottom: 0;
        page-break-after: always;
    }

    .chapter-index {
        display: inline-block;
        margin-right: 8px;
        padding: 6px 10px;
        background-color: #111 !important;
        color: #fff !important;
    }

    body.print-colour .chapter-index {
        background-color: #0074a2 !important;
    }

    .chapter-heading {
        padding: 0;
    }

    body.print-colour .chapter-heading {
        color: #0074a2 !important;
    }

    .explanation {
        max-width: none;
    }

    .phrase-list-item {
        clear: both;
    }

    .dl-horizontal dt {
        float: left;
        clear: left;
        text-align: left;
        width: 50%;
        overflow: visible;
        white-space: normal;
    }

    .dl-horizontal dd {
        margin-left: 50%;
    }

    dt, dd {
        padding: 2px 4px;
    }

    .related-chapters {
        border-top: none;
    }

    .note, .note::before, .note::after {
        color: #aaa !important;
    }

    .optional {
        color: #999 !important;
    }

    .placeholder {
        border-bottom: 1px dashed #444;
    }

    .highlight {
        padding: 0 3px;
        background-color: #eee !important;
        color: #000 !important;
    }

    body.print-colour .note, body.print-colour .note::before, body.print-colour .note::after {
        color: #31708f !important;
    }

    body.print-colour .placeholder {
        border-bottom-color: #31708f !important;
    }

    body.print-colour .highlight {
        background-color: #f7ec99 !important;
        color: #524c20 !important;
    }

    .related-chapters {
        padding: 0.8em 0 1.5em;
    }

    .credits {
        margin: 0 !important;
        font-size: 0.7em;
    }

    .credits h3 {
        margin-top: 0;
        font-size: 1.3em;
    }

    .credits h4 {
        font-size: 1em;
    }
}
