/*
 * Copyright (c) 2006-2012 Pixware SARL. All rights reserved.
 *
 * This file is part of the XMLmind XML Editor project.
 * For conditions of distribution and use, see the accompanying legal.txt file.
 *
 * Displays the structure (a little more than a TOC) of DocBook 5.0, 5.1 
 * documents.
 */

@namespace "http://docbook.org/ns/docbook";
@namespace db5 "http://docbook.org/ns/docbook";

@import url(docbook-config:css/inline1.imp);
@import url(docbook-config:css/inline2.imp);

*, 
*:comment,
*:processing-instruction,
topic > *,
set > *,
book > *,
part > *,
reference > *,
refentry > *,
preface > *,
chapter > *,
article > *,
appendix > *,
section > *,
sect1 > *,
sect2 > *,
sect3 > *,
sect4 > *,
sect5 > *,
setindex > *,
dedication > *,
toc > *,
lot > *,
glossary > *,
bibliography > *,
index > *,
colophon > *,
partintro > *,
tocchap > *,
info > * {
    display: none;
}

title {
    display: block;
}

title * {
    display: inline;
}

setindex,
dedication,
toc,
lot,
glossary,
bibliography,
index,
colophon,
partintro,
tocchap,
info {
    display: block; 
    content: element-name();
    font-size: small;
    color: gray;
}

topic,
set,
book,
part,
reference,
refentry,
preface,
chapter,
article,
appendix,
section,
sect1,
sect2,
sect3,
sect4,
sect5,
info:contains-element(title) {
    display: block;
    margin-left: 9ex;
}

info:contains-element(title) {
    content: "";
    font-size: inherit;
    color: inherit;
}

topic:before,
set:before,
book:before,
part:before,
reference:before,
refentry:before,
preface:before,
chapter:before,
article:before,
appendix:before,
section:before,
sect1:before,
sect2:before,
sect3:before,
sect4:before,
sect5:before,
info:contains-element(title):before {
    display: marker;
    marker-offset: fill;
    content: element-name();
    font-size: small;
    color: gray;
}

part > info > title:before {
    content: simple-counter(n--, upper-roman) " "; 
}

part > title:before { 
    content: simple-counter(n-, upper-roman) " "; 
}

chapter > info > title:before {
    content: simple-counter(n--, decimal) " "; 
}

chapter > title:before { 
    content: simple-counter(n-, decimal) " "; 
}

appendix > info > title:before {
    content: simple-counter(n--, upper-alpha) " "; 
}

appendix > title:before { 
    content: simple-counter(n-, upper-alpha) " "; 
}

refentry {
    content: xpath("join(.//db5:refname, ', ')");
    color: gray;
}

section > info > title:before,
sect1 > info > title:before {
    content: simple-counter(n--) " "; 
}

section > title:before,
sect1 > title:before {
    content: simple-counter(n-) " "; 
}

section section > info > title:before,
sect2 > info > title:before {
    content: simple-counter(nn--) " "; 
}

section section > title:before,
sect2 > title:before { 
    content: simple-counter(nn-) " "; 
}

section section section > info > title:before,
sect3 > info > title:before {
    content: simple-counter(nnn--) " "; 
}

section section section > title:before,
sect3 > title:before {
    content: simple-counter(nnn-) " "; 
}

section section section section > info > title:before,
sect4 > info > title:before {
    content: simple-counter(nnnn--) " "; 
}

section section section section > title:before,
sect4 > title:before { 
    content: simple-counter(nnnn-) " "; 
}

section section section section section > info > title:before,
sect5 > info > title:before {
    content: simple-counter(nnnnn--) " "; 
}

section section section section section > title:before,
sect5 > title:before { 
    content: simple-counter(nnnnn-) " "; 
}

section section section section * section > info > title:before,
section section section section * section > title:before { 
    content: ""; 
}

/*
 * topic (not numbered)
 */

topic > title,
topic > info > title {
    color: rgb(85,26,139);
}
