/* =========================================================
 * /home-customize/ ページ専用スタイル
 *
 * - .c-hc__* prefix を採用 (map.css の .c-map-* と同方針)
 * - swiper / swiper-pagination / swiper-button-next は既存テーマの
 *   files/css/swiper-bundle.min.css と files/js/common.js (.swiper4 init) を流用
 * - Section 2 SP 並び替え: 見出し → サブ見出し → 画像 → 本文 (grid order)
 * - Section 3 swiper キャプション: 画像下部に半透明黒オーバーレイ
 * - Section 5 hc_lead_pc.jpg: ページ幅 (1120px) で配置
 *
 * 既存 utility (mt40/fs16-sp/dspFlex 等) と
 * 既存 component (postContentRow/flexBox 等) は theme 側を流用
 * ========================================================= */

/* ---------------------------------------------------------
 * Section 2/3 共通: パンフ P18 配色 (ダーク背景 + ライト文字)
 * --------------------------------------------------------- */
.c-hc__bg-dark {
  background-color: #454446;
  color: #a8aaac;
}
/* ダーク bg 内のテキストは見出し・本文・キャプション含めすべて #a8aaac で統一 */
.c-hc__bg-dark h1,
.c-hc__bg-dark h2,
.c-hc__bg-dark h3,
.c-hc__bg-dark h4,
.c-hc__bg-dark h5,
.c-hc__bg-dark p,
.c-hc__bg-dark span,
.c-hc__bg-dark div {
  color: inherit;
}

/* ---------------------------------------------------------
 * Section 2: SPACE DESIGN CONCEPT
 * --------------------------------------------------------- */
.c-hc__space-design {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 50px;
  row-gap: 24px;
  align-items: start;
}

.c-hc__space-design__img {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.c-hc__space-design__img img {
  display: block;
  width: 100%;
  height: auto;
  /* PC: 元画像の縦長アスペクト (1100x1508 ≒ 11:15) を維持 */
  aspect-ratio: 11 / 15;
  object-fit: cover;
  object-position: center center;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.c-hc__space-design__heading {
  grid-column: 2;
  grid-row: 1;
}

.c-hc__space-design__body {
  grid-column: 2;
  grid-row: 2;
}

@media screen and (max-width: 767px) {
  .c-hc__space-design {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 0;
    row-gap: 16px;
  }
  .c-hc__space-design__heading {
    grid-column: 1;
    grid-row: 1;
  }
  .c-hc__space-design__img {
    grid-column: 1;
    grid-row: 2;
  }
  .c-hc__space-design__body {
    grid-column: 1;
    grid-row: 3;
  }
  .c-hc__space-design__img img {
    /* SP: 横長 (3:2) に強制クロップ (object-fit:cover で中央クロップ) */
    aspect-ratio: 3 / 2;
  }
}

/* ---------------------------------------------------------
 * Section 3: DESIGN IDEAS (logo + swiper)
 * --------------------------------------------------------- */
.c-hc__ideas-logo {
  text-align: center;
  /* 上: 詰め / 下: swiper との間隔を広く */
  padding: 24px 0 96px;
}
.c-hc__ideas-logo img {
  display: inline-block;
  width: 280px;
  height: auto;
  max-width: 100%;
  margin-top: 0 !important;
}
@media screen and (max-width: 767px) {
  .c-hc__ideas-logo {
    padding: 16px 0 64px;
  }
  .c-hc__ideas-logo img {
    width: 200px;
  }
}

.c-hc__ideas-swiper {
  position: relative;
  padding-right: 32px;
}
@media screen and (max-width: 767px) {
  .c-hc__ideas-swiper {
    padding-right: 0;
  }
}

.c-hc__slider-img {
  position: relative;
}
.c-hc__slider-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center center;
  margin-top: 0 !important;
}

.c-hc__bg-dark .c-hc__slider-caption,
.c-hc__slider-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box; /* padding を width 内に含め、画像幅をはみ出さないように */
  margin: 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #a8aaac; /* 本文と同色 */
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
@media screen and (max-width: 767px) {
  .c-hc__slider-caption {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* pagination: 本文色 #a8aaac で統一 (背景色 #454446 と同系統で馴染ませる) */
.c-hc__pagination {
  margin-top: 40px;
  text-align: center;
}
.c-hc__pagination .swiper-pagination-bullet {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  margin: 0 5px;
  background: rgba(168, 170, 172, 0.4);
  cursor: pointer;
  list-style: none;
  opacity: 1;
}
.c-hc__pagination .swiper-pagination-bullet-active {
  background: #a8aaac;
}

/* ボタン領域は画像エリアのみカバー (pagination 56px = margin-top 40 + bullet 16 を bottom で除外)
   → top:50% が画像中央と一致する */
.c-hc__slider-btn-area {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 56px;
  pointer-events: none;
}
.c-hc__slider-button {
  position: absolute;
  top: 50%;
  right: -4px;
  transform: translateY(-50%);
  pointer-events: auto;
}
@media screen and (max-width: 767px) {
  /* SP は viewport ギリギリで丸が右にはみ出して切れる問題があるため
     PC の -24px (外側) ではなく、内側に余白を確保。
     -12px = viewport 右端から 4px 程度の余白でスライド画像と重なりにくい位置 */
  .c-hc__slider-button {
    right: -12px;
  }
}
/* arrow ボタン: 本文色 #a8aaac 円 + 背景色 #454446 矢印 (背景となじむ同系トーン) */
.c-hc__arrow {
  width: 48px;
  height: 48px;
  background: #a8aaac;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.c-hc__arrow:hover {
  background: #bcbec0;
}
@media screen and (max-width: 767px) {
  .c-hc__arrow {
    width: 40px;
    height: 40px;
  }
}
/* 矢印アイコンは flex で円の中心へ。absolute/left/top は使わない (rotate でズレるため) */
.c-hc__arrow::before {
  color: #454446;
  font-family: "design_plus";
  content: "\e94b";
  font-size: 14px;
  line-height: 1;
  display: block;
  transform: rotate(180deg);
  -webkit-font-smoothing: antialiased;
}
@media screen and (max-width: 767px) {
  .c-hc__arrow::before {
    font-size: 12px;
  }
}

/* ---------------------------------------------------------
 * HOUSING METHOD 共通 (Section 7+: bg #e8e8e8 = bgColorBeige)
 * --------------------------------------------------------- */
.c-hc__hm__icon {
  display: inline-block;
  width: 152px;
  height: auto;
  max-width: 100%;
}
@media screen and (max-width: 767px) {
  .c-hc__hm__icon {
    width: 104px;
  }
}
/* HM5 用 拡大サイズ */
section.c-hc__hm .c-hc__hm__icon--lg {
  width: 280px;
}
@media screen and (max-width: 767px) {
  section.c-hc__hm .c-hc__hm__icon--lg {
    width: 190px;
  }
}

/* HM 共通: 続きを読むボタン展開時のみ最下端コンテンツとの余白を広く取る
   折りたたみ時は本文1行目との距離を保つため margin-top は utility (mt32 mt20-sp) のまま */
section.c-hc__hm .js-details.is-opened .pullDown__summary {
  margin-top: 80px !important;
}
@media screen and (max-width: 767px) {
  section.c-hc__hm .js-details.is-opened .pullDown__summary {
    margin-top: 40px !important;
  }
}

/* ---------------------------------------------------------
 * TB 対応 (768-1024px)
 * --------------------------------------------------------- */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  /* HM3 DINKs/Kitchen 列の本文 min-height を拡張して illust の上下位置を揃える
     ※ 列幅が狭くなる TB では本文の行数差で illust が縦にズレるため
     ※ section.c-hc__hm と #anc03 は同じ要素なので descendant 組合せ不可 */
  #anc03 .colBlock .minh72 {
    min-height: 110px !important;
  }

  /* HM2 住戸専有面積 ブロック: TB は文章と画像を縦並び + 両方コンテンツ幅一杯 + 縦余白 40px */
  section.c-hc__hm .flexBox.flexDirCol-tb {
    row-gap: 40px !important;
  }
  section.c-hc__hm .flexBox.flexDirCol-tb > .flexItemSub,
  section.c-hc__hm .flexBox.flexDirCol-tb > .flexItemMain {
    width: 100% !important;
  }

  /* ----- HM4 (間取ら図) TB 対応 ----- */

  /* HM4 STUDIO~3LDK PLAN: 画像の上辺を揃える
     ※ alignItemCenter を上書きして 4 列とも top 起点に
     ※ キャプション min-height を拡張 (改行削除で行数が増えるため) */
  section.c-hc__hm .hm04_flexBox {
    align-items: flex-start !important;
  }
  section.c-hc__hm .hm04_flexBox > div .minh72 {
    min-height: 105px !important;
  }
  /* arrow の縦位置を画像中央付近に再調整 (mt120 は PC 用) */
  section.c-hc__hm .hm04_flexBox > div .mt120 {
    margin-top: 90px !important;
  }

  /* HM4 「居住空間内の壁…」ブロック: 縦並び + Main2 は 100%, Sub2 は元サイズ維持 + 中央 */
  section.c-hc__hm .flexBox.flexDirCol-tb > .flexItemMain2 {
    width: 100% !important;
  }
  section.c-hc__hm .flexBox.flexDirCol-tb > .flexItemSub2 {
    width: auto !important;
    align-self: center !important;
  }
  section.c-hc__hm .flexBox.flexDirCol-tb > .flexItemSub2 img {
    max-width: 280px;
  }

  /* HM4 3-col ブロック (リモートワーク〜壁を動かす):
     - 説明 minh72 を 100px に拡張 → 矢印・ラベル上辺整列
     - ラベル box (border-b fs20 fw600) を flex-center + min-height 65px → 罫線揃え + 1LDK 上下中央
     - 説明下 minh112 はそのまま (改行削除で短くなるが 112px の上限内) */
  section.c-hc__hm .flexBox-c3 .minh72 {
    min-height: 100px !important;
  }
  section.c-hc__hm .flexBox-c3 .border-b.fs20.fw600 {
    min-height: 68px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
    padding-bottom: 8px !important;
  }

  /* HM4 arrow2 画像: 3 矢頭を下段 3-col の small arrow 中央と概ね揃える
     ※ PC の small arrow 中央は arrow2 画像幅の 1.26% / 50% / 98.74% に位置 (矢頭が画像両端付近)
     ※ TB の small arrow 間隔 ≒ 563px → 画像幅 563 / 0.9748 ≒ 578px */
  section.c-hc__hm .w788 {
    width: 578px !important;
  }
}

/* HM5 アイデアカード グリッド: row-gap を column-gap (50px) に揃える
   ※ 親テーマの .gap50 は column-gap のみ設定 (row-gap は base 24px) のため上書き */
section.c-hc__hm .colBlock.gap50 {
  row-gap: 50px;
}
@media screen and (max-width: 767px) {
  section.c-hc__hm .colBlock.gap50 {
    row-gap: 24px;
  }
}

/* ---------------------------------------------------------
 * GARALO SERIES (ohori3 構成移植)
 * --------------------------------------------------------- */
.c-catch {
  font-size: clamp(18px, 1.7vw, 26px);
}
@media screen and (max-width: 768px) {
  .c-catch {
    font-size: clamp(16px, 4.2vw, 20px);
  }
}

.p-hc__garalo-plans__row {
  display: flex;
}
.p-hc__garalo-plans__row--2 {
  justify-content: center;
}
.p-hc__garalo-plans__row > div {
  flex: 1;
  padding: 28px 20px;
}
/* Row 2: 幅制限 */
.p-hc__garalo-plans__row--2 > div {
  max-width: calc(100% / 3);
}
/* プラン名と説明文の間の横線 */
.p-hc__garalo-plans__row > div > p:first-child {
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  padding-bottom: 6px;
}
@media screen and (max-width: 768px) {
  .p-hc__garalo-plans__row {
    flex-direction: column;
  }
  .p-hc__garalo-plans__row > div {
    padding: 20px 0;
  }
  .p-hc__garalo-plans__row--2 > div {
    max-width: 100%;
  }
}

/* HM5 アイデアカード: 白背景 + 内側パディング (ohori3 details-parts-wrapper 相当) */
.c-hc__hm__idea-card {
  background-color: #fff;
  padding: 32px 32px 24px;
}
@media screen and (max-width: 767px) {
  .c-hc__hm__idea-card {
    padding: 24px 20px 20px;
  }
}
/* カード内の最下端余白を整理 (本文 p の mb40 を除去) */
.c-hc__hm__idea-card > p:last-child {
  margin-bottom: 0;
}

/* 本文フェードマスク
   折りたたみ時: 1 行分だけ表示 + 下方フェードアウト
   展開時 (.js-details.is-opened): mask 解除 + 全文表示
   ※ 親テーマ干渉対策で section.c-hc__hm スコープにして specificity を上げる */
/* 注: transition: max-height は親テーマ等の継承 transition と競合して値が反映されない不具合があるため
        ここでは transition を付けない。即時 展開/折りたたみ。
   1 行目を完全表示 (max-height >= line-height 1.8) + 全体を緩やかにフェード (uniform ~50%) */
section.c-hc__hm p.c-hc__hm__body {
  position: relative;
  /* max-height = lh 1.8 と同等 → 1 行ぎりぎり収まり、最下端で文字下部が薄く消える */
  max-height: 1.8em !important;
  overflow: hidden !important;
  /* 上 50% は uniform 0.55 (1 行をうっすら全表示)、下 50% で 0 までフェード
     → 文字下部が自然に薄れ消えるように見える */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.25) 85%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.25) 85%, rgba(0,0,0,0) 100%);
}
section.c-hc__hm .js-details.is-opened p.c-hc__hm__body {
  max-height: none !important;
  -webkit-mask-image: none !important;
              mask-image: none !important;
  overflow: visible !important;
}

/* ---------------------------------------------------------
 * Section 5: lead 画像 (ページ幅 1120px)
 * --------------------------------------------------------- */
.c-hc__lead-img {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto 48px;
}
.c-hc__lead-img img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0 !important;
}
