/* print.css — Card print stylesheet.
   Printed card: 85.6 mm × 54 mm (ISO/IEC 7810 ID-1), black on white.
   Only the card preview is rendered; all app chrome is hidden.
   Satisfies WCAG 2.1 AAA contrast (21:1 — black on white).
*/

@media print {
  /* Hide everything except the card preview.
     The preview lives inside <main> > #card-preview-section, so hide the
     siblings at each level instead of every direct child of <body>. */
  body > *:not(main),
  main > *:not(#card-preview-section),
  #card-preview-section > *:not(#card-preview-wrapper) {
    display: none !important;
  }

  main,
  #card-preview-section {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  @page {
    margin: 10mm;
  }

  #card-preview-wrapper {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  /* Reset (pseudo-elements too, e.g. the fold label) */
  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    background: white !important;
    color: black !important;
    font-family: 'Noto Sans JP', 'Noto Sans', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  }

  #card-preview-wrapper {
    width: 85.6mm;
    margin: 0 auto;
  }

  .card-face {
    width: 85.6mm;
    min-height: 54mm;
    padding: 3mm 4mm;
    box-sizing: border-box;
    page-break-inside: avoid;
    color: black;
    background: white;
    border: 0.5pt solid black;
  }

  .card-fold {
    width: 85.6mm;
    height: 0;
    border-top: 1pt dashed black;
    margin: 0;
    page-break-after: avoid;
  }

  /* Front face */
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2mm;
    border-bottom: 0.5pt solid black;
    padding-bottom: 1mm;
  }

  .card-name {
    font-size: 10pt;
    font-weight: bold;
    max-width: 55mm;
    overflow-wrap: break-word;
  }

  .card-blood {
    font-size: 12pt;
    font-weight: bold;
    min-width: 10mm;
    text-align: right;
  }

  .card-section {
    margin-top: 1.5mm;
  }

  .card-section-title {
    font-size: 7pt;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 0.3pt solid black;
    margin-bottom: 0.5mm;
    letter-spacing: 0.03em;
  }

  .card-row {
    font-size: 8pt;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .card-label {
    font-weight: bold;
    font-size: 7pt;
  }

  .card-disclaimer {
    font-size: 6pt;
    margin-top: 2mm;
    border-top: 0.3pt solid black;
    padding-top: 0.5mm;
    color: black;
  }

  /* Back face */
  .card-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 54mm;
    gap: 3mm;
  }

  .card-qr {
    width: 40mm;
    height: 40mm;
    display: block;
  }

  .card-scan-note {
    font-size: 8pt;
    text-align: center;
    line-height: 1.6;
  }

  /* Hide animation classes */
  .tombstone-state,
  .card-restore-enter,
  .card-restore-active {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
