/*  ---------------------------------------------------------------- */
/*  Feuille de style specifique a l'impression                       */
/*  ---------------------------------------------------------------- */

/*  Ne pas imprimer : on elimine les elements de navigation (display: none; )
---------------------------------------------- */
#entete, #hierarchie, #navigation, #pied, .tdm.menu { display: none; }
.repondre, .repondre, .formulaire_spip { display: none; }
.spip-admin, .spip-admin-float, .invisible { display: none; }

/*  Disposition a l'ecran
---------------------------------------------- */
.nettoyeur { clear: both; }

/*  Pour les liens, on les souligne et
/*  on affiche l'URL cible a la suite des liens sortants (!)
---------------------------------------------- */
a { color: #B04600 !important; text-decoration: none; }
a.spip_out:after, a.spip_glossaire:after, a.spip_mail:after {
 /* display: inline; content: " (" attr(href) ")"; */
}

/* foncer sensiblement pour l'impression */
body {color: #222;}
.spip_cadre, .coloration_code .cadre {color:#444;}

/* largeurs */
* {overflow:visible !important;}
body {padding:0; background:white;}

#page {width:auto; margin:0; padding:0;}
#conteneur {width:auto; margin:0; padding:0;}
#contenu {
	float: none;
	width: auto;
}
#contenu .exemple { background-image:url(images/puzzle_pdf.png);}
#contenu .exercice { background-image:url(images/exercice_pdf.png);}
#contenu .reponse { background-image:url(images/reponse_pdf.png);}

/* page break */
h1 { margin:0; padding:0;}
#contenu .integrale h1 {margin:0; padding:0;}
#contenu .integrale > .lesarticles .article:first-child h2 {padding: 0; margin:0; }

.integrale .couverture {page:couverture; page-break-after:always;}
.integrale .chapitre {page:chapitre; page-break-after:always; page-break-before:right;}
.integrale .chapitre_intro {page:presentation; page-break-after:always; page-break-before:right;}
.integrale .chapitre_intro_livre .article {page-break-after:always; page-break-before:right;}
.integrale .presentation {page:presentation; page-break-after:always; page-break-before:right;}
.integrale .tdm.sommaire {page:presentation; page-break-after:auto; page-break-before:right;}
.integrale .tdm {page:index; page-break-after:auto; page-break-before:right;}
.integrale .page_vide {page:vide; page-break-before:always;}


.integrale .rubrique {page-break-before:always;}
.integrale .rubrique .rubrique {page-break-before:auto;}


h1, h2, h3, h4, h5, h6 {
	page-break-after:avoid;
}

p,
.cadre,
.spip_cadre,
.coloration_code {
   /* page-break-inside: avoid;*/
   orphans:6; /* pas au point avec la coloration de code, dommage */
}

.spip_cadre, .coloration_code .cadre {overflow:visible;}
/* liens de téléchargements */
.cadre_download { display: none; }


/* assign values to header/footer strings */
.integrale .chapitre > h1 { string-set: chapter "# " content(); font-family:bolonewt;}
.integrale h1#tdm { string-set: chapter "# " content();}

.integrale .couverture .pied   { string-set: couverturepied content(); position:relative; left:-3000em; }


@page  {
	size: A4 portrait;

	padding:0 0 .5cm;
	margin:1.5cm 3cm 1cm;
	@top-right {
		content:"";
		color:#aaa;
		font-size:120%;
		text-align:right;
		font-weight:bold;
		font-family:bolonewt;
		padding:5px;
		margin-top:3mm;
		margin-right:-2cm;
	}
	@bottom-left {
		padding:5px;
		font-size:120%;
		font-weight:bold;
		font-family:bolonewt;
		vertical-align:top;
		color:#888;
		margin-top:-.5cm;
		margin-left:-2cm;
	}
	@bottom-right {
		padding:5px;
		font-size:120%;
		font-weight:bold;
		font-family:bolonewt;
		vertical-align:top;
		color:#888;
		margin-top:-.5cm;
		margin-right:-2cm;
	}
}

@page:right {
	@top-right {content: string(chapter);}
	@bottom-right {content: counter(page);}
}
@page:left {
	@bottom-left {content: counter(page);}
}

@page couverture {
	background:white;
	/*border:3px solid #ddd;*/
	padding:4cm .2em 1em;
	margin:3cm 3cm;
	@top-right {content:"";}
	@bottom-center {
		margin:0;
		content: string(couverturepied);
		font-size:100%;
		text-align:right;
	}
	@bottom-left {content:"";}
	@bottom-right {content:"";}
}

@page chapitre {
	background:white;
	/*border:3px solid #ddd;*/
	padding:1cm;
	margin:3cm 3cm;
	/*margin:4cm 3cm;*/
	@top-right {content:"";}
	@bottom-right {
		margin-top:1.5cm;
	}
}
@page chapitre:left {
	@bottom-left {content: "";}
}

@page presentation {
	padding:0 0 .5cm;
	margin:1.5cm 3cm .5cm;
	@bottom-left {content:"";}
	@bottom-right {content:"";}
}

@page index {
	padding:0 0 .5cm;
	margin:1.5cm 3cm .5cm;
	@bottom-left {margin-top:-1cm;}
	@bottom-right {margin-top:-1cm;}
}

@page vide {
	@top-right {content:"";}
	@bottom-left {content:"";}
	@bottom-right {content:"";}
}


.tdm ul a::after {
  content: leader('.') target-counter(attr(href), page);
}

a[title]::after {
  content:  " (p." target-counter(attr(href), page) ")";
}


/* PRINCE specific */
h1 { prince-bookmark-level: 1 }
h2 { prince-bookmark-level: 2 }
h3 { prince-bookmark-level: 3 }
