/* TOP — 4台グリッド（横スクロールなし・コンテナ内に収める） */
#purchaseAchievementsRoot {
  display: grid;
  gap: 0.75rem;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  padding: 0 0.625rem 0.25rem;
  box-sizing: border-box;
}

#purchaseAchievementsRoot .pa-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
}

#purchaseAchievementsRoot .pa-card__link,
#purchaseAchievementsRoot .pa-card__body,
#purchaseAchievementsRoot .pa-card__footer {
  min-width: 0;
}

/* 一覧ページ — 1行4台グリッド（768px〜） */
.pa-list-grid {
  display: grid;
  gap: 1rem;
  align-items: stretch;
  padding: 0 0.625rem 0.25rem;
  grid-template-columns: 1fr;
}

.pa-list-grid .pa-card {
  width: 100%;
  height: 100%;
}

/* --- カード共通（サイズ・レイアウト統一） --- */
.pa-card {
  --pa-card-width: 240px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 22.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(17, 60, 145, 0.07);
}

.pa-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  text-decoration: none;
  color: inherit;
}

.pa-card__link:hover .pa-card__figure img {
  opacity: 0.92;
}

/* 画像: 4:3 固定・背景色統一 */
.pa-card__figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: #eef2f7;
  flex-shrink: 0;
}

.pa-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: opacity 0.2s;
  background: #eef2f7;
}

/* No Image プレースホルダー */
.pa-card__noimg {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: #eef2f7;
  color: #94a3b8;
}

.pa-card__noimg-icon {
  width: 3rem;
  height: 2rem;
  opacity: 0.55;
}

.pa-card__noimg-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* テキスト領域: 高さ固定でカード下端を揃える */
.pa-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 5.75rem;
  padding: 0.625rem 0.875rem 0;
}

.pa-card__maker {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-card__maker-en {
  font-weight: 700;
  color: #475569;
}

.pa-card__model {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1e293b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.55em;
}

.pa-card__meta {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #94a3b8;
  min-height: 1rem;
}

.pa-card__meta:empty {
  visibility: hidden;
}

/* フッター: ボタン + 価格（1行・幅固定） */
.pa-card__footer,
.pa-card > .wp-block-columns {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.625rem 0.875rem 0.875rem;
  border-top: 1px solid #f1f5f9;
  width: 100%;
}

.pa-card__footer > .wp-block-column,
.pa-card > .wp-block-columns > .wp-block-column {
  margin: 0 !important;
  min-width: 0;
}

.pa-card__detail-btn {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 7.5rem;
  display: block;
  text-align: center;
  background: #113c91;
  color: #fff !important;
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.pa-card__detail-btn:hover {
  background: #0e3074;
}

.pa-card__price {
  flex: 0 0 auto;
  margin: 0;
  text-align: right;
  white-space: nowrap;
  line-height: 1;
}

.pa-card__price-num {
  font-size: 1.375rem;
  font-weight: 700;
  color: #113c91;
}

.pa-card__price-unit {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #113c91;
  margin-left: 0.125rem;
}

/* 旧マークアップ互換 */
.pa-card__title {
  margin: 0.625rem 0.875rem 0;
  min-height: 2.55em;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.pa-card__price-col {
  text-align: right;
  line-height: 1;
}

.pa-card__price-col p {
  margin: 0;
  color: #113c91 !important;
  font-size: 1.375rem !important;
  font-weight: 700;
  display: inline;
}

.pa-card__price-col p + p {
  font-size: 0.6875rem !important;
  margin-left: 0.125rem;
}

.pa-empty {
  flex: 1 0 100%;
  text-align: center;
  color: #718096;
  padding: 2rem;
  grid-column: 1 / -1;
}

/* 一覧ページ（TOP と同じ home-page レイアウト内） */
.pa-list-lead {
  margin: 0 0 1rem;
  padding: 0 0.625rem;
  font-size: 0.9375rem;
  color: var(--color-muted, #718096);
  line-height: 1.6;
}

.pa-list-search {
  display: grid;
  gap: 0.75rem;
  margin: 0 0.625rem 1rem;
  padding: 1rem 1.125rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius, 12px);
  box-shadow: 0 2px 8px rgba(17, 60, 145, 0.06);
}

.pa-list-search__field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-primary, #113c91);
}

.pa-list-search__field input,
.pa-list-search__field select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}

.pa-list-search__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pa-list-search__btn {
  padding: 0.625rem 1.25rem;
  background: var(--color-primary, #113c91);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.pa-list-search__btn:hover {
  background: var(--color-primary-dark, #0e3074);
}

.pa-list-search__reset {
  font-size: 0.875rem;
  color: var(--color-primary, #113c91);
  font-weight: 600;
}

.pa-list-count {
  margin: 0 0 1rem;
  padding: 0 0.625rem;
  font-size: 0.875rem;
  color: var(--color-muted, #718096);
}

.home-achievements-head__title {
  font-size: 1.25rem;
}

@media (min-width: 480px) {
  .pa-card {
    --pa-card-width: 248px;
  }

  .pa-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #purchaseAchievementsRoot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .pa-card {
    --pa-card-width: 256px;
  }

  .pa-list-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #purchaseAchievementsRoot {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.625rem;
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }

  .pa-list-search {
    grid-template-columns: 1fr 180px auto;
    align-items: end;
  }
}

.pa-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.pa-pagination a,
.pa-pagination span {
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
}

.pa-pagination a {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--color-primary, #113c91);
  font-weight: 600;
}

.pa-pagination span.is-current {
  background: var(--color-primary, #113c91);
  color: #fff;
}

/* 詳細ページ */
.ach-detail-page { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f7fafc; color: #1a202c; }
.ach-detail-backlinks { max-width: 960px; margin: 0 auto; padding: 1rem 1.25rem 0; }
.ach-back { color: #113c91; text-decoration: none; font-size: 0.875rem; margin-right: 1rem; }
.ach-back:hover { text-decoration: underline; }
.ach-back--sub { opacity: 0.85; }
.ach-detail-main { max-width: 960px; margin: 0 auto; padding: 1.25rem; display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .ach-detail-main { grid-template-columns: 1fr 1fr; align-items: start; } }
.ach-detail-main-photo img { width: 100%; height: auto; border-radius: 8px; display: block; background: #fff; }
.ach-detail-thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.ach-thumb { border: 2px solid transparent; padding: 0; background: none; cursor: pointer; border-radius: 6px; overflow: hidden; }
.ach-thumb.is-active { border-color: #113c91; }
.ach-thumb img { width: 72px; height: 54px; object-fit: cover; display: block; }
.ach-detail-no-photo { background: #edf2f7; padding: 4rem; text-align: center; border-radius: 8px; color: #718096; }
.ach-detail-body { background: #fff; border-radius: 12px; padding: 1.25rem 1.5rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.ach-detail-maker { color: #718096; font-size: 0.875rem; margin: 0 0 0.25rem; }
.ach-detail-body h1 { margin: 0 0 1rem; font-size: 1.5rem; }
.ach-detail-price { display: flex; align-items: baseline; gap: 0.35rem; margin-bottom: 1.25rem; color: #113c91; }
.ach-detail-price-label { font-size: 0.875rem; background: #113c91; color: #fff; padding: 0.25rem 0.625rem; border-radius: 4px; }
.ach-detail-price-value { font-size: 2.25rem; font-weight: 700; line-height: 1; }
.ach-detail-price-unit { font-size: 1rem; font-weight: 700; }
.ach-detail-spec { display: grid; grid-template-columns: 5rem 1fr; gap: 0.5rem 1rem; font-size: 0.9375rem; margin: 0 0 1.25rem; }
.ach-detail-spec dt { color: #718096; margin: 0; }
.ach-detail-spec dd { margin: 0; font-weight: 600; }
.ach-detail-comment h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.ach-detail-comment p { margin: 0; line-height: 1.7; font-size: 0.9375rem; }
.ach-detail-note { font-size: 0.75rem; color: #718096; margin: 1.25rem 0 0; }
