/* =========================================================
   Rirekisho (履歴書) preview — a distinct render path from the
   Classic/Modern/Minimal/Elegant .resume-preview grid in
   resume-themes.css. Two print pages styled as a traditional
   Japanese resume form: ruled tables, a photo box, and circle-one
   (◯で囲む) selectors for gender / yes-no fields.
   ========================================================= */

.rirekisho-preview {
  --ink: #16181d;
  --ink-muted: #5b6169;
  --line: #16181d;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans SC", "PingFang SC", Roboto, Helvetica, Arial, sans-serif;

  width: 210mm;
  color: var(--ink);
  font-family: var(--font-body);
  flex-shrink: 0;
}

.rirekisho-preview * { box-sizing: border-box; }

.rk-page {
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  padding: 14mm 12mm;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 18px 40px rgba(0, 0, 0, 0.12);
}
.rk-page + .rk-page { margin-top: 16px; }

.rk-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6mm;
}
.rk-title {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.35em;
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
}
.rk-doc-date { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }

table.rk-info-table,
table.rk-history-table,
table.rk-meta-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.rk-info-table td,
.rk-history-table th,
.rk-history-table td,
.rk-meta-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}

.rk-label {
  width: 24mm;
  background: #f5f5f5;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}
.rk-value { line-height: 1.6; }
.rk-name { font-size: 16px; font-weight: 700; }

.rk-photo-cell { width: 30mm; text-align: center; vertical-align: middle; padding: 4px; }
.rk-photo-cell img { width: 26mm; height: 32mm; object-fit: cover; display: block; margin: 0 auto; border: 1px solid var(--line); }
.rk-photo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26mm;
  height: 32mm;
  border: 1px dashed var(--ink-muted);
  color: var(--ink-muted);
  font-size: 11px;
}

.rk-info-table { margin-bottom: 6mm; }

.rk-history-table { margin-bottom: 6mm; }
.rk-history-table thead th { background: #f5f5f5; font-weight: 700; text-align: center; }
.rk-col-year, .rk-col-month { width: 16mm; text-align: center; }
.rk-history-table td:nth-child(1),
.rk-history-table td:nth-child(2) { text-align: center; }
.rk-history-table .rk-desc { text-align: left; }
.rk-subhead td:nth-child(3) { text-align: center; font-weight: 700; background: #fafafa; }
.rk-subhead-end .rk-end { text-align: right; padding-right: 14px; color: var(--ink-muted); }
.rk-empty-row { color: var(--ink-muted); font-style: italic; text-align: center !important; padding: 14px 8px; }

.rk-license-table { margin-bottom: 6mm; }

.rk-block { margin-bottom: 6mm; }
.rk-block-title {
  font-size: 12px;
  font-weight: 700;
  background: #f5f5f5;
  border: 1px solid var(--line);
  border-bottom: none;
  margin: 0;
  padding: 5px 8px;
}
.rk-prose {
  border: 1px solid var(--line);
  min-height: 26mm;
  padding: 8px;
  font-size: 12.5px;
  line-height: 1.7;
}

.rk-meta-table .rk-label { width: 34mm; }

.rk-circled {
  display: inline-block;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  padding: 0 5px;
  line-height: 1.5;
}
.rk-furigana-line { font-size: 10.5px; color: var(--ink-muted); }
.rk-contact-line { font-size: 11px; color: var(--ink-muted); }
.rk-placeholder { opacity: 0.45; font-style: italic; }
.rk-same { color: var(--ink-muted); }

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; }
  .rirekisho-preview { transform: none !important; width: 210mm; margin: 0; }
  .rk-page { box-shadow: none; width: 210mm; min-height: 297mm; margin: 0 !important; page-break-after: always; }
  .rk-page:last-child { page-break-after: auto; }
  .rirekisho-preview, .rirekisho-preview * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }
}
