/* 自由研究まとめ用紙メーカー: 画面・シート・印刷スタイル */

.jk-privacy-note {
  background-color: var(--accent-bg, #eef6ff);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 auto 20px;
  max-width: 1080px;
  font-size: 0.95rem;
  color: #333;
  text-align: center;
}

.jk-layout {
  display: flex;
  gap: 28px;
  max-width: 1080px;
  margin: 24px auto 40px;
  padding: 0 4px;
  align-items: flex-start;
}

/* ===== フォーム ===== */
.jk-form {
  width: 360px;
  flex-shrink: 0;
  text-align: left;
}

.jk-form .fs-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin: 20px 0 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent, #2a9d8f);
}

.jk-form .fs-title:first-child {
  margin-top: 0;
}

.jk-text-input,
.jk-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
}

.jk-form .radio-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 6px;
}

.jk-form .radio-line label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
}

.jk-page-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 6px;
}

.jk-page-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
}

.jk-form .field-hint {
  font-size: 11.5px;
  color: #888;
  margin: 6px 0 0;
  line-height: 1.6;
}

.jk-info {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent, #2a9d8f);
  margin: 16px 0 0;
}

/* ===== プレビュー側 ===== */
.jk-preview {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  text-align: center;
}

.jk-print-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.jk-print-btn:hover {
  opacity: 0.85;
}

.jk-print-note {
  font-size: 12px;
  color: #888;
  margin: 8px 0 12px;
  line-height: 1.5;
}

.jk-preview-caption {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

.jk-empty {
  padding: 40px 20px;
  color: #888;
  font-size: 14px;
  border: 1px dashed #ccc;
  border-radius: 8px;
  background: #fafafa;
}

/* ===== A4シート ===== */
.jk-sheet-box {
  overflow: hidden;
  border-radius: 4px;
}

.jk-sheet-box + .jk-sheet-box {
  margin-top: 16px;
}

.jk-sheet {
  width: 210mm;
  height: 297mm;
  background: #fff;
  box-sizing: border-box;
  position: relative;
  padding: 15mm 15mm 12mm;
  display: flex;
  flex-direction: column;
  transform-origin: top left;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  text-align: left;
  color: #1a1a1a;
}

/* common.cssのレガシーグローバル（* { font-size:14px; color:#313838 } 等）対策 */
.jk-sheet * {
  font-size: inherit;
  color: inherit;
  font-family: inherit;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 罫線の幅レベル */
.jk-sheet[data-lw="low"] {
  --lh: 12.5mm;
  --lthick: 0.45mm;
  --lcol: #1a1a1a;
}

.jk-sheet[data-lw="high"] {
  --lh: 9mm;
  --lthick: 0.3mm;
  --lcol: #2a2a2a;
}

/* ページ共通ヘッダー（表紙以外） */
.jk-head {
  display: flex;
  align-items: flex-end;
  gap: 6mm;
  padding-bottom: 2.5mm;
  border-bottom: 0.5mm solid #1a1a1a;
  flex-shrink: 0;
}

.jk-head-title {
  flex: 1;
  font-size: 16pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1a1a;
}

.jk-head-name {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 2mm;
}

.jk-head-label {
  font-size: 9.5pt;
  color: #333;
  white-space: nowrap;
  padding-bottom: 0.5mm;
}

.jk-head-line {
  width: 42mm;
  height: 8mm;
  border-bottom: 0.3mm solid #1a1a1a;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 12pt;
  padding-bottom: 0.5mm;
}

.jk-guide {
  font-size: 10pt;
  color: #555;
  margin: 3mm 0 1mm;
  flex-shrink: 0;
}

.jk-subhead {
  font-size: 11pt;
  font-weight: 700;
  color: #1a1a1a;
  margin: 4mm 0 1mm;
  flex-shrink: 0;
}

.jk-subhead::before {
  content: "■ ";
  color: var(--accent, #2a9d8f);
}

/* 罫線エリア */
.jk-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.jk-lines {
  margin-top: 2mm;
}

.jk-line {
  height: var(--lh);
  border-bottom: var(--lthick) solid var(--lcol);
}

.jk-line.is-bullet {
  position: relative;
}

.jk-line.is-bullet::before {
  content: "・";
  position: absolute;
  left: 0;
  bottom: 0.3mm;
  font-size: 13pt;
  color: #555;
}

/* 結果ページの表 */
.jk-table {
  border-collapse: separate;
  border-spacing: 0;
  border-left: 0.4mm solid #1a1a1a;
  border-top: 0.4mm solid #1a1a1a;
  width: 100%;
  margin-top: 3mm;
}

.jk-table td {
  border-right: 0.4mm solid #1a1a1a;
  border-bottom: 0.4mm solid #1a1a1a;
  height: var(--lh);
}

/* 写真をはるページ */
.jk-photo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6mm;
  margin-top: 3mm;
}

.jk-photo-box {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.jk-photo-frame {
  flex: 1;
  border: 0.5mm dashed #999;
  border-radius: 2mm;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 11pt;
}

.jk-photo-caption {
  display: flex;
  align-items: flex-end;
  gap: 2mm;
  margin-top: 2.5mm;
}

.jk-photo-caption .lbl {
  font-size: 10pt;
  color: #333;
  white-space: nowrap;
  padding-bottom: 0.5mm;
}

.jk-photo-caption .ln {
  flex: 1;
  height: 7mm;
  border-bottom: 0.3mm solid #1a1a1a;
}

/* 観察記録の日ブロック */
.jk-kansatsu {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4mm;
  margin-top: 3mm;
}

.jk-day {
  flex: 1;
  border: 0.4mm solid #1a1a1a;
  border-radius: 2mm;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.jk-day-head {
  display: flex;
  align-items: center;
  gap: 4mm;
  padding: 2mm 3mm;
  background: #f4f4f4;
  border-bottom: 0.3mm solid #bbb;
  flex-shrink: 0;
}

.jk-day-field {
  display: flex;
  align-items: flex-end;
  gap: 1.5mm;
  font-size: 10pt;
}

.jk-day-field .box {
  border-bottom: 0.3mm solid #1a1a1a;
  min-width: 10mm;
  height: 6mm;
}

.jk-day-field .box.wide {
  min-width: 22mm;
}

.jk-day-notes {
  flex: 1;
  padding: 1mm 3mm 2mm;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.jk-day-notes .jk-line {
  height: 9mm;
  border-bottom: 0.3mm solid #999;
}

/* ===== 表紙 ===== */
.jk-sheet.is-cover {
  padding: 22mm 20mm;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
}

.jk-cover-label {
  font-size: 14pt;
  letter-spacing: 0.5em;
  color: var(--accent, #2a9d8f);
  font-weight: 700;
  margin-top: 6mm;
}

.jk-cover-frame {
  width: 100%;
  border: 0.6mm solid #1a1a1a;
  border-radius: 3mm;
  padding: 14mm 12mm;
  margin-top: 12mm;
}

.jk-cover-theme-label {
  font-size: 11pt;
  color: #555;
  letter-spacing: 0.2em;
}

.jk-cover-theme {
  height: 26mm;
  border-bottom: 0.4mm solid #1a1a1a;
  margin-top: 8mm;
}

.jk-cover-theme + .jk-cover-theme {
  margin-top: 12mm;
}

.jk-cover-meta {
  display: flex;
  justify-content: center;
  gap: 12mm;
  margin-top: 18mm;
  flex-wrap: wrap;
}

.jk-cover-meta-field {
  display: flex;
  align-items: flex-end;
  gap: 2mm;
  font-size: 12pt;
  color: #1a1a1a;
}

.jk-cover-meta-field .ln {
  border-bottom: 0.3mm solid #1a1a1a;
  height: 9mm;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 13pt;
  padding-bottom: 0.5mm;
}

.jk-cover-meta-field .ln.grade {
  min-width: 14mm;
}

.jk-cover-meta-field .ln.name {
  min-width: 46mm;
}

/* ページ番号・フッター */
.jk-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3mm;
}

.jk-pageno {
  font-size: 8.5pt;
  color: #666;
}

.jk-foot-note {
  font-size: 7pt;
  color: #aaa;
}

/* ===== レスポンシブ ===== */
@media (max-width: 940px) {
  .jk-layout {
    flex-direction: column;
  }

  .jk-form {
    width: 100%;
  }

  .jk-preview {
    position: static;
    width: 100%;
  }
}

/* ===== 印刷用 ===== */
@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    height: auto !important;
  }

  body > *:not(.container) {
    display: none !important;
  }

  .container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  .container > *:not(.jk-layout) {
    display: none !important;
  }

  .jk-layout {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .jk-layout > *:not(.jk-preview) {
    display: none !important;
  }

  .jk-preview {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
  }

  .jk-preview > *:not(.jk-sheet-wrap) {
    display: none !important;
  }

  .jk-sheet-box {
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    break-after: page;
    page-break-after: always;
  }

  .jk-sheet-box:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .jk-sheet {
    transform: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 296mm !important;
    overflow: hidden !important;
  }
}
