/*
 * 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 ---------------------------------------------------------------- */

bookmap {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1; /* first line */
}

bookmap:before {
    property-group: map-content();
}

bookmap > title {
    property-group: map-title();
}

booklibrary {
    display: block;
    margin: 1.33ex 0;
}

mainbooktitle,
booktitlealt {
    display: block;
    font-family: serif;
    font-weight: bold;
}

mainbooktitle {
    font-size: 1.5em;
    margin: 0.83ex 0;
}

booktitlealt {
    margin: 1.33ex 0;
}

bookmap > booktitle,
bookmap > frontmatter,
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;
}

bookmap > booktitle:before,
bookmap > frontmatter:before,
bookmap > backmatter:before {
    display: block;
    color: gray;
    font-size: larger;
    font-weight: bold;
    margin-top: 1ex;
    margin-bottom: 0;
}

bookmap > booktitle:before {
    content: element-name();
}

bookmap > frontmatter:before,
bookmap > backmatter:before {
    content: paragraph(content(element-name(), " ", invoke("chunkIcon")));
}

part,
chapter,
appendix {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1; /* first line */
    margin-left: 4ex;
    margin-top: 0.5ex;
    margin-bottom: 0.5ex;
}

bookmap > part,
bookmap > chapter,
bookmap > appendix {
    margin-left: 0;
}

part:before,
chapter:before,
appendix:before {
    display: inline;
}

part:before {
    content: invoke("topicrefContent", 1.3em);
    color: #804000;
}

chapter:before {
    content: invoke("topicrefContent", 1.1em);
    color: #006080;
}

appendix:before {
    content: invoke("topicrefContent", 1.3em);
    color: #408000;
}

frontmatter > topicgroup,
frontmatter > topichead,
frontmatter > topicref,
backmatter > topicgroup,
backmatter > topichead,
backmatter > topicref {
    margin-left: 0;
}

booklists {
    display: block;
    collapsible: no;
    border: 1px solid gray;
    padding: 0.5ex;
    margin: 0;
}

booklists:before {
    content: "";
}

toc,
figurelist,
tablelist,
abbrevlist,
trademarklist,
bibliolist,
indexlist,
booklist,
glossarylist,
notices,
dedication,
colophon,
amendments,
bookabstract,
draftintro,
preface {
    display: block;
    collapsible: yes;
    not-collapsible-head: 1;
    margin: 0.5ex 0;
}

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

/* 
 * Metadata
 */

/* 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; 
}

bookmeta:before {
    display: marker;
    content: item-collapser();
    color: #808000;
}

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

publisherinformation:before,
person:before,
organization:before,
printlocation:before,
published:before,
publishtype:before,
revisionid:before,
started:before,
year:before,
month:before,
day:before,
completed:before,
bookid:before,
bookpartno:before,
edition:before,
isbn:before,
booknumber:before,
volume:before,
maintainer:before,
bookchangehistory:before,
reviewed:before,
edited:before,
tested:before,
approved:before,
bookevent:before,
bookeventtype:before,
bookrights:before,
copyrfirst:before,
copyrlast:before,
bookowner:before,
bookrestriction:before,
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;
}

bookeventtype {
    content: paragraph(content("name=", attr(name)));
    color: #333333;
}

publishtype,
bookrestriction {
    content: paragraph(content("value=", attr(value)));
    color: #333333;
}

