/* =========================================================
   制作事例の詳細（case-study）
   値は 10/13 のデザイン（docs/figma-cache/case-study/dump-1013.txt）。単位なしの値は幅1920px時のpx（--u で拡大縮小）
   WordPress では、制作事例の投稿1件を出すテンプレートになる
   ========================================================= */

/* ---------- pc-02-detail ---------- */
/* 開発ストーリーは事例ごとに長さが違うため、ここから下（ストーリー・ボタン）は上から順に並べ、高さは中身に合わせる */
.case-detail {
  position: relative;
  padding: calc(966 * var(--u)) 0 calc(190 * var(--u));
  overflow: hidden;   /* 方眼が右にはみ出す */
  color: var(--color-black);
}

.case-detail__category {
  position: absolute;
  top: calc(321 * var(--u));
  left: calc(259 * var(--u));
  margin: 0;
  font-family: var(--font-sawarabi);
  font-size: calc(20 * var(--u));
  line-height: calc(30 * var(--u));
  color: var(--color-lime-deep);
}

.case-detail__main {
  position: absolute;
  top: calc(356 * var(--u));
  left: calc(259 * var(--u));
  width: calc(382 * var(--u));
  max-width: none;
  height: calc(562 * var(--u));
  object-fit: cover;
}

.case-detail__head {
  position: absolute;
  top: calc(353 * var(--u));
  left: calc(694 * var(--u));
  width: calc(967 * var(--u));
}

.case-detail__title {
  width: calc(640 * var(--u));
  margin: 0;
  font-size: calc(35 * var(--u));
  font-weight: var(--fw-regular);
  line-height: calc(51 * var(--u));
}

.case-detail__lead {
  width: calc(628 * var(--u));
  margin: calc(18 * var(--u)) 0 0 calc(10 * var(--u));
  padding-top: calc(18 * var(--u));
  border-top: var(--border-width) solid var(--color-black);
  font-size: calc(20 * var(--u));
  line-height: calc(29 * var(--u));
}

/* 細部や別角度の写真（3枚） */
.case-detail__photos {
  position: absolute;
  top: calc(349 * var(--u));
  left: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-detail__photos img {
  display: block;
  width: calc(299 * var(--u));
  height: calc(216 * var(--u));
  object-fit: cover;
}

/* 開発ストーリー（左）とご依頼情報の表（右）。
   2026-10-27 デザイナーの修正案（表を右上から移し、ストーリーの幅を写真の列にそろえる）。左端・右端は写真とそろえる */
.case-detail__body {
  display: grid;
  grid-template-columns: calc(992 * var(--u)) calc(341 * var(--u));
  column-gap: calc(67 * var(--u));
  align-items: start;
  width: calc(1400 * var(--u));
  margin: 0 auto;
}

.case-detail__story { grid-area: 1 / 1; }

.case-detail__spec {
  grid-area: 1 / 2;
  width: 100%;
  border: var(--border-width) solid var(--color-black);
  border-collapse: collapse;
  font-size: calc(17 * var(--u));
  line-height: calc(27 * var(--u));
  background: #F6F6F6;
}

.case-detail__spec-title {
  border: var(--border-width) solid var(--color-black);
  border-bottom: 0;
  font-size: calc(22 * var(--u));
  line-height: calc(62 * var(--u));
  color: var(--color-white);
  background: var(--color-black);
}

.case-detail__spec th,
.case-detail__spec td {
  padding: calc(16 * var(--u)) calc(12 * var(--u));
  border-top: var(--border-width) solid var(--color-black);
  font-weight: var(--fw-regular);
  text-align: left;
  vertical-align: top;
}

.case-detail__spec th {
  width: calc(110 * var(--u));
  border-right: var(--border-width) solid var(--color-black);
  white-space: nowrap;
  color: var(--color-white);
  background: var(--color-gray-550);
}

/* 開発ストーリー（見出しの帯はデザインの「ご依頼から、形になるまで」と同じ） */
.case-detail__story-title {
  margin: 0;
  font-size: calc(25 * var(--u));
  font-weight: var(--fw-regular);
  line-height: calc(58 * var(--u));
  text-align: center;
  color: var(--color-white);
  background: var(--color-lime-deep);
}

.case-detail__story-body {
  margin-top: calc(60 * var(--u));
  font-size: calc(18 * var(--u));
  line-height: calc(36 * var(--u));
  text-align: center;
  color: #282828;
}

.case-detail__story-body p { margin: 0; }
.case-detail__story-body p + p { margin-top: calc(18 * var(--u)); }

.case-detail__actions {
  display: flex;
  justify-content: center;
  gap: calc(87 * var(--u));
  margin-top: calc(100 * var(--u));
}

/* ---------- pc-03-others ---------- */
.case-others {
  height: calc(621 * var(--u));
  padding: 0 calc(259 * var(--u));
  color: var(--color-black);
}

.case-others__head {
  display: flex;
  align-items: center;
  gap: calc(25 * var(--u));
}

.case-others__title {
  flex: 0 0 calc(1126 * var(--u));
  margin: 0;
  padding-left: calc(23 * var(--u));
  font-size: calc(18 * var(--u));
  font-weight: var(--fw-regular);
  line-height: calc(42 * var(--u));
  color: var(--color-white);
  background: var(--color-gray-500);
}

.case-others__more {
  display: flex;
  align-items: center;
  gap: calc(19 * var(--u));
  font-size: calc(20 * var(--u));
  line-height: calc(29 * var(--u));
  white-space: nowrap;
  color: #313131;
  text-decoration: none;
}

.case-others__more-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  background: var(--color-charcoal-900);
}

.case-others__more-icon img {
  width: calc(24 * var(--u));
  filter: brightness(0) invert(1);   /* 矢印を白に */
}

.case-others__list {
  display: grid;
  grid-template-columns: repeat(4, calc(310 * var(--u)));
  gap: calc(48 * var(--u));
  margin: calc(24 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
}

.case-others__item a {
  position: relative;
  display: block;
}

.case-others__item img {
  display: block;
  width: 100%;
  height: calc(231 * var(--u));
  object-fit: cover;
}

.case-others__label {
  position: absolute;
  right: calc(13 * var(--u));
  bottom: calc(13 * var(--u));
  padding: 0 calc(11 * var(--u));
  border: var(--border-width) solid var(--color-white);
  font-size: calc(16 * var(--u));
  line-height: calc(31 * var(--u));
  white-space: nowrap;
  color: var(--color-white);
  background: var(--color-black);
}

/* ---------- SP（デザインなし。仮の表示） ---------- */
@media (max-width: 1023px) {
  .case-detail { padding: var(--sp-section-sm) var(--sp-gutter) var(--sp-section); }

  .case-detail__category,
  .case-detail__main,
  .case-detail__head,
  .case-detail__photos,
  .case-detail__story { position: static; width: auto; }

  .case-detail__category { font-size: var(--fs-xs); line-height: var(--lh-heading); }
  .case-detail__main { display: block; width: 100%; height: auto; margin-top: var(--space-10); }
  .case-detail__head { margin-top: var(--sp-gap-text); }
  .case-detail__title { width: auto; font-size: var(--sp-fs-heading); line-height: var(--sp-lh-heading); }
  .case-detail__lead { width: auto; margin: var(--space-20) 0 0; padding-top: var(--space-20); font-size: var(--sp-fs-body); line-height: var(--sp-lh-body); letter-spacing: var(--sp-ls-body); }
  .case-detail__photos { gap: var(--space-10); margin-top: var(--sp-gap-block); }
  .case-detail__photos li { flex: 1; }
  .case-detail__photos img { width: 100%; height: auto; aspect-ratio: 299 / 216; }

  /* スマホは PC の修正（2026-10-27）の前のまま：表 → ストーリーの順に並べ、表の1行目を黒地にする */
  .case-detail__body { display: block; width: auto; }
  .case-detail__spec-title { display: none; }
  .case-detail__spec { width: 100%; height: auto; margin-top: var(--sp-gap-block); font-size: var(--sp-fs-body); line-height: var(--lh-heading); }
  .case-detail__spec th,
  .case-detail__spec td { padding: 10px 12px; vertical-align: middle; }
  .case-detail__spec th { width: 7em; color: inherit; background: none; }
  .case-detail__spec tr:first-child th,
  .case-detail__spec tr:first-child td { border-top: 0; border-right-color: var(--color-white); color: var(--color-white); background: var(--color-black); }

  .case-detail__story { margin-top: var(--sp-gap-block); }
  .case-detail__story-title { font-size: var(--fs-caption); line-height: 44px; }
  .case-detail__story-body { width: auto; margin-top: var(--sp-gap-text); text-align: left; font-size: var(--sp-fs-body); line-height: var(--sp-lh-body); letter-spacing: var(--sp-ls-body); }
  .case-detail__story-body p + p { margin-top: 1em; }

  .case-detail__actions { flex-direction: column; align-items: center; gap: var(--space-20); margin-top: var(--sp-gap-block); }

  .case-others { height: auto; padding: 0 var(--sp-gutter) var(--sp-section); }
  .case-others__head { flex-direction: column; align-items: stretch; gap: var(--space-10); }
  .case-others__title { flex: none; padding-left: 12px; font-size: var(--fs-xs); line-height: 36px; }
  .case-others__more { justify-content: flex-end; gap: 10px; font-size: var(--fs-xs); }
  .case-others__more-icon { width: 30px; height: 30px; }
  .case-others__more-icon img { width: 16px; }
  .case-others__list { grid-template-columns: 1fr 1fr; gap: var(--space-10); margin-top: var(--sp-gap-block); }
  .case-others__item img { height: auto; aspect-ratio: 310 / 231; }
  .case-others__label { right: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 0 6px; overflow: hidden; font-size: var(--sp-fs-min); line-height: 20px; text-overflow: ellipsis; }
}
