/* =====================================================================
   R3 工程セクション（トップページ #r86-journey）
   平たい絵の工程ストリップをやめ、実写真の並びと、乾燥工程の流れ（3D）で組み直したもの
   - 色は案2のトークンだけを使う。例外は、3Dの図の凡例2色（図の中の細切りと同じ値。配色トークンではない）
   - 余白・文字の大きさは r3-foundation.css の変数を使う
   ===================================================================== */
.r3-process { scroll-margin-top: 16px; }
.r3-process + .r82-workshop { border-top: 1px solid var(--line); }

/* 但し書き：見出しのすぐ下に、本文に近い大きさで置く */
.r3-caveat {
  max-width: var(--r3-measure);
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line-strong);
  font-size: var(--r3-sub);
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------------
   写真の並び：写真＋番号＋短い見出し＋説明
   --------------------------------------------------------------------- */
.r3-proc { margin-top: 56px; }
.r3-proc-head, .r3-flow-head { margin-bottom: 32px; }
.r3-proc-head h3, .r3-flow-head h3 { margin: 0 0 16px; font-size: var(--r3-h3); }
.r3-flow-head .r3-flow-lead { max-width: var(--r3-measure); margin: 0 0 16px; }

.r3-proc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
}
.r3-proc-step { min-width: 0; scroll-margin-top: 24px; }
.r3-proc-step figure { margin: 0 0 16px; }
.r3-photo-open {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--card);
  font: inherit;
  cursor: zoom-in;
}
.r3-photo-open img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 50%;
}
/* 写真ごとの見せる位置（切り取るのは表示だけ。拡大すると元の写真の全体が見られる） */
.r3-proc-step[data-r3-step="enter"] .r3-photo-open img {
  /* 会社案内の誌面の飾り（左上の紺の丸）が写り込んでいるので、右下を基準に少し寄せて外す */
  object-position: 100% 100%;
  transform: scale(1.2);
  transform-origin: 100% 100%;
}
.r3-proc-step[data-r3-step="select"] .r3-photo-open img { object-position: 35% 50%; }
.r3-proc-step[data-r3-step="weigh"] .r3-photo-open img { object-position: 15% 50%; }
.r3-proc-step[data-r3-step="pack"] .r3-photo-open img { object-position: 30% 50%; }
.r3-proc-step[data-r3-step="hand"] .r3-photo-open img { object-position: 45% 50%; }

/* 「写真を拡大」の札：写真の上でも読めるよう、単色の半透明を敷く */
.r3-photo-zoom {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 4px 12px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: var(--card);
  font-size: var(--r3-note);
  line-height: 1.7;
  letter-spacing: .06em;
}
.r3-photo-open:hover .r3-photo-zoom { background: var(--sea); }
.r3-nozoom .r3-photo-open { cursor: default; }
.r3-nozoom .r3-photo-zoom { display: none; }

.r3-proc-step figcaption { margin-top: 8px; font-size: var(--r3-note); line-height: 1.7; color: var(--muted); }
.r3-proc-num {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: var(--r3-h3);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  color: var(--sea);
}
.r3-proc-num::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.r3-proc-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: var(--r3-h3);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .05em;
  font-feature-settings: "palt" 1;
  color: var(--ink);
}
.r3-proc-title:focus { outline: none; }
.r3-proc-text { margin: 0; font-size: var(--r3-sub); line-height: 1.8; color: var(--ink-2); }

/* 会社のページから来たときの案内（その工程の札の中に出す） */
.r3-arrival {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--sea);
  border-radius: 4px;
  background: var(--card);
  font-size: var(--r3-sub);
  line-height: 1.8;
  color: var(--ink);
}
.r3-arrival a { color: var(--sea); font-weight: 700; white-space: nowrap; }
.r3-proc > .r3-arrival { max-width: var(--r3-measure); margin-bottom: 32px; }
.r3-proc-step.is-arrival .r3-proc-num::after { background: var(--sea); }

/* ---------------------------------------------------------------------
   乾燥工程の流れ（3D）
   --------------------------------------------------------------------- */
.r3-flow { margin-top: 72px; padding-top: 56px; border-top: 1px solid var(--line); }
.r3-flow-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 40px; align-items: start; }
.r3-flow-stage { min-width: 0; }
.r3-flow-view {
  position: relative;
  height: clamp(340px, 44vw, 500px);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.r3-flow-view canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;   /* 縦のスワイプはページのスクロールに譲る */
  cursor: grab;
  outline: none;
}
.r3-flow-view canvas.is-dragging { cursor: grabbing; }
.r3-flow-view canvas:focus-visible,
:root[data-theme="light"][data-palette="2"] .r3-flow-view canvas:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: -2px;
  box-shadow: none;
}
.r3-flow-fallback {
  display: none;
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  margin: 0;
  padding: 24px;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--r3-sub);
  line-height: 1.8;
  color: var(--ink-2);
}
.r3-flow-view.is-fallback canvas { display: none; }
.r3-flow-view.is-fallback .r3-flow-fallback { display: flex; }

.r3-flow-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  margin-top: 8px;
  font-size: var(--r3-note);
  line-height: 1.7;
  color: var(--ink-2);
}
.r3-flow-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; }
.r3-flow-legend-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.r3-flow-swatch { display: inline-block; width: 24px; height: 8px; border: 1px solid var(--line-strong); }
.r3-flow-swatch-raw { background: #f3e9c9; }   /* 図の中の細切り（乾燥前）と同じ値 */
.r3-flow-swatch-dry { background: #d9b676; }   /* 図の中の細切り（乾燥後）と同じ値 */
.r3-flow-actions { display: flex; gap: 24px; }
.r3-text-btn {
  min-height: 40px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--sea);
  font: inherit;
  font-size: var(--r3-sub);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
  cursor: pointer;
}
.r3-text-btn:hover { color: var(--sea-2); }
.r3-flow-hint, .r3-flow-reduce { margin: 4px 0 0; font-size: var(--r3-note); line-height: 1.7; color: var(--muted); }
.r3-hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .r3-hint-mouse { display: none; }
  .r3-hint-touch { display: inline; }
}

/* 工程の一覧：図の中の番号・ハイライトと同じ順で並ぶ。押すと、その工程に切り替わる */
.r3-flow-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.r3-flow-steps li { border-bottom: 1px solid var(--line); }
.r3-flow-step {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  gap: 0 8px;
  width: 100%;
  margin: 0;
  padding: 12px 8px 12px 12px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.r3-flow-step-num {
  grid-row: 1 / span 2;
  font-family: var(--font-head);
  font-size: var(--r3-h3);
  font-weight: 600;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.r3-flow-step-name {
  font-family: var(--font-head);
  font-size: var(--r3-h3);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .05em;
  font-feature-settings: "palt" 1;
}
.r3-flow-step-desc { font-size: var(--r3-sub); line-height: 1.7; color: var(--ink-2); }
.r3-flow-step:hover .r3-flow-step-name { color: var(--sea); }
.r3-flow-step.is-active { border-left-color: var(--sea); background: var(--card); }
.r3-flow-step.is-active .r3-flow-step-num { color: var(--sea); }
@media (prefers-reduced-motion: no-preference) {
  .r3-flow-step { transition: background-color .15s ease, border-color .15s ease; }
}

.r3-process .r75-result-links { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------------
   幅ごとの並び
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .r3-proc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
  .r3-flow-grid { grid-template-columns: 1fr; gap: 24px; }
  .r3-flow { margin-top: 56px; padding-top: 40px; }
}
@media (max-width: 600px) {
  .r3-proc { margin-top: 40px; }
  .r3-proc-head, .r3-flow-head { margin-bottom: 24px; }
  .r3-proc-list { grid-template-columns: 1fr; gap: 40px; }
  .r3-flow-view { height: 340px; }
  .r3-flow-step { padding: 12px 8px; }
}
@media print {
  .r3-flow-view, .r3-flow-meta, .r3-flow-hint, .r3-flow-reduce, .r3-photo-zoom { display: none !important; }
}
