/* Public Submitter styles */
.ps-wrapper { margin: 1rem 0; }
.ps-alert { background: #f0f7ff; border: 1px solid #bcdcff; color: #084b83; padding: .75rem 1rem; border-radius: .5rem; margin-bottom: 1rem; }
.ps-form .ps-field { margin-bottom: .8rem; }
.ps-form .ps-actions { margin-top: 1rem; }
.ps-button { appearance: none; border: none; background: #2c7be5; color: #fff; padding: .6rem 1rem; border-radius: .4rem; cursor: pointer; }
.ps-button.danger { background: #d9534f; }
.ps-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ps-card { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06); border-top: 4px solid var(--ps-accent, #e5e7eb); }
.ps-card-head { padding: 8px 12px; }
.ps-badge { display:inline-flex; align-items:center; gap:.35em; font-size:.8rem; background: var(--ps-accent, #64748b); color:#fff; padding:.2rem .5rem; border-radius:.4rem; }
.ps-badge i { margin-right:.35rem; }
.ps-card-thumb { aspect-ratio: 16/9; overflow: hidden; background: #f4f6f8; }
.ps-card-thumb .ps-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-card-body { padding: 12px; }
.ps-card-meta { font-size: .85rem; color: #6b7280; margin-bottom: .4rem; }
.ps-card-title { margin: .3rem 0 .5rem; font-size: 1.05rem; }
.ps-card-text p { margin: .4rem 0; }

/* Link button inside content */
.ps-link-btn {
  display: inline-block;
  background: #2c7be5;
  color: #fff;
  text-decoration: none;
  padding: .25rem .6rem;
  border-radius: .35rem;
  font-size: .85rem;
  margin: 0 .25rem;
}
.ps-link-btn:hover { background: #256ad9; }

/* === Portrait-safe thumbnail fit (縦のみ縮小・中央表示・左右余白OK) === */

/* サムネイル枠：中央寄せ（既存 aspect-ratio はそのまま活かす） */
.ps-card-thumb {
  /* 画像を常に中央に配置 */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 画像：横はそのまま（拡げない）、縦だけ必要時に縮小。拡大はしない。 */
.ps-card-thumb .ps-img {
  /* 既存の 100% & cover 指定を打ち消す（拡大やトリミング防止） */
  width: auto !important;
  height: auto !important;
  object-fit: unset !important;

  /* 縦が枠を超える場合だけ縮小（横は自動・左右余白OK） */
  max-height: 100% !important;
  max-width: 100%; /* 極端な横長が枠横幅を超えるのを防ぐ保険 */

  /* レイアウト安定のため */
  display: block;
  background-color: #f4f6f8; /* レターボックス色（必要に応じて変更可） */
}

/* 高さを固定したい場合のオプション（任意） */
.ps-card-thumb {
  aspect-ratio: auto;    /* 既存の比率を解除 */
  height: 320px;         /* お好みの高さに調整（例：280/300/320/360px） */
}