/* ═══════════════════════════════════════════════════════
   portfolio.css — Portfolio（作品集）ページ専用
   レイアウト = 章立て × エディトリアル交互（_lab/portfolio-d.html で承認済み）
   ═══════════════════════════════════════════════════════ */

/* ═══ ページヘッダー（このページはセンター揃えの1カラム） ═══ */
.page-head.portfolio-head { text-align: center; }
.page-lead {
  max-width: 36em;
  margin: var(--sp-3) auto 0;
  font-size: clamp(15.5px, 1.2vw, 18px);
  line-height: 2;
  color: var(--ink-soft);
}

/* ═══ 章扉 ═══ */
.chapter { padding-block: clamp(56px, 7vw, 104px); }
.chapter:nth-of-type(even) { background: var(--paper-pink); }
.chapter-inner { max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.chapter-head {
  display: flex;
  align-items: baseline;
  gap: clamp(18px, 2.4vw, 36px);
  border-bottom: 2px solid var(--line-strong);
  padding-bottom: clamp(16px, 2vw, 26px);
  margin-bottom: clamp(40px, 5vw, 72px);
}
.chapter-num {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: clamp(56px, 7vw, 120px);
  line-height: 1;
  background: var(--grad-idol);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chapter-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 50px);
  letter-spacing: 0.08em;
}
.chapter-en {
  margin-left: auto;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 17px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--pink-strong);
}

/* サブカテゴリ見出し（デザイン章の Webデザイン / グラフィックデザイン 等） */
.group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: clamp(56px, 7vw, 96px) 0 clamp(28px, 3.5vw, 48px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2vw, 32px);
  letter-spacing: 0.1em;
  color: var(--ink);
}
.group-head::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--grad-idol);
  flex: none;
}
.group-head::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--line);
}
.group-head:first-of-type { margin-top: 0; }
.chapter-head + .group-head { margin-top: 0; }

/* ═══ 章の中身: 作品行（画像と解説が左右交互） ═══ */
.rows { display: grid; gap: clamp(64px, 8vw, 120px); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
}
.row.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.row.flip .row-visual { order: 2; }
.row.flip .row-text { order: 1; text-align: right; }

/* 拡大ボタン（画像を包む。キーボード操作対応のため button 要素） */
.row-visual .zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.row-visual .zoom.portrait { width: auto; max-width: min(100%, 480px); margin-inline: auto; }
.row-visual .zoom:focus-visible { outline: 3px solid var(--pink-strong); outline-offset: 4px; border-radius: calc(var(--radius) + 6px); }
.row-visual img {
  width: 100%;
  display: block;
  border-radius: calc(var(--radius) + 6px);
  border: 2px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(190, 100, 150, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.row-visual .zoom:hover img { transform: translateY(-4px); box-shadow: 0 38px 80px -30px rgba(190, 100, 150, 0.55); }

/* 2枚組（カラム比は portfolio.js が画像の縦横比から inline で指定） */
.row-visual .duo { display: grid; gap: 16px; align-items: start; }
.row-visual .duo figure { margin: 0; }
.row-visual .duo img { object-fit: cover; }
.row-visual .duo figcaption {
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: var(--body-bold);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-align: center;
}

/* 作品テキスト */
.row-text .num {
  display: block;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: clamp(48px, 5vw, 84px);
  line-height: 1;
  background: var(--grad-idol);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.row-text .genre {
  display: block;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--pink-strong);
  margin-bottom: 12px;
}
.row-text h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.4vw, 40px);
  letter-spacing: 0.06em;
  line-height: 1.5;
  margin-bottom: var(--sp-2);
  text-wrap: balance;   /* タイトルの中途半端な改行を防ぐ */
}
.row-text h4 .nw { white-space: nowrap; }   /* 単語の途中で折れないよう、折り返しは .nw の境界だけに */
.row-text .comment {
  font-size: clamp(15.5px, 1.15vw, 17.5px);
  line-height: 2.1;
  color: var(--ink-soft);
  text-wrap: pretty;    /* 行末の1文字残り等の不格好な折り返しを防ぐ */
}

/* 補足ノート（使用アセットのクレジット等） */
.row-text .work-note {
  margin-top: 10px;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  line-height: 1.9;
  color: var(--ink-faint);
}
.row-text .work-note a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.row-text .work-note a:hover { color: var(--pink-strong); }

/* 素材待ちプレースホルダー */
.ph {
  display: grid;
  place-items: center;
  gap: 8px;
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 2px dashed var(--pink);
  border-radius: calc(var(--radius) + 6px);
  background: var(--lavender-wash);
}
.ph .t { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.8vw, 26px); color: var(--pink-strong); }
.ph .d { font-size: 14px; letter-spacing: 0.06em; color: var(--ink-faint); }

/* 音源プレイヤー（Frosted Path） */
.audio-work {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  padding: clamp(24px, 3vw, 44px);
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, #fff, var(--lavender-wash));
  box-shadow: 0 30px 70px -30px rgba(190, 100, 150, 0.4);
}
.audio-work .audio-note {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: clamp(40px, 4vw, 64px);
  line-height: 1;
  background: var(--grad-idol);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.audio-work audio { width: 100%; }

/* ═══ レスポンシブ ═══ */
@media (max-width: 860px) {
  /* モバイルの各作品ブロックは「数字 → ジャンル → タイトル → 写真 → 説明」の順。
     数字が「次のコンテンツへの切り替わり」の合図として先頭に来るようにする
     （写真が切れ目だと、前の説明と次の写真が同じコンテンツに見えて混同するため） */
  .row, .row.flip { grid-template-columns: 1fr; gap: 10px; }
  .row .row-text, .row.flip .row-text { display: contents; }
  .row-text .num { order: -3; margin-bottom: 0; }
  .row-text .genre { order: -2; margin-bottom: 0; }
  .row-text h4 { order: -1; margin-bottom: 4px; }
  /* .row.flip の order:2（デスクトップ用）より詳細度で勝つようセレクタを揃える */
  .row .row-visual, .row.flip .row-visual { order: 0; margin-block: 6px 4px; }
  .row-text .comment { order: 1; }
  .row.flip .row-text { text-align: left; }
  .chapter-head { flex-wrap: wrap; }
  .chapter-en { margin-left: 0; width: 100%; }
  .audio-work { grid-template-columns: 1fr; text-align: center; }
}
