/* WORKS詳細ページ：旧サイトの装飾を再現 */

body.single-works .tata-project-body {
  color: #263b35;
}

body.single-works .tata-project-body h2 {
  margin: 52px 0 18px !important;
  font-size: 26px;
  font-weight: 600;
}

body.single-works .tata-project-body h3 {
  color: #368a76;
  font-weight: 600;
}

/* 旧サイトのカード */
body.single-works .portfolio-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

body.single-works .portfolio-panel {
  background: #f4f8f3;
  border: 1px solid #dce9df;
  border-radius: 18px;
  padding: 24px;
}

body.single-works .portfolio-panel h3 {
  color: #368a76;
  margin: 0 0 12px;
}

body.single-works .portfolio-panel p {
  margin: 0;
  line-height: 1.9;
}

/* Gutenbergのカラムをカード表示 */
body.single-works .tata-project-body .wp-block-columns {
  gap: 16px !important;
}

body.single-works .tata-project-body .wp-block-columns > .wp-block-column {
  background: #f4f8f3;
  border: 1px solid #dce9df;
  border-radius: 18px;
  padding: 24px;
  min-width: 0;
}

body.single-works .tata-project-body .wp-block-columns h3,
body.single-works .tata-project-body .wp-block-columns h4 {
  color: #368a76 !important;
  margin-top: 0 !important;
}

/* テーブルをカード風に表示 */
body.single-works .tata-project-body .wp-block-table table {
  border-collapse: separate !important;
  border-spacing: 10px !important;
  border: none !important;
}

body.single-works .tata-project-body .wp-block-table td,
body.single-works .tata-project-body .wp-block-table th {
  background: #f4f8f3 !important;
  border: 1px solid #dce9df !important;
  border-radius: 14px;
  padding: 20px !important;
  vertical-align: top;
}

body.single-works .tata-project-body .wp-block-table th,
body.single-works .tata-project-body .wp-block-table td:first-child {
  color: #368a76;
  font-weight: 600;
}

/* 旧サイトの構成図 */
body.single-works .portfolio-architecture {
  background: #f4f8f3;
  border: 1px solid #dce9df;
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  margin-top: 24px;
}

body.single-works .architecture-node {
  display: inline-block;
  background: #fff;
  border: 2px solid #8fb9a6;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 700;
}

body.single-works .architecture-arrow {
  color: #368a76;
  font-size: 25px;
  margin: 12px;
}

body.single-works .portfolio-note {
  color: #687b72;
  font-size: 13px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  body.single-works .portfolio-grid {
    grid-template-columns: 1fr;
  }

  body.single-works .portfolio-panel,
  body.single-works .tata-project-body .wp-block-columns > .wp-block-column {
    padding: 20px;
  }

  body.single-works .tata-project-body .wp-block-columns {
    flex-direction: column;
  }

  body.single-works .tata-project-body .wp-block-table {
    overflow-x: auto;
  }
}

/* WORKS編集用カードパターン */
body.single-works .tata-work-card-columns {
    gap: 16px;
}

body.single-works .tata-work-card {
    height: 100%;
    box-sizing: border-box;
    background: #f4f8f3;
    border: 1px solid #dce9df;
    border-radius: 18px;
    padding: 24px;
}

body.single-works .tata-work-card h3 {
    margin: 0 0 12px !important;
    color: #368a76 !important;
    font-size: 17px;
}

body.single-works .tata-work-card p {
    margin: 0;
    color: #52665b;
    line-height: 1.9;
}

/* WORKS編集用カードパターン */
body.single-works .tata-work-card-columns {
    gap: 16px;
}

body.single-works .tata-work-card {
    height: 100%;
    box-sizing: border-box;
    background: #f4f8f3;
    border: 1px solid #dce9df;
    border-radius: 18px;
    padding: 24px;
}

body.single-works .tata-work-card h3 {
    margin: 0 0 12px !important;
    color: #368a76 !important;
    font-size: 17px;
}

body.single-works .tata-work-card p {
    margin: 0;
    color: #52665b;
    line-height: 1.9;
}

/* タイトル直下の概要文 */
body.single-works .tata-project-intro {
    max-width: 680px !important;
    margin: 16px 0 18px !important;
    color: #697c73 !important;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.9;
}

body.single-works .tata-project-intro p {
    margin: 0 !important;
    color: inherit !important;
    line-height: inherit;
}

/* 制作日との余白 */
body.single-works .tata-project-meta {
    margin-top: 0 !important;
    margin-bottom: 30px !important;
}

/* WORKS詳細：メイン画像を拡大 */
body.single-works .tata-project-image {
    width: 100% !important;
    max-width: 900px !important;
    margin: 40px auto 60px !important;
}

body.single-works .tata-project-image img {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
}

/* 画像を囲むコンテナの幅制限を解除 */
body.single-works .tata-project-container {
    max-width: 1120px !important;
}

@media (max-width: 800px) {
    body.single-works .tata-project-image {
        width: 100% !important;
        max-width: 100% !important;
        margin: 28px auto 40px !important;
    }
}

/* WORKS詳細：旧サイトと同じ横幅のメイン画像 */
body.single-works .tata-project-image {
    width: 100% !important;
    max-width: 1120px !important;
    margin: 48px auto 70px !important;
}

body.single-works .tata-project-image img {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    border-radius: 30px;
}

/* 画像の親コンテナも拡大 */
body.single-works .tata-project-container {
    width: min(1120px, calc(100% - 40px)) !important;
    max-width: 1120px !important;
}

/* WORKS詳細：本文の画像ブロックを幅広表示できるようにする */
@media (min-width: 801px) {
  body.single-works .tata-project-body .wp-block-post-content > .wp-block-image.alignwide {
    width: min(1120px, calc(100vw - 64px)) !important;
    max-width: none !important;
    margin-left: 50% !important;
    transform: translateX(-50%);
  }
}

/* 画像はブロックの横幅に合わせる */
body.single-works .tata-project-body .wp-block-image.alignwide img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 30px;
}

/* スマホでは画面幅に合わせる */
@media (max-width: 800px) {
  body.single-works .tata-project-body .wp-block-image.alignwide {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    transform: none !important;
  }
}

/* WORKS詳細：技術タグ */
.tata-project-detail .tata-project-tags {
    margin-top: 12px;
    margin-bottom: 28px;
}

.tata-project-detail .tata-technology-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tata-project-detail .tata-technology-terms a {
    display: inline-block;
    padding: 7px 13px;
    background: #e0efe6;
    color: #368a76;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}


/* WORKS詳細：技術タグの位置・色・区切り文字を調整 */
.tata-project-detail .tata-project-tags {
    width: 100%;
    max-width: none;
    margin: 12px 0 28px !important;
    padding: 0 !important;
}

.tata-project-detail .tata-project-tags .wp-block-post-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0;
    line-height: 1;
}

/* WordPressが出力する区切り文字を非表示 */
.tata-project-detail .tata-technology-terms .wp-block-post-terms__separator {
    display: none !important;
}

/* グレーのタグ */
.tata-project-detail .tata-technology-terms a {
    display: inline-flex;
    align-items: center;
    background: #e5e7e9 !important;
    color: #59636a !important;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    margin: 0 !important;
}

.tata-project-detail .tata-technology-terms a:hover {
    background: #d7dbde !important;
    color: #39434a !important;
}

