/*
 * Copyright (c) 2006-2010 Pixware. 
 *
 * This file is part of the XMLmind XML Editor project.
 * For conditions of distribution and use, see the accompanying legal.txt file.
 *
 * Styles for DITA topic elements. 
 */

@import "common.imp";

/* ---------------------------------------------------------------------------
  Topic elements
--------------------------------------------------------------------------- */

/* topic ------------------------------------------------------------------ */

dita {
    display: block;
}

*[class~="concept/concept"],
*[class~="task/task"],
*[class~="reference/reference"],
*[class~="topic/topic"] {
    display: block;
}

/* Vertical margins for nested topics or topics contained in a dita. */
* > *[class~="concept/concept"],
* > *[class~="task/task"],
* > *[class~="reference/reference"],
* > *[class~="topic/topic"] {
    margin: 1.33ex 0;
}

*[class~="concept/concept"] > *[class~="topic/title"],
*[class~="task/task"] > *[class~="topic/title"],
*[class~="reference/reference"] > *[class~="topic/title"],
*[class~="topic/topic"] > *[class~="topic/title"] { 
    font-size: 1.5em;
    margin: 0.83ex 0;
    border-width: 1px;
    border-style: solid;
    border-top-color: transparent;
    border-left-color: transparent;
    border-right-color: transparent;
}

*[class~="topic/section"] > *[class~="topic/title"] { 
    font-size: 1.3em;
    margin: 1ex 0;
}

*[class~="topic/body"] > *[class~="topic/section"] > *[class~="topic/title"],
*[class~="topic/topic"] > *[class~="topic/title"] {
    color: #6090B0;
    border-bottom-color: #6090B0;
}

*[class~="topic/titlealts"] {
    display: block;
    margin: 1.33ex 0;
}

*[class~="topic/searchtitle"],
*[class~="topic/navtitle"],
*[class~="topic/abstract"],
*[class~="topic/shortdesc"],
*[class~="topic/example"],
*[class~="topic/related-links"] {
    display: block;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/searchtitle"]:before,
*[class~="topic/navtitle"]:before,
*[class~="topic/abstract"]:before,
*[class~="topic/shortdesc"]:before,
*[class~="topic/example"]:before,
*[class~="topic/related-links"]:before {
    display: marker;
    content: element-name(); /*Support for specialization*/
    marker-offset: fill; /*Nicer*/
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="concept/conbody"],
*[class~="task/taskbody"],
*[class~="reference/refbody"],
*[class~="topic/body"] {
    display: block;
    /*Vertical margins set in child elements*/
}

*[class~="topic/section"] {
    display: block;
    margin: 1.33ex 0;
}

/* ---------------------------------------------------------------------------
  Body elements
--------------------------------------------------------------------------- */

/* topic ------------------------------------------------------------------ */

/*
 * Simple lists
 */

*[class~="topic/sl"] {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/sli"] {
    display: block;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/sl"][compact=yes] > *[class~="topic/sli"] {
    margin-top: 0;
    margin-bottom: 0;
}

/*
 * Ordered and unordered lists
 */

*[class~="topic/ol"],
*[class~="topic/ul"] { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/ul"] { 
    list-style-type: disc;
}

*[class~="topic/ul"] *[class~="topic/ul"] { 
    list-style-type: square;
}

*[class~="topic/ul"] *[class~="topic/ul"] *[class~="topic/ul"] { 
    list-style-type: circle;
}

*[class~="topic/ol"] { 
    list-style-type: decimal;
}

*[class~="topic/li"] {
    display: list-item;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/ul"][compact=yes] > *[class~="topic/li"],
*[class~="topic/ol"][compact=yes] > *[class~="topic/li"] {
    margin-top: 0;
    margin-bottom: 0;
}

*[class~="topic/li"] > *:first-child {
    margin-top: 0; 
    margin-bottom: 0; 
}
      
/*
 * Definition lists
 */

*[class~="topic/dl"] {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/dlhead"],
*[class~="topic/dlentry"] {
    display: block;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/dl"][compact=yes] > *[class~="topic/dlhead"],
*[class~="topic/dl"][compact=yes] > *[class~="topic/dlentry"] {
    margin-top: 0;
    margin-bottom: 0;
}

*[class~="topic/dthd"],
*[class~="topic/dt"] {
    display: block;
    font-weight: bold; 
}

*[class~="topic/ddhd"],
*[class~="topic/dd"] {
    display: block;
    margin-left: 4ex;
}

*[class~="topic/dl"]:contains-element(dlhead) {
    display: table;
    border: 1 solid #E0E0E0;
}

*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlhead"],
*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlentry"] {
    display: table-row;
    margin-top: 0;
    margin-bottom: 0;
}

*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlhead"] {
    background-color: #E0E0E0;
}

*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlentry"] {
    background-color: inherit; /*e.g. from read-only dl*/
}

*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlhead"] > *[class~="topic/dthd"],
*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlhead"] > *[class~="topic/ddhd"],
*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlentry"] > *[class~="topic/dt"],
*[class~="topic/dl"]:contains-element(dlhead) > *[class~="topic/dlentry"] > *[class~="topic/dd"] {
    display: table-cell;
    margin-left: 0;
    border: 1 solid #E0E0E0;
    padding: 2px;
    background-color: inherit;
}

/*
 * Figures
 */

*[class~="topic/fig"] {
    display: block;
    margin: 1.33ex 0;
}

*[class~="topic/figgroup"] {
    display: block;
    margin: 1.33ex 0;
}

*[class~="topic/desc"] {
    display: inline;
}

*[class~="topic/desc"]:before {
    display: inline;
    content: " [";
    color: #333333;
}

*[class~="topic/desc"]:after {
    display: inline;
    content: "]";
    color: #333333;
}

*[class~="topic/fig"] > *[class~="topic/desc"],
*[class~="topic/object"] > *[class~="topic/desc"],
*[class~="topic/table"] > *[class~="topic/desc"],
*[class~="topic/linklist"] > *[class~="topic/desc"] {
    display: block;
    margin: 1.33ex 0;
}

/*
 * Objects
 */

*[class~="topic/object"],
*[class~="topic/param"] {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1;
    border: 1 solid #E0E0E0;
    padding: 1;
    margin: 8 4;
}

*[class~="topic/object"]:before,
*[class~="topic/param"]:before {
    display: inline;
    content: division(content(paragraph(content(collapser(collapsed-icon, 
                                                          icon(pop-right), 
                                                          expanded-icon,
                                                          icon(pop-down)), " ",
                                                element-name(), "  ", 
                                                add-attribute-button(
                                                   check-has-attributes, yes,
                                                   tool-tip, "Add attribute",
                                                   color, navy)),
                               background-color, #E0E0E0,
                               padding-left, 4),
                     attributes(margin-top, 2,
                                margin-bottom, 2,
                                margin-left, 2,
                                margin-right, 2)));  
}

*[class~="topic/object"]::attribute,
*[class~="topic/param"]::attribute {
    attribute-content-left: attribute-name();
    attribute-content-middle: value-editor(attribute, attribute());
    attribute-content-right: 
        remove-attribute-button(attribute, attribute(),
                                tool-tip, "Remove attribute",
                                check-required, yes,
                                color, navy);
    show-attribute: when-added;
}

*[class~="topic/param"]::attribute(name),
*[class~="topic/param"]::attribute(value) {
    show-attribute: always;
}

/*
 * Block elements
 */

*[class~="topic/p"] {
    display: block;
    margin: 1.33ex 0;
}

*[class~="topic/lines"] {
    display: block;
    white-space: pre;
    margin: 1.33ex 0;
}

*[class~="topic/pre"] {
    display: block;
    white-space: pre;
    font-family: monospace;
    background-color: #EEEEEE; 
    border: 1px solid gray; 
    padding: 2px; 
    margin: 1.33ex 0;
}

*[class~="topic/note"] {
    display: block;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/note"]:before {
    display: marker;
    content: element-name();
    marker-offset: fill;
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="topic/note"][type]:before {
    content: attr(type);
}

*[class~="topic/note"][type=other][othertype]:before {
    content: xpath("substring(@othertype,1,14)");
}

*[class~="topic/note"] > *:first-child {
    margin-top: 0; 
    margin-bottom: 0; 
}

*[class~="topic/lq"] {
    display: block;
    line-height: 1.2;
    margin: 1.33ex 10ex;
}

*[class~="topic/lq"][reftitle]:after {
    display: inline;
    content: " (" attr(reftitle) ")";
    font-size: smaller;
    color: #333333;
}

/*
 * Inline elements
 */

*[class~="topic/cite"] {
    display: inline;
    font-style: italic;
}

*[class~="topic/xref"] {
    display: inline;
    color: navy;
    text-decoration: underline;
}

*[class~="topic/xref"]:after {
    display: inline;
    content: icon(left-link) attr(href);
    text-decoration: none;
    font-family: monospace;
    font-size: smaller;
    color: #333333;
}

/* ---------------------------------------------------------------------------
  Table elements
--------------------------------------------------------------------------- */

/* topic ------------------------------------------------------------------ */

/*
 * Simple table
 *
 * Specialization of simpletables is supported: suffice to modify
 * property element having dita.simpleTableEdit.tableSpecification as its name 
 * in the DITA configuration. This property is used by both 
 * com.xmlmind.xmleditext.dita.SimpleTableSupport (cell renderer) and 
 * com.xmlmind.xmleditext.dita.SimpleTableEdit (table editor).
 */

/*
 * Support for the relcolwidth and keycol attributes of simpletable.
 * Not really important. Just nice to have it.
 */
@extension 
"com.xmlmind.xmleditext.dita.SimpleTableSupport dita.simpleTableEdit.tableSpecification";

*[class~="topic/simpletable"] {
    display: table; 
    border: 1 outset gray;
    margin: 1.33ex 0; 
}

*[class~="topic/sthead"] {
    display: table-row;
    font-weight: bold;
    background-color: #E0E0E0;
}

*[class~="topic/strow"] {
    display: table-row; 
    background-color: inherit; /*e.g. from read-only simpletable*/
}

*[class~="topic/stentry"] {
    display: table-cell; 
    background-color: inherit;
    border: 1 inset gray;
    padding: 2px; 
}

*[class~="topic/stentry"] > *:first-child {
    margin-top: 0; 
    margin-bottom: 0; 
}

/*
 * CALS table (but simplified: no spanspec, tfoot, entrytbl, 
 * no colspec inside thead)
 *
 * SPECIALIZATION OF TABLE ``STRUCTURE'' NOT SUPPORTED:
 * The extension used to properly style CALS tables uses element names.
 */

/*
 * "black" is the color used to draw a border around the table and its
 * cells based on values of attributes such as frame, rowsep and colsep.
 *
 * "rgb(238,238,224)" (a very light gray) is the color used to draw 
 * a border around each cell whether the cell actually has borders or not.
 * Remove this parameter if this ``cell footprint'' disturbs you.
 *
 * For more information about CALS table support, see 
 * XMLmind XML Editor - Configuration and Deployment.
 */
@extension 
"com.xmlmind.xmleditext.docbook.table.TableSupport black rgb(238,238,224)";

table {
    display: block;
    margin: 1.33ex 0; 
}
          
table > title {
    font-weight: normal;
    font-style: italic; 
    text-align: center; 
    /* keep margin because tgroup has no margin */
}

colspec {
    display: table-column;
    collapsed: yes;
}

tgroup {
    display: table; 
    border-style: solid;
    border-width: 1;
}
    
thead {
    display: table-row-group;
    font-weight: bold; 
    background-color: #E0E0E0;
}
       
tbody {
    display: table-row-group;
    background-color: inherit; /*e.g. from read-only tgroup*/
}

row {
    display: table-row; 
    background-color: inherit; /*e.g. from read-only tbody*/
}
          
entry {
    display: table-cell; 
    background-color: inherit; /*e.g. from read-only row*/
    border-style: solid;
    border-width: 1;
    padding: 2px; 
}

entry > *:first-child {
    margin-top: 0; 
    margin-bottom: 0; 
}

/* ---------------------------------------------------------------------------
  Typographic elements
--------------------------------------------------------------------------- */

/* hi-d ------------------------------------------------------------------- */

*[class~="hi-d/b"] {
    display: inline;
    font-weight: bold;
}

*[class~="hi-d/i"] {
    display: inline;
    font-style: italic;
}

*[class~="hi-d/u"] {
    display: inline;
     text-decoration: underline;
}

*[class~="hi-d/tt"] {
    display: inline;
    font-family: monospace;
}

*[class~="hi-d/sup"],
*[class~="hi-d/sub"] {
    display: inline-block;
    white-space: nowrap;
    font-size: smaller;
}

*[class~="hi-d/sup"] {
    vertical-align: super;
}

*[class~="hi-d/sub"] {
    vertical-align: sub;
}

/* ---------------------------------------------------------------------------
  Software elements
--------------------------------------------------------------------------- */

/* pr-d ------------------------------------------------------------------- */

*[class~="pr-d/codeblock"],
*[class~="pr-d/codeph"] {
    font-family: monospace;
}

*[class~="pr-d/codeph"] {
    display: inline;
}

*[class~="pr-d/codeblock"] {
    display: block;
    white-space: pre;
    margin: 1.33ex 0;
    padding: 2px;
}

*[class~="pr-d/option"] {
    display: inline;
    font-weight: bold;
}

*[class~="pr-d/apiname"],
*[class~="pr-d/parmname"] {
    display: inline;
    font-family: monospace;
}

*[class~="pr-d/parmname"] {
    font-style: italic;
}

*[class~="pr-d/parml"] {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="pr-d/plentry"] {
    display: block;
}

*[class~="pr-d/pt"] {
    display: block;
    font-weight: bold; 
}

*[class~="pr-d/pd"] {
    display: block;
    margin-left: 4ex;
}

/*
 * Syntax diagram elements
 */

*[class~="pr-d/syntaxdiagram"] > *[class~="topic/title"],
*[class~="pr-d/synblk"] > *[class~="topic/title"],
*[class~="pr-d/groupseq"] > *[class~="topic/title"],
*[class~="pr-d/groupchoice"] > *[class~="topic/title"],
*[class~="pr-d/groupcomp"] > *[class~="topic/title"],
*[class~="pr-d/fragment"] > *[class~="topic/title"] {
    margin-top: 0;
    margin-bottom: 0;
}

*[class~="pr-d/syntaxdiagram"] {
    display: block;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="pr-d/synblk"],
*[class~="pr-d/groupseq"],
*[class~="pr-d/groupchoice"],
*[class~="pr-d/groupcomp"],
*[class~="pr-d/fragment"],
*[class~="pr-d/synnote"],
*[class~="pr-d/fragref"],
*[class~="pr-d/synnoteref"] {
    display: block;
    margin-left: 16ex;
}

*[class~="pr-d/syntaxdiagram"]:before,
*[class~="pr-d/synblk"]:before,
*[class~="pr-d/groupseq"]:before,
*[class~="pr-d/groupchoice"]:before,
*[class~="pr-d/groupcomp"]:before,
*[class~="pr-d/fragment"]:before,
*[class~="pr-d/synnote"]:before,
*[class~="pr-d/fragref"]:before,
*[class~="pr-d/synnoteref"]:before {
    display: marker;
    content: element-name();
    marker-offset: fill;
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="pr-d/fragref"] {
    color: navy;
    text-decoration: underline;
}

*[class~="pr-d/fragref"]:after,
*[class~="pr-d/synnoteref"] {
    content: icon(left-link) attr(href);
    text-decoration: none;
    font-family: monospace;
    font-size: smaller;
    color: #333333;
}

*[class~="pr-d/fragref"]:after {
    display: inline;
}

*[class~="pr-d/synnoteref"]:after {
    /* Inherits from xref: would mean link displayed twice */
    content: "";
}

*[class~="pr-d/repsep"] {
    display: block;
}

*[class~="pr-d/repsep"]:before {
    content: "(";
    color: #333333;
}

*[class~="pr-d/repsep"]:after {
    content: ")";
    color: #333333;
}

*[class~="pr-d/synph"],
*[class~="pr-d/oper"],
*[class~="pr-d/sep"],
*[class~="pr-d/delim"],
*[class~="pr-d/var"],
*[class~="pr-d/kwd"] {
    display: inline;
}

*[class~="pr-d/oper"]:before,
*[class~="pr-d/sep"]:before,
*[class~="pr-d/delim"]:before,
*[class~="pr-d/var"]:before,
*[class~="pr-d/kwd"]:before {
    display: inline;
    content: " ";
}

*[class~="pr-d/oper"]:first-child:before,
*[class~="pr-d/sep"]:first-child:before,
*[class~="pr-d/delim"]:first-child:before,
*[class~="pr-d/var"]:first-child:before,
*[class~="pr-d/kwd"]:first-child:before {
    content: "";
}

*[class~="pr-d/kwd"] {
    font-weight: bold;
}

*[class~="pr-d/var"] {
    font-style: italic;
}

*[class~="pr-d/oper"] {
    color: rgb(96,0,96);
}

*[class~="pr-d/sep"] {
    color: rgb(96,96,0);
}

*[class~="pr-d/delim"] {
    color: rgb(0,96,96);
}

/* ---------------------------------------------------------------------------
  Software elements
--------------------------------------------------------------------------- */

/* sw-d ------------------------------------------------------------------- */

*[class~="sw-d/msgnum"],
*[class~="sw-d/msgblock"],
*[class~="sw-d/msgph"] {
    font-family: monospace;
    background-color: #E0E0E0;
}

*[class~="sw-d/msgph"] {
    display: inline;
}

*[class~="sw-d/msgblock"] {
    display: block;
    white-space: pre;
    margin: 1.33ex 0;
    padding: 2px;
}

*[class~="sw-d/msgnum"] {
    display: inline;
    font-weight: bold;
}

*[class~="sw-d/userinput"],
*[class~="sw-d/systemoutput"],
*[class~="sw-d/filepath"],
*[class~="sw-d/varname"],
*[class~="sw-d/cmdname"] {
    display: inline;
    font-family: monospace;
}

*[class~="sw-d/cmdname"] {
    font-weight: bold;
}

*[class~="sw-d/varname"] {
    font-style: italic;
}

*[class~="sw-d/userinput"] {
    background-color: rgb(192,255,192);
}

*[class~="sw-d/systemoutput"] {
    background-color: rgb(255,255,192);
}

/* ---------------------------------------------------------------------------
  User interface elements
--------------------------------------------------------------------------- */

/* ui-d ------------------------------------------------------------------- */

*[class~="ui-d/uicontrol"],
*[class~="ui-d/wintitle"] {
    display: inline;
    font-weight: bold;
}

*[class~="ui-d/menucascade"] {
    display: inline;
}

*[class~="ui-d/menucascade"] > *[class~="ui-d/uicontrol"]:before {
    content: " \279C  ";
    color: #333333;
}

*[class~="ui-d/menucascade"] > *[class~="ui-d/uicontrol"]:first-child:before {
    content: "";
}

*[class~="ui-d/shortcut"] {
    display: inline;
    text-decoration: underline;
}

*[class~="ui-d/screen"] {
    display: block;
    white-space: pre;
    font-family: monospace;
    background-color: #E0E0E0; 
    border: 2px ridge gray; 
    padding: 5px; 
    margin: 1.33ex 0;
}

/* ---------------------------------------------------------------------------
  Utility elements
--------------------------------------------------------------------------- */

/* ut-d ------------------------------------------------------------------- */

*[class~="ut-d/imagemap"] {
    display: block;
    margin: 1.33ex 0;
    border: 1px solid #C0C0C0; 
    padding: 5px; 
}

*[class~="ut-d/area"] {
    display: block;
    margin-left: 20px;
}

*[class~="ut-d/area"]:before {
    display: marker;
    content: square;
}

*[class~="ut-d/shape"],
*[class~="ut-d/coords"] {
    display: inline;
}

*[class~="ut-d/shape"]:before,
*[class~="ut-d/coords"]:before {
    display: inline;
    content: element-name() " ";
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="ut-d/shape"]:after,
*[class~="ut-d/coords"]:after {
    display: inline;
    content: " ";
}

/* ---------------------------------------------------------------------------
  Miscellaneous elements
--------------------------------------------------------------------------- */

/* topic ------------------------------------------------------------------ */

*[class~="topic/draft-comment"] {
    display: block;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/draft-comment"]:before {
    display: marker;
    content: element-name();
    marker-offset: fill;
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="topic/fn"] {
    font-size: smaller;
    display: block;
    margin-left: 8ex;
    margin-right: 8ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/fn"]:before {
    display: marker;
    content: xpath("concat(index-of-node(//fn,.),'.')");
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="topic/fn"][callout]:before {
    content: attr(callout);
}

*[class~="topic/fn"],
*[class~="topic/fn"]:before {
    border-width: 1px;
    border-style: solid;
    border-top-color: gray;
    border-bottom-color: transparent;
    border-left-color: transparent;
    border-right-color: transparent;
    padding: 2px; 
}

/* ---------------------------------------------------------------------------
  Related links elements
--------------------------------------------------------------------------- */

/* topic ------------------------------------------------------------------ */

*[class~="topic/linklist"],
*[class~="topic/linkpool"] {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/linklist"] {
    list-style-type: circle;
}

*[class~="topic/linkpool"] {
    list-style-type: square;
}

*[class~="topic/linkinfo"] {
    display: block;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="topic/linkinfo"]:before {
    display: marker;
    content: element-name();
    marker-offset: fill;
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="topic/linktext"] {
    display: inline;
}

*[class~="topic/link"] {
    display: list-item;
}

*[class~="topic/link"]:after {
    content: icon(left-link) attr(href);
    font-family: monospace;
    font-size: smaller;
    color: #333333;
}

/* ---------------------------------------------------------------------------
  Specialization elements
--------------------------------------------------------------------------- */

/* topic ------------------------------------------------------------------ */

*[class~="topic/itemgroup"] {
    display: block;
    margin: 1.33ex 0;
}

*[class~="topic/required-cleanup"] {
    display: block;
    border-width: 2px;
    border-style: solid;
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-left-color: red;
    border-right-color: transparent;
    padding: 5px; 
    margin: 1.33ex 0;
}

/*
 * no-topic-nesting does not need to be styled.
 */

/* ---------------------------------------------------------------------------
  Concept elements
--------------------------------------------------------------------------- */

/* concept ---------------------------------------------------------------- */

*[class~="concept/conbody"] > *[class~="topic/section"] > *[class~="topic/title"],
*[class~="concept/concept"] > *[class~="topic/title"] {
    color: rgb(139,0,0);
    border-bottom-color: rgb(139,0,0);
}

/* ---------------------------------------------------------------------------
  Task elements
--------------------------------------------------------------------------- */

/* task ------------------------------------------------------------------- */

*[class~="task/task"] > *[class~="topic/title"] { 
    color: rgb(0,100,0);
    border-bottom-color: rgb(0,100,0);
}

/* 
 * parent>child selectors are needed by only for the classed CSS.
 * Without it, the weight of the following rules would be less than
 * the weight of section rules.
 */

*[class~="task/taskbody"] > *[class~="task/prereq"],
*[class~="task/taskbody"] > *[class~="task/context"],
*[class~="task/taskbody"] > *[class~="task/result"],
*[class~="task/taskbody"] > *[class~="task/postreq"],
*[class~="task/info"],
*[class~="task/tutorialinfo"],
*[class~="task/stepxmp"],
*[class~="task/stepresult"] {
    display: block;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="task/taskbody"] > *[class~="task/prereq"]:before,
*[class~="task/taskbody"] > *[class~="task/context"]:before,
*[class~="task/taskbody"] > *[class~="task/result"]:before,
*[class~="task/taskbody"] > *[class~="task/postreq"]:before,
*[class~="task/info"]:before,
*[class~="task/tutorialinfo"]:before,
*[class~="task/stepxmp"]:before,
*[class~="task/stepresult"]:before {
    display: marker;
    content: element-name();
    marker-offset: fill;
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="task/choices"],
*[class~="task/substeps"],
*[class~="task/steps-unordered"],
*[class~="task/steps"] {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

*[class~="task/step"] {
    display: block;
}

*[class~="task/steps-unordered"] > *[class~="task/step"] {
    margin-left: 20px;
}

*[class~="task/steps-unordered"] > *[class~="task/step"]:before {
    display: marker;
    content: url(icons/step_marker.gif);
}

*[class~="task/steps"] > *[class~="task/step"] {
    margin-left: 6ex;
}

*[class~="task/steps"] > *[class~="task/step"]:before {
    display: marker;
    content: simple-counter(n, decimal) " " url(icons/step_marker.gif);
}

*[class~="task/substep"] {
    display: block;
    margin-left: 6ex;
}

*[class~="task/substep"]:before {
    display: marker;
    content: simple-counter(n, lower-alpha) " " url(icons/step_marker.gif);
}

*[class~="task/choice"] {
    display: block;
    margin-left: 20px;
}

*[class~="task/choice"]:before {
    display: marker;
    content: url(icons/choice_marker.gif);
}

*[class~="task/cmd"] {
    display: block;
    /* Mandatory first element of a step or a substep: 
       no need to add vertical margins. */
}

*[class~="task/choicetable"] {
    display: table;
    border: 1 solid #D0FFD0;
    margin: 1.33ex 0;
}

*[class~="task/chhead"],
*[class~="task/chrow"] {
    display: table-row;
}

*[class~="task/chhead"] {
    background-color: #D0FFC0;
}

*[class~="task/chrow"] {
    background-color: inherit; /*e.g. for a read-only choicetable*/
}

*[class~="task/choptionhd"],
*[class~="task/chdeschd"],
*[class~="task/choption"],
*[class~="task/chdesc"] {
    display: table-cell;
    border: 1 solid #D0FFD0;
    padding: 2px;
    background-color: inherit;
}

*[class~="task/chdeschd"],
*[class~="task/chdesc"] {
    width: 66%;
}

/* ---------------------------------------------------------------------------
  Reference elements
--------------------------------------------------------------------------- */

/* reference -------------------------------------------------------------- */

*[class~="reference/refbody"] > *[class~="topic/section"] > *[class~="topic/title"],
*[class~="reference/reference"] > *[class~="topic/title"] { 
    color: rgb(85,26,139);
    border-bottom-color: rgb(85,26,139);
}

*[class~="reference/refsyn"] {
    display: block;
    margin: 1.33ex 0;
    background-color: #F0E0FF;
    padding: 2px;
}

*[class~="reference/properties"] {
    display: table;
    border: 1 solid #F0D0FF;
    margin: 1.33ex 0;
}

*[class~="reference/prophead"],
*[class~="reference/property"] {
    display: table-row;
}

*[class~="reference/prophead"] {
    background-color: #F0E0FF;
}

*[class~="reference/property"] {
    background-color: inherit; /*e.g. from read-only properties*/
}

*[class~="reference/proptypehd"],
*[class~="reference/propvaluehd"],
*[class~="reference/propdeschd"],
*[class~="reference/proptype"],
*[class~="reference/propvalue"],
*[class~="reference/propdesc"] {
    display: table-cell;
    margin-left: 0;
    border: 1 solid #F0D0FF;
    padding: 2px;
    background-color: inherit;
}

*[class~="reference/propdeschd"],
*[class~="reference/propdesc"] {
    width: 50%;
}

*[class~="reference/proptypehd"],
*[class~="reference/proptype"] {
    start-column: 0;
}

*[class~="reference/propvaluehd"],
*[class~="reference/propvalue"] {
    start-column: 1;
}

*[class~="reference/propdeschd"],
*[class~="reference/propdesc"] {
    start-column: 2;
}

/* ---------------------------------------------------------------------------
  Glossentry elements
--------------------------------------------------------------------------- */

/* glossentry ------------------------------------------------------------- */

*[class~="glossentry/glossentry"] {
    display: block;
    margin: 1.33ex 0;
}

/* 
 * parent>child selectors are needed by only for the classed CSS.
 * Without it, the weight of the following rules would be less than
 * the weight of concept>title rules.
 */

*[class~="glossentry/glossentry"] > *[class~="glossentry/glossterm"] {
    display: block;
    font: normal bold medium sans-serif; 
    color: black;
    border-style: none;
    margin-bottom: 0;
}

*[class~="glossentry/glossentry"] > *[class~="glossentry/glossdef"] {
    display: block;
    margin-top: 0;
    margin-left: 4ex;
}

*[class~="glossentry/glossentry"] > *[class~="glossentry/glossdef"]:before {
    content: "";
}

/* ---------------------------------------------------------------------------
  Display attributes
--------------------------------------------------------------------------- */

*[scale="50"] {
    font-size: 50%;
}

*[scale="60"] {
    font-size: 60%;
}

*[scale="70"] {
    font-size: 70%;
}

*[scale="80"] {
    font-size: 80%;
}

*[scale="90"] {
    font-size: 90%;
}

*[scale="100"] {
    font-size: 100%;
}

*[scale="110"] {
    font-size: 110%;
}

*[scale="120"] {
    font-size: 120%;
}

*[scale="140"] {
    font-size: 140%;
}

*[scale="160"] {
    font-size: 160%;
}

*[scale="180"] {
    font-size: 180%;
}

*[scale="200"] {
    font-size: 200%;
}

*[frame] {
    border: 1px solid black;
    padding: 2px;
}

*[frame=none],
*[class~="topic/table"][frame] {
    border-width: 0;
    padding: 0;
}

*[frame=top] {
    border-left-color: transparent;
    border-right-color: transparent;
    border-bottom-color: transparent;
}

*[frame=bottom] {
    border-top-color: transparent;
    border-left-color: transparent;
    border-right-color: transparent;
}

*[frame=topbot] {
    border-left-color: transparent;
    border-right-color: transparent;
}

*[frame=sides] {
    border-top-color: transparent;
    border-bottom-color: transparent;
}

/* ---------------------------------------------------------------------------
  Make topics and sections collapsible
--------------------------------------------------------------------------- */

*[class~="topic/section"],
*[class~="concept/concept"],
*[class~="task/task"],
*[class~="reference/reference"],
*[class~="topic/topic"] {
    collapsible: yes;
    not-collapsible-head: 1; /* title */
}

*[class~="topic/section"] > *[class~="topic/title"]:before,
*[class~="concept/concept"] > *[class~="topic/title"]:before,
*[class~="task/task"] > *[class~="topic/title"]:before,
*[class~="reference/reference"] > *[class~="topic/title"]:before,
*[class~="topic/topic"] > *[class~="topic/title"]:before {
    display: inline;
    content: collapser(collapsed-icon, icon(pop-right), 
                       expanded-icon, icon(pop-down)) " ";
}

*[class~="glossentry/glossentry"] {
    collapsible: no;
}

*[class~="glossentry/glossentry"] > *[class~="glossentry/glossterm"]:before {
    content: "";
}

/* ---------------------------------------------------------------------------
  When printing
--------------------------------------------------------------------------- */

@media print {
    * {
        line-height: 1.2; 
    }

    *:read-only {
        background-color: transparent;
    }

    colspec {
        display: none; 
    }
}

