/* ===== Header（Fixed + 縮小） ===== */
/* ヘッダーの高さをCSS変数で管理 */
:root {
  --header-height-mobile: 80px; /* 400px以下: padding 25px × 2 + ロゴ高さ約30px */
  --header-height-small: 85px; /* 401px-640px: padding 25px × 2 + ロゴ高さ約35px */
  --header-height-medium: 95px; /* 641px-1024px: padding 25px × 2 + ロゴ高さ約45px */
  --header-height-large: 105px; /* 1025px以上: padding 25px × 2 + ロゴ高さ約55px */
}

.site-header,
.wp-block-group.has-base-background-color.has-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: #ffffff !important;
  border-bottom: none !important;
  transition: padding 0.3s ease;
  padding-block: 24px;
}

.site-header.is-compact {
  padding-block: 16px;
  background: #ffffff !important;
}

/* メインコンテンツにヘッダー分のスペースを確保 */
main,
main.wp-block-group,
.tpl-archive-project,
.tpl-archive-news,
.tpl-contact {
  padding-top: 84px; /* ヘッダーの高さ分（padding 24px × 2 + コンテンツ高さ約36px） */
}

/* トップページとaboutページは最初のセクションがヘッダーの直下に来るようにpadding-topを0に */
.tpl-front,
.tpl-company {
  padding-top: 0;
}

.site-brand {
  font-weight: 400;
  letter-spacing: 0.1em;
  font-size: clamp(14px, 1.5vw, 16px);
  text-transform: uppercase;
}

/* ===== Header Logo（レスポンシブ対応） ===== */
.header-logo-img {
  width: 120px;
  height: auto;
}

@media (min-width: 641px) {
  .header-logo-img {
    width: 180px;
  }
}

.site-nav a {
  padding: 8px 16px;
  display: inline-block;
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.site-nav a:hover {
  opacity: 0.6;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 0;
  border: 1px solid var(--c-fg);
  background: transparent;
  color: var(--c-fg);
  transition: all 0.3s ease;
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn:hover {
  background: var(--c-fg);
  color: var(--c-bg);
}

.btn-primary {
  background: var(--c-fg);
  color: var(--c-bg);
}

.btn-primary:hover {
  background: transparent;
  color: var(--c-fg);
}

.btn-text {
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.all-link {
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
}

.all-link a {
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease;
}

.all-link a:hover {
  opacity: 0.6;
}

/* ===== Cards ===== */
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  opacity: 0.9;
}

.project-card .thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 0;
  border: none;
  background: var(--c-gray);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-card .title {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 400;
  margin: 0;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.project-card .subtitle {
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  text-transform: none;
  opacity: 0.7;
  line-height: 1.6;
  margin-top: var(--space-2);
}

.project-card .roles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.role-chip {
  font-size: 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  padding: 2px 10px
}

.news-item {
  border-top: 1px solid var(--c-border);
  padding-block: 24px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  transition: opacity 0.2s ease;
}

.news-item:hover {
  opacity: 0.7;
}

.news-item:last-child {
  border-bottom: 1px solid var(--c-border);
}

.news-meta {
  font-size: clamp(12px, 1.3vw, 14px);
  opacity: 0.6;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.news-title {
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.02em;
}

@media (max-width:640px) {
  .news-item {
    grid-template-columns: 1fr;
    gap: 8px
  }
}
/* .news-thumb に画像が無い場合は1カラムに切替 */
.news-item:not(:has(.news-thumb img)) {
  grid-template-columns: 1fr;
}

.news-item:not(:has(.news-thumb img)) .news-thumb {
  display: none;
}

/* ===== Project band（一覧ページで使っている帯スタイルを流用可） ===== */
.project-band {
  position: relative;
  padding: 32px 40px;
  margin-bottom: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: #fff;
  overflow: hidden;
}

.project-band .wp-block-columns {
  align-items: center;
  gap: 24px
}
/* ===== topページ ===== */
/* TOPの Projects に入ったカードだけ角丸＆白カードに */
/* ===== FRONT PAGE: Projects セクション - archive-projectと同じデザイン ===== */
.tpl-front .sec-top-projects .project-card,
.tpl-archive-project .sec-archive-projects .project-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row; /* 全デバイスで横並び */
  align-items: center !important; /* cardの高さの中央揃え */
  gap: var(--space-4);
  border-radius: var(--r-marubi);
  background: #fff;
  border: 1px solid var(--c-border);
  /* 黒の細線でラグジュアリー感 */
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  padding: var(--space-4);
  /* 高さを自動調整 */
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  /* 右側からスライドインのアニメーション用（透明度は変更しない） */
  opacity: 1;
  transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* カード内のサムネも角丸に - 全デバイス共通 */
.tpl-front .sec-top-projects .project-card .thumb,
.tpl-archive-project .sec-archive-projects .project-card .thumb {
  flex-shrink: 0;
  width: 30%; /* cardの30%を使用（PCと同じ） */
  height: auto;
  aspect-ratio: 16/9;
  border-radius: var(--r-marubi-inner);
  border: 1px solid var(--c-border);
  overflow: hidden; /* パディングを設けるためhiddenに変更 */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: var(--space-2); /* 画像と枠の間にパディングを追加 */
  box-sizing: border-box; /* パディングを含めたサイズ計算 */
  align-self: center; /* 画像を中央揃え */
}

.tpl-front .sec-top-projects .project-card .thumb figure,
.tpl-front .sec-top-projects .project-card .thumb .wp-block-post-featured-image,
.tpl-front .sec-top-projects .project-card .thumb .wp-block-post-featured-image figure,
.tpl-archive-project .sec-archive-projects .project-card .thumb figure,
.tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image,
.tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image figure {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.tpl-front .sec-top-projects .project-card .thumb img,
.tpl-front .sec-top-projects .project-card .thumb figure img,
.tpl-front .sec-top-projects .project-card .thumb .wp-block-post-featured-image img,
.tpl-archive-project .sec-archive-projects .project-card .thumb img,
.tpl-archive-project .sec-archive-projects .project-card .thumb figure img,
.tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* プロジェクトコンテンツ - 全デバイス共通 */
.tpl-front .sec-top-projects .project-card .project-content,
.tpl-archive-project .sec-archive-projects .project-card .project-content {
  flex: 1;
  width: 70%; /* cardの70%を使用（PCと同じ） */
  max-width: 70%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: flex-start !important;
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-right: var(--space-4); /* 画像の左側のマージンと等しくする */
  align-items: flex-start;
  text-align: left;
}

/* プロジェクトタイトル */
.tpl-front .sec-top-projects .project-card .title,
.tpl-archive-project .sec-archive-projects .project-card .title {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: left; /* デフォルトは左寄せ */
  width: 100%;
}

/* PC表示時：タイトルを中央寄せ */
@media (min-width: 1025px) {
  .tpl-front .sec-top-projects .project-card .title,
  .tpl-archive-project .sec-archive-projects .project-card .title {
    text-align: center !important;
  }
}

/* プロジェクト説明文 - 全文表示を確実にする */
.tpl-front .sec-top-projects .project-card .subtitle,
.tpl-front .sec-top-projects .project-card .wp-block-post-excerpt.subtitle,
.tpl-front .sec-top-projects .project-card .wp-block-post-excerpt.subtitle p,
.tpl-front .sec-top-projects .project-card .wp-block-post-excerpt__excerpt,
.tpl-front .sec-top-projects .project-card .wp-block-post-excerpt,
.tpl-front .sec-top-projects .project-card .wp-block-post-excerpt *,
.tpl-archive-project .sec-archive-projects .project-card .subtitle,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle p,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt__excerpt,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt * {
  margin: 0 !important;
  text-align: left !important;
  font-size: clamp(14px, 1.8vw, 18px) !important;
  line-height: 1.8 !important;
  letter-spacing: 0.02em !important;
  color: #000000 !important; /* 黒色に変更 */
  opacity: 1 !important; /* 不透明度を1に変更 */
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  display: block !important;
  /* -webkit-line-clampを完全に無効化 */
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  max-height: none !important;
  height: auto !important;
  min-height: auto !important;
  /* display: -webkit-boxを無効化 */
}

/* wp-block-post-excerptをproject-content内で中央配置（テキストは左寄せのまま） */
.tpl-front .sec-top-projects .project-card .project-content .wp-block-post-excerpt,
.tpl-archive-project .sec-archive-projects .project-card .project-content .wp-block-post-excerpt {
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100%;
  max-width: 100%;
}

/* インスタグラムCTA */
.tpl-front .sec-top-projects .project-card .project-instagram-link,
.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link {
  margin: 0;
  margin-top: auto;
}

.tpl-front .sec-top-projects .project-card .project-instagram-link a,
.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 40px;
  height: 40px;
  padding: 0;
  background: #E4405F;
  color: #ffffff;
  text-decoration: none;
  border-radius: 50%;
  font-size: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tpl-front .sec-top-projects .project-card .project-instagram-link a:hover,
.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link a:hover {
  opacity: 0.9;
  transform: translateY(-1px) scale(1.05);
}

.tpl-front .sec-top-projects .project-card .project-instagram-link a svg,
.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.tpl-front .sec-top-projects .project-card .project-instagram-link:empty,
.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link:empty {
  display: none;
}

/* タブレット表示時（641px - 1024px）：PCと同様に横並び */
@media (min-width: 641px) and (max-width: 1024px) {
  /* Gridアイテムとして全てのカードの高さを統一 */
  .tpl-front .wp-block-post-template > *,
  .tpl-archive-project .wp-block-post-template > * {
    display: flex !important;
    flex-direction: column !important; /* 縦方向に配置（プロジェクトカードと商品セクション） */
    align-items: stretch !important;
  }
  
  /* プロジェクトカードのみ高さを統一 */
  .tpl-front .wp-block-post-template > * > .project-card,
  .tpl-archive-project .wp-block-post-template > * > .project-card {
    flex-shrink: 0 !important; /* プロジェクトカードの高さを固定 */
  }
  
  .tpl-front .sec-top-projects .project-card,
  .tpl-archive-project .sec-archive-projects .project-card {
    flex-direction: row; /* タブレットも横並び */
    gap: var(--space-5);
    align-items: stretch !important; /* 全てのカードの高さを2番目のプロジェクトと同じにする */
    height: 100% !important; /* 親要素の高さに合わせる */
  }

  .tpl-front .sec-top-projects .project-card .thumb,
  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    width: 30%; /* cardの30%を使用（PCと同じ） */
    height: auto;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    align-self: center; /* 画像を中央揃え */
  }

  .tpl-front .sec-top-projects .project-card .project-content,
  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    flex: 1;
    width: 70%; /* cardの70%を使用（PCと同じ） */
    max-width: 70%;
    padding-right: var(--space-4); /* 画像の左側のマージンと等しくする */
  }

  /* タイトルを中央寄せ */
  .tpl-front .sec-top-projects .project-card .title,
  .tpl-archive-project .sec-archive-projects .project-card .title {
    text-align: center !important;
    width: 100%;
  }
}

/* PC表示時（1025px以上）：横並び */
@media (min-width: 1025px) {
  /* Gridアイテムとして全てのカードの高さを統一 */
  .tpl-front .wp-block-post-template > *,
  .tpl-archive-project .wp-block-post-template > * {
    display: flex !important;
    flex-direction: column !important; /* 縦方向に配置（プロジェクトカードと商品セクション） */
    align-items: stretch !important;
  }
  
  /* プロジェクトカードのみ高さを統一 */
  .tpl-front .wp-block-post-template > * > .project-card,
  .tpl-archive-project .wp-block-post-template > * > .project-card {
    flex-shrink: 0 !important; /* プロジェクトカードの高さを固定 */
  }
  
  .tpl-front .sec-top-projects .project-card,
  .tpl-archive-project .sec-archive-projects .project-card {
    flex-direction: row; /* PCは横並び */
    gap: var(--space-5);
    align-items: stretch !important; /* 全てのカードの高さを2番目のプロジェクトと同じにする */
    height: auto !important; /* 高さを自動調整（商品セクションに影響されない） */
    flex-shrink: 0 !important; /* プロジェクトカードは縮小しない */
  }

  .tpl-front .sec-top-projects .project-card .thumb,
  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    width: 30%; /* cardの30%を使用 */
    height: auto;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    align-self: center; /* 画像を中央揃え */
  }

  .tpl-front .sec-top-projects .project-card .project-content,
  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    flex: 1;
    width: 70%; /* cardの70%を使用 */
    max-width: 70%;
    padding-right: var(--space-4); /* 画像の左側のマージンと等しくする */
  }

  .tpl-front .sec-top-projects .project-card .title,
  .tpl-archive-project .sec-archive-projects .project-card .title {
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.03em;
    text-align: center !important; /* PC表示時は中央寄せ */
  }

  .tpl-front .sec-top-projects .project-card .subtitle,
  .tpl-front .sec-top-projects .project-card .wp-block-post-excerpt.subtitle,
  .tpl-front .sec-top-projects .project-card .wp-block-post-excerpt.subtitle p,
  .tpl-front .sec-top-projects .project-card .wp-block-post-excerpt__excerpt,
  .tpl-front .sec-top-projects .project-card .wp-block-post-excerpt,
  .tpl-front .sec-top-projects .project-card .wp-block-post-excerpt *,
  .tpl-archive-project .sec-archive-projects .project-card .subtitle,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle p,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt__excerpt,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt * {
    font-size: clamp(16px, 2vw, 22px) !important;
    line-height: 1.8 !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    height: auto !important;
    min-height: auto !important;
    display: block !important;
  }
}

/* ===== FRONT PAGE: スマホ表示時（640px以下） - archive-projectと同じデザイン ===== */
@media (max-width: 640px) {
  /* 画像とタイトルを同じ行に配置（gridで統一） */
    .tpl-front .sec-top-projects .project-card,
    .tpl-archive-project .sec-archive-projects .project-card {
      display: grid !important;
grid-template-columns: max-content minmax(0, 1fr) !important;
  grid-template-rows: auto auto;
      gap: var(--space-2) !important;
      position: relative;
  
      /* flex系は書かない（意味がない＆混乱の元） */
      padding: var(--space-2);
      min-height: auto;
      height: auto;
    }

  .tpl-front .sec-top-projects .project-card .thumb {
    width: auto !important;
    height: 70px !important;
    aspect-ratio: unset !important;
    flex-shrink: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--space-2) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: transparent !important;
    align-self: flex-start !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  
  /* 全てのプロジェクトカードの画像マージンを統一 */
  .tpl-front .sec-top-projects .project-card .thumb,
  .tpl-front .sec-top-projects .project-card:nth-child(1) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-child(2) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-child(3) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-child(4) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-of-type(1) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-of-type(3) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-of-type(4) .thumb {
    padding-left: var(--space-2) !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
  }

    /* thumb内の画像を高さ70pxに合わせて自然な比率で表示 */
    .tpl-front .sec-top-projects .project-card .thumb img,
    .tpl-front .sec-top-projects .project-card .thumb figure img,
    .tpl-archive-project .sec-archive-projects .project-card .thumb img,
    .tpl-archive-project .sec-archive-projects .project-card .thumb figure img {
      height: 70px !important;
      width: auto !important;
      max-width: none !important;
      object-fit: contain !important;
      display: block !important;
    }

  .tpl-front .sec-top-projects .project-card .thumb figure {
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
    .tpl-front .sec-top-projects .project-card .thumb figure,
    .tpl-archive-project .sec-archive-projects .project-card .thumb figure {
      height: 70px !important;
      width: auto !important;
      margin: 0 !important;
    }
  /* 2つ目のプロジェクトカードの画像右側のマージンを削除 */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .thumb,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .thumb {
    margin-right: 0 !important;
    padding-right: 0 !important;
  }
  
  /* 2つ目のプロジェクトカードのGrid gapを調整 */
  .tpl-front .sec-top-projects .project-card:nth-child(2),
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) {
    column-gap: 0 !important;
  }

  .tpl-front .sec-top-projects .project-card .thumb {
    grid-column: 1;
    grid-row: 1;
    align-self: flex-start !important;
  }

  .tpl-front .sec-top-projects .project-card .project-content {
    grid-column: 2;
    grid-row: 1;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: contents !important; /* Gridの子要素として直接配置 */
  }

  /* タイトルを2列目1行目に配置 */
  .tpl-front .sec-top-projects .project-card .title {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: 100% !important;
    font-size: clamp(16px, 2vw, 24px) !important; /* フォントサイズを小さくして1行表示に */
    line-height: 1.2 !important; /* 行間を縮める */
    min-height: 70px !important; /* 画像の高さ（70px）に合わせる */
    height: 70px !important; /* 画像の高さ（70px）に合わせる */
    white-space: nowrap !important; /* 1行表示 */
    overflow: hidden !important; /* はみ出しを隠す */
    text-overflow: ellipsis !important; /* 省略記号を表示 */
    display: flex !important; /* flexboxで中央揃え */
    align-items: center !important; /* 縦方向中央揃え */
    justify-content: flex-start !important; /* 横方向左揃え */
  }
  
  /* 2つ目のプロジェクトタイトルから「by TOKIMEKI」を非表示（スマホのみ） */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .title,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .title {
    position: relative;
  }
  
  .tpl-front .sec-top-projects .project-card:nth-child(2) .title::after,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .title::after {
    content: '';
    display: none;
  }

  /* テキストを全列2行目に配置 */
  .tpl-front .sec-top-projects .project-card .wp-block-post-excerpt {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ===== ARCHIVE PROJECT: スマホ表示時（640px以下） ===== */
@media (max-width: 640px) {
  .tpl-archive-project .sec-archive-projects .project-card {
    flex-direction: column !important; /* 縦方向に変更 */
    gap: var(--space-2) !important;
    min-height: auto;
    height: auto;
    align-items: stretch !important;
    padding: var(--space-2);
    padding-bottom: calc(var(--space-2) + 40px) !important; /* ボタンのスペースを確保 */
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    width: auto !important;
    height: 70px !important;
    aspect-ratio: unset !important;
    flex-shrink: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--space-2) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: transparent !important;
    align-self: flex-start !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  
  /* 全てのプロジェクトカードの画像マージンを統一 */
  .tpl-archive-project .sec-archive-projects .project-card .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(1) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(3) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(4) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(1) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(3) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(4) .thumb {
    padding-left: var(--space-2) !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb figure {
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  
  /* 画像とタイトルを同じ行に配置 */
  .tpl-archive-project .sec-archive-projects .project-card {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-2) !important;
    position: relative;
  }
  
  /* 2つ目のプロジェクトカードの画像右側のマージンを削除 */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .thumb {
    margin-right: 0 !important;
    padding-right: 0 !important;
  }
  
  /* 2つ目のプロジェクトカードのGrid gapを調整 */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2),
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) {
    column-gap: 0 !important;
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    grid-column: 1;
    grid-row: 1;
    align-self: flex-start !important;
  }

  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    grid-column: 2;
    grid-row: 1;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: contents !important; /* Gridの子要素として直接配置 */
  }

  /* タイトルを2列目1行目に配置 */
  .tpl-archive-project .sec-archive-projects .project-card .title {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: 100% !important;
    font-size: clamp(16px, 2vw, 24px) !important;
    line-height: 1.2 !important;
    min-height: 70px !important;
    height: 70px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  
  /* 2つ目のプロジェクトタイトルから「by TOKIMEKI」を非表示（スマホのみ） */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .title,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .title {
    position: relative;
  }
  
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .title::after,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .title::after {
    content: '';
    display: none;
  }

  /* テキストを全列2行目に配置 */
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* ボタンはグリッドの影響を受けない独立ブロックとして配置 */
  .tpl-front .sec-top-projects .project-card .project-external-links,
  .tpl-archive-project .sec-archive-projects .project-card .project-external-links {
    position: absolute !important; /* グリッドの影響を受けない絶対配置 */
    bottom: 4px !important; /* カードの下部に配置（8pxから4pxに縮小） */
    left: 12px !important;
    right: 0 !important;
    width: 100% !important;
    display: flex !important;
    align-items: flex-end !important; /* 下揃え */
    justify-content: space-between !important; /* 左右に配置 */
    gap: var(--space-2) !important;
    margin-top: 0 !important;
    z-index: 1 !important;
    pointer-events: auto !important;
  }

  /* 2つ目のプロジェクト：Web/Instaボタングループを左側に配置（スマホ） */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-external-links .project-left-buttons,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-external-links .project-left-buttons,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links .project-left-buttons,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links .project-left-buttons {
    display: flex !important;
    align-items: flex-end !important; /* グループ内の下揃え */
    gap: var(--space-2) !important;
    margin-right: auto !important; /* 左寄せ */
    align-self: flex-end !important; /* 親要素内で下揃え */
    height: auto !important;
    min-height: 36px !important;
  }


  /* 2つ目のプロジェクト：project-external-linksを基準点にする */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-external-links,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-external-links,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links {
    position: relative !important; /* 基準点として設定 */
  }

  /* 2つ目のプロジェクト：Webボタンを▼ボタンと同じ位置（bottom: 4px）に配置（スマホ） */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-external-links .project-website-btn,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-external-links .project-website-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links .project-website-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links .project-website-btn {
    position: absolute !important;
    bottom: 0 !important; /* project-external-linksの下端に配置 */
    left: 0px !important; /* 左側に配置 */
    height: 36px !important; /* ▼ボタンと同じ高さ */
    padding: 0 var(--space-3) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
  }

  /* 2つ目のプロジェクト：Instagramボタンを▼ボタンと同じ位置（bottom: 4px）に配置（スマホ） */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-external-links .project-instagram-btn,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-external-links .project-instagram-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links .project-instagram-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links .project-instagram-btn {
    position: absolute !important;
    bottom: 0 !important; /* project-external-linksの下端に配置 */
    left: calc(8px + 60px + 8px) !important; /* Webボタンの右隣（8px + Webボタン幅60px + gap 8px） */
    width: 36px !important;
    height: 36px !important; /* ▼ボタンと同じ高さ */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
  }
}

/* ===== ARCHIVE: Projects ページ - PCと同様に横並び ===== */
.tpl-archive-project .sec-archive-projects .project-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row; /* 全デバイスで横並び */
  align-items: center !important; /* デフォルトは中央揃え（PC/タブレット時はstretchで上書き） */
  gap: var(--space-4);
  border-radius: var(--r-marubi);
  background: #fff;
  border: 1px solid var(--c-border);
  /* 黒の細線でラグジュアリー感 */
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  padding: var(--space-4);
  /* 高さを自動調整 */
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  /* 右側からスライドインのアニメーション用（透明度は変更しない） */
  opacity: 1;
  transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* カード内のサムネも角丸に - 全デバイス共通 */
.tpl-archive-project .sec-archive-projects .project-card .thumb {
  flex-shrink: 0;
  width: 30%; /* cardの30%を使用（PCと同じ） */
  height: auto;
  aspect-ratio: 16/9;
  border-radius: var(--r-marubi-inner);
  border: 1px solid var(--c-border);
  overflow: hidden; /* パディングを設けるためhiddenに変更 */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: var(--space-2); /* 画像と枠の間にパディングを追加 */
  box-sizing: border-box; /* パディングを含めたサイズ計算 */
  align-self: center; /* 画像を中央揃え */
}

.tpl-archive-project .sec-archive-projects .project-card .thumb figure,
.tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image,
.tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image figure {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.tpl-archive-project .sec-archive-projects .project-card .thumb img,
.tpl-archive-project .sec-archive-projects .project-card .thumb figure img,
.tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* プロジェクトコンテンツ - 全デバイス共通 */
.tpl-archive-project .sec-archive-projects .project-card .project-content {
  flex: 1;
  width: 70%; /* cardの70%を使用（PCと同じ） */
  max-width: 70%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: flex-start !important;
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-right: var(--space-4); /* 画像の左側のマージンと等しくする */
  align-items: flex-start;
  text-align: left;
}

/* プロジェクトタイトル */
.tpl-archive-project .sec-archive-projects .project-card .title {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: left; /* デフォルトは左寄せ */
  width: 100%;
}

/* PC表示時：タイトルを中央寄せ */
@media (min-width: 1025px) {
  .tpl-archive-project .sec-archive-projects .project-card .title {
    text-align: center !important;
  }
}

/* プロジェクト説明文 - 全文表示を確実にする */
.tpl-archive-project .sec-archive-projects .project-card .subtitle,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle p,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt__excerpt,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt,
.tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt * {
  margin: 0 !important;
  text-align: left !important;
  font-size: clamp(14px, 1.8vw, 18px) !important;
  line-height: 1.8 !important;
  letter-spacing: 0.02em !important;
  color: #000000 !important; /* 黒色に変更 */
  opacity: 1 !important; /* 不透明度を1に変更 */
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  display: block !important;
  /* -webkit-line-clampを完全に無効化 */
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  max-height: none !important;
  height: auto !important;
  min-height: auto !important;
  /* display: -webkit-boxを無効化 */
}

/* wp-block-post-excerptをproject-content内で中央配置（テキストは左寄せのまま） */
.tpl-archive-project .sec-archive-projects .project-card .project-content .wp-block-post-excerpt {
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100%;
  max-width: 100%;
}

.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link {
  margin: 0;
  margin-top: auto;
}

.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 40px;
  height: 40px;
  padding: 0;
  background: #E4405F;
  color: #ffffff;
  text-decoration: none;
  border-radius: 50%;
  font-size: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link a:hover {
  opacity: 0.9;
  transform: translateY(-1px) scale(1.05);
}

.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.tpl-archive-project .sec-archive-projects .project-card .project-instagram-link:empty {
  display: none;
}

/* タブレット表示時（641px - 1024px）：PCと同様に横並び */
@media (min-width: 641px) and (max-width: 1024px) {
  /* Gridアイテムとして全てのカードの高さを統一 */
  .tpl-archive-project .wp-block-post-template > * {
    display: flex !important;
    flex-direction: column !important; /* 縦方向に配置（プロジェクトカードと商品セクション） */
    align-items: stretch !important;
  }
  
  /* プロジェクトカードのみ高さを統一 */
  .tpl-archive-project .wp-block-post-template > * > .project-card {
    flex-shrink: 0 !important; /* プロジェクトカードの高さを固定 */
  }
  
  .tpl-archive-project .sec-archive-projects .project-card {
    flex-direction: row; /* タブレットも横並び */
    gap: var(--space-5);
    align-items: stretch !important; /* 全てのカードの高さを2番目のプロジェクトと同じにする */
    height: 100% !important; /* 親要素の高さに合わせる */
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    width: 30%; /* cardの30%を使用（PCと同じ） */
    height: auto;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    align-self: center; /* 画像を中央揃え */
  }

  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    flex: 1;
    width: 70%; /* cardの70%を使用（PCと同じ） */
    max-width: 70%;
    padding-right: var(--space-4); /* 画像の左側のマージンと等しくする */
  }

  /* タイトルを中央寄せ */
  .tpl-archive-project .sec-archive-projects .project-card .title {
    text-align: center !important;
    width: 100%;
  }
}

/* PC表示時（1025px以上）：横並び */
@media (min-width: 1025px) {
  /* Gridアイテムとして全てのカードの高さを統一 */
  .tpl-archive-project .wp-block-post-template > * {
    display: flex !important;
    flex-direction: column !important; /* 縦方向に配置（プロジェクトカードと商品セクション） */
    align-items: stretch !important;
  }
  
  /* プロジェクトカードのみ高さを統一 */
  .tpl-archive-project .wp-block-post-template > * > .project-card {
    flex-shrink: 0 !important; /* プロジェクトカードの高さを固定 */
  }
  
  .tpl-archive-project .sec-archive-projects .project-card {
    flex-direction: row; /* PCは横並び */
    gap: var(--space-5);
    align-items: stretch !important; /* 全てのカードの高さを2番目のプロジェクトと同じにする */
    height: auto !important; /* 高さを自動調整（商品セクションに影響されない） */
    flex-shrink: 0 !important; /* プロジェクトカードは縮小しない */
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    width: 30%; /* cardの30%を使用 */
    height: auto;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    align-self: center; /* 画像を中央揃え */
  }

  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    flex: 1;
    width: 70%; /* cardの70%を使用 */
    max-width: 70%;
    padding-right: var(--space-4); /* 画像の左側のマージンと等しくする */
  }

  .tpl-archive-project .sec-archive-projects .project-card .title {
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.03em;
    text-align: center !important; /* PC表示時は中央寄せ */
  }

  .tpl-archive-project .sec-archive-projects .project-card .subtitle,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle p,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt__excerpt,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt * {
    font-size: clamp(16px, 2vw, 22px) !important;
    line-height: 1.8 !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    height: auto !important;
    min-height: auto !important;
    display: block !important;
  }
}

/* スマホ表示時（640px以下）：画像とタイトルを2カラム、テキストを1カラム */
@media (max-width: 640px) {
  .tpl-archive-project .sec-archive-projects .project-card {
    flex-direction: column !important; /* 縦方向に変更 */
    gap: var(--space-2) !important;
    min-height: auto;
    height: auto;
    align-items: stretch !important;
    padding: var(--space-2); /* パディングを縮める */
    padding-bottom: calc(var(--space-2) + 40px) !important; /* ボタンのスペースを確保 */
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    width: auto !important; /* 幅を自動にして画像のサイズに合わせる */
    height: 70px !important; /* 高さを70pxに固定 */
    aspect-ratio: unset !important; /* aspect-ratioを無効化 */
    flex-shrink: 0 !important;
    border-radius: 0 !important; /* 角丸を削除 */
    border: none !important; /* 枠を削除 */
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--space-2) !important; /* 左側のパディングを統一 */
    box-sizing: border-box !important;
    overflow: visible !important; /* 画像が切れないようにvisibleに */
    background: transparent !important; /* 背景を透明に */
    align-self: flex-start !important; /* 上揃え */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  
  /* 全てのプロジェクトカードの画像マージンを統一 */
  .tpl-archive-project .sec-archive-projects .project-card .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(1) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(3) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(4) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(1) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(3) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(4) .thumb {
    padding-left: var(--space-2) !important; /* 全て統一 */
    padding-right: 0 !important; /* 右側のパディングを0に */
    margin-right: 0 !important; /* 右側のマージンを0に */
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb figure {
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  
  /* 画像とタイトルを同じ行に配置 */
  .tpl-archive-project .sec-archive-projects .project-card {
    display: grid !important;
    grid-template-columns: auto 1fr; /* 画像は自動幅、タイトル残り */
    grid-template-rows: auto auto; /* 2行 */
    gap: var(--space-2) !important;
    position: relative; /* ボタンの絶対配置の基準点 */
  }
  
  /* 2つ目のプロジェクトカードの画像右側のマージンを削除 */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .thumb,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .thumb {
    margin-right: 0 !important;
    padding-right: 0 !important;
  }
  
  /* 2つ目のプロジェクトカードのGrid gapを調整 */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2),
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) {
    column-gap: 0 !important; /* 画像とタイトル間のgapを0に */
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb {
    grid-column: 1; /* 1列目 */
    grid-row: 1; /* 1行目 */
    align-self: flex-start !important; /* 上揃え */
  }

  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    grid-column: 2; /* 2列目 */
    grid-row: 1; /* 1行目 */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    align-items: flex-start !important;
  }

  /* タイトルのみを表示（1行目） */
  .tpl-archive-project .sec-archive-projects .project-card .project-content .title {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important; /* 左寄せ */
    width: 100% !important;
  }

  /* テキストを2行目に全幅で配置 */
  .tpl-archive-project .sec-archive-projects .project-card .project-content .wp-block-post-excerpt {
    grid-column: 1 / -1; /* 全列にまたがる */
    grid-row: 2; /* 2行目 */
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative; /* Grid配置のため */
  }

  /* project-contentからテキストをGridで配置するために、project-contentをGridに */
  .tpl-archive-project .sec-archive-projects .project-card .project-content {
    display: contents !important; /* Gridの子要素として直接配置 */
  }

  /* タイトルを2列目1行目に配置 */
  .tpl-archive-project .sec-archive-projects .project-card .title {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: 100% !important;
    font-size: clamp(16px, 2vw, 24px) !important; /* フォントサイズを小さくして1行表示に */
    line-height: 1.2 !important; /* 行間を縮める */
    min-height: 70px !important; /* 画像の高さ（70px）に合わせる */
    height: 70px !important; /* 画像の高さ（70px）に合わせる */
    white-space: nowrap !important; /* 1行表示 */
    overflow: hidden !important; /* はみ出しを隠す */
    text-overflow: ellipsis !important; /* 省略記号を表示 */
    display: flex !important; /* flexboxで中央揃え */
    align-items: center !important; /* 縦方向中央揃え */
    justify-content: flex-start !important; /* 横方向左揃え */
  }
  
  /* 2つ目のプロジェクトタイトルから「by TOKIMEKI」を非表示（スマホのみ） */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .title,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .title {
    position: relative;
  }
  
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .title::after,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .title::after {
    content: '';
    display: none;
  }

  /* テキストを全列2行目に配置 */
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* ボタンはグリッドの影響を受けない独立ブロックとして配置 */
  .tpl-archive-project .sec-archive-projects .project-card .project-external-links {
    position: absolute !important; /* グリッドの影響を受けない絶対配置 */
    bottom: 4px !important; /* カードの下部に配置（8pxから4pxに縮小） */
    left: 12px !important;
    right: 0 !important;
    width: 100% !important;
    display: flex !important;
    align-items: flex-end !important; /* 下揃え */
    justify-content: space-between !important; /* 左右に配置 */
    gap: var(--space-2) !important;
    margin-top: 0 !important;
    z-index: 1 !important;
    pointer-events: auto !important;
  }

  /* 2つ目のプロジェクト：Web/Instaボタングループを左側に配置（スマホ） */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links .project-left-buttons,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links .project-left-buttons {
    display: flex !important;
    align-items: flex-end !important; /* グループ内の下揃え */
    gap: var(--space-2) !important;
    margin-right: auto !important; /* 左寄せ */
    align-self: flex-end !important; /* 親要素内で下揃え */
    height: auto !important;
    min-height: 36px !important;
  }


  /* 2つ目のプロジェクト：project-external-linksを基準点にする */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links {
    position: relative !important; /* 基準点として設定 */
  }

  /* 2つ目のプロジェクト：Webボタンを▼ボタンと同じ位置（bottom: 4px）に配置（スマホ） */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links .project-website-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links .project-website-btn {
    position: absolute !important;
    bottom: 0 !important; /* project-external-linksの下端に配置 */
    left: 0px !important; /* 左側に配置 */
    height: 36px !important; /* ▼ボタンと同じ高さ */
    padding: 0 var(--space-3) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
  }

  /* 2つ目のプロジェクト：Instagramボタンを▼ボタンと同じ位置（bottom: 4px）に配置（スマホ） */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .project-external-links .project-instagram-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .project-external-links .project-instagram-btn {
    position: absolute !important;
    bottom: 0 !important; /* project-external-linksの下端に配置 */
    left: calc(8px + 60px + 8px) !important; /* Webボタンの右隣（8px + Webボタン幅60px + gap 8px） */
    width: 36px !important;
    height: 36px !important; /* ▼ボタンと同じ高さ */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
  }
  
  /* 「▼」ボタン - スマホ時：全てのプロジェクトで位置をpxで固定 */
  .tpl-archive-project .sec-archive-projects .project-card .project-toggle-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
    position: absolute !important;
    bottom: 4px !important; /* pxで固定（8pxから4pxに縮小） */
    right: 8px !important; /* pxで固定 */
    z-index: 1 !important;
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb figure,
  .tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image,
  .tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image figure {
    width: auto !important; /* 幅を自動にして画像のサイズに合わせる */
    height: 70px !important; /* 高さを70pxに固定 */
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* 左揃え */
    box-sizing: border-box !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    aspect-ratio: unset !important; /* aspect-ratioを無効化して画像の比率を保持 */
  }
  
  /* 2つ目のプロジェクトの.wp-block-post-featured-imageの右側マージンを削除 */
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .thumb .wp-block-post-featured-image,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .thumb .wp-block-post-featured-image,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(2) .thumb .wp-block-post-featured-image figure,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(2) .thumb .wp-block-post-featured-image figure {
    margin-right: 0 !important;
    padding-right: 0 !important;
  }

  .tpl-archive-project .sec-archive-projects .project-card .thumb img,
  .tpl-archive-project .sec-archive-projects .project-card .thumb figure img,
  .tpl-archive-project .sec-archive-projects .project-card .thumb .wp-block-post-featured-image img {
    width: auto !important; /* 幅を自動にして画像の比率を保持 */
    height: 70px !important; /* 高さを70pxに固定 */
    max-width: none !important; /* 最大幅の制限を解除 */
    max-height: 70px !important; /* 最大高さも70pxに */
    min-width: auto !important;
    min-height: 70px !important; /* 最小高さも70pxに */
    object-fit: contain !important; /* containで画像の比率を保持 */
    object-position: center !important; /* 中央に配置 */
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
  }

  .tpl-archive-project .sec-archive-projects .project-card .subtitle,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt.subtitle p,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt__excerpt,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt,
  .tpl-archive-project .sec-archive-projects .project-card .wp-block-post-excerpt * {
    font-size: clamp(13px, 1.5vw, 16px) !important; /* フォントサイズを少し縮める */
    line-height: 1.5 !important; /* 行間を縮める（1.8から1.5に） */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    height: auto !important;
    min-height: auto !important;
    display: block !important;
  }

  .tpl-archive-project .sec-archive-projects .header {
    margin-left: auto;
    margin-right: auto;
    padding: var(--space-3) var(--space-4);
  }
}

/* ===== Contact Page ===== */
.tpl-contact {
  padding-top: 84px;
}

.tpl-contact .contact-description {
  margin-top: var(--space-4);
  opacity: 0.8;
}

.tpl-contact .contact-form-wrapper {
  max-width: 100%;
}

/* MW WP Form スタイルカスタマイズ */
.tpl-contact .mw_wp_form {
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
}

.tpl-contact .mw_wp_form .mwform-field {
  margin-bottom: var(--space-5);
}

.tpl-contact .mw_wp_form label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  font-weight: 400;
}

.tpl-contact .mw_wp_form input[type="text"],
.tpl-contact .mw_wp_form input[type="email"],
.tpl-contact .mw_wp_form input[type="tel"],
.tpl-contact .mw_wp_form input[type="url"],
.tpl-contact .mw_wp_form textarea,
.tpl-contact .mw_wp_form select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: 0;
  background: #fff;
  color: var(--c-fg);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.tpl-contact .mw_wp_form input[type="text"]:focus,
.tpl-contact .mw_wp_form input[type="email"]:focus,
.tpl-contact .mw_wp_form input[type="tel"]:focus,
.tpl-contact .mw_wp_form input[type="url"]:focus,
.tpl-contact .mw_wp_form textarea:focus,
.tpl-contact .mw_wp_form select:focus {
  outline: none;
  border-color: var(--c-fg);
}

.tpl-contact .mw_wp_form textarea {
  min-height: 200px;
  resize: vertical;
}

.tpl-contact .mw_wp_form .mwform-checkbox-field,
.tpl-contact .mw_wp_form .mwform-radio-field {
  margin-bottom: var(--space-3);
}

.tpl-contact .mw_wp_form .mwform-checkbox-field label,
.tpl-contact .mw_wp_form .mwform-radio-field label {
  display: inline-flex;
  align-items: center;
  margin-bottom: var(--space-2);
  cursor: pointer;
}

.tpl-contact .mw_wp_form .mwform-checkbox-field input[type="checkbox"],
.tpl-contact .mw_wp_form .mwform-radio-field input[type="radio"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
}

.tpl-contact .mw_wp_form .mwform-error {
  color: #d32f2f;
  font-size: clamp(12px, 1.3vw, 14px);
  margin-top: var(--space-1);
  letter-spacing: 0.05em;
}

.tpl-contact .mw_wp_form .mwform-error-message {
  background: #ffebee;
  border: 1px solid #d32f2f;
  padding: 12px 16px;
  margin-bottom: var(--space-5);
  color: #d32f2f;
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
}

.tpl-contact .mw_wp_form .mwform-submit {
  margin-top: var(--space-6);
}

.tpl-contact .mw_wp_form input[type="submit"],
.tpl-contact .mw_wp_form button[type="submit"] {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 0;
  border: 1px solid var(--c-fg);
  background: var(--c-fg);
  color: var(--c-bg);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.tpl-contact .mw_wp_form input[type="submit"]:hover,
.tpl-contact .mw_wp_form button[type="submit"]:hover {
  background: transparent;
  color: var(--c-fg);
}

.tpl-contact .mw_wp_form .mwform-back-button {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 0;
  border: 1px solid var(--c-border);
  background: transparent;
  color: var(--c-fg);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  margin-right: var(--space-3);
}

.tpl-contact .mw_wp_form .mwform-back-button:hover {
  border-color: var(--c-fg);
  background: var(--c-fg);
  color: var(--c-bg);
}

.tpl-contact .mw_wp_form .mwform-complete-message {
  padding: var(--space-5);
  background: #f5f5f5;
  border: 1px solid var(--c-border);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  line-height: 1.8;
}

/* 必須マークのスタイル */
.tpl-contact .mw_wp_form .mwform-required {
  color: #d32f2f;
  margin-left: 4px;
}

/* 確認画面のスタイル */
.tpl-contact .mw_wp_form.mw_wp_form_confirm .mwform-field {
  padding: var(--space-3);
  background: #f9f9f9;
  border: 1px solid var(--c-border);
  margin-bottom: var(--space-4);
}

.tpl-contact .mw_wp_form.mw_wp_form_confirm .mwform-field dt {
  font-weight: 500;
  margin-bottom: var(--space-1);
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
}

.tpl-contact .mw_wp_form.mw_wp_form_confirm .mwform-field dd {
  margin: 0;
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.05em;
  line-height: 1.8;
}

/* ===== ARCHIVE: Projects ページ - 商品セクション ===== */
.tpl-front .sec-top-projects .project-products,
.tpl-archive-project .project-products {
  display: flex;
  flex-wrap: nowrap;
  width: 100%; /* 親要素（Gridアイテム）の幅に合わせる */
  margin-top: 1px; /* プロジェクトカードとの間隔を1pxに */
  gap: 0; /* マージンなし */
  /* プロジェクトカードの高さに影響を与えないようにする */
  flex-shrink: 0; /* 商品セクションは縮小しない */
}

/* PC/タブレット時：商品セクションをプロジェクトカードの下に配置 */
@media (min-width: 641px) {
  .tpl-front .sec-top-projects .project-products,
.tpl-archive-project .project-products {
    width: 100%; /* 親要素（Gridアイテム）の幅に合わせる */
    margin-top: 1px;
  }
}

.tpl-front .sec-top-projects .project-products .product-item,
.tpl-archive-project .project-products .product-item {
  width: 25%; /* プロジェクトカードの横幅の25% */
  aspect-ratio: 1 / 1; /* 正方形 */
  border-radius: var(--r-marubi-inner);
  border: 1px solid var(--c-border);
  overflow: hidden;
  background: #fff;
  padding: var(--space-2);
  box-sizing: border-box;
  display: flex;
  flex-direction: column; /* 縦方向に配置（画像とタイトル） */
  align-items: center;
  justify-content: flex-start;
  margin: 0; /* マージンなし */
}

/* 商品画像ラッパー（PC/タブレット時） */
.tpl-archive-project .project-products .product-item .product-image-wrapper {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  box-sizing: border-box;
  min-height: 0; /* flexアイテムの縮小を許可 */
}

.tpl-archive-project .project-products .product-item .product-image-wrapper img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* 商品タイトル（PC/タブレット時） */
.tpl-archive-project .project-products .product-item .product-title {
  width: 100%;
  text-align: center;
  font-size: clamp(12px, 1.5vw, 16px);
  font-weight: 500;
  color: #000;
  padding: var(--space-1) 0;
  margin-top: auto;
  flex-shrink: 0; /* タイトルは縮小しない */
}

/* 画像がない場合のタイトルのみ表示（中央配置） */
.tpl-archive-project .project-products .product-item:has(.product-title:only-child) .product-title {
  margin-top: auto;
  margin-bottom: auto;
}

/* Coming soon（PC/タブレット時） */
.tpl-archive-project .project-products .product-item .product-coming-soon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(12px, 1.5vw, 16px);
  font-weight: 500;
  color: #999;
}

.tpl-archive-project .project-products .product-item:first-child {
  border-top-left-radius: var(--r-marubi-inner);
  border-bottom-left-radius: var(--r-marubi-inner);
}

.tpl-archive-project .project-products .product-item:last-child {
  border-top-right-radius: var(--r-marubi-inner);
  border-bottom-right-radius: var(--r-marubi-inner);
}

/* 既存の空のproduct-image用（その他のプロジェクト用） */
.tpl-archive-project .project-products .product-item .product-image,
.tpl-archive-project .project-products .product-item .product-image img,
.tpl-archive-project .project-products .product-item figure,
.tpl-archive-project .project-products .product-item .wp-block-image {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.tpl-archive-project .project-products .product-item .product-image img,
.tpl-archive-project .project-products .product-item figure img,
.tpl-archive-project .project-products .product-item .wp-block-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0 !important;
  display: block !important;
}


/* スマホ表示時（640px以下）：商品を2列に */
@media (max-width: 640px) {
  .tpl-front .sec-top-projects .project-products,
.tpl-archive-project .project-products {
    flex-wrap: wrap;
  }
  
  .tpl-front .sec-top-projects .project-products .product-item,
.tpl-archive-project .project-products .product-item {
    width: 50%; /* 2列に変更 */
    /* スマホ時は一旦全ての角丸をリセット */
    border-radius: 0;
  }
  
  /* 1つ目（左上）：左上と左下の角丸 */
  .tpl-archive-project .project-products .product-item:first-child {
    border-top-left-radius: var(--r-marubi-inner) !important;
    border-bottom-left-radius: var(--r-marubi-inner) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
  
  /* 2つ目（右上）：右上と右下の角丸 */
  .tpl-archive-project .project-products .product-item:nth-child(2) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--r-marubi-inner) !important;
    border-bottom-right-radius: var(--r-marubi-inner) !important;
  }
  
  /* 3つ目（左下）：左上と左下の角丸 */
  .tpl-archive-project .project-products .product-item:nth-child(3) {
    border-top-left-radius: var(--r-marubi-inner) !important;
    border-bottom-left-radius: var(--r-marubi-inner) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
  
  /* 4つ目（右下）：右上と右下の角丸 */
  .tpl-archive-project .project-products .product-item:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--r-marubi-inner) !important;
    border-bottom-right-radius: var(--r-marubi-inner) !important;
  }
}

/* ===== ARCHIVE: Projects ページ - 外部リンクボタン ===== */
.tpl-front .sec-top-projects .project-card .project-external-links,
.tpl-archive-project .project-external-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  justify-content: flex-start; /* 右寄せ */
}

/* PC/タブレット時：project-external-linksをexcerptの下に配置 */
@media (min-width: 641px) {
  /* project-external-linksをproject-content内に配置 */
  .tpl-front .sec-top-projects .project-card .project-content .project-external-links,
  .tpl-archive-project .project-content .project-external-links {
    display: flex !important; /* flexコンテナとして維持 */
    width: 100% !important; /* project-contentの全幅を使用 */
    flex-wrap: wrap !important; /* 必要に応じて折り返し */
    margin-top: var(--space-4) !important; /* excerptの下に配置 */
    order: 3 !important; /* excerptの後に配置 */
  }
  
  /* 2つ目のプロジェクト：project-external-linksをプロジェクトカードのbottom:10pxに配置 */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-content .project-external-links,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-content .project-external-links,
  .tpl-archive-project .project-card:nth-child(2) .project-content .project-external-links,
  .tpl-archive-project .project-card:nth-of-type(2) .project-content .project-external-links {
    position: absolute !important; /* プロジェクトカードの右下に配置 */
    bottom: 10px !important; /* プロジェクトカードの下端から10px */
    left: 0 !important; /* 左端から開始 */
    right: auto !important;
    width: auto !important; /* 幅を自動に */
    justify-content: flex-start !important; /* 左寄せ（基本スタイルのflex-endを上書き） */
    align-items: flex-end !important; /* 下揃え */
    margin-top: 0 !important;
  }
  
  /* 2つ目のプロジェクト：Web/Instaボタングループを左寄せ */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-content .project-external-links .project-left-buttons,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-content .project-external-links .project-left-buttons,
  .tpl-archive-project .project-card:nth-child(2) .project-content .project-external-links .project-left-buttons,
  .tpl-archive-project .project-card:nth-of-type(2) .project-content .project-external-links .project-left-buttons {
    display: flex !important;
    align-items: flex-end !important;
    gap: var(--space-2) !important;
    margin: 0 !important; /* マージンをリセット */
  }
  
  /* ▼ボタン用のラッパー：プロジェクトカードの右下に配置（PC/タブレット時） */
  .tpl-front .sec-top-projects .project-card .project-toggle-wrapper,
  .tpl-archive-project .project-card .project-toggle-wrapper {
    position: absolute !important;
    bottom: 12px !important; /* プロジェクトカードの下端から10px */
    right: 20px !important; /* プロジェクトカードの右端から20px */
    z-index: 1 !important;
  }
  
  /* ラッパー内の▼ボタン */
  .tpl-front .sec-top-projects .project-card .project-toggle-wrapper .project-toggle-btn,
  .tpl-archive-project .project-card .project-toggle-wrapper .project-toggle-btn {
    position: static !important; /* ラッパー内で通常のフロー */
    bottom: auto !important;
    right: auto !important;
    margin: 0 !important;
  }
  
  /* project-external-linksがproject-contentの外にある場合のフォールバック */
  .tpl-front .sec-top-projects .project-card .project-external-links,
  .tpl-archive-project .project-card .project-external-links {
    display: flex !important;
    width: 100% !important;
    margin-top: var(--space-4) !important;
    bottom: 10px;
  }
  
  /* 2つ目のプロジェクト：project-contentの幅を確実に維持 */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-content,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-content,
  .tpl-archive-project .project-card:nth-child(2) .project-content,
  .tpl-archive-project .project-card:nth-of-type(2) .project-content {
    width: 70% !important;
    max-width: 70% !important;
    min-width: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* 2つ目のプロジェクト：タイトルとexcerptの幅を確実に維持 */
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-content .title,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-content .title,
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-content .wp-block-post-excerpt,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-content .wp-block-post-excerpt,
  .tpl-archive-project .project-card:nth-child(2) .project-content .title,
  .tpl-archive-project .project-card:nth-of-type(2) .project-content .title,
  .tpl-archive-project .project-card:nth-child(2) .project-content .wp-block-post-excerpt,
  .tpl-archive-project .project-card:nth-of-type(2) .project-content .wp-block-post-excerpt {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* 「▼」ボタン - 全プロジェクト共通（PC/タブレット時） */
@media (min-width: 641px) {
  .tpl-front .sec-top-projects .project-card .project-toggle-btn,
  .tpl-archive-project .project-card .project-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #000 !important;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: absolute !important; /* 位置を固定するため */
    bottom: 10px !important; /* プロジェクトカードの下端から10px */
    right: 20px !important; /* プロジェクトカードの右端から20px */
    margin-top: 0 !important; /* margin-topをリセット */
    margin-left: 0 !important; /* margin-leftをリセット */
    margin-right: 0 !important; /* margin-rightをリセット */
  }

  /* 1つ目、3つ目のプロジェクトの「▼」ボタン：右端から20px、下端から10pxに統一 */
  .tpl-front .sec-top-projects .project-card:not(:nth-child(2)):not(:nth-of-type(2)):not(:nth-child(4)):not(:nth-of-type(4)) .project-toggle-btn,
  .tpl-archive-project .project-card:not(:nth-child(2)):not(:nth-of-type(2)):not(:nth-child(4)):not(:nth-of-type(4)) .project-toggle-btn {
    position: absolute !important;
    bottom: 10px !important; /* プロジェクトカードの下端から10px */
    right: 20px !important; /* プロジェクトカードの右端から20px */
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* 4つ目のプロジェクトの「▼」ボタンを非表示 */
  .tpl-front .sec-top-projects .project-card:nth-child(4) .project-toggle-btn,
  .tpl-front .sec-top-projects .project-card:nth-of-type(4) .project-toggle-btn,
  .tpl-front .sec-top-projects .project-card:nth-child(4) .project-toggle-wrapper,
  .tpl-front .sec-top-projects .project-card:nth-of-type(4) .project-toggle-wrapper,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(4) .project-toggle-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(4) .project-toggle-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(4) .project-toggle-wrapper,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(4) .project-toggle-wrapper,
  .tpl-archive-project .project-card:nth-child(4) .project-toggle-btn,
  .tpl-archive-project .project-card:nth-of-type(4) .project-toggle-btn,
  .tpl-archive-project .project-card:nth-child(4) .project-toggle-wrapper,
  .tpl-archive-project .project-card:nth-of-type(4) .project-toggle-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* 「▼」ボタン - 全プロジェクト共通（スマホ時） */
@media (max-width: 640px) {
  .tpl-front .sec-top-projects .project-card .project-toggle-btn,
  .tpl-archive-project .project-card .project-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    background: #000 !important; /* 黒背景 */
    color: #fff !important; /* 白文字 */
    border: none !important;
    border-radius: 50% !important; /* 丸形 */
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
  }
  
  /* ラッパー内の▼ボタン（スマホ時） */
  .tpl-front .sec-top-projects .project-card .project-toggle-wrapper .project-toggle-btn,
  .tpl-archive-project .project-card .project-toggle-wrapper .project-toggle-btn {
    background: #000 !important; /* 黒背景 */
    color: #fff !important; /* 白文字 */
    border-radius: 50% !important; /* 丸形 */
  }
  
  /* 4つ目のプロジェクトの「▼」ボタンを非表示（スマホ時） */
  .tpl-front .sec-top-projects .project-card:nth-child(4) .project-toggle-btn,
  .tpl-front .sec-top-projects .project-card:nth-of-type(4) .project-toggle-btn,
  .tpl-front .sec-top-projects .project-card:nth-child(4) .project-toggle-wrapper,
  .tpl-front .sec-top-projects .project-card:nth-of-type(4) .project-toggle-wrapper,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(4) .project-toggle-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(4) .project-toggle-btn,
  .tpl-archive-project .sec-archive-projects .project-card:nth-child(4) .project-toggle-wrapper,
  .tpl-archive-project .sec-archive-projects .project-card:nth-of-type(4) .project-toggle-wrapper,
  .tpl-archive-project .project-card:nth-child(4) .project-toggle-btn,
  .tpl-archive-project .project-card:nth-of-type(4) .project-toggle-btn,
  .tpl-archive-project .project-card:nth-child(4) .project-toggle-wrapper,
  .tpl-archive-project .project-card:nth-of-type(4) .project-toggle-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

.tpl-front .sec-top-projects .project-card .project-toggle-btn:hover,
.tpl-archive-project .project-card .project-toggle-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px) scale(1.05);
}

/* 2つ目のプロジェクト：Web/Instaを左寄せ、▼を右寄せ */
.tpl-front .sec-top-projects .project-card:nth-child(2) .project-external-links,
.tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-external-links,
.tpl-archive-project .project-card:nth-child(2) .project-external-links,
.tpl-archive-project .project-card:nth-of-type(2) .project-external-links {
  justify-content: space-between !important; /* 左右に配置 */
  align-items: flex-end !important; /* 下揃え */
}

/* 2つ目のプロジェクト：Web/Instaボタングループを左側に配置（PC/タブレット時） */
.tpl-front .sec-top-projects .project-card:nth-child(2) .project-external-links .project-left-buttons,
.tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-external-links .project-left-buttons,
.tpl-archive-project .project-card:nth-child(2) .project-external-links .project-left-buttons,
.tpl-archive-project .project-card:nth-of-type(2) .project-external-links .project-left-buttons {
  display: flex;
  align-items: flex-end; /* 下揃え */
  gap: var(--space-2);
  margin-right: auto; /* 左寄せ */
}


/* 2つ目のプロジェクトの「▼」ボタン：スマホ時のみ絶対配置（project-external-linksの外） */
@media (max-width: 640px) {
  .tpl-front .sec-top-projects .project-card:nth-child(2) .project-toggle-btn,
  .tpl-front .sec-top-projects .project-card:nth-of-type(2) .project-toggle-btn,
  .tpl-archive-project .project-card:nth-child(2) .project-toggle-btn,
  .tpl-archive-project .project-card:nth-of-type(2) .project-toggle-btn {
    position: absolute !important;
    bottom: 4px !important;
    right: 8px !important;
    z-index: 1 !important;
  }
  
}

.tpl-archive-project .project-website-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px; /* 「▼」ボタンと同じ高さ */
  padding: 0 var(--space-4);
  background: #000 !important;
  color: #fff !important;
  text-decoration: none;
  border: none;
  border-radius: var(--r-marubi-inner);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-sizing: border-box;
  cursor: pointer;
  line-height: 1;
}

.tpl-front .sec-top-projects .project-card .project-website-btn:hover,
.tpl-archive-project .project-website-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.tpl-front .sec-top-projects .project-card .project-instagram-btn,
.tpl-archive-project .project-instagram-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #000 !important;
  color: #ffffff !important;
  text-decoration: none;
  border: none;
  border-radius: 50%;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  line-height: 1;
}

.tpl-front .sec-top-projects .project-card .project-instagram-btn:hover,
.tpl-archive-project .project-instagram-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px) scale(1.05);
}

.tpl-front .sec-top-projects .project-card .project-instagram-btn svg,
.tpl-archive-project .project-instagram-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* スマホ表示時 */
@media (max-width: 640px) {
  .tpl-archive-project .project-external-links {
    gap: var(--space-2);
    margin-top: var(--space-3);
    justify-content: center !important; /* 中央寄せ */
    width: 100%;
  }

  .tpl-archive-project .project-website-btn {
    height: 36px !important; /* スマホ時も「▼」ボタンと同じ高さ */
    padding: 0 var(--space-3) !important;
    font-size: clamp(12px, 1.3vw, 14px);
  }

  .tpl-archive-project .project-instagram-btn {
    width: 36px;
    height: 36px;
  }

  .tpl-archive-project .project-instagram-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
  .tpl-contact .wp-block-columns {
    flex-direction: column;
  }

  .tpl-contact .wp-block-column {
    flex-basis: 100% !important;
  }

  .tpl-contact .contact-description {
    margin-top: var(--space-3);
  }
}