/** Styles for Print Version
* Ref: https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/
*/

@import 'variables';

.d-block-not-print,
.d-inline-block-not-print,
.d-inline-not-print {
  display: none;
}

@media print {
  /** Setting margins */
  @page {
    size: letter;
    margin: 0;
  }
  body {
    margin: 0 auto;
    font-size: 0.9rem;
  }

  .print-page-break {
    page-break-before: always;
  }

  .container {
    max-width: none;
  }

  /* Defining all page breaks */
  .section:not(:last-child) {
    page-break-after: always;
  }

  app-ad-sense,
  app-annex,
  app-footer {
    display: none;
    visibility: hidden;
  }

  app-game-base > *:not(:first-child) {
    page-break-before: always;
  }

  .cheat-sheet {
    page-break-inside: auto;
    display: block;
    overflow: visible;
  }

  section .container,
  .section .container {
    padding: 10px;
  }

  .card {
    margin: 10px 0;
  }

  a {
    page-break-inside: avoid;
  }

  p {
    margin-bottom: 0.4rem;
  }

  blockquote {
    page-break-inside: avoid;
  }

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

  h4 {
    break-before: auto;
    font-size: 1.3rem;
  }

  h4,
  .card-title {
    margin-bottom: 0.4rem;
  }

  img {
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  /* Hiding unnecessary elements for the print */
  .side-nav,
  .nav-opener {
    display: none;
  }

  hr {
    margin: 0.5rem 0;
  }

  .col-print-7 {
    max-width: 58.333333%;
  }

  .col-print-6 {
    max-width: 50%;
  }

  .col-print-5 {
    max-width: 41.666667%;
  }

  .col-print-4 {
    max-width: 33.333333%;
  }

  .list-group-item,
  .card-header,
  .card-body {
    padding: 0.4rem 1rem 1px;
    // padding: 2px 1rem;
  }

  img.factorio-icon {
    height: 1.5rem !important;
  }
  .icon-composite {
    img.factorio-icon {
      height: initial !important;
    }
  }

  #belt-throughput,
  #balancers,
  #nuclear-power {
    img:not(.factorio-icon) {
      width: 60%;
    }
  }

  #modules-and-beacons {
    img:not(.factorio-icon) {
      width: 40%;
    }
  }

  #NuclearTableControls {
    display: none;
  }

  .table td,
  .table th {
    padding: 0;
  }

  .table-caption,
  table > caption {
    padding: 0;
  }

  // Overwrite bootstrap's print styles... -_-
  .table td,
  .table th {
    background-color: initial !important;
  }

  .table-bordered td,
  .table-bordered th {
    border: 1px solid $c-pallette-neutral2 !important;
  }

  .d-none-print {
    display: none !important;
  }
  .d-block-not-print {
    display: block !important;
  }
  .d-inline-block-not-print {
    display: inline-block !important;
  }
  .d-inline-not-print {
    display: inline !important;
  }
}

// ENABLE ONLY FOR LIGHT PDF

// img.factorio-icon {
//   filter: drop-shadow(2px 2px 2px white) !important;
// }
// .icon-composite {
//   .icon-bg {
//     filter: blur(0.7px) drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff)
//       drop-shadow(0 0 2px #fff) !important;
//   }
//   .rate-text,
//   .count-text {
//     text-shadow: 0px 1px 1px #fff, 0px -1px 1px #fff, 1px 0px 1px #fff,
//       -1px 0px 1px #fff, 0px 0px 10px #fff !important;
//   }
// }

// .factorio-icon-text {
//   text-shadow: 0px 1px 1px #fff, 0px -1px 1px #fff, 1px 0px 1px #fff,
//     -1px 0px 1px #fff, 0px 0px 10px #fff !important;
// }
