
/* From https://github.com/rachelandrew/css-for-print/blob/master/pdf-styles.css
 * From https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/
 *
 * this stylesheet is used when generating a PDF with PrinceXML or any other tool 
 * that understands the CSS used. 
 *
 * Doc CSS
 *   https://www.w3.org/TR/css3-page/
 *   https://www.w3.org/TR/css-gcpm-3/
 */

/* define a page */
@page {
    size: A4;
    margin: 1.5cm;
    size: auto;/* auto is the initial value */
    margin: 5%;
    padding: 5%;
    font-size: 9pt;
}

@page:first {
    size: A4;
   margin: 0;
}

img {
  max-width: 100%;
}

div.frontcover { 
  page: cover; 
  content: url("https://support.ircam.fr/docs/Antescofo/manuals_05052021/images/cover.png");
  width: 100%;
  height: 100%; 
}



/* styles for the right hand spread
Bottom left we display the title of the book, bottom right the page using a CSS counter, top right the content of the current chapter */
@page:right{ 
   @bottom-left {
       margin: 10pt 0 30pt 0;
       border-top: .25pt solid #666;
	   content: "Our Cats";
       font-size: 9pt;
       color: #333;
   }
   @bottom-right { 
       margin: 10pt 0 30pt 0;
       border-top: .25pt solid #666;
       content: counter(page);
       font-size: 9pt;
   }
   @top-right {
   	   content:  string(doctitle);
   	   margin: 30pt 0 10pt 0;
   	   font-size: 9pt;
   	   color: #333;
   }
}

/* styles for the left hand spread 
Bottom right book title, bottom left current page */
@page:left {

   @bottom-right {
       margin: 10pt 0 30pt 0;
       border-top: .25pt solid #666;
	     content: "Our Cats";
       font-size: 9pt;
       color: #333;
   }
   @bottom-left { 
       margin: 10pt 0 30pt 0;
       border-top: .25pt solid #666;
       content: counter(page);
       font-size: 9pt;
   }
}

/* first page */
@page:first {
  @bottom-right {
    content: normal;
    margin: 0;
  }

  @bottom-left {
    content: normal;
    margin: 0;
  }
}



/* reset chapter and figure counters on the body */
body {
	counter-reset: chapternum figurenum;
	font-family: 'IBM Plex Sans', 'Roboto', sans-serif;
	line-height: 1.5;
	font-size: 13pt;
	color: #334;
	background-color: #FAFAFC;
}


# background colo here to deal with the override between css file
highlight {
    background-color: #F4F4F4;
}


# code = in-line code, pre = bloc de code
# inherit from highlight 			   
pre,code {
    font-family: 'IBM Plex Mono', 'Roboto Mono', monospace;
    font-size: 16pt;
    background-color: #F4F4F4;
}

/* get the title of the current chapter - this will be the content of the h1 
reset figure counter as figures start from 1 in each chapter */
h1 {
    string-set: doctitle content();
    page-break-before: always;
    counter-reset: figurenum;
    counter-reset: footnote;
    line-height: 3; /* 1.3; */
}

/* increment chapter counter */
h1.chapter:before {
    counter-increment: chapternum;
    content: counter(chapternum) ". ";
}

/* increment and display figure counter */
figcaption:before {
	counter-increment: figurenum;
	content: counter(chapternum) "-" counter(figurenum) ". ";
}

/* footnotes */
.fn {
  float: footnote;
}

.fn {
  counter-increment: footnote;
}

.fn::footnote-call {
  content: counter(footnote);
  font-size: 9pt;
  vertical-align: super;
  line-height: none;
}

.fn::footnote-marker {
  font-weight: bold;
}

.twocol {
    -webkit-column-count: 2; /* Chrome, Safari, Opera */
    -moz-column-count: 2; /* Firefox */
    column-count: 2;
}

.threecol {
    -webkit-column-count: 3; /* Chrome, Safari, Opera */
    -moz-column-count: 3; /* Firefox */
    column-count: 3;
}


.column {
  float: left;
  width: 50%;
}

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
} 

@page {
  @footnotes {
    border-top: 0.6pt solid black;
    padding-top: 8pt;
  }
}

/* HERE to define the title font. Access to the font is given in
 * references.ref through a link rel command 
 */
h1,h2,h3,h4,h5 {
        font-family: 'Cabin Sketch', sans-serif, serif;
	font-weight: bold;
	page-break-after: avoid;
	page-break-inside:avoid;
}

h1 {
    font-size: 40px;
    line-height: 50px;
}

h2 {
    font-size: 32px;
    line-height: 40px;
}

h3 {
    font-size: 26px;
    line-height: 32px;
}

h4 {
    font-size: 22px;
    line-height: 28px;
    font-weight: normal;
}

h5 {
    font-size: 18px;
    line-height: 24px;
    font-weight: lighter;
}

h1+p, h2+p, h3+p {
	page-break-before: avoid;
}

table, figure {
	page-break-inside: avoid;
}

ul.toc {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* create page numbers using target-counter in the TOC */
ul.toc a::after {
  content: leader('.') target-counter(attr(href), page);
}

ul.toc li {
	line-height: 2;
}

ul.toc li a {
	text-decoration: none;
}

a {
    color: #285681;
    text-decoration: underline #2FA4E7;

/*
    text-decoration: underline #CCC;
    text-decoration: underline wavy #CCC;
    text-decoration: underline dashed #CCC;
    text-decoration: underline dotted #2ba2e6; 
*/
}

/* add page number to cross references */
a.xref:after {
  content: " (page " target-counter(attr(href, url), page) ")";
}

