/* =====================================================
   matoba — Property Detail Page (Plugin-bundled CSS)
   プラグインが自動生成する物件詳細ページ用スタイル
   .matoba-page スコープ配下で自己完結
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Noto+Sans+JP:wght@400;500;700&family=Shippori+Mincho:wght@400;500;700&display=swap');

.matoba-page {
  --color-text: #333;
  --color-white: #fff;
  --color-bg: #fff;
  --color-line: #c7c7c7;
  --font-heading: "Shippori Mincho", "Noto Serif JP", "游明朝", "Yu Mincho", "YuMincho", serif;
  --font-en: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body: "Noto Sans JP", "游ゴシック", "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;

  --m-pad-1200: max(24px, calc((100% - 1200px) / 2));
  --m-pad-900:  max(24px, calc((100% - 900px) / 2));

  box-sizing: border-box;
  position: relative;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.matoba-page *,
.matoba-page *::before,
.matoba-page *::after { box-sizing: inherit; }

.matoba-page .m-detail-hero,
.matoba-page .m-detail-gallery-main,
.matoba-page .m-detail-thumb {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.matoba-page img { max-width: 100%; height: auto; display: block; }
.matoba-page a { color: inherit; text-decoration: none; }
.matoba-page button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* =====================================================
   追従お問い合わせボタン（右端固定）
   ===================================================== */
.matoba-page .m-float-contact {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  width: 60px;
  height: 60px;
  background: #333;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.matoba-page .m-float-contact:hover { background: #555; }
.matoba-page .m-float-contact svg { width: 28px; height: 20px; fill: #fff; }

/* =====================================================
   Header / Nav（白背景・ダーク文字・下線）
   ===================================================== */
.matoba-page .m-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 60px 18px 94px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-line);
}
.matoba-page .m-logo {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.04em;
  line-height: 1;
}
.matoba-page .m-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.matoba-page .m-nav a {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text);
  position: relative;
  padding-bottom: 4px;
  white-space: nowrap;
}
.matoba-page .m-nav a[aria-current="page"] { opacity: 0.55; }
.matoba-page .m-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right 0.3s ease;
}
.matoba-page .m-nav a:hover::after { right: 0; }

.matoba-page .m-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 60;
}
.matoba-page .m-nav-toggle span {
  display: block;
  position: absolute;
  left: 6px; right: 6px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}
.matoba-page .m-nav-toggle span:nth-child(1) { top: 12px; }
.matoba-page .m-nav-toggle span:nth-child(2) { top: 19px; }
.matoba-page .m-nav-toggle span:nth-child(3) { top: 26px; }
.matoba-page.is-nav-open .m-nav-toggle span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.matoba-page.is-nav-open .m-nav-toggle span:nth-child(2) { opacity: 0; }
.matoba-page.is-nav-open .m-nav-toggle span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* =====================================================
   Button (m-btn / m-btn-dark)
   ===================================================== */
.matoba-page .m-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 257px;
  height: 50px;
  background: var(--color-white);
  border: 1px solid #333;
  color: #333;
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.14em;
  padding-left: 10px;
  transition: background 0.3s ease, color 0.3s ease;
  overflow: hidden;
}
.matoba-page .m-btn::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 10px;
  background: #333;
  transition: width 0.3s ease;
}
.matoba-page .m-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 8px;
  height: 8px;
  border-top: 1px solid #333;
  border-right: 1px solid #333;
  transform: translateY(-50%) rotate(45deg);
  transition: right 0.3s ease, border-color 0.3s ease;
}
.matoba-page .m-btn:hover { background: #333; color: var(--color-white); }
.matoba-page .m-btn:hover::before { width: 100%; }
.matoba-page .m-btn:hover::after { border-color: var(--color-white); right: 16px; }
.matoba-page .m-btn span { position: relative; z-index: 1; }

/* =====================================================
   PRINT OUT 縦タブ
   ===================================================== */
.matoba-page .m-detail-print {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  width: 44px;
  min-height: 180px;
  background: #1a1a1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  padding: 22px 0;
  transition: background 0.3s ease, width 0.3s ease;
}
/* 施工事例ページでは PRINT OUT を非表示（クライアント要望） */
.matoba-page.is-work .m-detail-print { display: none !important; }

/* 施工事例の見出しタグ行（WORKS No.○○）をヒーローの「WORKS」と同じ書体に */
.matoba-page.is-work .m-detail-tag-line {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* =====================================================
   施工事例 (.is-work) 専用：写真ギャラリー
   PC：横写真＝全幅(1カラム)／縦写真＝2枚並び(2カラム)。
       縦が1枚しかない場合は隣が空きになる（grid-auto-flow: row）。
   SP：すべて1カラム。
   ※写真の向きは JS が判定して is-landscape / is-portrait を付与。
   ===================================================== */
.matoba-page .m-work-photos {
  max-width: 900px;
  margin: 50px auto 0;
  padding: 0 24px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: row;          /* dense にしない＝順序維持＆空きを残す */
  gap: 16px;
  align-items: start;
}
.matoba-page .m-work-photo {
  margin: 0;
  background: #ececec;
  grid-column: span 1;          /* 既定（縦写真）は1カラム */
}
/* 横写真は全幅（1カラム＝2トラックぶち抜き） */
.matoba-page .m-work-photo.is-landscape { grid-column: 1 / -1; }
.matoba-page .m-work-photo.is-portrait  { grid-column: span 1; }
.matoba-page .m-work-photo img {
  display: block;
  width: 100%;
  height: auto;
}
.matoba-page .m-work-photo figcaption {
  font-family: var(--font-heading);
  font-size: 13px;
  color: #555;
  padding: 6px 2px 0;
  letter-spacing: 0.04em;
}
.matoba-page .m-work-photos .m-detail-gallery-caption {
  grid-column: 1 / -1;
  margin: 12px 0 0;
}
@media (max-width: 768px) {
  .matoba-page .m-work-photos {
    grid-template-columns: 1fr;   /* SPは全て1カラム */
    padding: 0 16px;
  }
  .matoba-page .m-work-photo.is-landscape,
  .matoba-page .m-work-photo.is-portrait { grid-column: 1 / -1; }
}

/* 施工事例：CTA（CONTACT）の上に写真とのマージン、下にフッターとのマージンを確保 */
.matoba-page.is-work .m-detail-cta {
  padding-top: 80px;
  padding-bottom: 160px;
}
@media (max-width: 768px) {
  .matoba-page.is-work .m-detail-cta { padding-top: 56px; padding-bottom: 100px; }
}
.matoba-page .m-detail-print:hover { background: #000; }
.matoba-page .m-detail-print span {
  display: inline-block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}

/* =====================================================
   Detail — 見出し
   ===================================================== */
.matoba-page .m-detail-heading { padding: 80px var(--m-pad-1200) 50px; }

.matoba-page .m-detail-tag-line {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 16px;
  color: #000;
  letter-spacing: 0.04em;
}

.matoba-page .m-detail-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 32px;
  margin: 0;
  color: #000;
  letter-spacing: 0.04em;
}

/* Detail — ヒーロー画像 */
.matoba-page .m-detail-hero {
  position: relative;
  margin: 0 var(--m-pad-1200) 80px;
  aspect-ratio: 1200 / 900;
  background: #ececec;
  overflow: hidden;
}
.matoba-page .m-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.matoba-page .m-detail-hero-tag {
  position: absolute;
  top: 0; left: 0;
  background: var(--color-white);
  color: #000;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 8px 18px;
  z-index: 2;
}

/* Detail — Introduction */
.matoba-page .m-detail-intro {
  position: relative;
  padding: 60px var(--m-pad-900) 60px;
}
.matoba-page .m-detail-intro-heading {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0 0 36px;
  color: #000;
  padding-right: 96px;
}
.matoba-page .m-detail-intro-text {
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: #000;
  max-width: 900px;
  margin: 0;
}
.matoba-page .m-detail-intro-contact {
  position: absolute;
  top: 60px;
  right: var(--m-pad-900);
  width: 72px;
  height: 72px;
  background: #333;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.matoba-page .m-detail-intro-contact:hover { background: #555; }
.matoba-page .m-detail-intro-contact svg { width: 32px; height: 22px; fill: #fff; }

/* Detail — 間取り図 */
.matoba-page .m-detail-plan {
  display: flex;
  justify-content: center;
  margin: 40px var(--m-pad-900) 80px;
}
.matoba-page .m-detail-plan img { max-width: 541px; width: 100%; height: auto; }

/* Detail — 写真ギャラリー（メイン900px・下に横スクロールサムネ・縦写真対応・左右矢印） */
.matoba-page .m-detail-gallery {
  max-width: 900px;
  margin: 60px auto 0;
  padding: 0 24px;
  box-sizing: border-box;
}
.matoba-page .m-detail-gallery-stage {
  position: relative;
  width: 100%;
  background: #ececec;
  text-align: center;
  overflow: hidden;
}
.matoba-page .m-detail-gallery-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 360px;
}
.matoba-page .m-detail-gallery-main img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.25s ease;
}
/* メイン写真 左下のキャプション（例：リビングダイニング） */
.matoba-page .m-detail-gallery-cap {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 8px 14px;
}
.matoba-page .m-detail-gallery-cap[hidden] { display: none; }

/* ギャラリー・間取り図の下の黒ベタ CONTACT ボタン */
.matoba-page .m-detail-mid-cta {
  display: flex;
  justify-content: center;
  margin: 36px var(--m-pad-900) 0;
}
/* CONTACT 表記（アイコン無し）なので、封筒アイコン用の左パディングを打ち消す */
.matoba-page .m-detail-mid-cta .m-btn-dark { padding-left: 10px; }
.matoba-page .m-detail-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.matoba-page .m-detail-gallery-arrow:hover { background: rgba(0, 0, 0, 0.85); }
.matoba-page .m-detail-gallery-arrow[data-dir="prev"] { left: 14px; }
.matoba-page .m-detail-gallery-arrow[data-dir="next"] { right: 14px; }
.matoba-page .m-detail-gallery-arrow svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
}
.matoba-page .m-detail-thumbs {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.matoba-page .m-detail-thumb {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  overflow: hidden;
  background: #ececec;
  cursor: pointer;
  border: 0;
  padding: 0;
  position: relative;
  scroll-snap-align: start;
}
.matoba-page .m-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}
.matoba-page .m-detail-thumb:hover img { filter: brightness(1.1); }
.matoba-page .m-detail-thumb.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #333;
  pointer-events: none;
}

/* Detail — ギャラリー出典キャプション（任意・入力時のみ表示） */
.matoba-page .m-detail-gallery-caption {
  margin: 12px 0 80px;
  text-align: right;
  font-size: 12px;
  line-height: 1.7;
  color: #888;
}
.matoba-page .m-detail-gallery-caption a { color: #888; text-decoration: underline; }
.matoba-page .m-detail-gallery-caption .label {
  display: block;
  color: #555;
  letter-spacing: 0.1em;
}

/* Detail — スペック表 */
.matoba-page .m-detail-spec { margin: 80px var(--m-pad-900) 60px; }
.matoba-page .m-detail-spec-heading {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 30px;
  color: #000;
  padding-left: 16px;
  letter-spacing: 0.06em;
}
.matoba-page .m-detail-spec-table {
  display: grid;
  grid-template-columns: 214px 1fr;
  border-top: 1px solid var(--color-line);
  margin: 0;
}
.matoba-page .m-detail-spec-table dt,
.matoba-page .m-detail-spec-table dd {
  padding: 22px 16px;
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1.7;
  color: #000;
  border-bottom: 1px solid var(--color-line);
  margin: 0;
}
.matoba-page .m-detail-spec-table dt { font-weight: 500; background: transparent; }
.matoba-page .m-detail-spec-table dd .notes {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.8;
  color: #555;
}

/* 折りたたみ：初期状態では .is-collapsible な dt/dd を非表示。is-open で展開 */
.matoba-page .m-detail-spec.has-collapsible:not(.is-open) .m-detail-spec-table .is-collapsible {
  display: none;
}

/* MORE / CLOSE ボタン */
.matoba-page .m-detail-spec-toggle {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.matoba-page .m-detail-spec-more,
.matoba-page .m-detail-spec-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 240px;
  height: 48px;
  background: #fff;
  border: 1px solid #333;
  color: #333;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.matoba-page .m-detail-spec-more:hover,
.matoba-page .m-detail-spec-close:hover {
  background: #333;
  color: #fff;
}
.matoba-page .m-detail-spec-more svg {
  width: 14px; height: 8px;
  fill: none; stroke: currentColor;
  transition: transform 0.25s ease;
}
.matoba-page .m-detail-spec.has-collapsible.is-open .m-detail-spec-more { display: none; }
.matoba-page .m-detail-spec.has-collapsible:not(.is-open) .m-detail-spec-close { display: none; }

/* Detail — 地図（下マージンは CTA と詰めて MORE ボタン程度の間隔に） */
.matoba-page .m-detail-map {
  margin: 60px var(--m-pad-900) 24px;
  aspect-ratio: 900 / 600;
  background: #ececec;
  overflow: hidden;
  border: 1px solid #ddd;
}
.matoba-page .m-detail-map iframe,
.matoba-page .m-detail-map img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

/* Detail — CTA（上は地図と詰める。下はフッターとのマージン維持） */
.matoba-page .m-detail-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 0 24px 140px;
}
/* CONTACT 表記（アイコン無し）のボタンは封筒用の左パディングを打ち消す */
.matoba-page .m-detail-cta .m-btn-dark:not(:has(.m-btn-mail)) { padding-left: 10px; }
.matoba-page .m-btn-dark {
  background: #333;
  color: #fff;
  border-color: #333;
  position: relative;
  padding-left: 60px;
}
.matoba-page .m-btn-dark::before { display: none; }
.matoba-page .m-btn-dark::after { border-top-color: #fff; border-right-color: #fff; }
.matoba-page .m-btn-dark .m-btn-mail {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 22px;
  height: 16px;
  transform: translateY(-50%);
  fill: #fff;
  transition: fill 0.3s ease;
}
.matoba-page .m-btn-dark:hover { background: #555; color: #fff; }
.matoba-page .m-btn-dark:hover::after { border-top-color: #fff; border-right-color: #fff; }

/* =====================================================
   Responsive — Tablet (≤1024px)
   ===================================================== */
@media (max-width: 1024px) {
  .matoba-page .m-header { padding: 16px 24px; }
  .matoba-page .m-logo { font-size: 28px; }
  .matoba-page .m-nav { gap: 22px; }
  .matoba-page .m-nav a { font-size: 14px; }

  .matoba-page .m-detail-title { font-size: 26px; }
  .matoba-page .m-detail-thumb { width: 84px; height: 84px; }
  .matoba-page .m-detail-spec-table { grid-template-columns: 180px 1fr; }
  .matoba-page .m-detail-spec-table dt,
  .matoba-page .m-detail-spec-table dd { font-size: 15px; padding: 18px 12px; }

  /* タブレット：PRINT OUT 縦タブを縮小 */
  .matoba-page .m-detail-print { width: 34px; min-height: 130px; padding: 16px 0; }
  .matoba-page .m-detail-print span { font-size: 12px; letter-spacing: 0.22em; }
}

/* =====================================================
   Responsive — Mobile (≤768px)
   ===================================================== */
@media (max-width: 768px) {
  .matoba-page .m-header { padding: 14px 20px; }
  .matoba-page .m-logo { font-size: 26px; }
  .matoba-page .m-nav-toggle { display: block; }
  .matoba-page .m-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    z-index: 55;
  }
  .matoba-page .m-nav a { font-size: 20px; }
  .matoba-page.is-nav-open .m-nav { transform: translateX(0); }

  .matoba-page .m-float-contact { right: 14px; width: 50px; height: 50px; }
  .matoba-page .m-float-contact svg { width: 24px; height: 17px; }

  .matoba-page .m-detail-heading { padding-top: 40px; padding-bottom: 24px; }
  .matoba-page .m-detail-tag-line { font-size: 14px; }
  .matoba-page .m-detail-title { font-size: 22px; line-height: 1.4; }
  .matoba-page .m-detail-hero { margin-left: 0; margin-right: 0; margin-bottom: 40px; }
  .matoba-page .m-detail-hero-tag { font-size: 14px; padding: 6px 12px; }
  .matoba-page .m-detail-intro { padding-top: 30px; padding-bottom: 30px; }
  .matoba-page .m-detail-intro-heading { font-size: 18px; margin-bottom: 24px; padding-right: 0; }
  .matoba-page .m-detail-intro-text { font-size: 14px; padding-right: 0; }
  .matoba-page .m-detail-intro-contact {
    position: static;
    width: 100%;
    height: 64px;
    margin-top: 28px;
  }
  .matoba-page .m-detail-intro-contact svg { width: 36px; height: 24px; }
  /* ギャラリー：メインは縮小・サムネは下に横スクロール（PC仕様の延長） */
  .matoba-page .m-detail-gallery { padding: 0 16px; }
  .matoba-page .m-detail-gallery-main { min-height: 240px; }
  .matoba-page .m-detail-gallery-arrow {
    width: 36px; height: 36px;
  }
  .matoba-page .m-detail-gallery-arrow[data-dir="prev"] { left: 8px; }
  .matoba-page .m-detail-gallery-arrow[data-dir="next"] { right: 8px; }
  .matoba-page .m-detail-thumb { width: 72px; height: 72px; flex-shrink: 0; }
  .matoba-page .m-detail-spec-heading { font-size: 18px; }
  .matoba-page .m-detail-spec-table { grid-template-columns: 1fr; }
  .matoba-page .m-detail-spec-table dt,
  .matoba-page .m-detail-spec-table dd { font-size: 14px; padding: 14px 10px; }
  .matoba-page .m-detail-spec-table dt { padding-bottom: 4px; border-bottom: 0; color: #555; }
  .matoba-page .m-detail-spec-table dd { padding-top: 4px; }
  .matoba-page .m-detail-spec-more,
  .matoba-page .m-detail-spec-close { width: 100%; max-width: 320px; }
  .matoba-page .m-detail-cta { padding: 0 24px 80px; gap: 16px; }
  /* スマホ：PRINT OUT 縦タブをさらに縮小＋本文にかぶらないよう左下へ寄せる */
  .matoba-page .m-detail-print {
    width: 28px; min-height: 100px; padding: 12px 0;
    top: auto; bottom: 20px; transform: none;
  }
  .matoba-page .m-detail-print span { font-size: 10px; letter-spacing: 0.18em; }
}

/* =====================================================
   テーマ（Lightning 等）のヘッダー／フッター／装飾を強力に非表示
   ===================================================== */
body:has(.matoba-page) > header,
body:has(.matoba-page) header:not(.m-header):not(.entry-header):not(.page-header),
body:has(.matoba-page) .l-header,
body:has(.matoba-page) header.l-header,
body:has(.matoba-page) .l-header-container,
body:has(.matoba-page) #l-header,
body:has(.matoba-page) .site-header,
body:has(.matoba-page) #site-header,
body:has(.matoba-page) .siteHeader,
body:has(.matoba-page) #siteHeader,
body:has(.matoba-page) .siteHeader_container,
body:has(.matoba-page) .global-nav,
body:has(.matoba-page) .global_nav,
body:has(.matoba-page) .gnav,
body:has(.matoba-page) #gnav,
body:has(.matoba-page) .vk_header,
body:has(.matoba-page) .vk-site-header,
body:has(.matoba-page) .vk-mobile-nav,
body:has(.matoba-page) #vk-mobile-nav,
body:has(.matoba-page) .vk-mobile-nav-menu-btn,
body:has(.matoba-page) #vk-mobile-nav-menu-btn,
body:has(.matoba-page) .vk-mobile-nav-drop-in,
body:has(.matoba-page) .headerColor-default,
body:has(.matoba-page) .header-container {
  display: none !important;
}

body:has(.matoba-page) .entry-header,
body:has(.matoba-page) .page-header,
body:has(.matoba-page) .entry-title,
body:has(.matoba-page) .page-title,
body:has(.matoba-page) .archive-header,
body:has(.matoba-page) .mainTitle,
body:has(.matoba-page) .breadcrumb,
body:has(.matoba-page) #breadcrumb,
body:has(.matoba-page) .breadcrumbList,
body:has(.matoba-page) .ld-breadcrumb,
body:has(.matoba-page) nav[aria-label="breadcrumb"] {
  display: none !important;
}

/* テーマのデフォルトフッター（Powered by / Copyright 等）を非表示 */
body:has(.matoba-page) .l-footer,
body:has(.matoba-page) .site-footer,
body:has(.matoba-page) #site-footer,
body:has(.matoba-page) .siteFooter,
body:has(.matoba-page) .l-footer__powered,
body:has(.matoba-page) .l-footer__copyright,
body:has(.matoba-page) .siteContent_footer,
body:has(.matoba-page) .footer-copyright,
body:has(.matoba-page) .copyright,
body:has(.matoba-page) footer:not(.m-footer):not(.entry-footer) {
  display: none !important;
}

/* テーマ／Lightning の SNS シェアボタン・「ページの先頭へ」を非表示 */
body:has(.matoba-page) .veu_sns,
body:has(.matoba-page) .veu_socialSet,
body:has(.matoba-page) .vk-sns,
body:has(.matoba-page) .sns-share,
body:has(.matoba-page) .sns-share-message,
body:has(.matoba-page) .sns-share-buttons,
body:has(.matoba-page) .share-link-buttons,
body:has(.matoba-page) .vk_post_socialBtns,
body:has(.matoba-page) .vk_socialBtns,
body:has(.matoba-page) .page-top,
body:has(.matoba-page) .pagetop,
body:has(.matoba-page) .l-page-top,
body:has(.matoba-page) #page-top,
body:has(.matoba-page) #pagetop,
body:has(.matoba-page) .back-to-top,
body:has(.matoba-page) .scroll-to-top,
body:has(.matoba-page) .post-thumbnail,
body:has(.matoba-page) .entry-footer,
body:has(.matoba-page) .entry-meta,
body:has(.matoba-page) .nav-links,
body:has(.matoba-page) .post-navigation,
body:has(.matoba-page) #comments,
body:has(.matoba-page) .comments-area,
body:has(.matoba-page) .related-entry-heading,
body:has(.matoba-page) .related-entry,
body:has(.matoba-page) .related-posts {
  display: none !important;
}

body:has(.matoba-page) .l-main,
body:has(.matoba-page) #main,
body:has(.matoba-page) .site-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* テーマ由来の見出し装飾を全消し */
.matoba-page h1,
.matoba-page h2,
.matoba-page h3,
.matoba-page h4 {
  border: 0 !important;
  background: none !important;
}
.matoba-page h2::before,
.matoba-page h2::after,
.matoba-page h3::before,
.matoba-page h3::after {
  display: none !important;
  content: none !important;
}

/* テーマのコンテンツ幅制限を解除（詳細ページを画面いっぱいに） */
body:has(.matoba-page) .l-main,
body:has(.matoba-page) .l-main-section,
body:has(.matoba-page) .l-section,
body:has(.matoba-page) .l-container,
body:has(.matoba-page) .container,
body:has(.matoba-page) .entry-content,
body:has(.matoba-page) .post-content,
body:has(.matoba-page) .page-content,
body:has(.matoba-page) #content,
body:has(.matoba-page) main {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.matoba-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

/* フッター下の余白を除去 */
body:has(.matoba-page) .l-main,
body:has(.matoba-page) .l-container,
body:has(.matoba-page) .l-contents,
body:has(.matoba-page) .l-content,
body:has(.matoba-page) .l-main__contents,
body:has(.matoba-page) #main,
body:has(.matoba-page) .site-main,
body:has(.matoba-page) .entry-content,
body:has(.matoba-page) .post-content,
body:has(.matoba-page) .page-content,
body:has(.matoba-page) #content,
body:has(.matoba-page) main {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
body:has(.matoba-page) { margin-bottom: 0 !important; }
.matoba-page { margin-bottom: 0 !important; }

/* =====================================================
   Footer — matoba 共通
   ===================================================== */
.matoba-page .m-footer {
  position: relative;
  width: 100%;
  min-height: 523px;
  overflow: hidden;
  color: #fff;
  background-color: #1d1d1c;
  isolation: isolate;
  font-family: "Noto Sans JP", "游ゴシック", "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
}
.matoba-page .m-footer * { box-sizing: border-box; }
.matoba-page .m-footer-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.matoba-page .m-footer-bg--sp { display: none; }
/* footer-bg.webp が無い場合の保険：src 属性が無くなれば img ごと非表示 */
.matoba-page .m-footer-bg:not([src]),
.matoba-page .m-footer-bg[src=""] { display: none !important; }
.matoba-page .m-footer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20,20,19,0.4), rgba(20,20,19,0.55));
  z-index: 1;
  pointer-events: none;
}
.matoba-page .m-footer-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  padding: 90px max(24px, calc((100% - 1200px) / 2)) 80px;
  min-height: 523px;
}
.matoba-page .m-footer-left { display: flex; flex-direction: column; }
.matoba-page .m-footer-title {
  font-family: "Shippori Mincho", "Noto Serif JP", serif !important;
  font-size: 40px !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em !important;
  margin: 0 0 28px !important;
  line-height: 1.1 !important;
  color: #fff !important;
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
}
.matoba-page .m-footer-info {
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  margin: 0 0 36px;
  color: #fff;
}
.matoba-page .m-footer-info p { margin: 0; }
.matoba-page .m-footer-social { display: flex; gap: 14px; margin-bottom: 36px; }
.matoba-page .m-footer-social a {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease;
  color: #fff;
}
.matoba-page .m-footer-social a:hover { opacity: 0.7; }
.matoba-page .m-footer-social svg {
  width: 100%; height: 100%;
  fill: none; stroke: #fff; stroke-width: 1.7;
}
.matoba-page .m-footer-meta {
  display: flex; flex-wrap: wrap; gap: 30px;
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
  font-size: 16px; letter-spacing: 0.06em;
  margin: auto 0 16px;
}
.matoba-page .m-footer-meta a {
  position: relative; padding-bottom: 3px; color: #fff;
}
.matoba-page .m-footer-meta a::after {
  content: ""; position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px; background: currentColor;
  transition: right 0.3s ease;
}
.matoba-page .m-footer-meta a:hover::after { right: 0; }
.matoba-page .m-footer-copy {
  font-size: 14px; letter-spacing: 0.04em;
  margin: 0; opacity: 0.85; color: #fff;
}
.matoba-page .m-footer-right { display: flex; flex-direction: column; justify-content: flex-end; }
.matoba-page .m-footer-right .m-btn {
  background: transparent !important;
  border: 1px solid #fff !important;
  color: #fff !important;
}
.matoba-page .m-footer-right .m-btn::before { background: #fff !important; }
.matoba-page .m-footer-right .m-btn::after {
  border-top-color: #fff !important;
  border-right-color: #fff !important;
}
.matoba-page .m-footer-right .m-btn:hover {
  background: #fff !important;
  color: #333 !important;
}
.matoba-page .m-footer-right .m-btn:hover::after {
  border-top-color: #333 !important;
  border-right-color: #333 !important;
}

@media (max-width: 1024px) {
  .matoba-page .m-footer-inner { padding-left: 60px; padding-right: 40px; }
  .matoba-page .m-footer-title { font-size: 32px !important; }
}
@media (max-width: 768px) {
  .matoba-page .m-footer-inner {
    grid-template-columns: 1fr;
    padding: 70px 24px 60px;
    min-height: auto;
  }
  .matoba-page .m-footer-bg--pc { display: none; }
  .matoba-page .m-footer-bg--sp { display: block; }
  .matoba-page .m-footer-title { font-size: 26px !important; }
  .matoba-page .m-footer-info { font-size: 14px; }
  .matoba-page .m-footer-meta { font-size: 14px; gap: 18px; }
  .matoba-page .m-footer-copy { font-size: 12px; }
  .matoba-page .m-footer-right { justify-content: flex-start; margin-top: 24px; }
}

/* ★★★ 詳細ページの祖先要素をすべて 100% 幅に強制 ★★★
   :has() で「matoba-page を内包しているあらゆる要素」を一網打尽に */
html:has(.matoba-page) body :is(div, section, article, main, aside):has(.matoba-page),
html:has(.matoba-page) body :is(div, section, article, main, aside):has(> .matoba-page),
html:has(.matoba-page) body :is(div, section, article, main, aside):has(> * > .matoba-page),
html:has(.matoba-page) body :is(div, section, article, main, aside):has(> * > * > .matoba-page) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  flex: 0 0 100% !important;
  flex-basis: 100% !important;
  -webkit-flex: 0 0 100% !important;
  -ms-flex: 0 0 100% !important;
  float: none !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* 詳細ページ全体を「画面いっぱい」にする（full-bleed）
   親要素が 100% 化された上でこの margin トリックを使えば確実に viewport 全幅に */
.matoba-page.is-detail {
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  position: relative;
}

/* テーマのサイドバー（widget area / secondary）を非表示 */
body:has(.matoba-page) aside.l-sidebar,
body:has(.matoba-page) .l-sidebar,
body:has(.matoba-page) #sidebar,
body:has(.matoba-page) .sidebar,
body:has(.matoba-page) #secondary,
body:has(.matoba-page) .secondary,
body:has(.matoba-page) .widget-area,
body:has(.matoba-page) .l-content__sidebar,
body:has(.matoba-page) .sub-section {
  display: none !important;
}

/* ★ Lightning / Bootstrap グリッドのカラム幅制限を全解除
   .col-lg-9 / .col-md-8 等の「サイドバー前提の固定幅」を 100% に強制 */
body:has(.matoba-page) [class*="col-xs-"],
body:has(.matoba-page) [class*="col-sm-"],
body:has(.matoba-page) [class*="col-md-"],
body:has(.matoba-page) [class*="col-lg-"],
body:has(.matoba-page) [class*="col-xl-"],
body:has(.matoba-page) .l-main,
body:has(.matoba-page) .l-content__main {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  -ms-flex: 0 0 100% !important;
  -webkit-flex: 0 0 100% !important;
  flex-basis: 100% !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Bootstrap の .row が padding を持っていると左右にズレるので 0 に */
body:has(.matoba-page) .row,
body:has(.matoba-page) .l-row,
body:has(.matoba-page) .l-content > .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

/* テーマのコンテンツ列を 100% 幅化（保険） */
body:has(.matoba-page) .l-content,
body:has(.matoba-page) .l-content__main,
body:has(.matoba-page) .l-main__contents,
body:has(.matoba-page) .l-section__inner,
body:has(.matoba-page) .l-section-inner {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* テーマの SNS シェアと「次の記事 / 前の記事」ナビゲーションを非表示 */
body:has(.matoba-page) .post-navigation,
body:has(.matoba-page) .posts-navigation,
body:has(.matoba-page) .nav-links,
body:has(.matoba-page) .nav-previous,
body:has(.matoba-page) .nav-next,
body:has(.matoba-page) .next-prev,
body:has(.matoba-page) .prev-next-link,
body:has(.matoba-page) .l-postNavi,
body:has(.matoba-page) .navigation.post-navigation,
body:has(.matoba-page) #respond,
body:has(.matoba-page) .author-info,
body:has(.matoba-page) .author-box,
body:has(.matoba-page) .related-entries,
body:has(.matoba-page) .related-post,
body:has(.matoba-page) .single-related-posts,
body:has(.matoba-page) .vk_posts,
body:has(.matoba-page) .sns-btns,
body:has(.matoba-page) .sns-buttons,
body:has(.matoba-page) .share,
body:has(.matoba-page) .share-buttons,
body:has(.matoba-page) .share-list,
body:has(.matoba-page) [class*="sns-share"],
body:has(.matoba-page) [class*="social-share"],
body:has(.matoba-page) [class*="sharebutton"],
body:has(.matoba-page) [id*="share"] {
  display: none !important;
}

/* =====================================================
   印刷 / PDF 出力用
   ===================================================== */
@media print {
  body > *:not(.matoba-page):not([id^="matoba-property-detail"]) { display: none !important; }
  body:has(.matoba-page) .l-footer,
  body:has(.matoba-page) .site-footer,
  body:has(.matoba-page) footer:not(.m-footer) { display: none !important; }

  /* ===== 印刷は A4 2枚構成 =====
     1枚目：見出し＋ヒーロー＋Introduction＋間取図
     2枚目：Detail（スペック表・全展開・1枚に収める）
     写真ギャラリー・地図は印刷しない */
  .matoba-page .m-header,
  .matoba-page .m-footer,
  .matoba-page .m-float-contact,
  .matoba-page .m-detail-print,
  .matoba-page .m-detail-intro-contact,
  .matoba-page .m-detail-cta,
  .matoba-page .m-detail-mid-cta,
  .matoba-page .m-detail-gallery,
  .matoba-page .m-detail-gallery-caption,
  .matoba-page .m-detail-map,
  .matoba-page .m-detail-gallery-arrow,
  .matoba-page .m-detail-spec-toggle,
  .matoba-page .m-detail-thumbs { display: none !important; }

  /* 印刷時は折りたたみを全展開する */
  .matoba-page .m-detail-spec .is-collapsible { display: revert !important; }

  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  .matoba-page {
    color: #000 !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
  }

  /* --- 1枚目をコンパクトに --- */
  .matoba-page .m-detail-heading { padding: 0 0 8px !important; }
  .matoba-page .m-detail-title   { font-size: 20px !important; }
  .matoba-page .m-detail-tag-line{ font-size: 12px !important; margin-bottom: 6px !important; }
  .matoba-page .m-detail-hero    { margin: 0 0 10px !important; aspect-ratio: auto; height: 70mm; }
  .matoba-page .m-detail-hero img{ width: 100% !important; height: 100% !important; object-fit: cover !important; }
  .matoba-page .m-detail-intro   { padding: 8px 0 !important; }
  .matoba-page .m-detail-intro-text { font-size: 10px !important; line-height: 1.7 !important; }
  .matoba-page .m-detail-plan    { margin: 8px 0 0 !important; }
  .matoba-page .m-detail-plan img{ max-height: 120mm !important; width: auto !important; max-width: 100% !important; margin: 0 auto !important; }

  .matoba-page .m-detail-hero,
  .matoba-page .m-detail-plan { page-break-inside: avoid; break-inside: avoid; }

  /* --- 2枚目：Detail をページ頭から・1枚に収める --- */
  .matoba-page .m-detail-spec {
    margin: 0 !important;
    break-before: page;
    page-break-before: always;
  }
  .matoba-page .m-detail-spec-heading { font-size: 14px !important; margin-bottom: 10px !important; padding-left: 0 !important; }
  .matoba-page .m-detail-spec-table { grid-template-columns: 170px 1fr !important; }
  .matoba-page .m-detail-spec-table dt,
  .matoba-page .m-detail-spec-table dd {
    font-size: 9.5px !important;
    line-height: 1.5 !important;
    padding: 4px 8px !important;
    color: #000 !important;
    page-break-inside: avoid; break-inside: avoid;
  }
  .matoba-page .m-detail-spec-table dd .notes { font-size: 8.5px !important; margin-top: 4px !important; }

  .matoba-page img { max-width: 100% !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}


/* =====================================================
   SPメニュー展開中：メニューを全画面化＋背面スクロール禁止
   ===================================================== */
html:has(.matoba-page.is-nav-open),
body:has(.matoba-page.is-nav-open) {
  overflow: hidden !important;
}
