/*
    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"); fyou 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: Category

Wiki markup:
    %%category [JSPWikiStyles] /%

DOM structure before:
    (start code)
    span.category
        a.wikipage Category-Page
    (end)

DOM structure after:
    (start code)
    div|span.category
        span
            a.wikipage.categorylink[href=".."] Category-Page
            div.popup (.hidden|.loading|.active)
                div.title
                    a.wikipage[href=".."]Category-Page
                ul
                    li
                        a.hover
                br
                a.morelink ..and x more
                br
    (end)
*/
.category-link {
    border-bottom:3px solid @wiki-category-link-color;
    &:hover, &:focus { text-decoration:none; }
}

/*
Style: cage
   Used to capture absolute positioned popups, popovers, tootips, tips ... and
   automatically positions them relative to the visible part of the .cage
DOM Structure:
(start code)
    span.cage
      button xx
       div.popup ...
(end)
*/
.cage { position:relative; }


/*
Style: Popup
    Reusable popup dialog box, with a list of hoverable links
    IEx fallback using the half-transparent background image tip.png => fixme
*/
.popup {
    position:absolute;
    z-index:10;
	//reset font to initial body values (see bootstrap/scaffolding.less
    font-family: @font-family-base;
    font-size: @font-size-base;
    line-height: @line-height-base;

    background:@black;
    background:@tooltip-bg;
    border-radius:@border-radius-base;
    .box-shadow( 2px 2px 4px @tooltip-bg );
    _width:240px;

    color:@white;
    padding:0;

    .transition(all 1s ease);
    .opacity(0);
    visibility:hidden;

    ul { .list-unstyled; }
    a {
        display: block;
        padding: 0.1em .75em;
        color: @white;
        text-decoration: none;
        text-shadow: 1px 1px 0 @tooltip-bg;

        &:hover {
            background:@black;
            background:fade(@tooltip-bg,25%);
            border-radius:@border-radius-base;
            _background-color:@black;
        }
    }

    &.loading {
        height:1em; overflow:hidden;
        .progress-striped .progress-bar;
        .progress.active .progress-bar;
    }
}
.category:hover .popup.loading,
.category:hover .popup.active {
    .opacity(.9);
    visibility:visible;
}

.category .popup {

    margin-top:3px;  //slightly move popup down with 3px under the category-link

    //FIXME: remove this from AJAXCategory.jsp
    .categoryTitle, br { .hide; }

}

