/* ===========================================================================
   print.css — handwriting sheets.
   The .genkouyoushi grid (defined in components.css for screen) is redefined
   here for paper: black on white, 1px #999 cells with a dashed centre cross,
   .ghost cells showing the glyph at 25% opacity for tracing.
   Chrome/Safari need "Background graphics" ticked for the guide lines.
   =========================================================================== */

@media print {
  @page { margin: 14mm; }

  html, body {
    background: #fff !important;
    color: #000 !important;
    background-image: none !important;
  }

  /* chrome we never want on paper */
  #header, #nav, #units, .toast-host, .confetti-canvas, .levelup-overlay,
  .btn, .audio-btn, .aplayer, .quiz-foot, .combo-chip, .no-print {
    display: none !important;
  }

  #view { max-width: none; padding: 0; margin: 0; }

  .card, .qbox, .units {
    background: #fff !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
  }

  a { color: #000 !important; text-decoration: none; }
  .dim, rt { color: #555 !important; }
  .eyebrow, .tag { color: #555 !important; border-color: #999 !important; }
  h1, h2, h3 { color: #000 !important; text-shadow: none !important; }

  .print-sheet, .genkouyoushi { page-break-inside: avoid; break-inside: avoid; }
  .page-break { page-break-after: always; break-after: page; }

  .genkouyoushi .cell {
    border: 1px solid #999 !important;
    color: #000 !important;
    background-image:
      linear-gradient(to right, transparent calc(50% - .5px), #ccc calc(50% - .5px), #ccc calc(50% + .5px), transparent calc(50% + .5px)),
      linear-gradient(to bottom, transparent calc(50% - .5px), #ccc calc(50% - .5px), #ccc calc(50% + .5px), transparent calc(50% + .5px)) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .genkouyoushi .cell.ghost { color: rgba(0, 0, 0, .25) !important; }
}

/* A dashed centre cross variant, usable on screen and on paper. */
.genkouyoushi.dashed .cell {
  background-image:
    repeating-linear-gradient(to right,
      transparent 0 5px, rgba(255, 255, 255, .16) 5px 10px);
  background-position: 0 50%;
  background-size: 100% 1px;
  background-repeat: no-repeat;
  position: relative;
}
.genkouyoushi.dashed .cell::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: repeating-linear-gradient(to bottom,
    rgba(255, 255, 255, .16) 0 5px, transparent 5px 10px);
}
@media print {
  .genkouyoushi.dashed .cell {
    background-image: repeating-linear-gradient(to right, transparent 0 5px, #bbb 5px 10px) !important;
  }
  .genkouyoushi.dashed .cell::before {
    background: repeating-linear-gradient(to bottom, #bbb 0 5px, transparent 5px 10px) !important;
  }
}

/* sheet header shown only when printing */
.print-only { display: none; }
@media print { .print-only { display: block; } }
