/*
    Copyright 2014-2019 Google LLC

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        https://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
@import "bootstrap.less";
@import (inline) "../prettify-tomorrow.css";

@import "../toc.less";


/* Variables */

@body-font: 'Noto Serif';
@serif-font: @body-font;
@code-font: 'Inconsolata';
@code-light-gray: lighten(#8e908c, 10%);
@footer-height: @navbar-height;
@h-font: 'Karla';
@sans-serif-font: @h-font;
@h-margin-top-large: (@line-height-computed * 2);
@h-margin-top-small: @line-height-computed;

@indigo-light: #9FA8DA;      // Material Design Indigo 200
@blue-light: #90CAF9;        // Material Design Blue 200
@green-light: #A5D6A7;       // Material Design Green 200
@light-green-light: #C5E1A5; // Material Design Light Green 200
@orange-light: #FFCC80;      // Material Design Orange 200
@deep-orange-light: #FFAB91; // Material Design Deep Orange 200
@deep-purple-light: #B39DDB; // Material Design Deep Purple 200

/* Typography */

.p-margin() {
    margin-bottom: 0;
}

.h-base() {
    font-family: @h-font, sans-serif;
}

.h-border() {
    border-bottom: 1px solid @gray-lighter;
}

.code-base() {
    font-family: @code-font, monospace;
    font-size: 100%;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    font-family: @body-font, serif;
    // leave space for the header and footer
    margin-bottom: @footer-height;
    padding-top: @navbar-height * 1.5;
}

h1, .h1 {
    .h-base();
    .h-border();
    font-size: floor((@font-size-base * 2.4));
    margin-top: @h-margin-top-large;

    + section h2:first-child, + section .h2:first-child {
        margin-top: @h-margin-top-small;
    }
}

h2, .h2 {
    .h-base();
    .h-border();
    font-size: floor((@font-size-base * 2));
    margin-top: @h-margin-top-large;

    + section h3:first-child, + section .h3:first-child {
        margin-top: @h-margin-top-small;
    }
}

h3, .h3 {
    .h-base();
    font-size: ceil((@font-size-base * 1.5));
    margin-top: @h-margin-top-large;
}

h4, .h4, h5, .h5, h6, .h6 {
    .h-base();
    margin-top: @h-margin-top-small;
}

code, pre > code {
    .code-base();
}

dt, th {
    font-family: @sans-serif-font;
}

.dl-compact {
    dt {
        &:extend(.dl-horizontal dt);
        text-align: left;
    }

    dd {
        &:extend(.dl-horizontal dd);

        pre {
            margin-bottom: 0;
        }
    }
}

.dl-summary-callout dd {
    margin-bottom: floor(@line-height-computed / 2);
}

dd > p {
    .p-margin();
}

.label {
    font-family: @sans-serif-font;
    font-size: 100%;
    font-weight: normal;
    padding: 0.1em 0.5em 0.1em;
    text-transform: uppercase;
}

.label-async {
    background-color: @light-green-light;
}

.label-generator {
    background-color: @indigo-light;
}

.label-package, .label-private, .label-protected, .label-public {
    background-color: @blue-light;
}

.label-constant, .label-readonly {
    background-color: @deep-orange-light;
}

.label-kind {
    background-color: @orange-light;
}

.label-inner, .label-static {
    background-color: @green-light;
}

.label-virtual {
    background-color: @deep-purple-light;
}

.page-header {
    border-bottom: 0;
}

.prettyprint.linenums li {
    .code-base();
    color: @code-light-gray;
}

.property-type {
    margin-left: @font-size-base;
}

.signature-params, .signature-returns {
    color: @code-light-gray;
}

.source-link {
    font-size: @font-size-base * 0.8;
    margin-top: -0.75em;
}

.summary-callout, .symbol-index-section {
    font-size: @font-size-base * 0.9;

    h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
        &:extend(.h4);
        color: @brand-info;
        margin-top: @h-margin-top-small;
    }
}

.summary-callout-heading, .symbol-index-section-heading {
    border-bottom: 0;
}

// Use larger text in the first paragraph of the description
.symbol-classdesc, .symbol-description {
    p:first-child {
        .lead();
    }
}

.symbol-detail-labels {
    font-size: @font-size-base * 0.8;
    margin-bottom: ceil(@font-size-base / 4);
    margin-top: @h-margin-top-large;
}

// Remove whitespace above the first set of labels to follow an h2
h2 + section > .symbol-detail-labels:first-child,
.h2 + section > .symbol-detail-labels:first-child {
    margin-top: 0;
}

// Remove whitespace above a heading that follows a set of labels
.symbol-detail-labels + h1, .symbol-detail-labels + .h1,
.symbol-detail-labels + h2, .symbol-detail-labels + .h2,
.symbol-detail-labels + h3, .symbol-detail-labels + .h3,
.symbol-detail-labels + h4, .symbol-detail-labels + .h4,
.symbol-detail-labels + h5, .symbol-detail-labels + .h5,
.symbol-detail-labels + h6, .symbol-detail-labels + .h6 {
    margin-top: 0;
}

.symbol-index-list > dd {
    margin-bottom: 0.75em;
}

.symbol-index-name {
    text-indent: -1em;
    margin-left: 1em;
}

.symbol-name {
    font-weight: bold;
}


/* Grid */

// TODO: use class selectors
#jsdoc-body-container, #jsdoc-footer-container, #jsdoc-navbar-container {
    .container-fluid();
}

.jsdoc-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: @footer-height;
    margin: auto;
    padding: @navbar-padding-vertical @navbar-padding-horizontal;
    background-color: @navbar-default-bg;
    border: 1px solid @navbar-default-border;

    p {
        margin: 0;
        text-align: center;
    }
}

.summary-callout, .symbol-index {
    .container-fluid();
}

// TODO: use class selectors
#jsdoc-content, .summary-content, .symbol-index-content {
    .make-row();
}

.summary-column, .symbol-index-column {
    .make-md-column(4);
}

// TODO: use class selectors
#jsdoc-content-container {
    .make-md-column(9);
    .make-md-column-push(3);
}

// TODO: use class selectors
#jsdoc-toc-nav {
    .make-md-column(3);
    .make-md-column-pull(9);
    font-family: @h-font, sans-serif;
    margin-top: (@line-height-computed * 2.5);
}


/* Navigation */

.jsdoc-navbar {
    &:extend(.navbar, .navbar-default, .navbar-fixed-top);
}

.jsdoc-navbar-package-name {
    &:extend(.navbar-brand);
}

.jsdoc-panel {
    &:extend(.panel, .panel-default);
}

.jsdoc-panel-heading {
    &:extend(.panel-heading);
}


/* Tables */

.jsdoc-details-table {
    .table();
    .table-hover();
}

td > p:last-child {
    .p-margin();
}

article td, article th {
    padding: @table-condensed-cell-padding @table-cell-padding @table-condensed-cell-padding 0;
}

/* Callouts */

.summary-callout {
    padding: 0 1em 0 1em;
    margin: 1em 0 1em 0;
    border: 1px solid #eee;
    border-left-width: 1em;
    border-left-color: @brand-info;
    border-radius: @border-radius-small;
}

/* Appify changes */

/* stop forcing upperCase for @mermaid tags */
g{text-transform: none !important}

/* enable fixed sidebar */
#jsdoc-toc-nav{height:calc(100vh - 50px); overflow: auto; width:20% !important; right: 80% !important; position: fixed !important; margin-top: 0px !important; padding-top: 15px !important; top: 50px !important; padding-bottom: 3em; border-right: #c0c0c0 1px solid; background: #fff;}

/* better spacing between nav & content */
#jsdoc-content-container{width: 80% !important; left: 20% !important;}

/* center main content it if > max size */
#jsdoc-main{margin-left: auto; margin-right: auto; max-width: 1000px;}

/* spacing between dropdowns
ul.jqtree_common{ padding-bottom: 1em;}

