/*
 * Copyright (c) 2007-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 bookmap elements.
 */

@import "map.css";
@import "xnal.imp";

/* bookmap ---------------------------------------------------------------- */

*[class~="bookmap/bookmap"] {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1; /* first line */
}

*[class~="bookmap/bookmap"]:before {
    property-group: map-content();
}

*[class~="bookmap/bookmap"] > *[class~="topic/title"] {
    property-group: map-title();
}

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

*[class~="bookmap/mainbooktitle"],
*[class~="bookmap/booktitlealt"] {
    display: block;
    font-family: serif;
    font-weight: bold;
}

*[class~="bookmap/mainbooktitle"] {
    font-size: 1.5em;
    margin: 0.83ex 0;
}

*[class~="bookmap/booktitlealt"] {
    margin: 1.33ex 0;
}

*[class~="bookmap/bookmap"] > *[class~="bookmap/booktitle"],
*[class~="bookmap/bookmap"] > *[class~="bookmap/frontmatter"],
*[class~="bookmap/bookmap"] > *[class~="bookmap/backmatter"] {
    display: block;
    collapsible: no;
    font-family: sans-serif;
    font-size: medium;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 1.33ex;
    border: 1px solid gray;
    padding: 0.5ex;
}

*[class~="bookmap/bookmap"] > *[class~="bookmap/booktitle"]:before,
*[class~="bookmap/bookmap"] > *[class~="bookmap/frontmatter"]:before,
*[class~="bookmap/bookmap"] > *[class~="bookmap/backmatter"]:before {
    display: block;
    color: gray;
    font-size: larger;
    font-weight: bold;
    margin-top: 1ex;
    margin-bottom: 0;
}

*[class~="bookmap/bookmap"] > *[class~="bookmap/booktitle"]:before {
    content: element-name();
}

*[class~="bookmap/bookmap"] > *[class~="bookmap/frontmatter"]:before,
*[class~="bookmap/bookmap"] > *[class~="bookmap/backmatter"]:before {
    content: paragraph(content(element-name(), " ", invoke("chunkIcon")));
}

*[class~="bookmap/part"],
*[class~="bookmap/chapter"],
*[class~="bookmap/appendix"] {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1; /* first line */
    margin-left: 4ex;
    margin-top: 0.5ex;
    margin-bottom: 0.5ex;
}

*[class~="bookmap/bookmap"] > *[class~="bookmap/part"],
*[class~="bookmap/bookmap"] > *[class~="bookmap/chapter"],
*[class~="bookmap/bookmap"] > *[class~="bookmap/appendix"] {
    margin-left: 0;
}

*[class~="bookmap/part"]:before,
*[class~="bookmap/chapter"]:before,
*[class~="bookmap/appendix"]:before {
    display: inline;
}

*[class~="bookmap/part"]:before {
    content: invoke("topicrefContent", 1.3em);
    color: #804000;
}

*[class~="bookmap/chapter"]:before {
    content: invoke("topicrefContent", 1.1em);
    color: #006080;
}

*[class~="bookmap/appendix"]:before {
    content: invoke("topicrefContent", 1.3em);
    color: #408000;
}

*[class~="bookmap/frontmatter"] > *[class~="mapgroup-d/topicgroup"],
*[class~="bookmap/frontmatter"] > *[class~="mapgroup-d/topichead"],
*[class~="bookmap/frontmatter"] > *[class~="map/topicref"],
*[class~="bookmap/backmatter"] > *[class~="mapgroup-d/topicgroup"],
*[class~="bookmap/backmatter"] > *[class~="mapgroup-d/topichead"],
*[class~="bookmap/backmatter"] > *[class~="map/topicref"] {
    margin-left: 0;
}

*[class~="bookmap/booklists"] {
    display: block;
    collapsible: no;
    border: 1px solid gray;
    padding: 0.5ex;
    margin: 0;
}

*[class~="bookmap/booklists"]:before {
    content: "";
}

*[class~="bookmap/toc"],
*[class~="bookmap/figurelist"],
*[class~="bookmap/tablelist"],
*[class~="bookmap/abbrevlist"],
*[class~="bookmap/trademarklist"],
*[class~="bookmap/bibliolist"],
*[class~="bookmap/indexlist"],
*[class~="bookmap/booklist"],
*[class~="bookmap/glossarylist"],
*[class~="bookmap/notices"],
*[class~="bookmap/dedication"],
*[class~="bookmap/colophon"],
*[class~="bookmap/amendments"],
*[class~="bookmap/bookabstract"],
*[class~="bookmap/draftintro"],
*[class~="bookmap/preface"] {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1;
    margin: 0.5ex 0;
}

*[class~="bookmap/toc"]:before,
*[class~="bookmap/figurelist"]:before,
*[class~="bookmap/tablelist"]:before,
*[class~="bookmap/abbrevlist"]:before,
*[class~="bookmap/trademarklist"]:before,
*[class~="bookmap/bibliolist"]:before,
*[class~="bookmap/indexlist"]:before,
*[class~="bookmap/booklist"]:before,
*[class~="bookmap/glossarylist"]:before,
*[class~="bookmap/notices"]:before,
*[class~="bookmap/dedication"]:before,
*[class~="bookmap/colophon"]:before,
*[class~="bookmap/amendments"]:before,
*[class~="bookmap/bookabstract"]:before,
*[class~="bookmap/draftintro"]:before,
*[class~="bookmap/preface"]:before {
    display: inline;
    content: invoke("topicrefContent", normal);
    color: #333333;
}

/* 
 * Metadata
 */

/* bookmap ---------------------------------------------------------------- */

*[class~="bookmap/bookmeta"] {
    display: block;
    collapsible: yes;
    collapsed: yes;
    collapsed-content: paragraph(content("(", element-name(), ")"), 
                                 color, #808000, 
                                 font-size, smaller,
                                 font-weight, bold);
    collapsed-content-align: center;
    background-color: #F8F8E0;
    border: 1px solid #C0C080;
    padding: 0.5em;
    border-radius: 0.5em;
    margin-left: 20px;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex; 
}

*[class~="bookmap/bookmeta"]:before {
    display: marker;
    content: item-collapser();
    color: #808000;
}

*[class~="bookmap/publisherinformation"],
*[class~="bookmap/person"],
*[class~="bookmap/organization"],
*[class~="bookmap/printlocation"],
*[class~="bookmap/published"],
*[class~="bookmap/publishtype"],
*[class~="bookmap/revisionid"],
*[class~="bookmap/started"],
*[class~="bookmap/year"],
*[class~="bookmap/month"],
*[class~="bookmap/day"],
*[class~="bookmap/completed"],
*[class~="bookmap/bookid"],
*[class~="bookmap/bookpartno"],
*[class~="bookmap/edition"],
*[class~="bookmap/isbn"],
*[class~="bookmap/booknumber"],
*[class~="bookmap/volume"],
*[class~="bookmap/maintainer"],
*[class~="bookmap/bookchangehistory"],
*[class~="bookmap/reviewed"],
*[class~="bookmap/edited"],
*[class~="bookmap/tested"],
*[class~="bookmap/approved"],
*[class~="bookmap/bookevent"],
*[class~="bookmap/bookeventtype"],
*[class~="bookmap/bookrights"],
*[class~="bookmap/copyrfirst"],
*[class~="bookmap/copyrlast"],
*[class~="bookmap/bookowner"],
*[class~="bookmap/bookrestriction"],
*[class~="bookmap/summary"] {
    display: block;
    collapsible: no;
    margin-left: 16ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex; 
    border-width: 0;
    border-style: none;
    padding: 0;
}

*[class~="bookmap/publisherinformation"]:before,
*[class~="bookmap/person"]:before,
*[class~="bookmap/organization"]:before,
*[class~="bookmap/printlocation"]:before,
*[class~="bookmap/published"]:before,
*[class~="bookmap/publishtype"]:before,
*[class~="bookmap/revisionid"]:before,
*[class~="bookmap/started"]:before,
*[class~="bookmap/year"]:before,
*[class~="bookmap/month"]:before,
*[class~="bookmap/day"]:before,
*[class~="bookmap/completed"]:before,
*[class~="bookmap/bookid"]:before,
*[class~="bookmap/bookpartno"]:before,
*[class~="bookmap/edition"]:before,
*[class~="bookmap/isbn"]:before,
*[class~="bookmap/booknumber"]:before,
*[class~="bookmap/volume"]:before,
*[class~="bookmap/maintainer"]:before,
*[class~="bookmap/bookchangehistory"]:before,
*[class~="bookmap/reviewed"]:before,
*[class~="bookmap/edited"]:before,
*[class~="bookmap/tested"]:before,
*[class~="bookmap/approved"]:before,
*[class~="bookmap/bookevent"]:before,
*[class~="bookmap/bookeventtype"]:before,
*[class~="bookmap/bookrights"]:before,
*[class~="bookmap/copyrfirst"]:before,
*[class~="bookmap/copyrlast"]:before,
*[class~="bookmap/bookowner"]:before,
*[class~="bookmap/bookrestriction"]:before,
*[class~="bookmap/summary"]:before {
    display: marker;
    /* Limit the length of very long tags such as publisherinformation. */
    content: xpath("substring(name(),1,14)");
    marker-offset: fill;
    font-size: smaller;
    font-weight: bold;
    color: #333333;
}

*[class~="bookmap/bookeventtype"] {
    content: paragraph(content("name=", attr(name)));
    color: #333333;
}

*[class~="bookmap/publishtype"],
*[class~="bookmap/bookrestriction"] {
    content: paragraph(content("value=", attr(value)));
    color: #333333;
}

