@import "reset.css";
/* @import 'fonts.css'; */

@font-face {
  font-family: "substitut";
  src: url("../fonts/substitut.ttf");
}

/* global */
body {
  color: var(--color);
  background: var(--background);
  font-family: monospace;
  font-size: 12px;
  line-height: 1.1rem;
  overflow-x: hidden;
	padding-bottom: 50vh;
}

a {
  color: inherit;
}

a:not(.bonbon a):hover,
#about_button:hover,
#title:hover {
  color: var(--background);
  background-color: var(--color);
  text-decoration: none;
}

h1,
h2 {
  font-weight: bold;
}

h1 span#martine {
	font-size: 1.4em;
}

em {
  font-style: italic;
}

.hidden {
  display: none;
}

/*  nav */

nav {
  padding: .75rem;
  left: 0;
  padding-bottom: 0;
	position: fixed;
  max-width: 10%;
	z-index: 17;
}

nav a {
  text-decoration: none;
}

nav h1 {
  border-bottom: 1px solid;
  padding-left: 0.5em;
  padding-right: 0.5em;
  flex: 1;
}

nav h1 span {
  font-weight: normal;
}

nav h1#title {
  border-right: 1px solid;
}

nav h1#subtitle {
  font-weight: normal;
  border-bottom: none;
}

#about_button {
  border-left: 1px solid;
  border-bottom: 1px solid;
  position: fixed;
  right: 0;
  top: 0;
  margin: .75rem;
  padding-left: 0.5em;
  padding-right: 0.5em;
  cursor: pointer;
	z-index: 15
}


/* font view */

.main-fonts {
  padding-top: 2.5em;
	text-align: center;
	width: 80%;
	margin-left: 10%;
	opacity: 0;
}


.main-fonts.hidden {
	display: block;
	transition: opacity .5s;
	opacity: 1;
}
.main-fonts.visible {
	transition: opacity .5s;
	opacity: 1;
}
.main-fonts.visible::first-letter {
text-transform: uppercase;
}

.close-font {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 3rem;
}

.close-font:hover {
  cursor: pointer;
  opacity: .5;
  transition: opacity .25s;
}

.close-font.visible {
  display: block;
}

.font {
	display: inline;
	text-align: center;
}

.font a {
  text-decoration: none;
}

.font div.font-face {
  display: none;
}

.head-font {
  display: flex;
  width: 100%;
}

.head-font > * {
  padding-left: 0.5em;
  margin-right: 0.5em;
  border-left: 1px solid;
}

.head-font > div {
  flex: 1;
  display: flex;
}

.head-font > div > * {
  width: 50%;
}

.head-font div:nth-of-type(1) {
  columns: 1;
}

.head-font div span {
  display: block;
  font-weight: bold;
}

.head-font div .title {
  font-weight: normal;
}

.sample-text {
  font-size: 5rem;
  line-height: 1.05em;
  display: inline;
}

.sample-text-header {
  font-family: monospace;
	font-size: 10px;
	line-height: 1.5em;
	display: inline-block;
	text-align: start;
}

.sample-text-header:hover {
  background-color: var(--color);
  color: var(--background);
}

.sample-text-header div {
  margin: .25em 0;
}

.sample-text-header .sample-text-header-fontname {
  font-weight: bold;
}

.sample-text-edit {
	/* cursor: url(/images/cursor.svg) 5 5 pointer; */
	cursor: url("../images/cursor-x60.png")  0 30, auto;
	/* cursor: not-allowed; */
  word-break: break-word;
}

.sample-text-edit:focus {
  outline: none;
}

.sample-text-edit.backward {
  opacity: .0;
  transition: opacity .2s;

}

.sample-text-edit.backward:hover {
  opacity: .25;
  transition: opacity .25s;
}

.sample-text.hover .sample-text-edit.backward {
  opacity: 1;
}

.charset {
  display: none;
  background-color: var(--background);
}

.sample-text-edit.forward + .charset {
  border-top: 1px solid;
  display: block;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 2.5rem;
  line-height: 1.1em;
  padding: 20px 10vw;
  z-index: 10;
  max-height: 25vh;
  overflow-y: auto;
}

/* tools */

#tester {
  position: fixed;
  display: flex;
  bottom: 0.5rem;
  left: 10px;
  padding: 0.5rem 0 0.5rem 0.5rem;
  width: auto;
  text-align: right;
  z-index: 15;
  flex-direction: column;
}

#tester.hidden { display: none }

#tester input {
  padding: 0;
  margin: 0;
  width: 100%;
  border: none;
  background: transparent;
}

#tester > div {
  width: 100px;
}

#tester > div h5 {
  width: 100%;
}

#tester .size {
  transform: rotate(-90deg);
  transform-origin: left top;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  height: 25px;
  justify-content: center;
}

#tester .colors,
#tester .sort {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  width: 25px;
}

#tester .colors .color {
  width: 100%;
}

#tester .colors .color input {
  cursor: pointer;
}

#tester .colors .color:hover:after,
#tester .sort #sort:hover:after {
  position: absolute;
  left: 40px;
	margin: 2px 0;
  width: 25vw;
	text-align: left;
  font-size: .5rem;
}

#tester .colors .color:nth-of-type(1):hover:after {
  content: "Changer la couleur du texte";
}

#tester .colors .color:nth-of-type(2):hover:after {
  content: "Changer la couleur de fond";
}

#tester .sort #sort:hover:after {
  content: "Trier aléatoirement";
}

#tester .sort #sort.random:hover:after {
  content: "Trier par graisse";
}

#tester .sort {
	padding-bottom: 2em;
}

#tester .sort #sort {
  font-size: 2rem;
  line-height: 0;
  text-align: center;
  cursor: pointer;
}

#tester .print {
	position: fixed;
	right: 20px;
	bottom: 20px;
	font-size: 2em;
	cursor: pointer;
}

#tester .print:before {
  position: absolute;
  right: 30px;
  margin: 2px 0;
  text-align: right;
  font-size: .5rem;
  width: 140px;
}
#tester .print:hover:before {
	content: '(chrome ou firefox)';
}

#about {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: auto;
  padding: 20px 5vw;
  background-color: var(--background);
  border-top: 1px solid;
  z-index: 16;
  height: calc(100% - 40px);
  overflow-y: auto;
  font-size: 1.5rem;
  line-height: 1.25em;
}

#about .close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2em;
  cursor: pointer;
}

#about .close:hover {
  cursor: pointer;
  opacity: .5;
  transition: opacity .25s;
}

#about .content {
	margin-top: 100px;
}

#about h2 {
  padding: 1em 0;
}

#about h2:nth-of-type(1) {
  padding-top: 0;
}
#about p {
  padding: .25em 0;
  max-width: 1100px;
}

#about ul {
  padding-top: 2em;
  font-size: 1rem;
}

#text-hidden {
	display: none; 
}

.bonbon {
	position: absolute;
	display: none;
}

.bonbon.active {
	display: block;
}

.bonbon a {
	width: 50px;
	height: 15px;
	background-size: 100%;
	background-repeat: no-repeat;
	position: absolute; 
  transition: transform .1s;
  z-index: -1;
}

.bonbon a:hover {
  transform: scale(1.5);
  transform-origin: center;
  transition: transform .2s;
}

.bonbon:nth-of-type(3n+1) a {
	background-image: url('../images/bonbon1.svg');
}

.bonbon:nth-of-type(3n+2) a {
	background-image: url('../images/bonbon2.svg')
}

.bonbon:nth-of-type(3n+3) a {
	background-image: url('../images/bonbon3.svg')
}

@media screen and (max-width: 1000px) {

  .head-font > div {
    flex-direction: column;
  }

  .head-font > div > * {
    width: 100%;
  }

  .sample-text {
    hyphens: auto;
    font-size: 4rem;
    line-height: 1em;
  }
}

@media screen and (max-width: 600px) {

  nav h1#subtitle,
  #tester .size {
    display: none;
  }

  nav {
    padding: 0;
    max-width: 100%;
    width: 100%;
    background-color: var(--background);
    z-index: 0;
  }

  #about_button {
    margin: 0;
    border: none;
    padding: 0.2em;
    padding-right: 20px;
  }

  nav h1 {
    width: 100%;
    border-left: 0px solid;
    padding: .2em;
    padding-left: 20px;
    margin-right: 0;
  }

  .main-fonts {
    width: 90%;
    margin-left: 5%;

  }

  .head-font {
    flex-direction: column;
  }

  .head-font > * {
    border-left: none;
    border-bottom: 1px dotted;
    padding-bottom: .25em;
  }

  .head-font > div {
    flex-direction: row;
  }

  .sample-text {
    font-size: 2.5rem;
    line-height: 2.5rem;
  }

  .sample-text-header {
    line-height: 1.25em;
  }

  .sample-text-header a div {
    margin: 0;
  }

  #tester {
    padding: 0;
    bottom: 20px;
    left: 20px;
  }

  #about {
    top: 20px;
    max-height: 100vh;
    border-top: none;
    padding-top: 40px;
    font-size: 1.2rem;
  }

  #about .close {
    right: 0.25em;
    top: 0.25em;
  }

  #about ul {
    font-size: 0.75rem;
  }

	#tester *:hover:after,
	#tester *:hover:before
	{
		content: '' !important;
	}
  
}


@media print {

  @page {
    margin: 5.94mm 0mm;
  }

  html,body{
    height: 100%;
  }
  
	body {
		-webkit-print-color-adjust:exact;
		print-color-adjust:exact;
	}
  body,
  #about,
  nav {
    color: black !important;
    background: transparent !important;
  }

  body:last-child {
     page-break-after: auto;
}

	nav {
		position: relative;
		max-width: 100%;
		display: flex;
		margin-top: -1em;
		margin-bottom: 2em;
	}

  #tester,
  #about .close {
    display: none;
  }

  .main-fonts {
    width: 90%;
    margin-left: 5%;
    padding-top: 0;
  }

  .sample-text {
    font-size: 2.5rem !important;
    line-height: 3rem !important;
  }

  .sample-text-header {
    line-height: 1em;
  }

  .sample-text-header div {
    margin: 0;
  }

  #about {
    page-break-before: always;
    display: block;
    position: relative;
    border-top: none;
    padding: 0 5%;
    font-size: 1rem;
    margin-right: 5%;
  }
  
  #about ul {
    font-size: .75rem;
  }

  .main-fonts-bonbon #bonbon_1 {
    display: block;
  }

  .bonbon a {
    width: 5cm;
    height: 5cm;
  }

	.charset, #about_button {
		display: none !important;
	}
	.sample-text-edit {
		opacity: 1 !important;
	}
}
