/* 施工事例ページ（ihw-）の見た目。色はアイホームのサイト（茶色の文字・オレンジ）に合わせている。
   色を変えるときは .ihw の変数だけ直す。 */
.ihw {
  --ihw-main: #482f18;
  --ihw-accent: #e38025;
  --ihw-sub: #8b7765;
  --ihw-soft: #fdf6ee;
  --ihw-th: #f8e7d5;
  --ihw-line: #eddcc8;
  color: var(--ihw-main);
  font-size: 17px;
  line-height: 1.8;
}
.ihw p, .ihw li, .ihw th, .ihw td { font-size: inherit; line-height: inherit; color: inherit; }
.ihw p, .ihw figure, .ihw ul, .ihw h2, .ihw h3 { margin: 0; }
.ihw .wp-block-group { max-width: none; }
/* 旧来のテーマではグループの中身が inner-container で包まれるので、無いものとして並べる */
.ihw .wp-block-group__inner-container { display: contents; }
.ihw > * + *, .ihw > .wp-block-group__inner-container > * + * { margin-top: 36px; }
.ihw img { display: block; max-width: 100%; height: auto; margin: 0 !important; }

/* 冒頭：カテゴリ・リード文（横いっぱい）→ 施工概要（横いっぱいの箱） */
.ihw-head { display: grid; grid-template-columns: 1fr; gap: 20px; }
.ihw-badge { display: inline-block; background: var(--ihw-accent); color: #fff !important; font-weight: 700; font-size: 15px !important; padding: 2px 14px; border-radius: 4px; }
.ihw-lead { margin-top: 14px !important; }
.ihw-summary { background: var(--ihw-soft); border: 1px solid var(--ihw-line); border-radius: 10px; padding: 16px 20px 18px; }
.ihw-summary__title { font-size: 19px !important; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px !important; color: var(--ihw-main); }
/* 表は行ごとに「見出し｜値」の2マス。短い項目の表は行を2列に並べ、数が奇数なら最後の行を横いっぱいに */
.ihw-summary__table { margin: 0 !important; }
.ihw-summary__table table, .ihw-summary__table tbody, .ihw-summary__table tr, .ihw-summary__table th, .ihw-summary__table td { margin: 0 !important; }
.ihw-summary__table table, .ihw-summary__table tbody { display: block; width: 100%; border: 0; }
.ihw-summary__table--grid tbody { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.ihw-summary__table--grid tr:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ihw-summary__table--wide { margin-top: 0 !important; }
.ihw-summary__table tr { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; align-items: stretch; padding: 4px 0; border: 0; }
.ihw-summary__table th, .ihw-summary__table td { display: flex; align-items: center; border: 0; padding: 5px 10px; font-size: 15px; text-align: left; }
.ihw-summary__table th { background: var(--ihw-th); font-weight: 700; border-radius: 4px; white-space: nowrap; }
.ihw-summary__table td { padding-left: 0; border-bottom: 1px dotted var(--ihw-line); }

/* 施工前 → ▼ → 施工後（縦に並べ、同じ種類の写真は横に並べる） */
.ihw-ba { display: grid; grid-template-columns: 1fr; gap: 56px; }
.ihw-photo { position: relative; }
.ihw-photo__label { text-align: center; color: #fff !important; padding: 8px 12px; border-radius: 10px 10px 0 0; font-size: 14px !important; line-height: 1.5 !important; margin: 0 !important; }
.ihw-photo__label strong { font-size: 19px; }
.ihw-photo--before .ihw-photo__label { background: var(--ihw-sub); }
.ihw-photo--after .ihw-photo__label { background: var(--ihw-accent); }
.ihw-photo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--ihw-line); border-top: 0; border-radius: 0 0 10px 10px; margin: 0 !important; }
.ihw-photo__grid--single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.ihw .ihw-photo__img { margin: 0 !important; }
.ihw-photo__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.ihw-photo--before::after { content: ""; position: absolute; left: 50%; bottom: -40px; transform: translateX(-50%); border-left: 20px solid transparent; border-right: 20px solid transparent; border-top: 22px solid var(--ihw-accent); }
/* 施工前・施工後とも1枚ずつのとき（PC）：左右に並べて ▶ でつなぐ */
@media (min-width: 768px) {
  .ihw-ba--pair { grid-template-columns: 1fr 1fr; gap: 56px; }
  .ihw-ba--pair .ihw-photo__grid--single { grid-template-columns: 1fr; }
  .ihw-ba--pair .ihw-photo--before::after { left: auto; right: -40px; top: 55%; bottom: auto; transform: translateY(-50%); border-top: 16px solid transparent; border-bottom: 16px solid transparent; border-left: 20px solid var(--ihw-accent); border-right: 0; }
}

/* 見出し付きの横長の箱 */
.ihw-box { display: grid; grid-template-columns: 280px 1fr; align-items: center; background: var(--ihw-soft); border-radius: 10px; padding: 20px 24px; }
.ihw-box + .ihw-box { margin-top: 14px; }
.ihw-box__title { font-size: 20px !important; font-weight: 700; display: flex; align-items: center; gap: 12px; padding-right: 20px; border-right: 1px solid var(--ihw-line); align-self: stretch; color: var(--ihw-main); }
.ihw-box__body { padding-left: 24px; }
/* テーマが ul/li の点を消し、li に上の余白を付けるので戻す */
.ihw .ihw-points { list-style: disc !important; padding-left: 1.2em !important; margin: 0 !important; }
.ihw .ihw-points li { list-style: inherit !important; margin: 0 !important; padding: 0 !important; }
.ihw .ihw-points li + li { margin-top: 6px !important; }
.ihw-points li::marker { color: var(--ihw-accent); }
.ihw-box--voice { background: #fff; border: 2px solid var(--ihw-line); }

/* アイコン（SVG を背景に使う） */
.ihw-box__title::before, .ihw-summary__title::before, .ihw-section-title::before { content: ""; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff center / 24px no-repeat; }
.ihw-summary__title::before, .ihw-section-title::before { width: 26px; height: 26px; background-size: 24px; background-color: transparent; }
.ihw-box--request .ihw-box__title::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e38025' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3Cpath d='M8.5 12h.01M12 12h.01M15.5 12h.01'/%3E%3C/svg%3E"); }
.ihw-box--points .ihw-box__title::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e38025' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
.ihw-box--voice .ihw-box__title::before { background-color: var(--ihw-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e38025' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.ihw-summary__title::before, .ihw-section-title--steps::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23482f18' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0 5 5L21 13l-8 8-3-3 8-8-1.3-1.3a4 4 0 0 1-5-5L13 2l1.7 4.3zM3 21l6-6'/%3E%3C/svg%3E"); }
.ihw-section-title--related::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23482f18' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h4'/%3E%3C/svg%3E"); }

/* 施工内容と解決方法 */
.ihw-section-title { display: inline-flex; align-items: center; gap: 8px; font-size: 22px !important; font-weight: 700; padding-bottom: 6px; border-bottom: 3px solid var(--ihw-accent); color: var(--ihw-main); }
.ihw-section-lead { font-size: 15px !important; color: var(--ihw-sub) !important; margin-top: 6px !important; }
.ihw-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 16px; }
.ihw-steps--3 { grid-template-columns: repeat(3, 1fr); }
.ihw-steps--2 { grid-template-columns: repeat(2, 1fr); }
.ihw-steps--1 { grid-template-columns: 1fr; }
.ihw-step { position: relative; background: var(--ihw-soft); border-radius: 10px; padding: 14px; }
.ihw-step:not(:last-child)::after { content: ""; position: absolute; right: -24px; top: 50%; border-left: 12px solid var(--ihw-accent); border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.ihw-step__title { display: flex; align-items: center; gap: 8px; font-size: 17px !important; font-weight: 700; line-height: 1.4 !important; min-height: 2.8em; color: var(--ihw-main); }
.ihw .ihw-step__num { margin: 0 !important; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ihw-accent); color: #fff; font-size: 16px; }
.ihw-step__img { margin-top: 8px !important; }
.ihw-step__img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }

/* 本文の下：前後の事例ボタン → 関連する施工事例（works-related.php が出す） */
.single-works .post-navigation { display: none; }
.ihw-after { margin-top: 64px; }
/* テーマが本文中のすべての要素に上の余白を付けるので、いったん消して必要なところだけ付ける */
.ihw-after * { margin: 0 !important; }
.ihw-after .ihw-related-wrap { margin-top: 40px !important; }
.ihw-after .ihw-related { margin-top: 20px !important; }
.ihw-after .ihw-pager__title { margin-top: 2px !important; }
.ihw-after .ihw-card__label { margin-bottom: 6px !important; }
.ihw-after .ihw-card__date { margin-top: 4px !important; }
.ihw-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ihw-pager__link { position: relative; display: block; padding: 14px 20px 14px 44px; border: 1px solid var(--ihw-line); border-radius: 10px; background: #fff; color: var(--ihw-main) !important; text-decoration: none !important; transition: border-color .2s, background .2s; }
.ihw-pager__link:hover { border-color: var(--ihw-accent); background: var(--ihw-soft); }
.ihw-pager__link--next { grid-column: 2; padding: 14px 44px 14px 20px; text-align: right; }
.ihw-pager__link::before { content: ""; position: absolute; top: 50%; left: 20px; width: 9px; height: 9px; border-left: 2px solid var(--ihw-accent); border-bottom: 2px solid var(--ihw-accent); transform: translateY(-50%) rotate(45deg); }
.ihw-pager__link--next::before { left: auto; right: 20px; transform: translateY(-50%) rotate(-135deg); }
.ihw-pager__dir { font-size: 13px; font-weight: 700; color: var(--ihw-accent); line-height: 1.5; }
.ihw-pager__title { font-size: 15px; font-weight: 700; line-height: 1.5; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ihw-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ihw-card { display: block; border: 1px solid var(--ihw-line); border-radius: 10px; background: #fff; overflow: hidden; color: var(--ihw-main) !important; text-decoration: none !important; transition: border-color .2s, box-shadow .2s; }
.ihw-card:hover { border-color: var(--ihw-accent); box-shadow: 0 4px 14px rgba(72, 47, 24, .08); }
.ihw-card__img { aspect-ratio: 4 / 3; background: var(--ihw-soft); }
.ihw-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0 !important; }
.ihw-card__body { padding: 12px 14px 14px; }
.ihw-card__label { display: inline-block; background: var(--ihw-accent); color: #fff; font-size: 12px; line-height: 1.6; padding: 0 8px; border-radius: 3px; margin-bottom: 6px; }
.ihw-card__title { font-weight: 700; font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ihw-card__date { font-size: 12px; color: var(--ihw-sub); margin-top: 4px; }

/* スマホ */
@media (max-width: 767px) {
  .ihw { font-size: 15px; }
  .ihw > * + *, .ihw > .wp-block-group__inner-container > * + * { margin-top: 28px; }
  .ihw-after { margin-top: 48px; }
  .ihw-pager { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ihw-pager__link { padding: 10px 10px 10px 30px; }
  .ihw-pager__link--next { padding: 10px 30px 10px 10px; }
  .ihw-pager__link::before { left: 12px; }
  .ihw-pager__link--next::before { right: 12px; }
  .ihw-pager__title { font-size: 13px; }
  .ihw-related { grid-template-columns: 1fr; gap: 10px; }
  .ihw-card { display: grid; grid-template-columns: 110px 1fr; }
  .ihw-card__img { aspect-ratio: auto; }
  .ihw-card__body { padding: 10px 12px; }
  .ihw-summary__table--grid tbody { grid-template-columns: 1fr; }
  .ihw-summary__table tr { grid-template-columns: 1fr; gap: 4px; padding: 6px 0; }
  .ihw-summary__table th { justify-self: start; padding: 2px 10px; font-size: 13px; }
  .ihw-summary__table td { padding: 2px 0 8px; }
  .ihw-ba { gap: 48px; }
  .ihw-photo__grid { gap: 8px; padding: 8px; }
  .ihw-photo--before::after { bottom: -36px; border-left-width: 16px; border-right-width: 16px; border-top-width: 18px; }
  .ihw-box { grid-template-columns: 1fr; padding: 16px; }
  .ihw-box__title { border-right: 0; border-bottom: 1px solid var(--ihw-line); padding: 0 0 10px; font-size: 18px !important; }
  .ihw-box__body { padding: 12px 0 0; }
  .ihw-steps, .ihw-steps--2, .ihw-steps--3, .ihw-steps--4 { grid-template-columns: 1fr; gap: 10px; }
  .ihw-step__title { min-height: 0; }
  .ihw-step:not(:last-child)::after { display: none; }
  .ihw-step__title { font-size: 15px !important; }
}
