/*
 * Copyright (c) 2003-2007 Pixware. 
 *
 * This file is part of the XMLmind XML Editor project.
 * For conditions of distribution and use, see the accompanying legal.txt file.
 */

@import "xhtml_table.imp";
@import "xhtml_form.imp";

html {
    display: block;
}

/* ---------------------------------------------------------------------------
   Head
--------------------------------------------------------------------------- */

head {
    display: block;
}

title { 
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 2em;
    color: #804040;
    margin-top: .67ex;
    margin-bottom: .67ex;
}

base,
meta,
link,
style,
script,
noscript {
    display: tree;
}

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

body {
    display: block;
}

/*
 * Partial support for the Transitional DTD.
 */
body[bgcolor] {
    background-color: concatenate(attr(bgcolor));
}
body[text] {
    color: concatenate(attr(text));
}

/* ---------------------------------------------------------------------------
   Blocks
--------------------------------------------------------------------------- */

div {
    display: block;
}

/*
 * Partial support for the Transitional DTD.
 */
center {
    display: block;
}
div[align=center],
center { 
    margin-left: auto;
    margin-right: auto;
    text-align: center; 
}
div[align=right] { 
    margin-left: auto;
    margin-right: 0;
    text-align: right; 
}

hr {
    display: block;
    content: icon(invisible) icon(invisible);
    border: 2 inset gray;
}

/*
 * Partial support for the Transitional DTD.
 */
hr[noshade] {
    background-color: gray;
    border-style: solid;
}

/* -------------------------------------
   Headings
------------------------------------- */

h1, 
h2, 
h3, 
h4, 
h5,
h6 {
    display: block;
    font-weight: bold;
    color: #804040;
}

h1 { 
    font-size: 1.5em;
    margin-top: .83ex;
    margin-bottom: .83ex;
}

h2 { 
    font-size: 1.3em;
    margin-top: 1ex;
    margin-bottom: 1ex;
}

h3, 
h4, 
h5, 
h6 { 
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

/*
 * Partial support for the Transitional DTD.
 */
h1[align], 
h2[align], 
h3[align], 
h4[align], 
h5[align],
h6[align] {
    text-align: concatenate(attr(align)); 
}

/* -------------------------------------
   Paragraphs
------------------------------------- */

address {
    display: block;
    font-style: italic; 
    margin-top: 1.33ex 0;
}

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

/*
 * Partial support for the Transitional DTD.
 */
p[align] {
    text-align: concatenate(attr(align)); 
}

pre { 
    display: block;
    white-space: pre;
    font-family: monospace;
    background-color: #EEEEEE;
    border: thin solid gray;
    padding: 2px;
    margin: 1.33ex 0;
}

blockquote {
    display: block;
    margin: 1.33ex 10ex;
}

/* -------------------------------------
   Lists
------------------------------------- */

ul { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

li {
    display: block;
}

ul > li {
    margin-left: 2.5ex;
}
ul > li:before {
    display: marker;
    content: disc;
}
ul > li ul > li:before {
    content: square;
}
ul > li ul > li ul > li:before {
    content: icon(diamond);
}
ul > li ul > li ul > li ul > li:before {
    content: circle;
}

/*
 * Partial support for the Transitional DTD.
 */
dir,
menu { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}
dir > li,
menu > li {
    margin-left: 2.5ex;
}
dir > li:before {
    display: marker;
    content: icon(right-half-disc);
    color: #804040;
}
menu > li:before {
    display: marker;
    content: icon(right);
    color: #804040;
}

ol { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

ol > li {
    margin-left: 6ex;
}
ol > li:before {
    display: marker;
    content: simple-counter(n, decimal) ".";
    font-weight: bold;
}

/* Example of value for style attribute: "list-style-type: lower-roman;" */
ol[style*=lower-alpha] > li:before {
    content: simple-counter(n, lower-alpha) ".";
}
ol[style*=upper-alpha] > li:before {
    content: simple-counter(n, upper-alpha) ".";
}
ol[style*=lower-roman] > li:before {
    content: simple-counter(n, lower-roman) ".";
}
ol[style*=upper-roman] > li:before {
    content: simple-counter(n, upper-roman) ".";
}

/*
 * Partial support for the Transitional DTD.
 */
ol[type=a] > li:before {
    content: simple-counter(n, lower-alpha) ".";
}
ol[type=A] > li:before {
    content: simple-counter(n, upper-alpha) ".";
}
ol[type=i] > li:before {
    content: simple-counter(n, lower-roman) ".";
}
ol[type=I] > li:before {
    content: simple-counter(n, upper-roman) ".";
}

ol ul, ul ol, ul ul, ol ol { 
    margin-top: 0; 
    margin-bottom: 0; 
}

dl {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

dt {
    display: block;
    font-weight: bold; 
}

dd { 
    display: block;
    margin-left: 4ex;
}

/* ---------------------------------------------------------------------------
   Inlines

   span
   em strong cite dfn code samp kbd var abbr acronym
   q
   sub sup
   br
   tt i b 
   big small
   basefont font
   strike s u
   a
--------------------------------------------------------------------------- */

b, 
strong { 
    font-weight: bold; 
}

i, 
em, 
cite,
q,
var { 
    font-style: italic; 
}

tt, 
kbd, 
code, 
samp,
var { 
    font-family: monospace;
}

abbr, 
acronym { 
    font-weight: bold;
}

dfn {
    background-color: #FFFFE0;
}

sub, 
sup {
    display: inline-block;
    white-space: nowrap;
    font-size: small;
}
sub { 
    vertical-align: sub;
}
sup { 
    vertical-align: super;
}

/*
 * Partial support for the Transitional DTD.
 */
strike,
s {
    text-decoration: line-through;
}
u { 
    text-decoration: underline;
}

br:before { 
    content: "\A"; 
    color: gray;
}

big { 
    font-size: large;
}
small { 
    font-size: small;
}

/*
 * Partial support for the Transitional DTD.
 */
basefont { 
    content: "basefont=" attr(size);
    font-size: small;
    color: gray;
}
font[color] {
    color: concatenate(attr(color));
}
font[face] {
    font-family: concatenate(attr(face));
}
font[size="1"] {
    font-size: x-small;
}
font[size="2"] {
    font-size: small;
}
font[size="3"] {
    font-size: medium;
}
font[size="4"] {
    font-size: large;
}
font[size="5"] {
    font-size: x-large;
}
font[size="6"],
font[size="7"] {
    font-size: xx-large;
}
font[size="-3"] {
    font-size: smaller;
}
font[size="-2"] {
    font-size: smaller;
}
font[size="-1"] {
    font-size: smaller;
}
font[size="+1"] {
    font-size: larger;
}
font[size="+2"] {
    font-size: larger;
}
font[size="+3"] {
    font-size: larger;
}

a[href] { 
    color: navy;
    text-decoration: underline;
}
a[name]:after,
a[id]:after { 
    content: icon(right-target); 
    color: gray;
    vertical-align: text-top;
}

a[href][class="drop_site"]:after {
    content: " " drop-site(icon, icon(drop),
                           command, "setImage", 
                           parameter, "href anyURI - '%{value}'");
    vertical-align: text-top;
}

/* ---------------------------------------------------------------------------
   Ins/del
  
   When this is really needed, put the ins/del into a span 
   to force inline display.
--------------------------------------------------------------------------- */

ins {
    display: block;
    border-width: 2px;
    border-style: solid;
    border-color: transparent blue transparent transparent;
    padding-right: 5px;
}

p ins,
h1 ins, h2 ins, h3 ins, h4 ins, h5 ins, h6 ins,
dt ins, 
address ins,
a ins,
span ins,
bdo ins,
em ins, strong ins,
dfn ins,
code ins,
samp ins,
kbd ins,
var ins,
cite ins,
abbr ins, acronym ins,
q ins,
sub ins, sup ins,
tt ins, i ins, b ins,
big ins, small ins {
    display: inline;
    text-decoration: underline;
}

del {
    display: block;
    color: gray;
    border-width: 2px;
    border-style: solid;
    border-color: transparent gray transparent transparent;
    padding-right: 5px;
}

p del,
h1 del, h2 del, h3 del, h4 del, h5 del, h6 del,
dt del, 
address del,
a del,
span del,
bdo del,
em del, strong del,
dfn del,
code del,
samp del,
kbd del,
var del,
cite del,
abbr del, acronym del,
q del,
sub del, sup del,
tt del, i del, b del,
big del, small del {
    display: inline;
    text-decoration: line-through;
}

/* ---------------------------------------------------------------------------
   Objects
--------------------------------------------------------------------------- */

img {
    display: inline;
    content: image-viewport(attribute, src,
			    data-type, anyURI,
	                    content-width, attr(width),
                            content-height, attr(height));
}

/*
 * Partial support for the Transitional DTD.
 */
img[align=bottom],
img[align=middle],
img[align=top] {
    vertical-align: concatenate(attr(align));
}

object,
applet,
param {
    display: tree;
}

map,
area {
    display: tree;
}

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

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

    base,
    meta,
    link,
    style,
    script,
    noscript {
	display: none;
    }

    meta[name=author][content],
    meta[name=date][content] { 
        display: block;
	text-align: center;
	/* 
	 * Without paragraph(), a static text label is used 
         * and words are not wrapped.
	 */	
        content: paragraph(attr(content));
    }
}
