/*
Cocoa HTML Import CSS Cleaner
(c) 2015, Literature and Latte LTD, all rights reserved.
Ioa Petra'ka <ioa@literatureandlatte.com>

Attempts to clean up HTML formatting imported into TextKit.

--- Known issues

* Multi-paragraph list elements have a <br> injected into them,
  creating unnecessary space between each item. It's impossible
  to remove that with CSS.
* Code blocks are not well spaced around other elements. They
  seem to have all margins and padding forced to 0px. Nothing I can do about it.
* Definition text spacing is locked down. Best I can do is
  change the text formatting somehow, like smaller print, but I
  feel that is making too much of an assumption. The issue is most obvious when normal text follows a definition.
*/

/* Set up some default paragraph formatting using indents instead of spacing */
p
{
	margin-top: 0;
	margin-bottom: 0;
	text-indent: 2em;
}

/* Remove indent from lines following headings. */
h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p { text-indent: 0; }

/* Add some styling to blockquotes */
blockquote p { margin-left: 3em; }
blockquote blockquote p { margin-left: 5em; }
blockquote blockquote blockquote p { margin-left: 7em; }
blockquote p:first-child { text-indent: 0; }

/* Clean up definition list a bit */
dt
{
	font-weight: bold;
	line-height: 2em;
}

/* Make sure list lines stay as tidy as possible */
li { margin: 0; }

/* Fixes unnecessarily spaced lists when multi-paragraph elements exist within the list. */
li p
{
	margin-top: 0;
	margin-bottom: 0;
}

/* Ensures that all headings having spacing above and below them. */
h1, h2, h3 { line-height: 2em; }
h4, h5 { line-height: 3em; }
h6 { line-height: 4em; }

/* Table clean up */
table { width: 100%; }
thead th {  border: solid #000;  border-width: 0 0 1px 0; }
th
{
	white-space: nowrap;
}
td
{
	-webkit-border-horizontal-spacing: 0px;
	-webkit-border-vertical-spacing: 0px;
	padding: 0.5em;
}
table caption { font-size: 10pt; }

