/** list-tree.css - nested ul lists as trees
  *
  * Renders nested ul lists as trees, complete with vertical and horizontal alignment
  * guides.  Suitable for depicting nested file directories (folders), and other
  * hierarchical structures.  For example:
  *
  *     |
  *     +- dir
  *     |    |
  *     |    +- subdir
  *     |    |   |
  *     |    |   +- file
  *     |    |   |
  *     |    |   +- file
  *     |    |   |
  *     |    |   +- file (trailing)
  *     |    |
  *     |    +- subdir
  *     |    |
  *     |    +- subdir (trailing)
  *     |
  *     +- dir
  *     |
  *     +- dir (trailing)
  *          |
  *          +- file (trailing)
  *
  * The above file structure may be documented as follows.  Note the use of classes 'a'
  * and 'b' to mark the trailing items.
  *
  *    <div class='list-tree'><ul>
  *        <li class='d a'>dir<ul>
  *            <li class='d a'>subdir</li>
  *            <li class='d a'>subdir<ul>
  *                <li class='f a'>file</li>
  *                <li class='f a'>file</li>
  *                <li class='f b'>file (trailing)</li>
  *                </ul></li>
  *            <li class='d b'>subdir (trailing)</li>
  *            </ul></li>
  *        <li class='d a'>dir</li>
  *        <li class='d b'>dir (trailing)<ul>
  *            <li class='f b'>file (trailing)</li>
  *            </ul></li>
  *        </ul></div>
  *
  *
  * Copyright 2009, Michael Allan.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE.
  */


.list-tree
{
    white-space: nowrap; /* Wrap misaligned because of list-style-position:inside.  So use
      span.br instead, as in <br/><span class='br'>next line</span> */
}



/** - a - non-trailing item ------------
  */
.list-tree li.a
{
    border-left: 1px solid #C0C0C0;
}



/** - b - trailing item ----------------
  */
.list-tree li.b /* final li */
{
    border-left: 1px solid transparent; /* matching the layout of li.a */
    background-image: url('list-tree-line-y.png'); /* effecting a partial left border to
      form an elbow joint, in line with any preceding li.a * exact vertical alignment
      depends on font size * there may be a vertical gap with larger fonts * the vertical
      gap may be closed by heightening both list-tree-line images, at the cost of
      increasing li spacing for smaller fonts */
    background-repeat: no-repeat;
}


 /* .list-tree li.a + li.b */
    .list-tree ul > li.b /* IE ignores this selector */
    {
        background-position: -1px 0; /* only Firefox needs this adjust */
    }



/** - br -------------------------------
  */
.list-tree span.br
{
    margin-left: 16px; /* marker list-tree-line-x.png */
    padding-left: 0.7em; /* ~0.7em gap between marker and content */
}



/** - c - etc item ---------------------
  */
.list-tree li.c /* trailing or non-trailing */
{
    border-left: 1px dashed #C0C0C0;
}


.list-tree ul.c /* useful when the trailing item is li.c */
{
    padding-bottom: 0.6em;
}



/** - d - directory --------------------
  */
.list-tree li.d
{
    font-weight: bold;
}



/** - f - file -------------------------
  */
.list-tree li.f
{
    font-weight: normal;
}



/** - li -------------------------------
  */
.list-tree li
{
    margin: 0;
    padding: 0;
}



/** - ul -------------------------------
  */
.list-tree ul
{
    list-style-image: url('list-tree-line-x.png');
    list-style-position: inside;
    list-style-type: disc; /* if images not supported */
    margin: 0;
    padding: 0;
}


.list-tree ul.root /* to hold a single named li, at the very root of the tree (otherwise the root is anonymous) */
{
    list-style-image: none;
    list-style-position: outside; /* needed for IE7 */
    list-style-type: none;
}


.list-tree ul ul, .list-tree ul.root ul ul
{
    margin-left: 16px; /* parent marker list-tree-line-x.png */
    padding-left: 1em; /* ~0.7em gap between parent marker and content, plus nesting indent */
}


.list-tree ul.root ul
{
    margin-left: 0;
    padding-left: 0.5em;
}
