/*
    JSPWiki - a JSP-based WikiWiki clone.

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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

       http://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.
*/
/*
Style: TableOfContentsPlugin

    When a TOC plugin is invoked multiple times, only the first one renders the
    collapsible table of contents box.
    All subsequent invocations of the TOC plugin render a link to the toc. (a.toc)
    This link has little use; so we just hide it.

    Typical use-case: have a LeftMenu with a call of the TOC plugin.
    When the main wiki-page already contains a TOC, the plugin only generates
    a toc link (a.toc)

DOM structure:
    (begin)
    div.toc
        div.collapsebox
            h4#section-TOC Table Of Contents
            div.collapse-body
                ul
                    li.toclevel-1
                    li.toclevel-2
                    li.toclevel-3
    (end)
*/
.toc {
    width: @wiki-commentbox-width-inverse;
    min-width: @wiki-small-viewport-dialog-width;

    .collapsebox {
		padding: ((@line-height-computed - 1) / 2);   //re-use same padding as a PRE block
		border-radius: @alert-border-radius;
    	border: 1px solid @panel-default-border;
    }

    ul {
        .list-unstyled;
        li:hover { background:@dropdown-link-hover-bg; }
        margin-bottom:0;
    }
    .toclevel-1 { padding-left:1em }
    .toclevel-2 { padding-left:2em; }
    .toclevel-3 { padding-left:3em; }
}
//in case a TOC is added to the sidebar;  it will show the TOC of the main page
.sidebar .toc {
    width:100%;
	.toclevel-1 { padding-left:.5em; }
    .toclevel-2 { padding-left:1em; }
    .toclevel-3 { padding-left:1.5em; }
}

//Multiple occurrences of the TOC plugin are rendered as links (a.toc)
a.toc { .hide; }

