/**
 * @author Nicolas CARPi <nico-git@deltablot.email>
 * @copyright 2012 Nicolas CARPi
 * @see https://www.elabftw.net Official website
 * @license AGPL-3.0
 * @package elabftw
 */

@use './variables';
/* see documentation: https://mpdf.github.io/paging/using-page.html */
@page {
  /* stylelint-disable-next-line property-no-unknown */
  footer: html_footer;
  margin: 1cm;
}

body {
  font-family: 'DejaVu', sans-serif;
  font-kerning: normal;
}

/* TITLES */
h1 {
  font-size: 150%;
}

h2 {
  font-size: 140%;
}

h3 {
  font-size: 130%;
}

h4 {
  font-size: 120%;
}

h5 {
  font-size: 110%;
}

a {
  color: variables.$elabblue;
  text-decoration: none;
}

code {
  background-color: #eee;
  border: 1px dotted #ccc;
}

/* fix metadata extra fields having numbers in pdf */
.no-list-style li {
  list-style-type: none;
}

/* fix table being collapsed on export */
table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

table,
th,
td {
  border: 1px solid #797979;
}

table td {
  padding: 5px;
}

table th {
  background-color: variables.$firstlevel;
  color: variables.$medium;
  font-size: 90%;
  padding: 5px;
  text-align: left;
  text-transform: uppercase;
  width: 150px;
}

/* color one row every other row */
tr:nth-child(even) {
  background-color: #fff;
}

tr:nth-child(odd) {
  background-color: #f2f2f2;
}

.no-break {
  page-break-inside: avoid;
}

.page-break {
  page-break-after: always;
}

.pdf-ul {
  border: 1px solid #797979;
  border-radius: 5px;
  margin: 5px;
  padding: 7px;
}

.elabid {
  color: variables.$strongest;
  font-size: 8pt;
  text-align: right;
}

.barcode {
  color: variables.$strongest;
  margin: 0;
  padding: 1.5mm;
  vertical-align: middle;
}

.attached-image {
  border: 1px solid variables.$firstlevel;
  margin-top: 0.5em;
  max-height: 10cm;
  max-width: 100%;
}

/* border-radius or padding not working on non div elements */
.tag {
  border: 1px solid #ccc;
}

.noborder {
  border-style: none;
}

#infoblock {
  background-color: #f2f2f2;
  border: 1px solid #dcdddc;
  border-radius: 5px;
  margin-top: 1em;
  width: 100%;
}

#header {
  border-bottom: 1px solid #dcdddc;
  margin-bottom: 1em;
  overflow: hidden;
  position: relative;
}

// use floats as mPDF does not allow display flex
.entry-title {
  float: left;
  width: 60%;
}

.entry-meta {
  float: right;
  font-size: 90%;
  text-align: right;
  width: 35%;
}

.footer-block {
  border-top: 1px solid #dcdddc;
  font-size: 80%;
  text-align: right;
}

.timestamped-block {
  background-color: variables.$superlight;
  border: 1px solid variables.$medium;
  border-radius: 5px;
  color: variables.$medium;
  font-size: 80%;
  margin: 7px 0;
  padding-left: 7px;
  width: 100%;
}

.signatures {
  margin-top: 10px;
  padding-left: 10px;
  text-align: left;
}

/* caption for tinymce */
.image figcaption {
  border: 1px solid variables.$medium;
  /* stylelint-disable-next-line shorthand-property-no-redundant-values */
  margin: 2px 0 6px 0;
  text-align: center;
}

/* This helps alignment for inline equations */
img, /* <-- can be removed after PR https://github.com/mpdf/mpdf/pull/1405 is accepted and mpdf is bumped to next version */
.mathjax-svg { /* keep only this selector */
  vertical-align: middle;
}

/* BLOCKQUOTE */
// quote marks in pdf is not implemented by mpdf
// https://github.com/mpdf/mpdf/blob/d3ef7689800c6356ab7df7604289f97c17f37c76/src/Tag/BlockQuote.php
blockquote {
  background: variables.$firstlevel;
  border-left: 10px solid variables.$medium;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
}
