@font-face {
  font-family: 'Sontribe WenKai';
  src: url('./assets/fonts/LXGWWenKaiKR-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

#print-root { display: none; }

.ceremony-preview {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #e5dfd4;
  background: #fffcf6;
  border-radius: 12px;
}

.ceremony-preview .ceremony-lines {
  writing-mode: vertical-rl;
  list-style: none;
  width: max-content;
  height: 640px;
  margin: 0 auto;
  padding: 24px;
  color: #302921;
  font: 24px/1.2 'Sontribe WenKai', serif;
}

.ceremony-preview .ceremony-lines li:not(:last-child) { margin-left: 22px; }
.ceremony-preview .ceremony-lines.is-five-lines li:not(:last-child) { margin-left: 36px; }

@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.print-ready #app { display: none !important; }
  body.print-ready #print-root { display: block !important; }
  .skip-link { display: none !important; }

  .print-sheet {
    box-sizing: border-box;
    width: 186mm;
    height: 265mm;
    margin-inline: auto;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
  }

  .print-sheet:last-child { break-after: auto; page-break-after: auto; }
  .print-sheet-ceremony { position: relative; }
  .print-sheet-jibang { display: flex; align-items: center; justify-content: center; }

  .print-sheet-ceremony .ceremony-lines {
    position: absolute;
    top: 8mm;
    left: 50%;
    transform: translateX(-50%);
    writing-mode: vertical-rl;
    list-style: none;
    width: max-content;
    height: 255mm;
    margin: 0;
    padding: 0;
    color: #000;
    font: 29pt/1.1 'Sontribe WenKai', serif;
  }

  .print-sheet-ceremony .ceremony-lines.is-great-grandchild {
    top: 8mm;
    height: 255mm;
    font-size: 26pt;
  }

  .print-sheet-ceremony .ceremony-lines.is-grandchild {
    top: 12mm;
    height: 247mm;
  }

  .print-sheet-ceremony .ceremony-lines li:not(:last-child) { margin-left: 15mm; }
  .print-sheet-ceremony .ceremony-lines.is-five-lines li:not(:last-child) { margin-left: 27mm; }
  .print-sheet-ceremony .hanja-token { display: inline-block; position: relative; inline-size: 1em; block-size: 1em; line-height: 1; text-align: center; }
  .print-sheet-ceremony .hanja-reading { position: absolute; top: 50%; right: calc(100% + 0.08em); transform: translateY(-50%); writing-mode: horizontal-tb; white-space: nowrap; font-size: 0.4em; line-height: 1; color: rgba(0, 0, 0, 0.48); }
  .print-sheet-ceremony .ceremony-lines.without-reading .hanja-reading { visibility: hidden; }
}
