/* ============================================
   自分らしい魅せ方講座 — ワークブック メインスタイル
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600&family=Noto+Serif+JP:wght@300;400;500&display=swap');

/* ---------- CSS変数（表紙画像から抽出した配色） ---------- */
:root {
  --cream:       #FBFAF8;  /* ページ背景（表紙画像の地色に合わせたオフホワイト） */
  --cream-deep:  #FBFAF8;
  --paper-bg:    #F1E2DC;  /* 画面上でページの外側になる背景（ブラッシュピンク） */
  --ink:         #4D2B1F;  /* 本文の文字色（ダークブラウン） */
  --ink-soft:    #6E5044;  /* 補足文字 */
  --ink-pale:    #A98E80;  /* さらに薄い補足 */
  --brand:       #C69A6B;  /* ゴールドアクセント（罫線・フレーム・リーフモチーフ） */
  --brand-deep:  #AD7E4E;  /* ゴールド濃色（ラベルなど） */
  --rose:        #B76579;  /* ローズピンクアクセント（強調テキスト） */
  --rose-pale:   #F6E4E2;  /* ボックス背景（薄ピンク） */
  --line:        #E8D9C8;  /* 罫線・区切り */
  --white:       #FFFFFF;

  --font-mincho: 'Shippori Mincho', 'Noto Serif JP', serif;
  --font-body:   'Noto Serif JP', serif;
}

/* ---------- ベース ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper-bg);
  font-size: 11.5pt;
  line-height: 1.9;
  letter-spacing: 0.03em;
  padding-top: 14mm;
}

h1, h2, h3, h4 {
  font-family: var(--font-mincho);
  font-weight: 500;
  color: var(--ink);
}

/* ---------- ページ ---------- */
.page {
  width: 210mm;
  min-height: 297mm;
  background: var(--cream);
  margin: 0 auto 12px;
  padding: 20mm 20mm 18mm;
  position: relative;
  overflow: hidden;
}

.page--hidden { display: none !important; }

/* 表紙以外のページに、表紙画像と呼応する細いゴールドの縁取りを入れる */
.page:not(.cover)::before {
  content: '';
  position: absolute;
  inset: 8mm;
  border: 1px solid var(--brand);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

/* ほんのりしたピンクのウォッシュ（表紙の水彩感の余韻） */
.page:not(.cover)::after {
  content: '';
  position: absolute;
  top: -30mm;
  right: -30mm;
  width: 110mm;
  height: 110mm;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183,101,121,0.10) 0%, rgba(183,101,121,0) 70%);
  pointer-events: none;
  z-index: -1;
}

.page > * { position: relative; z-index: 1; }

/* ---------- 保存バー ---------- */
.save-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow-x: auto;
  background: var(--ink);
  color: var(--cream);
  padding: 2.5mm 5mm;
  font-family: var(--font-body);
  height: 14mm;
}

.save-bar__left { display: flex; align-items: center; gap: 4mm; white-space: nowrap; overflow: hidden; }

.save-bar__title {
  font-family: var(--font-mincho);
  font-size: 10pt;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.save-bar__status {
  font-size: 8.5pt;
  color: var(--brand);
  opacity: 0.9;
  white-space: nowrap;
}

.save-bar__right { display: flex; align-items: center; gap: 2mm; flex-shrink: 0; }

.save-bar__btn,
.save-bar__print,
.save-bar__reset {
  font-family: var(--font-body);
  font-size: 8.5pt;
  letter-spacing: 0.03em;
  padding: 1.6mm 3mm;
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.save-bar__btn:hover,
.save-bar__print:hover { background: var(--brand); color: var(--ink); }

.save-bar__reset {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.55);
}
.save-bar__reset:hover { color: var(--cream); border-color: var(--cream); }

/* ---------- 装飾フラワーモチーフ ---------- */
.deco {
  position: absolute;
  color: var(--brand);
  opacity: 0.55;
  pointer-events: none;
}
.deco--corner-br { width: 34mm; height: 34mm; right: 8mm; bottom: 8mm; transform: scaleX(-1); }
.deco--corner-tl { width: 26mm; height: 26mm; left: 8mm; top: 8mm; opacity: 0.4; }
.deco--cover     { width: 60mm; height: 60mm; opacity: 0.7; }

/* ============================================
   表紙（提供画像をフルブリードで使用）
   ============================================ */
.cover {
  padding: 0;
  min-height: 297mm;
  height: 297mm;
}

.cover__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ============================================
   記入欄（Date / Name）— 目次ページ上部に配置
   ============================================ */
.entry-row {
  display: flex;
  gap: 10mm;
  justify-content: flex-end;
  margin-bottom: 6mm;
}

.entry-field {
  display: flex;
  align-items: baseline;
  gap: 2mm;
}

.entry-field__label {
  font-family: var(--font-mincho);
  font-size: 9pt;
  color: var(--brand-deep);
  letter-spacing: 0.1em;
}

.entry-field__input {
  width: 32mm;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 10pt;
  color: var(--ink);
  padding: 1mm 0;
  text-align: left;
}
.entry-field__input:focus { outline: none; border-bottom-color: var(--rose); }
.entry-field__input::placeholder { color: var(--ink-pale); }

/* ============================================
   ページ共通ヘッダー
   ============================================ */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 8mm;
  padding-bottom: 4mm;
  border-bottom: 1.5px solid var(--brand);
}

.page-header__step {
  font-family: var(--font-mincho);
  font-size: 9.5pt;
  color: var(--rose);
  letter-spacing: 0.25em;
  display: block;
  margin-bottom: 1.5mm;
}

.page-header__title-jp {
  font-family: var(--font-mincho);
  font-size: 18pt;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.page-header__num {
  font-family: var(--font-mincho);
  font-size: 22pt;
  font-weight: 400;
  color: var(--line);
  line-height: 1;
}

/* ============================================
   本文テキスト・見出し
   ============================================ */
.lead-text {
  font-size: 11.5pt;
  color: var(--ink);
  line-height: 2.05;
  letter-spacing: 0.04em;
  margin-bottom: 5mm;
}
.lead-text:last-child { margin-bottom: 0; }

.sub-heading {
  font-family: var(--font-mincho);
  font-size: 13.5pt;
  font-weight: 500;
  color: var(--brand-deep);
  letter-spacing: 0.06em;
  margin: 8mm 0 4mm;
  display: flex;
  align-items: center;
  gap: 3mm;
}
.sub-heading:first-of-type { margin-top: 0; }
.sub-heading::before {
  content: '';
  width: 5mm;
  height: 5mm;
  border: 1.4px solid var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
}

.point-box {
  background: var(--rose-pale);
  border-left: 3px solid var(--rose);
  padding: 6mm 8mm;
  margin: 5mm 0;
}
.point-box__title {
  font-family: var(--font-mincho);
  font-size: 11.5pt;
  color: var(--rose);
  margin-bottom: 2mm;
  letter-spacing: 0.05em;
}
.point-box__text {
  font-size: 10.8pt;
  color: var(--ink-soft);
  line-height: 1.9;
}

/* ============================================
   ワーク：入力欄
   ============================================ */
.work-instruction {
  font-family: var(--font-mincho);
  font-size: 12.5pt;
  color: var(--ink);
  line-height: 1.9;
  letter-spacing: 0.04em;
  margin-bottom: 6mm;
  padding-bottom: 4mm;
  border-bottom: 1px dashed var(--line);
}

.field-label {
  font-family: var(--font-mincho);
  font-size: 11.5pt;
  color: var(--brand-deep);
  letter-spacing: 0.04em;
  margin-bottom: 3mm;
  line-height: 1.7;
}

.field-textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  font-family: var(--font-body);
  font-size: 10.8pt;
  color: var(--ink);
  line-height: 1.9;
  padding: 4mm 5mm;
  resize: none;
  overflow: hidden;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(1.9em - 1px),
    var(--line) calc(1.9em - 1px),
    var(--line) calc(1.9em)
  );
  background-attachment: local;
}
.field-textarea:focus { outline: none; border-color: var(--brand); }
.field-textarea::placeholder { color: var(--ink-pale); }

.field-textarea--sm  { min-height: 16mm; }
.field-textarea--md  { min-height: 24mm; }
.field-textarea--lg  { min-height: 34mm; }
.field-textarea--xl  { min-height: 48mm; }
.field-textarea--xxl { min-height: 70mm; }

.work-block { margin-bottom: 7mm; }
.work-block:last-child { margin-bottom: 0; }

/* ============================================
   目次
   ============================================ */
.toc {
  display: flex;
  flex-direction: column;
}

.toc__item {
  display: flex;
  align-items: baseline;
  gap: 5mm;
  padding: 5mm 0;
  border-bottom: 1px solid var(--line);
}
.toc__item:first-child { padding-top: 0; }

.toc__tag {
  flex-shrink: 0;
  min-width: 24mm;
  font-family: var(--font-mincho);
  font-size: 9.5pt;
  color: var(--white);
  background: var(--rose);
  padding: 1.2mm 3mm;
  text-align: center;
  letter-spacing: 0.04em;
  border-radius: 1px;
}
.toc__tag--sub {
  background: transparent;
  color: var(--brand-deep);
  border: 1px solid var(--brand);
}

.toc__title {
  flex: 1;
  font-family: var(--font-mincho);
  font-size: 12pt;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.toc__page {
  font-family: var(--font-mincho);
  font-size: 10pt;
  color: var(--ink-pale);
  letter-spacing: 0.05em;
}

/* ============================================
   写真アップロード
   ============================================ */
.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6mm;
  margin-top: 4mm;
}

.img-slot {
  aspect-ratio: 3/4;
  border: 1.5px dashed var(--brand);
  background: var(--cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.img-slot img { display: none; width: 100%; height: 100%; object-fit: cover; }
.img-slot.has-image img { display: block; }
.img-slot.has-image { border-style: solid; }

.img-slot__pick {
  font-family: var(--font-mincho);
  font-size: 9.5pt;
  color: var(--brand-deep);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4mm;
  letter-spacing: 0.03em;
  line-height: 1.7;
}
.img-slot.has-image .img-slot__pick { display: none; }

.img-slot__del {
  display: none;
  position: absolute;
  bottom: 2mm;
  right: 2mm;
  font-family: var(--font-body);
  font-size: 8pt;
  color: var(--white);
  background: rgba(74,55,40,0.75);
  border: none;
  padding: 1mm 2.5mm;
  cursor: pointer;
  border-radius: 2px;
}
.img-slot.has-image .img-slot__del { display: inline-block; }

.photo-label {
  text-align: center;
  font-family: var(--font-mincho);
  font-size: 10pt;
  color: var(--brand-deep);
  margin-top: 2mm;
  letter-spacing: 0.06em;
}

/* ============================================
   深掘りブロック（3スタイル分）
   ============================================ */
.deepdive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6mm;
  margin-top: 4mm;
}

.deepdive-col {
  border: 1px solid var(--line);
  padding: 4mm;
  display: flex;
  flex-direction: column;
  gap: 3mm;
}

.deepdive-col__head {
  display: flex;
  align-items: center;
  gap: 3mm;
  padding-bottom: 2mm;
  border-bottom: 1px solid var(--line);
}

.deepdive-col__thumb {
  width: 12mm;
  height: 16mm;
  object-fit: cover;
  background: var(--cream-deep);
  flex-shrink: 0;
  display: none;
}
.deepdive-col__thumb.has-image { display: block; }

.deepdive-col__title {
  font-family: var(--font-mincho);
  font-size: 10.5pt;
  color: var(--brand-deep);
  letter-spacing: 0.04em;
}

.deepdive-q {
  font-size: 9.3pt;
  color: var(--ink-soft);
  line-height: 1.6;
}

.deepdive-col .field-textarea { font-size: 9.5pt; }

/* ============================================
   クロージング
   ============================================ */
.closing-fill {
  text-align: center;
  margin: 10mm 0;
}
.closing-fill__q {
  font-family: var(--font-mincho);
  font-size: 15pt;
  color: var(--ink);
  letter-spacing: 0.06em;
  line-height: 1.9;
}
.closing-fill__blank {
  font-family: var(--font-mincho);
  font-size: 15pt;
  color: var(--rose);
  font-weight: 600;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--rose);
  padding: 0 2mm;
}

.closing-message {
  font-family: var(--font-mincho);
  font-size: 12pt;
  color: var(--ink);
  line-height: 2.1;
  letter-spacing: 0.05em;
  text-align: center;
  margin-top: 8mm;
}

.field-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 10.8pt;
  color: var(--ink);
  padding: 2mm 1mm;
}
.field-input:focus { outline: none; border-bottom-color: var(--brand); }
.field-input::placeholder { color: var(--ink-pale); }

/* ============================================
   印刷（プレビュー切替は不要のため常時表示）
   ============================================ */
@media print {
  .save-bar { display: none !important; }
}
