/* commun-shibuya/working-shelf-box — gallery-3 editorial + mobile (was inline before shared bundle) */
/* PC：画像とテキストを文書順で分散（すべて元の画像比率） */
.project-gallery.gallery-3 .gallery-grid {
  grid-template-rows: none;
  grid-auto-rows: auto;
  gap: 0;
}
.project-gallery.gallery-3 .gallery-cell {
  grid-column: 1 / -1;
  grid-row: auto;
}
.project-gallery.gallery-3 .gallery-cell img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  position: relative;
  vertical-align: bottom;
}

/* ヘッダーのタイポグラフィ微調整 */
.project-gallery .gallery-head {
  text-align: center;
  padding: clamp(72px, 9vw, 104px) 0 clamp(40px, 6vw, 56px);
}
.project-gallery .gallery-head h1 {
  font-size: clamp(20px, 3.2vw, 30px);
  letter-spacing: 0.18em;
}
.project-gallery .gallery-head .project-code {
  display: block;
  font-size: 9px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 8px;
}
.project-gallery .gallery-head .project-name {
  display: block;
}
.project-gallery .gallery-head p {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.project-gallery .gallery-head p .ja {
  display: block;
  font-size: 0.74em;
  letter-spacing: 0.18em;
  opacity: 0.8;
  margin-top: 4px;
}

/* プロジェクトテキスト：見出し・本文の階層をはっきり */
.project-gallery.gallery-3 .gallery-cell--text {
  grid-column: 1 / -1;
  padding: 40px 0 36px;
  box-sizing: border-box;
}
/* 一番上：リード文ブロック（アクセント線・余白多め） */
.project-gallery.gallery-3 .gallery-cell--text:first-of-type {
  padding-top: 64px;
  padding-bottom: 48px;
}
.project-gallery.gallery-3 .gallery-cell--text:first-of-type .project-text-inner {
  border-left: 3px solid var(--accent);
  padding-left: 28px;
  max-width: 880px;
}
.project-gallery.gallery-3 .gallery-cell--text:first-of-type h2 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 22px;
}
.project-gallery.gallery-3 .gallery-cell--text:first-of-type p {
  font-size: 16px;
  line-height: 2.1;
  color: var(--gray-700);
  letter-spacing: 0.02em;
}
/* 画像直後ブロック：区切り線・見出しをきちんと */
.project-gallery.gallery-3 .gallery-cell--text.after-image {
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--gray-100);
}
.project-gallery.gallery-3 .gallery-cell--text .project-text-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad);
  box-sizing: border-box;
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.025em;
  color: var(--gray-700);
}
/* 見出し h2：セリフ体・サイズ・字間で表現 */
.project-gallery.gallery-3 .gallery-cell--text h2 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gray-700);
  margin: 0 0 18px;
  line-height: 1.4;
}
.project-gallery.gallery-3 .gallery-cell--text.after-image h2 {
  margin-top: 0;
  padding-top: 0;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--gray-500);
}
.project-gallery.gallery-3 .gallery-cell--text p {
  margin: 0 0 1.4em;
}
.project-gallery.gallery-3 .gallery-cell--text p:last-child {
  margin-bottom: 0;
}
/* CTA：控えめだがはっきり */
.project-gallery.gallery-3 .gallery-cell--text .project-cta {
  margin-top: 36px;
  margin-bottom: 0;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.project-gallery.gallery-3 .gallery-cell--text .project-cta a {
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 6px;
  color: var(--gray-700);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.project-gallery.gallery-3 .gallery-cell--text .project-cta a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.project-gallery.gallery-3 .gallery-cell--text .project-text-inner--wide {
  max-width: 100%;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

@media (max-width: 768px) {
  :root { --pad: 20px; }
  .nav-links { display: none !important; }
  .nav-toggle { display: flex !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .carousel-inner > .item > img,
  .carousel-inner > .item > a > img { height: 56vw; }

  /* モバイル：画像を 4:3 でバランスよく表示（トリミング） */
  .project-gallery.gallery-3 .gallery-cell:not(.gallery-cell--text) {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 4 / 3;
  }
  .project-gallery.gallery-3 .gallery-cell:not(.gallery-cell--text) img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  .project-gallery.gallery-3 .gallery-cell:not(.gallery-cell--text) .cell-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px var(--pad);
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  /* 1枚目（文書順で最初の画像＝pos-2）だけ元の画像比率で表示 */
  .project-gallery.gallery-3 .gallery-cell.pos-2 {
    aspect-ratio: auto !important;
    overflow: visible !important;
  }
  .project-gallery.gallery-3 .gallery-cell.pos-2 img {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    vertical-align: bottom;
  }

  /* モバイル：テキスト・見出しのサイズと余白 */
  .project-gallery.gallery-3 .gallery-cell--text {
    padding: 24px 0 20px;
  }
  .project-gallery.gallery-3 .gallery-cell--text:first-of-type {
    padding-top: 32px;
    padding-bottom: 24px;
  }
  .project-gallery.gallery-3 .gallery-cell--text:first-of-type h2 {
    font-size: 10px;
    letter-spacing: 0.3em;
    margin-bottom: 16px;
  }
  .project-gallery.gallery-3 .gallery-cell--text:first-of-type p {
    font-size: 14px;
    line-height: 2;
  }
  .project-gallery.gallery-3 .gallery-cell--text.after-image {
    padding-top: 18px;
    padding-bottom: 22px;
  }
  .project-gallery.gallery-3 .gallery-cell--text.after-image h2 {
    font-size: 11px;
    letter-spacing: 0.26em;
    margin-bottom: 14px;
  }
  .project-gallery.gallery-3 .gallery-cell--text .project-text-inner {
    font-size: 14px;
    line-height: 1.95;
    max-width: 100%;
    padding-left: var(--pad);
    padding-right: var(--pad);
  }
  .project-gallery.gallery-3 .gallery-cell--text:first-of-type .project-text-inner {
    border-left-width: 2px;
    padding-left: calc(var(--pad) + 10px);
  }
  .project-gallery.gallery-3 .gallery-cell--text .project-cta {
    font-size: 9px;
    letter-spacing: 0.22em;
    margin-top: 28px;
  }
  .project-gallery.gallery-3 .gallery-cell:not(.gallery-cell--text) {
    margin-bottom: 0;
  }
  /* フォームレスポンシブ */
  .mailform th, .mailform td { display: block !important; width: 100% !important; padding: 8px 0 !important; border-bottom: none !important; }
  .mailform th { border-top: 1px solid var(--gray-100) !important; padding-top: 20px !important; }
  .mailform td { padding-bottom: 0 !important; }
  .mailform input[type="text"],
  .mailform input[type="email"],
  .mailform textarea,
  .mailform .mf { max-width: 100% !important; }
  .mailform input[type="submit"] { width: 100% !important; margin-bottom: 12px; }
  .mailform input[type="reset"] { width: 100% !important; margin-left: 0 !important; }
}
