/*
  file: list-cards.css
  scope:
  - /test/
  - /test/search/
  - station pages
  purpose:
  - property list cards
  - building group cards
  - room rows and CTA
*/

body.site-theme-conversion .property-grid .building-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .building-card__photo {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 5px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  /* contain 時の余白を白に近づけ、#f3f5f7 より目立ちにくく */
  background: #f8fafc;
  border-radius: 14px 14px 0 0;
}

/* TOP 新着（.tp-home-new__grid）の建物枠は従来のトーンを維持（一覧側の緩和対象外） */
body.site-theme-conversion .property-grid.tp-home-new__grid .building-card__photo {
  background: #f3f5f7;
}

body.site-theme-conversion .property-grid .building-card__photo.is-floorplan {
  place-items: center;
  padding: 0;
  background: #fff;
}

body.site-theme-conversion .property-grid .building-card__photo img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
  transition: transform 0.22s ease;
}

body.site-theme-conversion .property-grid .building-card__photo img.is-floorplan {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
}

/* -----------------------------------------------------------------
   一覧・検索・駅グリッドの物件カード写真
   画像の縦横比は崩さない（object-fit の等倍スケールのみ）。
   img に scaleX / scaleY や width だけ・height だけの非等方ストレッチは付けない。
   ホバー演出は transform: scale(1.04) のような縦横同率のみ（間取り .is-floorplan は除外）。
   TOP 新着（.tp-home-new__grid）の property-card は styles.css 側の専用レイアウトを優先するため除外。
----------------------------------------------------------------- */

body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb:not(.is-floorplan) {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 6px;
  margin: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  /* 建物サムネ枠: 外観 contain 時の余白をやわらかく（号室 .room-row__thumb は別指定のまま） */
  background: #f8fafc;
  border-radius: 16px 16px 0 0;
}

body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb:not(.is-floorplan) img.list-card-image:not(.is-floorplan) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center center;
  transform-origin: center center;
  transition: transform 0.22s ease;
}

body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb.is-floorplan {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  border-radius: 16px 16px 0 0;
}

body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb.is-floorplan img.list-card-image,
body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb img.list-card-image.is-floorplan {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
}

body.site-theme-conversion .property-grid .building-card__title {
  font-size: clamp(16px, 1.08vw, 18px);
  font-weight: 700;
  color: #334155;
  line-height: 1.5;
}

@media (min-width: 701px) {
  body.site-theme-conversion .property-grid:not(.property-grid--station) .property-card > .list-card-info > .list-card-body > .list-card-pricebar {
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px 6px;
    margin: 0 0 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
  }

  body.site-theme-conversion .property-grid:not(.property-grid--station) .property-card > .list-card-info > .list-card-body > .list-card-pricebar .list-rent {
    color: #1f2937;
    font-size: clamp(21px, 1.8vw, 25px);
    font-weight: 900;
    line-height: 1.08;
  }

  body.site-theme-conversion .property-grid:not(.property-grid--station) .property-card > .list-card-info > .list-card-body > .list-card-pricebar .list-mgmt {
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }
}

body.site-theme-conversion .property-grid .room-row__cta {
  min-width: 180px;
}

body.site-theme-conversion .property-grid .room-row__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
}

body.site-theme-conversion .property-grid .room-row__title a {
  color: #0f172a;
  text-decoration: none;
}

body.site-theme-conversion .property-grid .room-row__title a:hover {
  color: #2563eb;
  text-decoration: underline;
}

@media (max-width: 900px) {
  body.site-theme-conversion .property-grid .building-card__head {
    grid-template-columns: 1fr;
  }

  body.site-theme-conversion .property-grid .room-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
  }

  body.site-theme-conversion .property-grid .room-row__cta {
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* 一覧・検索・駅ページ: カード画像ギャラリー prev/next（.js-card-slider） */
.building-card__photo.js-card-slider,
.thumb-wrap.list-card-thumb.js-card-slider,
.room-row__thumb.js-card-slider,
.tp-list-card__photo.js-card-slider,
.search-result-card__photo.js-card-slider {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo-slider-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
}

/* 矢印は inner 基準で absolute（外枠の flex 中央寄せと併用） */
body.site-theme-conversion .property-grid .building-card__photo.js-card-slider,
body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb.js-card-slider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.building-card__photo.js-card-slider .card-photo-slider-inner img[data-card-slide-img],
.thumb-wrap.list-card-thumb.js-card-slider .card-photo-slider-inner img[data-card-slide-img],
.room-row__thumb.js-card-slider img[data-card-slide-img],
.tp-list-card__photo.js-card-slider .card-photo-slider-inner img[data-card-slide-img],
.search-result-card__photo.js-card-slider .card-photo-slider-inner img[data-card-slide-img],
.building-card__photo.js-card-slider > img[data-card-slide-img],
.thumb-wrap.list-card-thumb.js-card-slider > img[data-card-slide-img],
.tp-list-card__photo.js-card-slider > img[data-card-slide-img],
.search-result-card__photo.js-card-slider > img[data-card-slide-img] {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  touch-action: pan-y;
}

/* .list-card-image と [data-card-slide-img] は同一要素のことが多い */
body.site-theme-conversion .property-grid .building-card__photo.js-card-slider .card-photo-slider-inner img.list-card-image,
body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb.js-card-slider .card-photo-slider-inner img.list-card-image,
body.site-theme-conversion .property-grid .building-card__photo.js-card-slider > img.list-card-image,
body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb.js-card-slider > img.list-card-image {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.card-photo-slider-inner .card-photo-nav,
.card-photo-slider-inner .list-card-img-nav,
.card-photo-nav,
.list-card-img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  padding: 0;
  margin: 0;
}

.card-photo-nav--prev,
.list-card-img-nav--prev {
  left: 8px;
}

.card-photo-nav--next,
.list-card-img-nav--next {
  right: 8px;
}

.card-photo-nav:hover,
.list-card-img-nav:hover {
  background: #fff;
}

@media (max-width: 760px) {
  .card-photo-nav,
  .list-card-img-nav {
    width: 30px;
    height: 30px;
    font-size: 21px;
  }

  .card-photo-nav--prev,
  .list-card-img-nav--prev {
    left: 6px;
  }

  .card-photo-nav--next,
  .list-card-img-nav--next {
    right: 6px;
  }
}

body.site-theme-conversion .property-grid .room-row__thumb {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 4px;
  overflow: hidden;
  background: #f3f5f7;
  border-radius: 10px;
  aspect-ratio: 3 / 2;
  width: 100%;
  max-width: 112px;
  height: auto;
  min-height: 0;
  cursor: zoom-in;
}

/* 号室サムネはスライダーなし方針（旧DOMに矢印が残っていても非表示） */
body.site-theme-conversion .property-grid .room-row__thumb .card-photo-nav,
body.site-theme-conversion .property-grid .room-row__thumb .list-card-img-nav {
  display: none !important;
}

body.site-theme-conversion .property-grid .room-row__thumb.is-floorplan {
  place-items: center;
  padding: 0;
  background: #fff;
}

body.site-theme-conversion .property-grid .room-row__thumb img:not(.is-floorplan),
body.site-theme-conversion .property-grid .room-row__thumb .list-card-image:not(.is-floorplan) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
  transition: transform 0.22s ease;
}

body.site-theme-conversion .property-grid .room-row__thumb.is-floorplan img,
body.site-theme-conversion .property-grid .room-row__thumb img.is-floorplan,
body.site-theme-conversion .property-grid .room-row__thumb.is-floorplan .list-card-image,
body.site-theme-conversion .property-grid .room-row__thumb .list-card-image.is-floorplan {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
}

body.site-theme-conversion .property-grid .room-row {
  padding: 8px 4px;
  gap: 10px;
}

body.site-theme-conversion .search-result-card__photo,
body.site-theme-conversion .tp-list-card__photo {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 6px;
  overflow: hidden;
  background: #f8fafc;
  aspect-ratio: 4 / 3;
  border-radius: 14px 14px 0 0;
}

body.site-theme-conversion .search-result-card__photo.is-floorplan,
body.site-theme-conversion .tp-list-card__photo.is-floorplan {
  place-items: center;
  padding: 0;
  background: #fff;
}

body.site-theme-conversion .search-result-card__photo img:not(.is-floorplan),
body.site-theme-conversion .tp-list-card__photo img:not(.is-floorplan) {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
  transition: transform 0.22s ease;
}

body.site-theme-conversion .search-result-card__photo img.is-floorplan,
body.site-theme-conversion .tp-list-card__photo img.is-floorplan {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #fff;
}

@media (hover: hover) and (pointer: fine) {
  body.site-theme-conversion .property-grid .building-card:hover .building-card__photo img:not(.is-floorplan) {
    transform: scale(1.04);
  }

  body.site-theme-conversion .property-grid .room-row:hover .room-row__thumb img:not(.is-floorplan),
  body.site-theme-conversion .property-grid .room-row:hover .room-row__thumb .list-card-image:not(.is-floorplan) {
    transform: scale(1.04);
  }

  body.site-theme-conversion .search-result-card:hover .search-result-card__photo img:not(.is-floorplan),
  body.site-theme-conversion .tp-list-card:hover .tp-list-card__photo img:not(.is-floorplan) {
    transform: scale(1.04);
  }
}

/* PC: 建物メイン写真枠をやや大きく（号室サムネ .room-row__thumb は対象外） */
@media (min-width: 901px) {
  body.site-theme-conversion .property-grid .building-card__head {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 16px;
  }

  body.site-theme-conversion .property-grid .building-card__photo {
    min-height: 210px;
    align-self: stretch;
  }

  body.site-theme-conversion .property-grid:not(.tp-home-new__grid) .property-card > .thumb-wrap.list-card-thumb.js-card-slider:not(.list-card-thumb--empty) {
    min-height: 200px;
  }

  body.site-theme-conversion .tp-search-results .building-card__head {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 16px;
  }

  body.site-theme-conversion .tp-search-results .building-card__photo,
  body.site-theme-conversion .tp-search-results .building-card__photo.js-card-slider {
    min-height: 210px;
  }

  body.site-theme-conversion .search-result-card__photo,
  body.site-theme-conversion .tp-list-card__photo {
    min-height: 200px;
  }

  body.site-theme-conversion .tp-search-results .thumb-wrap.list-card-thumb.js-card-slider:not(.list-card-thumb--empty),
  body.site-theme-conversion .tp-search-results .list-card-thumb.js-card-slider:not(.list-card-thumb--empty) {
    min-height: 200px;
  }
}
