/** http://www.css3files.com/smashing-winery/css/print.css **/
/* Smashing winery
   Example site for article at Smashing Magazine
   by Christian Krammer, ck@css3files.com
   
   Print style */

/* Reset quotes */
q {quotes: none}
q:before, q:after {content: ""}   

/* Hide everything unneeded */
header h1, header nav, footer, img {display: none}

/* font sizes */
body {
	font: 12pt Georgia, "Times New Roman", Times, serif;
	line-height: 1.3;
	color: #000;
}

h1 {font-size: 24pt}

h2 {font-size: 14pt; margin-top: 25px}

aside h2 {font-size: 18pt}

/* Show printer-frindly logo. */
header .print {display: block}

/* If you like things a little bit easier and more semantic you can alternatively just leave the h1 of the header visible, switch off the margin and make it bigger than the rest of the headlines */
/*header nav, footer, img {display: none}

header h1 {
	margin: 0;
	font-size: 30pt;
}*/

/* Some browsers like to show a border around images. Switch it off */
img {border: 0}

/* Mover the header a little bit awy from the content */
header {margin-bottom: 40px}

/* Display the URL of the site so that the user knows where the printout came from */
header:after {display: block; content: "www.smashing-winery.com"}

/* Additionally/optionally a little message could be displayed */
/*header:before {
	display: block;
	content: "Thank your for printing our content at www.smashing-winery.com. Please check back soon for new offers about delicious wine from our winery.";
	margin-bottom: 10px;
	border: 1px solid #bbb;
	padding: 3px 5px;
	font-style: italic;
}*/

/* Separate blockquotes a little bit from the rest */
blockquote {
	font-size: 13pt;
	font-style: italic;
}

/* By default links are blue. For optimal legibility change them to black */
p a {color: #000}

/* Show the URL after each link, whereby internal links are preceeded by the site's URL */
p a:after {
	content: " (http://www.smashing-winery.com/" attr(href) ")";
	font-size: 80%;
	word-wrap: break-word;
}

/* External links don't get this treatment */
p a[href^="http://"]:after, p a[href^="https://"]:after {
	content: " (" attr(href) ")";
}

/* Append the source of the citation */
q:after {content: " (" attr(cite) ")"}

/* The Sidebar is placed under the content automatically. To distinguish it from the rest a border and a gap is set before */
aside {
	border-top: 1px solid #bbb;
	margin-top: 30px;
	display: block;
	/*page-break-before: always; */ /* Moves the sidebar to new page */
}


/* PRINT ONLY rules follow */
@media print {

  marquee { -moz-binding: none; }

}



body{background:#fff; font-size:12pt}
/** make a reset (and by reset i mean display:none) for everything you dont' need printed.....like your nav **/
ul#mainmenu{display:none}
div#content{width:auto; margin:0 5%; padding:0; border:none; float:none !important; color:#000; background:transparent none}
/** div#content{margin-left: 10%; padding-top:1em; border-top:1px solid #930} **/
/** Display URL in Print Document because print docs dont have hypertext http://www.onextrapixel.com/2009/05/05/how-to-create-a-simple-print-css-for-your-site/ **/
a:after {content: " [" attr(href) "] "}
a:link, a:visited {background: transparent; color:#333; text-decoration:none}
a:link[href^="http://"]:after, a[href^="http://"]:visited:after {content: " (" attr(href) ") "; font-size: 11px}
a[href^="http://"] {color:#000}

/** orphans: keep shit on the right page, as in start a new one, no cut-offs **/
/** {page-break-before: always} **/
/** {page-break-after:always} **/
/** {page-break-before:always} **/
/** {page-break-after:avoid} **/
/** {page-break-before:avoid} **/

/** widows - lines of text to display @ the top of the second page when splitting text over pages. **/
p{widows:3}
blockquote{font-size:20px; line-height:20px; color:#000; margin-top:10px; letter-spacing:-1px; font-weight:200}
cite{display:block; text-align:right; font-variant:italic; font-size:12px; letter-spacing:1px; font-weight:200; margin-top:10px; margin-right:5px}





/** display content edge to edge, negating margins/padding and balance via @page rule - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
@media print {
  h1{color: #000; background: none;}
  nav, aside {display: none;}
  body, article {width: 100%; margin: 0; padding: 0;}
  @page {margin: 2cm;}
}
/** if content is intended for users to be able to add handwritten notes on the printed page, consider increasing the print margin - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/

/** prevent headings from being printed at bottom of page - helps ensure content is not broken across printed pages - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
h2,h3{page-break-after:avoid}

/** prevent images from bleeding over printed page edge - helps ensure content is not broken across printed pages - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
img{max-width:100% !important}

/** ensure articles always start on fresh page - helps ensure content is not broken across printed pages - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
article{page-break-before:always}

/** prevent large elements (in this case, ul and img) from being split across multiple pages - helps ensure content is not broken across printed pages - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
ul,img{page-break-inside:avoid}

/** force background images/colors to be printed, in separate media query; as of 2013-03-08 webkit only - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
@media print and (color) { *{-webkit-print-color-adjust:exact; print-color-adjust:exact} }

/** expand external links; requires using relative urls for local links like this <p><a href="/blog">internal link</a> and <a href="http://yourmom.com">external link</a>.</p> - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
@media print {
  article a{
    font-weight:bolder; text-decoration:none;
  }
  article a[href^=http]:after{
    content:" <" attr(href) "> ";
  }
}
/** anchor links and links around images will expand when printed; below fixes the anchor links - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
article a[href^="#"]:after{content:"";}

/** bc we cant select an element based on its children, links around images are more difficult; add a class to them, like below: - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
a.imglinkclass:after > img{content:""}

/** the approaches above assume users will continue to type in urls by hand; better solution is to make digital version of page easier to access by providing matching qr code - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
/** qr code (most likely) not visible on web, so odds are you're going to have to move things around to work with its position on the page **/
/** qr codes are unique to each page, so the below @media at-rule should be added as an embedded style sheet **/
@media print {
  header h1:after{content:url("http://yourmom.com/a/i/qrcode-for-this-page.png"); position:absolute; top:0; right:0;}
  
  /** the style declaration below declares a qr code using google charts api **/
  header h1.qr-code-google-chart-api:after{content:url("https://chart.googleapis.com/chart?cht=qr&chs=150x150&chl=http://yourdomain.com&choe=UTF-8); position:absolute; top:0; right:0}
}


/** css filters for improved print quality; an example of this (shown below) would be for banner/banner images that are white against a dark background - http://coding.smashingmagazine.com/2013/03/08/tips-tricks-print-style-sheets/  **/
/** the svg equivalents of css filters, used below, are for firefox and can be located here: http://dev.bowdenweb.com/a/i/svg/inverse-of-header-img.svg **/
@media print{
  header{background:none; color:#000}
  header img{filter:url("inverse-of-header-img.svg#negative"); -webkit-filter:inverse(100%); filter:invert(100%);}

}





/** use counters for automagick numbering; two counters are created below, one for chapter numbering/one for figure numbering; both are reset at every new chapter - http://alistapart.com/article/building-books-with-css3 **/
section.chapter > div.titlepage > div > div > h2.title:before{
  counter-increment: ChapterNo;
  content: "Chapter " counter(ChapterNo);
}
div.figure-title:before{
  counter-increment: FigureNo;
  content: "Figure " counter(ChapterNo)"-" counter(FigureNo)": ";
}
section.chapter{counter-reset: ChapterNo FigureNo;}





/** define page margins **/
/** this @page rule applies all the way around the page **/
@page { margin:0.5cm; }
/** the next two @page rules set the left/right page margins independently **/
@page :left { margin:0.5cm; }
@page :right { margin:0.5cm; }
/** target first page of printed document **/
@page :first { margin:1cm 2cm; }
/** add a message as a supplement/alternative to displaying urls of links in printed documents **/
/** NOTE the distinguished styles (border/italic) of this particular added generated content; lets users know its something set apart from the rest of the printed document **/
header:before{ display:block; content:"Thanks for printing out my content at www.yourmom.com. Check back soon for more content about your mom.";
  margin-bottom:10px; border:1px solid #bbb; font-style:italic; }
/** more methods of printing links **/
/** to distinguish internal links (local urls) **/
a:after{ content:"(http://www.yourmom.com/" attr(href) ")"; }
/** to hide internal links in the document being printed **/
a[href^="#":after { display:none; }
/** including ssl-secure documents **/
a[href^="http://"]:after,a[href^="https://"]:after{ content: " (" attr(href) ")"; }
/** if your links have super long ridiculous urls, add the following style declaration before the pseudo-classes - 2011 - works only in chrome for print; firefox automagically breaks long urls **/
a{ word-wrap: break-word; }
/** for citing quotes, append cite attribute (url) after quotation marks **/
q:after,blockquote:after{ content:" (Source: " attr(cite) ")"; }
/** for elements separate from the content (like a menu, sidebar, etc.), it can be good practice to move them to a new page for printing **/
aside{ page-break-before:always; }

/** widows sets minimum number of lines in a paragraph to leave at the top of a page before moving them entirely to a new page **/

/** orphans sets the number of lines for the bottom of the page **/






