/* ============================================================
   南さつま市 空き家バンク：最終表示調整
   既存CSSの後に読み込み、トップ／カテゴリー／詳細へ共通適用する。
   ============================================================ */

/* 正式な地図画像に背景色を重ねない。 */
.akiyabank-prefooter-mainmap { background: transparent; }

/* トップ：画像比率を固定し、JSで揃えるカード本文を下端まで伸ばす。 */
#newProperties > .akiya-top-card { display: flex; }
#newProperties .akiya-top-card-link { display: flex; flex-direction: column; width: 100%; height: 100%; }
#newProperties .akiya-top-card-link figure { aspect-ratio: 3 / 2; overflow: hidden; }
#newProperties .akiya-top-card-link figure img { width: 100%; height: 100%; object-fit: cover; }
#newProperties .akiya-top-card-link .link-box-text { display: flex; flex: 1 1 auto; }
#newProperties .akiya-top-card-link .link-box-text > .reduce-bottom-1_2 { width: 100%; }

/* サイドバーが残るタブレット幅では、3列をやめてカード幅を確保する。 */
@media screen and (min-width: 768px) and (max-width: 1259px) {
  #newProperties > .akiya-top-card { flex: 0 0 50%; max-width: 50%; }
}

/* スマホはカード内の文字・ボタンを保てる幅を確保して横スクロールする。 */
@media screen and (max-width: 767px) {
  #newProperties { gap: 14px; padding-right: 4px; }
  #newProperties > .akiya-top-card { flex: 0 0 min(84vw, 360px); max-width: min(84vw, 360px); }
  #newProperties .akiya-top-card-link .link-box-text { padding: 1.1em; }
}

/* カテゴリー一覧：画像、表、詳細ボタンが狭い幅で崩れないようにする。 */
body.akiya-bank .primary-area > .body > article { overflow: hidden; }
body.akiya-bank .primary-area > .body > article .img-thumbnail { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
body.akiya-bank .primary-area > .body > article .entry-more { margin-top: 1em; }
@media screen and (max-width: 767px) {
  body.akiya-bank .primary-area > .body > article .table-responsive { margin-bottom: .8em; }
  body.akiya-bank .primary-area > .body > article .entry-more .button { display: block; width: 100%; white-space: normal; text-align: center; }
}

/* 新しい物件詳細：長い値、画像スライダー、表を小画面で安定させる。 */
.akiyabank-detail { min-width: 0; }
.akiyabank-detail__overview div,
.akiyabank-detail__overview dd,
.akiyabank-detail__table td { min-width: 0; overflow-wrap: anywhere; }
.akiyabank-detail .image-slider-container { min-width: 0; }
@media screen and (max-width: 767px) {
  .akiyabank-detail__overview { grid-template-columns: 1fr; }
  .akiyabank-detail__overview div { padding: .85em .9em; }
  .akiyabank-detail__table { table-layout: fixed; }
  .akiyabank-detail__table th { width: 38%; }
  .akiyabank-detail .image-slider .slick-prev,
  .akiyabank-detail .image-slider .slick-next { width: 38px; height: 48px; }
  .akiyabank-detail__caption { padding-right: 3.5em; padding-left: 3.5em; font-size: .85em; }
}

/* 検索・カテゴリー：狭い画面でもカード、ラベル、件数を収める。 */
.akiya-card-list,
.category-list,
.akiya-card,
.category-list li { min-width: 0; }
.akiya-card-title,
.akiya-card-price,
.category-list .cat-label { overflow-wrap: anywhere; }
.category-list .cat-count { flex: 0 0 auto; margin-left: .5em; }
.search-result-header { gap: .75em; }
.search-filter-options label { min-height: 2.35em; }

/* 詳細：長い値を折り返し、画像領域を画面幅に適した高さに保つ。 */
.akiyabank-detail-preview { min-width: 0; }
.akiyabank-detail-preview__overview div,
.akiyabank-detail-preview__overview dd,
.akiyabank-detail-preview__table td { min-width: 0; overflow-wrap: anywhere; }

@media screen and (max-width: 767px) {
  .search-filter-panel { padding: 14px; }
  .search-filter-options { gap: 7px; }
  .search-filter-options label { padding: 7px 10px; }
  .search-result-header { align-items: flex-start; flex-direction: column; }
  .search-result-header h2 { line-height: 1.4; }
  .search-result-count { margin: 0; }
  .akiya-card-list { gap: 12px; }
  .category-list { gap: 8px; }
  .category-list a { min-height: 3.2em; padding: 9px 10px; line-height: 1.35; }

  .akiyabank-detail-preview__main-image { width: 100%; max-width: 100%; min-height: 0; height: auto; aspect-ratio: 4 / 3; box-sizing: border-box; }
  .akiyabank-detail-preview__main-image img { width: 100%; min-width: 0; height: 100%; object-fit: cover; }
  .akiyabank-detail-preview__arrow { width: 40px; height: 48px; font-size: 2em; }
  .akiyabank-detail-preview__arrow--prev { left: .35em; }
  .akiyabank-detail-preview__arrow--next { right: .35em; }
  .akiyabank-detail-preview__caption { padding: .5em 3.25em; font-size: .82em; }
  .akiyabank-detail-preview__table { table-layout: fixed; }
  .akiyabank-detail-preview__table th { width: 35%; }
}