@charset "UTF-8";
/* ==========================================================================
   Domus LP — style.css（セクション別スタイル）
   ========================================================================== */

/* ==========================================================================
   00 ヘッダー
   ========================================================================== */
.p-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-base);
  border-bottom: 1px solid var(--line-base);
}

.p-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 40px;
}

.p-header__logo {
  display: flex;
  align-items: end;
  gap: 18px;
  flex-shrink: 0;
}

.p-header__logo img { width: 150px; height: auto; }

.p-header__logo-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--ls-wider);
  white-space: nowrap;
}

.p-header__nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
}

.p-header__nav-list a {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: var(--ls-wider);
  white-space: nowrap;
}

.p-header__toggle { display: none; }

/* --- tablet / sp --------------------------------------------------------- */
@media (max-width: 1180px) {
  .p-header__inner { padding: 14px 20px; }
  .p-header__logo img { width: 124px; }
  .p-header__logo-text { display: none; }
  .p-header__cta { display: none; }

  .p-header__nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 82vw);
    padding: 92px 32px 40px;
    background: var(--bg-soft);
    border-left: 1px solid var(--line-base);
    display: flex;
    flex-direction: column;
    gap: 32px;
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    overflow-y: auto;
  }

  .p-header__nav.is-open { transform: translateX(0); }

  .p-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .p-header__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 101;
  }

  .p-header__toggle span {
    display: block;
    width: 26px;
    height: 1.5px;
    margin-inline: auto;
    background: var(--text-main);
    transition: transform .3s var(--ease), opacity .3s var(--ease);
  }

  .p-header__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(38deg); }
  .p-header__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .p-header__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-38deg); }
}

/* ==========================================================================
   アニメーション
   - .js-reveal は JS が付与するので、JSが動かない環境では何も隠れない
   - transform ではなく translate / scale を使い、要素側の rotate と競合させない
   ========================================================================== */
.js-reveal {
  opacity: 0;
  translate: 0 28px;
  transition: opacity .9s var(--ease), translate .9s var(--ease);
}

.js-reveal.is-inview {
  opacity: 1;
  translate: 0 0;
}

/* MVは読み込み時に順番に出す */
@keyframes mv-in {
  from { opacity: 0; translate: 0 20px; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes mv-photo-in {
  from { opacity: 0; scale: .95; }
  to   { opacity: 1; scale: 1; }
}

.p-mv__script { animation: mv-in .9s var(--ease) .05s both; }
.p-mv__title  { animation: mv-in .9s var(--ease) .18s both; }
.p-mv__lead   { animation: mv-in .9s var(--ease) .31s both; }
.p-mv__btn    { animation: mv-in .9s var(--ease) .44s both; }

.p-mv__photo--main { animation: mv-photo-in 1.1s var(--ease) .30s both; }
.p-mv__photo--sub1 { animation: mv-photo-in 1.1s var(--ease) .46s both; }
.p-mv__photo--sub2 { animation: mv-photo-in 1.1s var(--ease) .62s both; }
.p-mv__illust      { animation: mv-in 1s var(--ease) .82s both; }
.p-mv__paper-tr    { animation: mv-in 1.2s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .js-reveal,
  .js-reveal.is-inview {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .p-mv__script,
  .p-mv__title,
  .p-mv__lead,
  .p-mv__btn,
  .p-mv__photo,
  .p-mv__illust,
  .p-mv__paper-tr { animation: none; }
}

/* ==========================================================================
   01 MV
   ========================================================================== */
/* 背景は方眼紙柄（CSSグラデーションで描画） */
.p-mv {
  position: relative;
  /* background-color: var(--bg-soft); */
  background-image:
    linear-gradient(to right,  var(--line-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
  overflow: hidden;
}

/* 右上のちぎり和紙。グリッド背景の上・コンテンツの下に重ねる */
.p-mv__paper-tr {
  position: absolute;
  top: 0;
  right: 0;
  width: 30vw;
  height: auto;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* 下のセクションとの仕切り（ちぎり紙のライン） */
.p-mv__underline {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: auto;
  z-index: 4;
  pointer-events: none;
  user-select: none;
}

.p-mv__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  max-width: 1440px;
  margin-inline: auto;
  /* ヘッダー分を引いてほぼ画面いっぱい。コラージュの設計高760pxは下回らない */
  min-height: max(760px, calc(106vh - 92px));
}

/* --- コピー側 ------------------------------------------------------------ */
.p-mv__copy {
  flex: 0 0 43%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 40px 220px 80px;
}

.p-mv__script {
  font-family: var(--font-script);
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.3;
  color: var(--text-muted);
  transform: rotate(-8deg);
  transform-origin: left center;
  margin-bottom: 28px;
}

.p-mv__title { margin-bottom: 28px; }

.p-mv__lead { margin-bottom: 28px; }

/* --- 写真コラージュ ------------------------------------------------------ */
/* 820×760 の設計比率をそのまま保つ箱。中身は % 配置なので
   幅が変わっても PC と同じ構図のまま拡大縮小される（＝タブレットもPCと同じ見え方） */
.p-mv__collage {
  flex: 1 1 auto;
  position: relative;
  aspect-ratio: 820 / 760;
  align-self: center; /* MVが伸びてもコラージュは中央に置く */
}

/* CMSが同じclassのdivをもう一段出力するため、内側は外側にぴったり重ねる */
.p-mv__collage .p-mv__collage {
  flex: none;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  align-self: auto;
}

.p-mv__photo {
  position: absolute;
  margin: 0;
  padding: 3px;
  background: var(--bg-placeholder);
  border: 1px solid var(--line-base);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.p-mv__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 位置・サイズは 820×760 に対する比率（元の px 値を % に置き換えたもの） */
.p-mv__photo--main {
  width: 68.29%;   /* 560px */
  height: 55.26%;  /* 420px */
  left: 16.46%;    /* 135px */
  top: 7.89%;      /*  60px */
  transform: rotate(2deg);
  z-index: 2;
}

.p-mv__photo--sub1 {
  width: 37.93%;   /* 311px */
  height: 28.95%;  /* 220px */
  left: 1.59%;     /*  13px */
  top: 43.29%;     /* 329px */
  transform: rotate(-6deg);
  z-index: 3;
}

.p-mv__photo--sub2 {
  width: 30.49%;   /* 250px */
  height: 22.37%;  /* 170px */
  left: 45.73%;    /* 375px */
  top: 57.89%;     /* 440px */
  transform: rotate(5deg);
  z-index: 3;
}

/* コラージュ右下のイラスト（旧マスキングテープの位置） */
.p-mv__illust {
  position: absolute;
  width: 18.29%;   /* 150px */
  height: auto;
  left: 81.10%;    /* 665px */
  top: 53.42%;     /* 406px */
  z-index: 4;
  pointer-events: none;
  user-select: none;
}

/* --- tablet -------------------------------------------------------------- */
@media (max-width: 1180px) {
  /* コラージュが比率で縮むので、MVの高さは中身なりでよい */
  .p-mv__inner { min-height: 0; }

  .p-mv__copy {
    flex: 0 0 47%;
    padding: 72px 12px 110px 40px;
  }
}

/* --- sp ------------------------------------------------------------------ */
@media (max-width: 860px) {
  .p-mv__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .p-mv__copy {
    flex: none;
    /* SPは下にコラージュが続くので、下余白は詰める */
    padding: 48px var(--gutter) 32px;
  }

  .p-mv__script { margin-bottom: 20px; }
  .p-mv__title,
  .p-mv__lead { margin-bottom: 24px; }

  /* SPはコラージュを解体して、メイン＋サブ2枚の並びに */
  .p-mv__collage {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    transform: none;
    margin: 0;
    padding: 0 var(--gutter) 72px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .p-mv__photo {
    position: static;
    width: auto;
    height: auto;
    inset: auto;
    aspect-ratio: 4 / 3;
    transform: none;
  }

  .p-mv__photo--main { grid-column: 1 / -1; aspect-ratio: 4 / 3; }

  /* SPではコラージュの上（＝キャッチコピー側の空きスペース）に置き直す。
     .p-mv__collage 基準の絶対配置なので、bottom:100% でコピー下部の右側に来る */
  .p-mv__illust {
    display: block;
    position: absolute;
    left: auto;
    top: auto;
    right: var(--gutter);
    bottom: calc(100% + 6px);
    width: min(116px, 30vw);
    height: auto;
    z-index: 2;
  }
}

/* ==========================================================================
   追従CTA
   ========================================================================== */
.p-floating-cta {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 26px;
  border: 1px solid var(--line-base);
  border-radius: var(--radius);
  background: var(--accent-base);
  color: var(--text-inverse);
  text-align: center;
  box-shadow: var(--shadow-cta);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s;
}

.p-floating-cta.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.p-floating-cta:hover { opacity: 1; background: var(--accent-dark); }

.p-floating-cta__main {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: var(--ls-wider);
}

.p-floating-cta__sub {
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
}

@media (max-width: 640px) {
  .p-floating-cta {
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 0;
    border-width: 1px 0 0;
    padding: 12px 20px;
  }
  .p-floating-cta__sub { display: none; }
}

/* ==========================================================================
   02 お悩み訴求
   ========================================================================== */
.p-worry { background: var(--bg-base); }
.p-worry__title { margin-bottom: 48px; }

.p-worry__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.p-worry__card {
  padding: 32px 36px;
  border: 1px solid var(--line-base);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}

.p-worry__card-title {
  font-size: clamp(16px, 1.25vw, 18px);
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: var(--ls-wider);
  text-align: center;
  margin-bottom: 24px;
}

.p-worry__card-body {
  display: flex;
  align-items: center;
  gap: 24px;
}

.p-worry__illust {
  flex: 0 0 135px;
  width: 135px;
}

.p-worry__list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-worry__list li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-worry__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-base);
  font-weight: 700;
}

.p-worry__lead {
  margin-top: 40px;
  text-align: center;
  font-size: clamp(15px, 1.25vw, 20px);
  font-weight: 700;
  line-height: 2.1;
  letter-spacing: var(--ls-wider);
}

@media (max-width: 768px) {
  .p-worry__cards { grid-template-columns: 1fr; }
  .p-worry__card { padding: 28px 24px; }
  .p-worry__card-body { flex-direction: column; gap: 16px; }
  .p-worry__illust { flex: none; }
}

/* ==========================================================================
   03 強み
   ========================================================================== */
.p-strength {
  position: relative;
  overflow: hidden;
}

/* 和紙の背景。縦は必ず全部見せ、横が足りない分は繰り返してつなぐ */
.p-strength__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .5;
  pointer-events: none;
  /* 元画像＋左右反転を1枚にした2倍幅タイル。繰り返しても継ぎ目が出ない */
  background-image: url(../img/washi-torn-mirror.webp);
  background-repeat: repeat-x;
  background-position: center left;
  background-size: auto 100%;
}

.p-strength .l-container--wide { position: relative; z-index: 1; margin: 30px auto;}

.p-strength__head { text-align: center; margin-bottom:60px; }

.p-strength__sub {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.1em;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.p-strength__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.p-strength__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  position: relative;
}

.p-strength__col:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0;
  right: -14px;
  width: 1px;
  height: 100%;
  background: var(--line-base);
}

.p-strength__col-title {
  font-size: clamp(15px, 1.12vw, 16px);
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: var(--ls-wider);
}

.p-strength__icon {
  width: 200px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-strength__icon img { width: auto; max-height: 130px; }

.p-strength__col-text {
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

@media (max-width: 768px) {
  .p-strength__cols { grid-template-columns: 1fr; gap: 40px; }
  .p-strength__col:not(:last-child)::after {
    top: auto; bottom: -20px; right: auto; left: 0;
    width: 100%; height: 1px;
  }
}

/* ==========================================================================
   04 サービス
   ========================================================================== */
.p-service { background: #fff; }

.p-service__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.p-service__card {
  display: flex;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  overflow: hidden;
  /* box-shadow: 0 2px 12px rgba(77, 61, 46, .06); */
}

.p-service__img {
  flex: 0 0 44%;
  background: var(--bg-placeholder);
}

/* CMSギャラリーが .p-service__img をもう一段出力するため、内側は素通しにして
   外側（flexアイテム）の高さをそのまま img まで伝える */
.p-service__img .p-service__img {
  flex: none;
  width: 100%;
  height: 100%;
}

.p-service__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-service__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 10px 28px 24px;
}

/* タイトル下のドット線 */
.p-service__body > h3 {
  padding-bottom: 14px;
  border-bottom: 2px dotted var(--line-base);
}

.p-service__body .c-textlink { margin-top: auto; }

/* タブレット：2カラムのまま、カードを縦組みにして本文の窮屈さを解消 */
@media (max-width: 1024px) {
  .p-service__cards { gap: 28px; }
  .p-service__card { flex-direction: column; }
  .p-service__img { flex: none; aspect-ratio: 16 / 10; }
  .p-service__body { padding: 24px 24px 22px; }
}

@media (max-width: 768px) {
  .p-service__cards { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
   06 ご相談からの流れ
   ========================================================================== */
.p-flow { background: var(--bg-base); }

.p-flow__steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
}

.p-flow__step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  position: relative;
  max-width: 220px;
}

/* 矢印 */
.p-flow__step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 34px;
  right: -14px;
  font-size: 20px;
  color: var(--text-muted);
}

.p-flow__icon {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--bg-soft);
  transition: transform .4s var(--ease), background-color .4s var(--ease);
}

.p-flow__icon img {
  max-width: 70px;
  max-height: 70px;
  width: auto;
  transition: transform .4s var(--ease);
}

/* ホバー：背景の丸とアイコンが少しだけ大きくなる */
.p-flow__step:hover .p-flow__icon {
  transform: scale(1.08);
}

.p-flow__step:hover .p-flow__icon img {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .p-flow__icon,
  .p-flow__icon img { transition: none; }

  .p-flow__step:hover .p-flow__icon,
  .p-flow__step:hover .p-flow__icon img { transform: none; }
}

.p-flow__num {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-base);
}

.p-flow__step-title {
  font-size: clamp(15px, 1.25vw, 17px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: var(--ls-wide);
  margin-top: 4px;
}

.p-flow__step-text {
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
  margin-top: 8px;
}

@media (max-width: 860px) {
  .p-flow__steps {
    flex-wrap: wrap;
    gap: 32px 12px;
  }
  .p-flow__step {
    flex: 0 0 calc(50% - 6px);
    max-width: none;
  }
  .p-flow__step:not(:last-child)::after { display: none; }
}

@media (max-width: 480px) {
  .p-flow__step { flex-basis: 100%; }
}

/* ==========================================================================
   06.5 お客様の声（VOICE）
   ========================================================================== */
.p-voice { background: var(--bg-soft); }

.p-voice__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.p-voice__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--bg-base);
  border: 1px solid var(--line-base);
  border-radius: var(--radius);
  padding: 40px 32px 32px;
}

.p-voice__cat {
  position: relative;
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--accent-base);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: var(--ls-wider);
  color: var(--accent-base);
  background: var(--bg-base);
  margin: auto;
}

.p-voice__title {
  position: relative;
  margin-top: 16px;
  font-size: clamp(16px, 1.3vw, 18px);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: var(--ls-wide);
}

.p-voice__text {
  margin-top: 14px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-voice__name {
  width: 100%;
  margin-top: auto;      /* カードの高さが揃うよう下端に寄せる */
  padding-top: 16px;
  border-top: 1px solid var(--line-base);
  font-size: 13px;
  letter-spacing: var(--ls-wide);
color: var(--text-sub);
}

@media (max-width: 860px) {
  .p-voice__list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .p-voice__card { padding: 36px 24px 28px; }
}

/* ==========================================================================
   10 よくあるご質問（FAQ）— details/summary のアコーディオン（JS不要）
   ========================================================================== */
.p-faq { background: var(--bg-base); }

/* Q&Aは1行が長くなりすぎないよう、本文カラムより絞る */
.p-faq__list {
  max-width: 760px;
  margin-inline: auto;
  border-top: 1px solid var(--line-base);
}

.p-faq__item { border-bottom: 1px solid var(--line-base); }

.p-faq__q {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 44px 22px 0;
  font-size: clamp(15px, 1.2vw, 16px);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  list-style: none;
  transition: color .3s var(--ease);
}

.p-faq__q::-webkit-details-marker { display: none; }

.p-faq__q:hover { color: var(--accent-base); }

/* 頭の「Q」 */
.p-faq__q::before {
  content: "Q";
  flex-shrink: 0;
  width: 24px;
  font-family: var(--font-serif-en);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent-base);
}

/* 開閉の矢印 */
.p-faq__q::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 30px;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--accent-base);
  border-bottom: 1.5px solid var(--accent-base);
  transform: translateY(-4px) rotate(45deg);
  transition: transform .3s var(--ease);
}

.p-faq__item[open] .p-faq__q::after {
  transform: translateY(1px) rotate(-135deg);
}

.p-faq__a {
  padding: 0 44px 26px 40px;
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

@media (prefers-reduced-motion: reduce) {
  .p-faq__q,
  .p-faq__q::after { transition: none; }
}

@media (max-width: 640px) {
  .p-faq__q { padding-right: 32px; gap: 12px; }
  .p-faq__q::before { width: 18px; font-size: 18px; }
  .p-faq__a { padding: 0 32px 22px 30px; font-size: 14px; }
}

/* ==========================================================================
   07 中間CTA
   ========================================================================== */
.p-midcta {
  background: var(--bg-soft);
  padding-block: 72px;
}

.p-midcta__inner {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3.4vw, 50px);
}

/* flex-shrink を効かせないと 900〜1080px で写真・イラストが画面からはみ出す */
.p-midcta__photo {
  flex: 0 1 360px;
  min-width: 0;
  margin: 0;
  transform: rotate(-2deg);
}

.p-midcta__illust {
  flex: 0 1 220px;
  min-width: 0;
  margin: 0;
  margin-bottom: 30px;
  margin-top: auto;
}

.p-midcta__illust img { width: 100%; }

.p-midcta__photo img {
  width: 100%;
  border-radius: var(--radius-sm);
  /* box-shadow: 0 6px 20px rgba(77, 61, 46, .12); */
}

.p-midcta__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-inline: 8px;
}

.p-midcta__title {
  font-size: clamp(22px, 2.23vw, 32px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: var(--ls-wide);
}

.p-midcta__text {
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0;
  color: var(--text-sub);
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .p-midcta__illust { display: none; }
}
@media (max-width: 768px) {
  .p-midcta__inner { flex-direction: column; gap: 28px; }
  .p-midcta__photo { flex: none; width: 260px; }
  .p-midcta__body { align-items: center; text-align: center; }

  .p-midcta__text {
    text-align: center;
    text-wrap: balance;
    word-break: auto-phrase;
  }
}

/* ==========================================================================
   08 会社紹介
   ========================================================================== */
.p-message { background: var(--bg-base); }

.p-message__inner {
  display: flex;
  align-items: flex-start;
  gap: 64px;
}

/* 614×498 の設計比率の箱。中の2枚は % 配置なので幅が変わっても構図は崩れない */
.p-message__photo {
  flex: 0 0 458px;
  margin: 0;
  position: relative;
  aspect-ratio: 614 / 498;
}

/* 背面のクラフト紙（少し傾けて敷く） */
.p-message__paper {
  position: absolute;
  z-index: 0;
  left: 2.43%;
  top: 10.84%;
  width: 74.2%;
  height: auto;
  transform: rotate(-9.3deg);
  pointer-events: none;
  user-select: none;
}

/* 前面の代表写真 */
.p-message__portrait {
  position: absolute;
  z-index: 1;
  left: 14.66%;
  top: 5.42%;
  width: 82.25%;
  height: auto;
  border-radius: var(--radius-sm);
}

.p-message__plant {
  position: absolute;
  z-index: 2;
  left: -50px;
  bottom: -20px;
  width: 130px;
  height: auto;
  pointer-events: none;
}

@media (max-width: 860px) {
  .p-message__plant { left: 0; width: 96px; }
}

.p-message__body { flex: 1 1 auto; }

.p-message__label { text-align: left; margin-bottom: 14px; }

.p-message__title {
  font-size: clamp(20px, 1.9vw, 24px);
  font-weight: 700;
  line-height: 1.75;
  letter-spacing: var(--ls-wider);
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #6B605A;
}

.p-message__text {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  font-size: 16px;
  line-height: 2;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-message__name {
  margin-top: 32px;
  font-size: 16px;
  letter-spacing: 0.08em;
}

@media (max-width: 860px) {
  .p-message__inner { flex-direction: column; gap: 32px; }
  .p-message__photo { flex: none; width: 100%; max-width: 458px; }
}

/* ==========================================================================
   09 会社概要
   ========================================================================== */
.p-company { background: #fbfaf8; }

.p-company__inner {
  display: flex;
  gap: 40px;
  align-items: stretch;
}

/* CMS化で table が div でラップされたため、旧 .p-company__table と同じ幅を wrap 側で持たせる */
.p-company__table-wrap {
  flex: 0 0 600px;
  min-width: 0;
}

.p-company__table-wrap table {
  width: 100%;
  table-layout: auto;
}

.p-company__table {
  flex: 0 0 600px;
  font-size: 15px;
}

.p-company__table th,
.p-company__table td {
  border-bottom: 1px solid var(--line-base);
  padding: 12px 18px;
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
}

.p-company__table th {
  width: 118px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.p-company__table td { color: var(--text-sub); }

/* CMS化で iframe がラッパー要素に包まれ height:100% が効かなくなったため、
   .p-company__map 自体を基準にして絶対配置で埋める（見た目はCMS化前と同じ） */
.p-company__map {
  flex: 1 1 auto;
  position: relative;
  min-height: 400px;
}

.p-company__map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-sm);
}

.p-company__map-placeholder {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-placeholder);
  color: var(--text-muted);
  font-size: 14px;
}

/* Instagram バナー */
.p-company__insta {
  display: block;
  position: relative;
  max-width: 608px;
  margin: 48px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 608 / 121;
}

.p-company__insta-bg { position: absolute; inset: 0; }
.p-company__insta-bg img { width: 100%; height: 100%; object-fit: cover; }

/* 文字を読みやすくするための暗めレイヤー */
.p-company__insta-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 33, .5);
}

.p-company__insta-text {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-inverse);
  text-align: center;
}

.p-company__insta-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.p-company__insta-title img { width: 32px; height: 32px; }
.p-company__insta-title i { font-size: 30px; line-height: 1; }

.p-company__insta-id {
  font-size: 14px;
  letter-spacing: var(--ls-wide);
}

@media (max-width: 900px) {
  .p-company__inner { flex-direction: column; }
  .p-company__table-wrap { flex: none; width: 100%; }
  .p-company__table { flex: none; width: 100%; }
  .p-company__map-placeholder { min-height: 300px; }
  .p-company__map { min-height: 300px; }
}

@media (max-width: 640px) {
  /* 見出し列を詰めて、本文に幅を回す */
  .p-company__table { font-size: 14px; }

  .p-company__table th,
  .p-company__table td { padding: 11px 0; }

  .p-company__table th {
    width: 88px;
    padding-right: 14px;
    white-space: nowrap;
  }

  /* Instagramバナー：高さ固定をやめて中身に合わせる */
  .p-company__insta {
    aspect-ratio: auto;
    margin-top: 32px;
    padding: 22px 16px;
  }

  .p-company__insta-text { height: auto; gap: 6px; }

  .p-company__insta-title { font-size: 19px; gap: 6px; }
  .p-company__insta-title img { width: 24px; height: 24px; }
  .p-company__insta-title i { font-size: 23px; }

  .p-company__insta-id { font-size: 12px; }
}

/* ==========================================================================
   11 お問い合わせ
   ========================================================================== */
.p-contact { background: var(--bg-base); }

.p-contact__lead {
  text-align: center;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  margin-bottom: 48px;
}

.p-contact__inner {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* CMS化でフォームがCMS出力に置き換わったため、旧 .p-contact__form の幅を
   placeholder 側（.p-contact__form-wrap）で持たせる */
.p-contact__form-wrap {
  flex: 1 1 700px;
  min-width: 0;
}

.p-contact__form {
  flex: 1 1 700px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.p-form__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-form__row label {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  display: flex;
  align-items: center;
  gap: 10px;
}

.p-form__req {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent-base);
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.06em;
}

.p-contact__form input,
.p-contact__form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-base);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 15px;
  line-height: 1.7;
  transition: border-color .3s var(--ease);
}

.p-contact__form input:focus,
.p-contact__form textarea:focus {
  outline: none;
  border-color: var(--accent-base);
}

.p-contact__form textarea { resize: vertical; min-height: 120px; }

.p-contact__submit {
  align-self: flex-start;
  min-width: 260px;
  justify-content: center;
  margin-top: 10px;
}

/* 連絡先パネル */
.p-contact__side {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 35px;
}

/* CMSが同じclassの <aside> をもう一段出力するため、内側の flex-basis と
   margin をリセットする（縦方向のflexでは flex:0 0 360px が高さ固定になる） */
.p-contact__side .p-contact__side {
  flex: 1 1 auto;
  width: 100%;
  margin-top: 0;
}

.p-contact__panel {
  padding: 22px 26px;
  background: transparent;
  border: 1px solid var(--line-base);
  border-radius: var(--radius);
}

.p-contact__panel-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  margin-bottom: 10px;
}

.p-contact__tel {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-base);
}

.p-contact__panel-line {
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-contact__panel-line a { color: var(--accent-base); font-weight: 700; }

.p-contact__panel-text {
  font-size: 14px;
  line-height: 1.9;
letter-spacing: 0;
  /* letter-spacing: var(--ls-wide); */
  color: var(--text-sub);
}

.p-contact__illust {
  margin-top: auto;
  text-align: center;
}

.p-contact__illust img { display: inline-block; max-width: 200px; }

@media (max-width: 900px) {
  .p-contact__inner { flex-direction: column; }
  .p-contact__form-wrap,
  .p-contact__form,
  .p-contact__side { flex: none; width: 100%; }
  .p-contact__submit { align-self: stretch; width: 100%; }
}

/* ==========================================================================
   99 フッター（白背景）
   ========================================================================== */
.p-footer {
  background: var(--bg-base);
  color: var(--text-main);
  border-top: 1px solid var(--line-base);
  padding-block: 64px 32px;
}

.p-footer__top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.p-footer__brand { flex: 0 0 200px; }

.p-footer__logo { width: 140px; margin-bottom: 20px; }
.p-footer__illust { width: 150px; opacity: .9; }

.p-footer__sitemap {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.p-footer__col-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  margin-bottom: 16px;
}

.p-footer__col ul {
  display: flex;
  flex-direction: column;
  /* gap: 12px; */
}

.p-footer__col a {
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-footer__copyright {
  margin-top: 40px;
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-jp);
}

@media (max-width: 768px) {
  .p-footer__top { flex-direction: column; gap: 32px; }
  .p-footer__sitemap { gap: 28px 40px; }
  .p-footer__col { flex: 0 0 calc(50% - 20px); }
  .p-footer__copyright { text-align: left; }

  /* ロゴ＋イラストは中央に */
  .p-footer__brand {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .p-footer__logo { margin-inline: auto; }
  .p-footer__illust { margin-inline: auto; }
}

/* ==========================================================================
   下層ページ共通（contact / thanks / privacy）
   ========================================================================== */
.p-page { background: var(--bg-base); }
.p-page .l-section__head h1 { margin-top: 14px; }

/* 入力エラー */
.p-form__error {
  color: #c0392b;
  font-size: 13px;
  letter-spacing: var(--ls-wide);
}

.p-form__error-top {
  max-width: 700px;
  margin: 0 auto 24px;
  padding: 12px 16px;
  background: #fdecea;
  border: 1px solid #f5c6c0;
  border-radius: var(--radius);
  color: #c0392b;
  font-size: 14px;
  text-align: center;
}

.p-contact__form--page {
  max-width: 700px;
  margin-inline: auto;
}

/* 確認画面 */
.p-confirm { max-width: 700px; margin-inline: auto; }

.p-confirm__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-base);
  margin-bottom: 32px;
}

.p-confirm__list > div {
  display: flex;
  gap: 20px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line-base);
}

.p-confirm__list dt {
  flex: 0 0 160px;
  font-weight: 700;
  letter-spacing: var(--ls-wide);
}

.p-confirm__list dd {
  flex: 1 1 auto;
  color: var(--text-sub);
  line-height: 1.9;
  letter-spacing: var(--ls-wide);
  word-break: break-word;
}

.p-confirm__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.p-confirm__back { min-width: 160px; }
.p-confirm__send { min-width: 260px; justify-content: center; }

@media (max-width: 600px) {
  .p-confirm__list > div { flex-direction: column; gap: 6px; }
  .p-confirm__list dt { flex: none; }
  .p-confirm__actions { flex-direction: column; }
  .p-confirm__back,
  .p-confirm__send { width: 100%; }
}

/* サンクス */
.p-thanks__body {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.p-thanks__body p { line-height: 2; letter-spacing: var(--ls-wide); }
.p-thanks__note { font-size: 14px; color: var(--text-sub); }
.p-thanks__back { align-self: center; justify-content: center; min-width: 260px; }

@media (max-width: 640px) {
  .p-thanks__body p,
  .p-thanks__note { text-align: left; }
}

/* 法務ページ */
.p-legal__body {
  max-width: 760px;
  margin-inline: auto;
  line-height: 2;
  letter-spacing: var(--ls-wide);
}

.p-legal__body h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 8px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-base);
}

.p-legal__body p { color: var(--text-sub); }
.p-legal__note { margin-top: 40px; font-size: 13px; color: var(--text-muted); }

/* ==========================================================================
   施工事例 一覧（works.php）
   ========================================================================== */
.p-works { background: var(--bg-base); }

.p-works__lead {
  margin-top: 14px;
  font-size: 15px;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-works__group {
  position: relative;
  padding-left: 60px;
  margin-top: 72px;
}

.p-works__group:first-of-type { margin-top: 0; }

/* 縦書きラベル */
.p-works__vlabel {
  position: absolute;
  left: 0;
  top: 0;
  writing-mode: vertical-rl;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.p-works__list {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.p-works__case {
  display: flex;
  gap: 48px;
  align-items: center;
}

/* 偶数事例は写真を右に（Figmaの左右交互レイアウト） */
.p-works__case:nth-child(even) { flex-direction: row-reverse; }

.p-works__case-img {
  flex: 0 0 56%;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-placeholder);
  aspect-ratio: 16 / 10;
}

.p-works__case-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.p-works__case:hover { opacity: 1; }
.p-works__case:hover .p-works__case-img img { transform: scale(1.04); }

.p-works__case-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p-works__case-no {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-base);
}

.p-works__case-title {
  font-size: clamp(18px, 1.67vw, 22px);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--ls-wide);
}

.p-works__case-text {
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-works__note {
  margin-top: 56px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: var(--ls-wide);
}

@media (max-width: 860px) {
  .p-works__group { padding-left: 32px; margin-top: 56px; }
  .p-works__list { gap: 40px; }
  .p-works__case,
  .p-works__case:nth-child(even) { flex-direction: column; gap: 20px; }
  .p-works__case-img { flex: none; width: 100%; }
}

@media (max-width: 480px) {
  .p-works__group { padding-left: 24px; }
  .p-works__vlabel { font-size: 13px; }
}

/* ==========================================================================
   施工事例 詳細（works-detail.php）
   ========================================================================== */
.p-work { background: var(--bg-base); }

.p-work__crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  margin-bottom: 32px;
}

.p-work__crumb a { color: var(--text-sub); }
.p-work__crumb .is-current { color: var(--text-muted); }

.p-work__head { text-align: center; margin-bottom: 40px; }
.p-work__cat { margin-bottom: 12px; }

.p-work__caseno {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-base);
  margin-bottom: 10px;
}

.p-work__title {
  font-size: clamp(22px, 2.23vw, 30px);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: var(--ls-wide);
}

.p-work__main {
  margin: 0 0 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-placeholder);
  aspect-ratio: 16 / 9;
}

.p-work__main img { width: 100%; height: 100%; object-fit: cover; }

.p-work__inner {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 56px;
}

.p-work__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1.4em;
  font-size: 16px;
  line-height: 2;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
}

.p-work__data {
  flex: 0 0 320px;
  padding: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--line-base);
  border-radius: var(--radius);
}

.p-work__data-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent-base);
  margin-bottom: 16px;
}

.p-work__data-table th,
.p-work__data-table td {
  border-bottom: 1px solid var(--line-base);
  padding: 12px 4px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: var(--ls-wide);
}

.p-work__data-table th {
  width: 88px;
  font-weight: 700;
  white-space: nowrap;
}

.p-work__data-table td { color: var(--text-sub); }
.p-work__data-table tr:last-child th,
.p-work__data-table tr:last-child td { border-bottom: 0; }

/* ギャラリー */
.p-work__gallery { margin-bottom: 56px; }

.p-work__gallery-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent-base);
  text-align: center;
  margin-bottom: 24px;
}

.p-work__gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.p-work__gallery-item {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-placeholder);
  aspect-ratio: 4 / 3;
}

.p-work__gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* 前後ナビ */
.p-work__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 40px;
  border-top: 1px solid var(--line-base);
  margin-bottom: 56px;
}

.p-work__nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.p-work__nav-link--next { text-align: right; }

.p-work__nav-dir {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-base);
}

.p-work__nav-title {
  font-size: 14px;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-work__nav-index {
  flex: 0 0 auto;
  padding: 10px 24px;
  border: 1px solid var(--line-base);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: var(--ls-wide);
  white-space: nowrap;
}

.p-work__nav-index:hover {
  opacity: 1;
  background: var(--accent-base);
  border-color: var(--accent-base);
  color: var(--text-inverse);
}

/* 詳細CTA */
.p-work__cta {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.p-work__cta-text {
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: var(--ls-wide);
  color: var(--text-sub);
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .p-work__inner { flex-direction: column; gap: 32px; }
  .p-work__data { flex: none; width: 100%; }
  .p-work__gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .p-work__nav { flex-wrap: wrap; }
  .p-work__nav-index { order: -1; flex: 1 1 100%; text-align: center; margin-bottom: 8px; }
  .p-work__gallery-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   05 施工事例（LP内・WORKS）非対称3列グリッド
   ========================================================================== */
/* 背景はMVと同じ方眼紙柄。画像を使わずCSSグラデーションで描く */
.p-works-lp {
  background-color: var(--bg-base);
  background-image:
    linear-gradient(to right,  var(--line-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
}
.p-works-lp__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 44px 35px;
  align-items: start;
}

.p-works-lp__grid>.p-works-lp__case:nth-child(1) .p-works-lp__img {
  aspect-ratio: 3 / 4;
  height: auto;
}
.p-works-lp__grid>.p-works-lp__case:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.p-works-lp__grid>.p-works-lp__case:nth-child(4) {
  grid-column: 3;
  grid-row: 1;
}

.p-works-lp__grid>.p-works-lp__case:nth-child(5) {
  grid-column: 3;
  grid-row: 2;
}

.p-works-lp__case {
  display: block;
}

.p-works-lp__case:hover {
  opacity: 1;
}

.p-works-lp__img {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-placeholder);
  aspect-ratio: 3 / 2;
  margin-bottom: 16px;
}

/* 1件目だけ縦長・大きい */
.p-works-lp__grid>.p-works-lp__case:nth-child(1) .p-works-lp__img {
  aspect-ratio: auto;
  height: 400px;
}

.p-works-lp__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.p-works-lp__case:hover .p-works-lp__img img {
  transform: scale(1.04);
}

.p-works-lp__caption {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* 通し番号は自動採番（CMSに番号項目を作らない） */
.p-works-lp__grid {
  counter-reset: works;
}

.p-works-lp__case {
  counter-increment: works;
}

.p-works-lp__no {
  font-family: var(--font-serif-en);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.p-works-lp__no::before {
  content: counter(works, decimal-leading-zero);
}

.p-works-lp__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.p-works-lp__tag {
  align-self: flex-start;
  padding: 3px 8px;
  border: 1px solid var(--accent-base);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  color: var(--accent-base);
  background: #fefefe;
}

.p-works-lp__title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: var(--ls-wider);
  color: var(--text-main);
}

@media (max-width: 900px) {
  .p-works-lp__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .p-works-lp__grid>.p-works-lp__case:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .p-works-lp__grid>.p-works-lp__case:nth-child(1) {
    grid-column: 1 / -1;
  }

  .p-works-lp__grid>.p-works-lp__case:nth-child(1) .p-works-lp__img {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 560px) {
  .p-works-lp__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .p-works-lp__grid>.p-works-lp__case:nth-child(1) .p-works-lp__img {
    height: auto;
    aspect-ratio: 3 / 2;
  }
}
@media (min-width: 901px) {
  .p-works-lp__grid>.p-works-lp__case:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .p-works-lp__grid>.p-works-lp__case:nth-child(1) .p-works-lp__img {
    aspect-ratio: 3 / 4;
    /* 縦長に */
    height: auto;
  }
}

/* ==========================================================================
   CMS未入力項目の非表示（空欄で枠だけ残らないようにする）
   ========================================================================== */

/* 画像が未登録（src="" または src属性なし）の figure / div を隠す */
.p-case-hero__photo:has(img:not([src])),
.p-case-hero__photo:has(img[src=""]),
.p-case-row__img:has(img:not([src])),
.p-case-row__img:has(img[src=""]),
.p-case-row__triple figure:has(img:not([src])),
.p-case-row__triple figure:has(img[src=""]),
.p-case-gallery__grid figure:has(img:not([src])),
.p-case-gallery__grid figure:has(img[src=""]) {
  display: none;
}

/* 本文が空なら、その行のセクションごと隠す */
.p-case-row:has(.p-case-row__body:empty) {
  display: none;
}

/* 物件概要：全項目が空ならセクションごと隠す */
.p-case-overview:has(.p-case-spec td:empty:nth-child(2)):has(.p-case-spec td:empty:nth-last-child(1)) {
  /* 個別に隠すのは難しいため、下記のJSで対応 */
}

/* ギャラリー：画像が1枚も無ければセクションごと隠す */
.p-case-gallery:not(:has(.p-case-gallery__grid img[src]:not([src=""]))) {
  display: none;
}

/* 画像が消えたとき、テキストが中央に来るよう調整 */
.p-case-row__inner:not(:has(.p-case-row__img, .p-case-row__triple)) .p-case-row__text {
  flex: 1 1 auto;
  max-width: 800px;
  margin-inline: auto;
}
/* 本文が空なら、テキストブロックだけ隠す */
.p-case-row__text:has(.p-case-row__body:empty) {
  display: none;
}

/* 本文も画像も無ければセクションごと隠す */
.p-case-row:not(:has(img[src]:not([src=""]))):has(.p-case-row__body:empty) {
  display: none;
}
/* CMSがボタン内に差し込む div を無効化 */
.c-btn>div[id^="cms-text-"] {
  display: contents;
}
.p-midcta__photo img,
.p-midcta__illust img {
  width: 100%;
  height: auto;
  display: block;
}
/* ==========================================================================
   フォームCMS デザイン調整（Domus）
   ========================================================================== */


/* 必須ラベル（元の .p-form__req 相当。任意は非表示） */
.p-contact .form-contents dl dt span.required::after,
.p-page .form-contents dl dt span.required::after {
  content: '必須';
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-inverse);
  background: var(--accent-base);
}

/* 入力欄（元の .p-contact__form input / textarea 相当） */
.p-contact .form-contents .textarea,
.p-contact .form-contents .textarea-select,
.p-page .form-contents .textarea,
.p-page .form-contents .textarea-select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  height: auto;
  padding: 11px 14px;
  border: 1px solid var(--line-base);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
  transition: border-color .3s var(--ease);
}

.p-contact .form-contents .textarea:focus,
.p-contact .form-contents .textarea-select:focus,
.p-page .form-contents .textarea:focus,
.p-page .form-contents .textarea-select:focus {
  outline: none;
  border-color: var(--accent-base);
}

.p-contact .form-contents textarea.textarea,
.p-page .form-contents textarea.textarea {
  min-height: 120px;
  resize: vertical;
}

/* CMS標準の背景を打ち消す */
.form-design-pattern-1 {
  background: transparent !important;
}

/* reCAPTCHA */
.form-contents .recaptcha-area {
  margin: 24px 0;
  display: flex;
  justify-content: flex-start;
}

/* 送信ボタン（元の .p-contact__submit / .c-btn 相当） */
.p-contact .form-contents input[type="submit"],
.p-contact .form-contents button[type="submit"],
.p-page .form-contents input[type="submit"],
.p-page .form-contents button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  margin-top: 10px;
  padding: 16px 32px;
  border: 1px solid var(--accent-base);
  border-radius: var(--radius);
  background: var(--accent-base);
  color: var(--text-inverse);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: var(--ls-wider);
  cursor: pointer;
  transition: background-color .3s var(--ease);
}

.p-contact .form-contents input[type="submit"]:hover,
.p-contact .form-contents button[type="submit"]:hover,
.p-page .form-contents input[type="submit"]:hover,
.p-page .form-contents button[type="submit"]:hover {
  background: var(--accent-dark);
}

/* エラー表示（元の .p-form__error-top 相当） */
.form-contents .form-err-msg {
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid #f5c6c0;
  border-radius: var(--radius);
  background: #fdecea;
  color: #c0392b;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 900px) {

  .p-contact .form-contents input[type="submit"],
  .p-contact .form-contents button[type="submit"],
  .p-page .form-contents input[type="submit"],
  .p-page .form-contents button[type="submit"] {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .form-contents .recaptcha-area {
    justify-content: center;
    transform: scale(.85);
    transform-origin: center;
  }
}
.form-design-pattern-1 dl dt:not(.pattern-exclusion) span.required::before {
display: none!important;
}
/* フォームCMS：dt/dd を縦積みにする */
.p-contact .form-contents dl dt,
.p-page .form-contents dl dt {
  display: block !important;
  float: none !important;
  width: 100% !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  clear: both;
}

.p-contact .form-contents dl dd,
.p-page .form-contents dl dd {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 22px !important;
  padding: 0 !important;
  margin-left: 0 !important;
}

.p-contact .form-contents .textarea,
.p-contact .form-contents .textarea-select,
.p-page .form-contents .textarea,
.p-page .form-contents .textarea-select {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
}
.p-contact .form-contents dl dt,
.p-page .form-contents dl dt {
  display: block !important;
  float: none !important;
  width: 100% !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  clear: both;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  color: var(--text-main);
}
/* フォームCMS：input の固定高さ（height:45px）を打ち消して padding 基準に戻す
   CMS 側 .form-contents dd:not(.pattern-exclusion) input.textarea が
   詳細度・読み込み順ともに勝つため !important で上書きする */
.p-contact .form-contents dd input.textarea,
.p-page .form-contents dd input.textarea,
.p-contact .form-contents dd select.textarea-select,
.p-page .form-contents dd select.textarea-select {
  height: auto !important;
  padding: 11px 14px !important;
  line-height: 1.7 !important;
}

.p-contact .form-contents dd textarea.textarea,
.p-page .form-contents dd textarea.textarea {
  height: auto !important;
  min-height: 120px !important;
}

/* フォームCMS：スマホでは外枠のパディングを詰める（CMS側 .form-contents の padding:35px 30px を打ち消す） */
@media (max-width: 560px) {
  .p-contact .form-contents,
  .p-page .form-contents {
    padding: 0 !important;
  }
}
