@charset "utf-8";

/* =========================
   ルームプラン：サブヘッダー
   ========================= */

/* 画像 260px ＋ その下にはみ出す見出し */
.roomplan-subhead {
  position: relative;
  padding-top: 215px;   /* h1 の開始位置 */
  padding-bottom: 70px; /* リード分の余白 */
  background-color: #fff;
  overflow: visible;
}

/* 上 260px だけ背景画像を敷く */
.roomplan-subhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 260px;
  background-image: url("../images/roomplan/subhead.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* 中身は最大幅 1000px・左寄せ */
.roomplan-subhead__overlay {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.roomplan-subhead__inner {
  text-align: left;
}

/* h1 */
.roomplan-subhead__title {
  font-size: 68px;
  letter-spacing: 0.18em;
  color: #211e23;
  line-height: 1.2;
}

/* リードテキスト */
.roomplan-subhead__lead {
  margin-top: 10px;
  font-size: 24px;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* =========================
   サブヘッダー SP 調整
   ========================= */
@media (max-width: 768px) {
  .roomplan-subhead {
    padding-top: 160px;
    padding-bottom: 50px;
  }

  .roomplan-subhead::before {
    height: 220px;
  }

  .roomplan-subhead__overlay {
    padding: 0 16px;
    box-sizing: border-box;
  }

  .roomplan-subhead__title {
    font-size: 34px;
    letter-spacing: 0.08em;
  }

  .roomplan-subhead__lead {
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.06em;
  }
}

/* =========================
   ルームプラン本編
   ========================= */

.roomplan-main {
  padding: 40px 0 20px;
  background-color: #fff;
}

.roomplan-main__inner {
  max-width: 1000px;
  margin: 0 auto;
}

/* 上の階層図ブロック */
.roomplan-main__plan {
  margin-bottom: 60px;
  text-align: center; /* 中の map を中央に */
}

/* =========================
   階層表（HTMLテーブル）
   ========================= */

.roomplan-map {
  width: min(640px, 100%);  /* PCで最大640px */
  margin: 0 auto;           /* コンテナ中央 */
}

.roomplan-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 18px;
}

/* 階数（左列） */
.roomplan-table__floor {
  width: 60px;
  text-align: center;
  font-weight: normal;
  border-bottom: 1px solid #d7d7d7;
  border-right: 1px solid #d7d7d7;
  padding: 16px 0;
}

/* 共通セル */
.roomplan-table__cell {
  text-align: center;
  border-bottom: 1px solid #d7d7d7;
  border-right: 1px solid #d7d7d7;
  padding: 16px 0;
}

/* A/B/C/CG のタイプセル（薄グレー） */
.roomplan-table__cell--type {
  background-color: #eceeef;
  cursor: pointer;
}

/* 1階の設備セル */
.roomplan-table__cell--facility {
  background-color: #ffffff;
}

/* 屋内駐輪場だけ枠を少し強調 */
.roomplan-table__cell--parking {
  border: 1px solid #e2d4b2;
}

/* テーブルの左端・一番上の線を整える */
.roomplan-table tr:first-child th,
.roomplan-table tr:first-child td {
  border-top: 1px solid #d7d7d7;
}
.roomplan-table tr th:first-child,
.roomplan-table tr td:first-child {
  border-left: 1px solid #d7d7d7;
}

/* =========================
   タイプ別ハイライト
   ========================= */

.roomplan-map--active-a .roomplan-table__cell[data-roomplan-type="a"],
.roomplan-map--active-b .roomplan-table__cell[data-roomplan-type="b"],
.roomplan-map--active-c .roomplan-table__cell[data-roomplan-type="c"],
.roomplan-map--active-cg .roomplan-table__cell[data-roomplan-type="cg"] {
  background-color: #20253a;
  color: #ffffff;
}

/* =========================
   下のタイプ概要カード（4枚）
   ========================= */

.roomplan-main__cards {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  row-gap: 40px;
  justify-items: center;
}

.roomplan-typecard {
  display: block;
  width: 100%;       /* グリッド列いっぱい */
  max-width: 480px;  /* 1枚あたり約480px */
}

.roomplan-typecard img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* ホバーで少し浮かせる */
.roomplan-typecard:hover img,
.roomplan-typecard:focus-visible img {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* JS から付く is-active で枠線強調 */
.roomplan-typecard.is-active img {
  box-shadow: 0 0 0 3px #9c8556;
}

/* =========================
   SP 調整
   ========================= */
@media (max-width: 768px) {
  .roomplan-main {
    padding: 40px 5vw 60px;
  }

  .roomplan-main__plan {
    margin-bottom: 40px;
  }

  .roomplan-map {
    width: 100%;
  }

  .roomplan-table {
    font-size: 16px;
  }

  .roomplan-table__floor,
  .roomplan-table__cell {
    padding: 12px 0;
  }

  .roomplan-main__cards {
    grid-template-columns: 1fr; /* スマホでは1列表示 */
    row-gap: 24px;
  }

  .roomplan-typecard {
    max-width: none;
  }
}
