@charset "UTF-8";

/* ============================================
   詳細ページ
   ============================================ */
.works-detail {
  margin-top: 65px;
  padding: 3rem 0 0;
}

.portfolio-title {
  font-size: 2rem;
  color: #333;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.hero-sub {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-sub img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.detail-intro {
  margin: 0 0 3rem;
}

.detail-intro__card {
  padding: 1.5rem 2rem;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 10px;
}

.detail-intro__body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #444;
}

.detail-intro__body p {
  margin: 0 0 1em;
}

.detail-intro__body p:last-child {
  margin-bottom: 0;
}

.detail-gallery {
  margin: 3rem 0;
}

.detail-gallery h3,
.detail-points h3,
.detail-data h3 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

/* 詳細コンテンツ */
.detail-content {
  margin: 3rem 0;
  font-size: 1rem;
  line-height: 1.8;
  color: #555;
}

.detail-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.gallery-grid img {
  border-radius: 10px;
  aspect-ratio: 1;
  object-fit: cover;
}

.detail-points ul {
  list-style: none;
  margin: 1.5rem 0;
}

.detail-points li {
  padding: 0.8rem 0;
  padding-left: 2rem;
  position: relative;
  color: #555;
  line-height: 1.8;
}

.detail-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #4a8f6f;
  font-weight: bold;
  font-size: 1.1rem;
}

.detail-data table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.detail-data th {
  text-align: left;
  padding: 0.8rem;
  background-color: #f0f0f0;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #4a8f6f;
}

.detail-data td {
  padding: 0.8rem;
  border-bottom: 1px solid #e0e0e0;
  color: #555;
}

/* プロジェクト情報のリンク */
.detail-data a {
  color: #4a8f6f;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.detail-data a:hover {
  border-bottom-color: #4a8f6f;
  transform: translateY(-1px);
}

.back-btn {
  margin: 3rem 0;
  text-align: center;
}

.back-btn a {
  display: inline-block;
  color: #4a8f6f;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border: 2px solid #4a8f6f;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.back-btn a:hover {
  background-color: #4a8f6f;
  color: white;
  transform: translateY(-2px);
}

/* 作品リンクボタン */
.detail-link {
  margin: 2rem 0;
  text-align: center;
}

.portfolio-link-btn {
  display: inline-block;
  background-color: #AA7E7E;
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.portfolio-link-btn:hover {
  background-color: #8c6060;
  color: white;
  transform: translateY(-2px);
}

/* ============================================
   レスポンシブデザイン
   ============================================ */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid img {
    aspect-ratio: 16/9;
  }

  .hero-sub {
    height: 250px;
  }

  .hero-sub h2 {
    font-size: 1.5rem;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-sub h2 {
    font-size: 1.2rem;
    padding: 1rem;
  }
}

/* ============================================
   タグ共通
   ============================================ */
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--category {
  background: #e8f3ee;
  color: #2e7d56;
}

.tag--role {
  background: #e8eef8;
  color: #2a5db0;
}

.tag--tech {
  background: #f0ece8;
  color: #8b4513;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.73rem;
}

.tag--tool {
  background: #f5f0f8;
  color: #6b3fa0;
}

.tag--type {
  background: #fef0e8;
  color: #c05c1a;
}

/* タグ内アイコン */
.tag-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 4px;
  object-fit: contain;
}

/* ============================================
   案件サマリー
   ============================================ */
.detail-summary {
  margin: 0 0 3rem;
}

.summary-card {
  padding: 1.75rem 2rem;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 10px;
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 0.9rem;
}

.summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-label {
  flex: 0 0 72px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #999;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 5px;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-text {
  flex: 1;
  font-size: 0.95rem;
  color: #444;
  margin: 0;
  line-height: 1.6;
}

/* 制作期間：合計+時期 */
.summary-period-block {
  flex: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.period-headline {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.period-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
}

.period-date {
  font-size: 0.82rem;
  color: #888;
  letter-spacing: 0.02em;
}

/* 内訳バッジ行 */
.period-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* 制作期間フェーズ */
.summary-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  margin: 0;
  padding: 0;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f0f4f8;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
}

.phase-name {
  color: #555;
  font-weight: 500;
}

.phase-sep {
  color: #bbb;
  font-size: 0.7rem;
}

.phase-duration {
  color: #4a8f6f;
  font-weight: 700;
}

/* ============================================
   背景・課題・対応
   ============================================ */
.detail-context {
  margin: 5rem 0 3rem;
}

.section-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid #4a8f6f;
  letter-spacing: 0.02em;
}

.context-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 1行目：背景・課題 */
.context-row-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* 2行目：対応（全幅） */
.context-row-bottom {
  display: grid;
  grid-template-columns: 1fr;
}

.context-block {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 10px;
}

.context-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2e6b4a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.context-text {
  font-size: 0.9rem;
  line-height: 1.85;
  color: #555;
  margin: 0;
}

/* ============================================
   成果物セクション
   ============================================ */
.detail-deliverables {
  margin: 5rem 0 3rem;
}

.deliverable-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 成果物間の区切りライン */
.deliverable-divider {
  border: none;
  border-top: 1px solid #bdd1b9;
  margin: 3rem 0;
}

.deliverable-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  scroll-margin-top: 90px;
}

/* 奇数番目：画像左 （デフォルト） */
.deliverable-item--odd {
  direction: ltr;
}

/* 偶数番目：画像右 */
.deliverable-item--even {
  direction: rtl;
}

.deliverable-item--even > * {
  direction: ltr;
}

.deliverable-image {
  border-radius: 10px;
  overflow: hidden;
  align-self: center;
}

.deliverable-image img {
  width: 100%;
  height: auto;
  display: block;
}

.deliverable-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  align-self: start;
}

/* 画像非表示時は1カラム */
.deliverable-item--no-image {
  grid-template-columns: 1fr !important;
  direction: ltr !important;
}

.deliverable-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.deliverable-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.deliverable-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.deliverable-meta-label {
  flex: 0 0 4.5em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #999;
  letter-spacing: 0.05em;
  padding-top: 4px;
}

.deliverable-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* 成果物タグに細枚線 */
.deliverable-meta .tag {
  border: 1px solid currentColor;
  opacity: 0.9;
}

.deliverable-desc {
  font-size: 0.9rem;
  line-height: 1.85;
  color: #555;
  margin: 0;
}

/* 成果物→自由記述 区切り */
.section-separator {
  border: none;
  border-top: 2px solid #d8d8d8;
  margin: 4rem 0;
  position: relative;
}

.section-separator::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: #4a8f6f;
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
}

/* ============================================
   成果物カテゴリ（アコーディオン）
   ============================================ */
.deliverable-category {
  margin-bottom: 1.5rem;
  border: 1px solid #bdd1b9;
  border-radius: 6px;
  overflow: hidden;
}

/* ヘッダー（カテゴリ名 + タイトル一覧 + トグルボタン） */
.deliverable-category__header {
  display: flex;
  align-items: stretch;
  background: #f7f7f7;
  cursor: pointer;
}

/* カテゴリ名 */
.deliverable-category__name {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.02em;
}

/* トグルボタン（▾のみ、右端） */
.deliverable-category__toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  border-left: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 0.75rem 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.deliverable-category__toggle:hover {
  background: #ededed;
}

/* 開閉インジケータ */
.deliverable-category__arrow {
  font-size: 1.75rem;
  color: #999;
  transition: transform 0.2s ease;
  display: inline-block;
  line-height: 1;
}

.deliverable-category__arrow::before {
  content: '▾';
}

.deliverable-category__toggle[aria-expanded="true"] .deliverable-category__arrow {
  transform: rotate(180deg);
}

/* タイトル一覧 */
.deliverable-category__title-list {
  list-style: none;
  margin: 0;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  flex: 1;
}

.deliverable-category__title-list li {
  font-size: 0.78rem;
  white-space: nowrap;
}

.deliverable-category__title-list li + li::before {
  content: '/';
  margin-right: 1rem;
  color: #ccc;
}

.deliverable-category__title-list a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.15s;
}

.deliverable-category__title-list a:hover {
  color: #4a8f6f;
  text-decoration: underline;
}

/* アコーディオン本体 */
.deliverable-category__body {
  border-top: 1px solid #e0e0e0;
  padding: 1.75rem 1.5rem 1.5rem;
}

/* 画像プレースホルダー */
.deliverable-image--placeholder {
  background: #f0f0f0;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
}

.deliverable-image__placeholder-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
}

/* ============================================
   サブ見出し＋テキストブロック
   ============================================ */
.detail-subblock {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  border-left: 3px solid #4a8f6f;
  background: #f7faf9;
  border-radius: 14px;
}

.detail-subblock__heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #4a8f6f;
  letter-spacing: 0.02em;
  margin: 0 0 0.4rem;
}

.detail-subblock__text {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #555;
  margin: 0;
}

.detail-subblock__text p {
  margin: 0 0 0.5em;
}

.detail-subblock__text p:last-child {
  margin-bottom: 0;
}

.detail-subblock__text ul,
.detail-subblock__text ol {
  padding-left: 1.4em;
  margin: 0.3em 0 0.5em;
}

.detail-subblock__text li {
  margin-bottom: 0.15em;
}

/* wysiwyg コンテンツのスタイル（context-text / deliverable-desc） */
.context-text p,
.deliverable-desc p {
  margin: 0 0 0.75em;
  font-size: 0.9rem;
  line-height: 1.85;
  color: #555;
}

.context-text p:last-child,
.deliverable-desc p:last-child {
  margin-bottom: 0;
}

.context-text ul,
.context-text ol,
.deliverable-desc ul,
.deliverable-desc ol {
  padding-left: 1.4em;
  margin: 0.4em 0 0.75em;
  font-size: 0.9rem;
  color: #555;
}

.context-text strong,
.deliverable-desc strong,
.detail-subblock__text strong {
  font-weight: 700;
  color: #333;
}

/* タグ：リンク化 */
.tag--link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.tag--link:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}

/* チップ内文字は改行なし */
.related-works__group-tag,
.related-works__group-subtype {
  white-space: nowrap;
}

/* 関連作品回遊エリア
   ============================================ */
.related-works {
  margin: 4rem 0 2rem;
  scroll-margin-top: 80px;
}

.related-works__heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid #4a8f6f;
  letter-spacing: 0.02em;
}

.related-works__filter-reset {
  display: none;
}

/* グループ（タグ別ブロック） */
.related-works__group {
  margin-bottom: 2.5rem;
  scroll-margin-top: 90px;
}

.related-works__group-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0;
}

.related-works__group-heading::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #4a8f6f;
  border-radius: 2px;
  vertical-align: middle;
  font-size: 14px;
}

.related-works__group-subtype {
  font-size: 0.72rem;
  font-weight: 700;
  color: #999;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease;
}

.related-works__group-subtype:hover {
  color: #555;
}

.related-works__group-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a8f6f;
  background: #edf5f1;
  border: 1px solid #b8d8c8;
  border-radius: 4px;
  padding: 0.2rem 0.75rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.related-works__group-tag:hover {
  background-color: #d4eee3;
  border-color: #7db89a;
  transform: translateY(-1px);
}

.related-works__group-tag.is-active-filter {
  background-color: #4a8f6f;
  border-color: #4a8f6f;
  color: white;
}

.related-works__group-tag--category {
  color: #2e6b50;
  background: #e0f0e8;
  border-color: #9ecdb5;
}

.related-works__group-tag--category:hover {
  background-color: #b8deca;
  border-color: #6aab88;
}

.related-works__group-tag--category.is-active-filter {
  background-color: #2e6b50;
  border-color: #2e6b50;
  color: white;
}

.related-works__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.related-works__card {
  display: block;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ebebeb;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: #fff;
}

.related-works__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.related-works__thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0f0f0;
}

.related-works__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.related-works__card:hover .related-works__thumb img {
  transform: scale(1.04);
}

.related-works__info {
  padding: 0.85rem 1rem;
}

.related-works__cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #4a8f6f;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.related-works__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   レスポンシブ（追加分）
   ============================================ */
@media (max-width: 768px) {
  .portfolio-title {
    font-size: 1.5rem;
  }

  .section-heading {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .detail-intro__body {
    font-size: 0.88rem;
  }

  /* 自由記載セクション：本文と同程度のサイズに */
  .detail-content {
    font-size: 0.88rem;
    line-height: 1.75;
  }

  .context-text {
    font-size: 0.85rem;
  }

  .deliverable-title {
    font-size: 1rem;
  }

  .deliverable-desc {
    font-size: 0.82rem;
  }

  .related-works__title {
    font-size: 0.82rem;
  }

  .related-works__grid {
    gap: 0.75rem;
  }

  /* 関連作品グループ：緯ライン+項目名を同行、チップを次行に */
  .related-works__group-heading {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
  }

  .related-works__group-heading::before {
    order: 0;
    align-self: center;
    margin-top: 0;
    flex-shrink: 0;
  }

  .related-works__group-subtype {
    order: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    margin-bottom: 0;
  }

  /* ::afterをスペーサーに使い、チップを次行へ押し出す */
  .related-works__group-heading::after {
    content: '';
    flex: 0 0 100%;
    height: 0;
    order: 1;
  }

  .related-works__group-tag {
    order: 2;
    flex-shrink: 0;
  }

  .summary-row {
    flex-direction: column;
    gap: 0.35rem;
  }

  .summary-label {
    flex: none;
  }

  .context-row-top {
    grid-template-columns: 1fr;
  }

  .deliverable-item--odd,
  .deliverable-item--even {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .related-works__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .related-works__grid {
    grid-template-columns: 1fr 1fr;
  }
}
