/* ── Japanese documents ─────────────────────────────────────────────────────
 *
 * 履歴書: faithful reproduction of the standard 厚生労働省様式例 sheet from
 * seed/templates/R3_excel_rireisyo base.ods — A3 landscape (420×297mm),
 * fixed grid, fixed row heights. Only the data cells are filled in; every
 * other cell/border stays exactly as in the source form.
 *
 * 職務経歴書: A4 portrait.
 */

html,
body {
  margin: 0;
  padding: 0;
}

/* ══ 履歴書 (A3 landscape) ═══════════════════════════════════════════════ */

.rk-sheet {
  position: relative;
  width: 420mm;
  height: 297mm;
  background: #ffffff;
  color: #000000;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic", "Meiryo", "MS Gothic", sans-serif;
  font-size: 10pt;
  line-height: 1.35;
  overflow: hidden;
}

.rk-sheet * {
  box-sizing: border-box;
}

.rk-left {
  position: absolute;
  left: 23.5mm;
  top: 23.4mm;
  width: 173.9mm;
}

.rk-right {
  position: absolute;
  left: 230.8mm;
  top: 28.8mm;
  width: 174.3mm;
}

/* Title + date */
.rk-title-row {
  position: relative;
  height: 17.2mm;
}

.rk-title {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 18pt;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
}

.rk-doc-date {
  position: absolute;
  left: 74mm;
  top: 3.2mm;
  width: 60mm;
  text-align: center;
  font-size: 9.5pt;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Photo (no frame, exactly where the ODS places it) */
.rk-photo {
  position: absolute;
  z-index: 0;
  /* Visible (clipped) photo area in the source ODS, measured on the rendered
     A3 sheet. Coordinates are relative to .rk-left (23.5 / 23.4 mm). */
  left: 132.34mm;
  top: 5.5mm;
  width: 31.36mm;
  height: 39.03mm;
  overflow: hidden;
  background: #ffffff;
}

.rk-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  display: block;
}

/* Generic form table */
.rk-form {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  position: relative;
  z-index: 1;
}

.rk-form th,
.rk-form td {
  border: 0.22mm solid #000000;
  padding: 0 1.6mm;
  vertical-align: middle;
  font-weight: 400;
  font-size: 10pt;
  overflow: hidden;
}

.rk-form th {
  font-weight: 400;
  text-align: left;
}

/* Name block */
.rk-name {
  margin-top: 0;
  /* The ODS name block ends at 140 mm; the photo lives in the blank area
     to its right. A full-width table drew a border behind the photo. */
  width: 116.5mm;
}

.rk-name .rk-furi-row th,
.rk-name .rk-furi-row td {
  height: 5.3mm;
}

.rk-name .rk-name-row th,
.rk-name .rk-name-row td {
  height: 26.6mm;
}

.rk-form .rk-label {
  font-size: 9.5pt;
  letter-spacing: 0.12em;
  padding-left: 2.4mm;
}

.rk-furi {
  text-align: center;
  font-size: 9.5pt;
  letter-spacing: 0.16em;
}

.rk-fullname {
  text-align: center;
  font-size: 12.5pt;
  letter-spacing: 0.12em;
  vertical-align: top;
  padding-top: 1.2mm;
}

/* Birth / gender row */
.rk-birth td,
.rk-birth th {
  height: 8.65mm;
}

.rk-birthdate {
  text-align: center;
  font-size: 12pt;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.rk-gender-lbl {
  text-align: left;
  font-size: 9.5pt;
  padding-left: 2mm;
  white-space: nowrap;
}

.rk-gender {
  text-align: center;
  font-size: 11pt;
}

/* Address tables */
.rk-address tr {
  height: 5.2mm;
}

.rk-address tr.rk-addr-main {
  height: 17.0mm;
}

.rk-addr-lbl {
  font-size: 9.5pt;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.rk-addr-value {
  position: relative;
  text-align: center;
  font-size: 10.5pt;
  padding: 0 3mm;
}

.rk-addr-note {
  position: absolute;
  top: 0.8mm;
  right: 2.5mm;
  font-size: 8pt;
  letter-spacing: 0;
}

.rk-phone {
  position: relative;
  text-align: center;
  vertical-align: middle;
}

.rk-phone .rk-phone-lbl {
  position: absolute;
  top: 0.5mm;
  left: 2mm;
  font-size: 9.5pt;
  letter-spacing: 0.2em;
}

.rk-phone .rk-phone-num {
  display: block;
  margin-top: 3.6mm;
  font-size: 10pt;
  white-space: nowrap;
}

/* History table */
.rk-left .rk-history {
  margin-top: 3.6mm;
}

.rk-left .rk-history tr {
  height: 8.95mm;
}

.rk-right .rk-history tr {
  height: 8.95mm;
}

.rk-history tr.rk-head-main {
  height: 7.6mm;
}

.rk-history tr.rk-head-cont {
  height: 8.3mm;
}

.rk-history tr.rk-head-lic {
  height: 7.2mm;
}

.rk-history .rk-head th {
  text-align: center;
  font-size: 10.5pt;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.rk-history .rk-sec td {
  padding-left: 2.4mm;
  font-size: 10.5pt;
  letter-spacing: 0.28em;
}

.rk-year,
.rk-month {
  text-align: center;
  white-space: nowrap;
}

.rk-year {
  font-size: 10.5pt;
}

.rk-month {
  font-size: 10.5pt;
}

.rk-history .rk-main {
  font-size: 10pt;
  padding-left: 2.4mm;
  overflow-wrap: anywhere;
}

.rk-history .rk-end {
  text-align: right;
  padding-right: 3mm;
  font-size: 10pt;
}

.rk-footnote {
  margin-top: 3.2mm;
  font-size: 7.5pt;
  letter-spacing: 0.02em;
}

/* Right column boxes */
.rk-box {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
}

.rk-box th,
.rk-box td {
  border: 0.22mm solid #000000;
  padding: 0 2.4mm;
  vertical-align: middle;
  font-weight: 400;
}

.rk-box .rk-box-title th {
  height: 7.2mm;
  text-align: left;
  font-size: 9.5pt;
  letter-spacing: 0.06em;
}

.rk-motivation {
  margin-top: 3.9mm;
}

.rk-motivation .rk-box-body {
  height: 53mm;
  vertical-align: top;
  padding: 1.6mm 2.4mm;
  font-size: 9.5pt;
  line-height: 1.55;
}

.rk-motivation .rk-box-body p {
  margin: 0 0 2.4mm;
  text-align: justify;
}

.rk-motivation .rk-box-body p:last-child {
  margin-bottom: 0;
}

.rk-motivation .rk-accent {
  color: #e60000;
  font-weight: 600;
}

.rk-wishes {
  margin-top: 3.8mm;
}

.rk-wishes .rk-box-title th {
  height: 7.5mm;
  font-size: 8.5pt;
}

.rk-wishes .rk-wish-row {
  height: 8.8mm;
  padding-left: 2.4mm;
  font-size: 10.5pt;
}

/* ══ 職務経歴書 (A4 portrait) ═══════════════════════════════════════════ */

.jp-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #ffffff;
  color: #111111;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Yu Gothic", "Meiryo", "MS Gothic", sans-serif;
  font-size: 10pt;
  line-height: 1.55;
  padding: 8mm 11mm;
  box-sizing: border-box;
}

.jp-head {
  position: relative;
  text-align: center;
  margin-bottom: 4mm;
}

.jp-title {
  font-size: 26pt;
  font-weight: 700;
  letter-spacing: 10px;
}

.jp-date {
  font-size: 10pt;
  text-align: right;
  margin-top: 2mm;
}

.jp-head-simple {
  text-align: left;
  border-bottom: 0.5mm solid #111;
  padding-bottom: 3mm;
}

.jp-head-simple .jp-title {
  text-align: center;
  letter-spacing: 6px;
}

.jp-skc-name {
  font-size: 12pt;
  font-weight: 700;
  margin: 3mm 0 1.5mm;
}

.jp-summary {
  font-size: 9.6pt;
  text-align: justify;
  margin-bottom: 3mm;
}

.jp-skc-line {
  font-size: 9.6pt;
  margin-bottom: 1.1mm;
}

.jp-skc-label {
  font-weight: 700;
}

.jp-section {
  margin-top: 3.6mm;
}

.jp-section-title {
  font-size: 11pt;
  font-weight: 700;
  border-bottom: 0.3mm solid #111;
  padding-bottom: 1.5mm;
  margin-bottom: 2mm;
}

.jp-job {
  margin-bottom: 2.8mm;
  font-size: 9.3pt;
}

.jp-job-head {
  font-weight: 700;
}

.jp-job ul,
.jp-section ul {
  margin: 1mm 0 0 6mm;
}

/* ══ Page setup + screen scaling ════════════════════════════════════════ */

@page {
  size: A3 landscape;
  margin: 0;
}

.rk-sheet {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

@media screen {
  body {
    background: #e4e8f1;
  }

  .rk-sheet,
  .jp-page {
    margin: 22px auto;
    box-shadow: 0 22px 60px rgba(18, 35, 74, 0.3);
  }

  .rk-sheet {
    transform: scale(var(--sheet-scale, 1));
    transform-origin: top center;
  }

  .jp-page {
    transform: scale(var(--sheet-scale, 1));
    transform-origin: top center;
  }
}

@media print {
  html,
  body {
    background: #ffffff;
  }

  .rk-sheet,
  .jp-page {
    margin: 0;
    box-shadow: none;
    transform: none;
  }
}

/* Invisible ATS layer (see backend/Services/DocumentHtmlBuilder.cs). */
.ats-text {
  position: absolute;
  left: 0;
  bottom: 1.5mm;
  width: 100%;
  z-index: 6;
  font-size: 1pt;
  line-height: 1;
  letter-spacing: 0;
  /* transparent text is still written to the PDF text stream (opacity:0 is not) */
  color: transparent;
  white-space: normal;
  overflow: visible;
  pointer-events: none;
}

.jp-page {
  position: relative;
}
