/* 「わかりやすさ」の見せ方（mu-plugins/egao-wakariyasusa.php が、要るページでだけ読む）。2026-11-18 r29。
   元＝Codex の見本 a-preview-20261115/mobile-candidate.css（社長 11/16「大体いいね」）。色と字は子テーマの決まり（--egao-*）。
   オレンジの上は白抜き（--egao-on-orange）・マウスを載せた時は濃いオレンジ（--egao-orange-hover）＝r28 の決まり。 */

/* (A) スマホのトップの新しい1画面目。600px 以上では出さない（パソコンとタブレットは今の公開版のまま）。 */
.egao-mobile-study { display: none; }

@media (max-width: 599px) {
  .egao-mobile-candidate .egao-hero-stage,
  .egao-mobile-candidate .egao-hero-caption { display: none !important; }

  .egao-mobile-candidate .post_content .egao-mobile-study { display: block; }

  .egao-mobile-candidate .post_content .egao-mobile-study.alignfull {
    background: var(--egao-paper);
    margin-top: 0 !important;
    padding: 0 0 9px;
  }

  .egao-mobile-inset { padding-inline: 24px 26px; }

  .egao-mobile-hero {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    isolation: isolate;
  }

  .egao-mobile-heading {
    align-self: start;
    grid-area: 1 / 1;
    padding-top: 14px;
    z-index: 1;
  }

  .egao-mobile-candidate .post_content #mobile-work {
    border: 0;
    font-size: var(--egao-lg) !important;
    line-height: 1.38;
    margin: 0 0 9px;
    padding: 0;
    text-wrap: wrap;
  }
  #mobile-work::before,
  #mobile-work::after { display: none; }
  #mobile-work > span { display: block; }

  .egao-mobile-room {
    grid-area: 1 / 1;
    margin: 0 !important;
  }

  .egao-mobile-visual {
    display: grid;
    grid-template-rows: clamp(245px,67vw,280px);
    grid-template-columns: minmax(0,1fr);
  }
  .egao-mobile-visual img,
  .egao-mobile-visual::after { grid-area: 1 / 1; }
  .egao-mobile-visual img {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: 71% center;
    width: 100%;
  }
  /* 題の後ろに生成り色の霞みを重ね、絵へつなげる（社長 11/15「グラデーションつけるとか霞みをつけるなどして…素敵にしてください」）。 */
  .egao-mobile-visual::after {
    background: linear-gradient(to bottom, var(--egao-paper) 8%, #faf9f6f7 21%, #faf9f6d9 29%, #faf9f640 42%, transparent 53%, transparent 90%, #faf9f62e 96%, var(--egao-paper) 100%);
    content: '';
    pointer-events: none;
  }

  .egao-mobile-candidate .post_content .egao-mobile-room figcaption {
    font-size: var(--egao-sm);
    line-height: 1.45;
    margin: 4px 0 0;
    padding-inline: 24px 26px;
    text-align: left;
  }

  .egao-mobile-info { padding-top: 7px; }
  .egao-mobile-candidate .post_content .egao-mobile-lead {
    font-size: var(--egao-md);
    line-height: 1.45;
    margin: 0 0 8px;
  }

  .egao-mobile-area {
    border-block: 1px solid var(--egao-line);
    padding: 6px 0 7px;
  }
  .egao-mobile-candidate .post_content .egao-mobile-area p {
    align-items: center;
    color: var(--egao-link);
    display: flex;
    font-size: var(--egao-md);
    gap: 6px;
    line-height: 1.3;
    margin: 0 0 4px;
  }
  .egao-mobile-area .egao-a-areas {
    display: flex;
    flex-wrap: wrap;
    font-size: var(--egao-sm);
    gap: 2px 12px;
    line-height: 1.4;
  }
  .egao-mobile-area .egao-a-area-item {
    align-items: baseline;
    display: inline-flex;
    gap: 0.45em;
    white-space: nowrap;
  }
  .egao-mobile-area .egao-a-area-item b { color: var(--egao-ink); }

  .egao-mobile-actions {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0,1fr));
    margin: 9px 0 0;
  }
  .egao-mobile-candidate .post_content .egao-mobile-actions a {
    align-items: center;
    display: flex;
    font-size: var(--egao-md);
    font-weight: 700;
    gap: 6px;
    justify-content: center;
    min-height: 44px;
    padding: 4px 5px;
    text-decoration: none;
  }
  .egao-mobile-candidate .post_content .egao-mobile-actions a {
    background: #fff;
    border: 1px solid var(--egao-line);
    color: var(--egao-ink);
    line-height: 1.2;
    transition: background .2s;
  }
  .egao-mobile-candidate .post_content .egao-mobile-actions .main-action {
    background: var(--egao-orange);
    border-color: var(--egao-orange);
    color: var(--egao-on-orange);
    grid-column: 1 / -1;
  }
  .egao-mobile-candidate .post_content .egao-mobile-actions a:hover,
  .egao-mobile-candidate .post_content .egao-mobile-actions a:focus-visible {
    background: #f5e6d3;
    border-color: var(--egao-link);
  }
  .egao-mobile-candidate .post_content .egao-mobile-actions .main-action:hover,
  .egao-mobile-candidate .post_content .egao-mobile-actions .main-action:focus-visible {
    background: var(--egao-orange-hover);
    border-color: var(--egao-orange-hover);
  }
  .egao-mobile-actions .egao-ico {
    color: var(--egao-link);
    display: inline-flex;
    flex: 0 0 16px;
    height: 16px;
    margin: 0 !important;
    width: 16px;
  }
  .egao-mobile-actions .egao-icon { height: 16px; width: 16px; }
  .egao-mobile-actions .main-action .egao-ico { color: var(--egao-on-orange); }

  .egao-mobile-candidate .post_content .egao-mobile-study .egao-textlink { margin: 12px 0 0; }
  .egao-mobile-candidate .post_content .egao-mobile-study .egao-textlink .egao-ico { color: var(--egao-link); }
  .egao-mobile-project {
    scroll-margin-top: 86px;
    padding: 13px 0 0;
  }
  .egao-mobile-candidate .post_content #mobile-case h2 { margin-top: 0; }
  .egao-mobile-pair {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .egao-mobile-candidate .post_content .egao-mobile-pair figure { margin: 0; }
  .egao-mobile-pair img {
    aspect-ratio: 4 / 3;
    display: block;
    height: auto;
    margin: 0;
    object-fit: cover;
    width: 100%;
  }
}

/* いちばん幅の狭いスマホ（350px 以下）：題が2行に収まるよう、このページの大の字だけ 26px にする（このページの中は 26・18・15 の3段のまま）。 */
@media (max-width: 350px) {
  .egao-mobile-candidate { --egao-lg: 26px; }
  .egao-mobile-candidate .post_content h1,
  .egao-mobile-candidate .post_content h2 { font-size: 26px !important; }
  .egao-mobile-actions { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); }
}

/* (C) 自宅の施工写真を寄せる。倍率と中心は mu-plugins/egao-wakariyasusa.php の表から枠に渡る。 */
.egao-photo-focus { display: block; overflow: hidden; }
.egao-photo-focus img {
  transform: scale(var(--egao-photo-scale, 1));
  transform-origin: var(--egao-photo-origin, center);
}

/* (B) 住宅ページ（/reform）の頭：お任せの文・釦・同じ住まいの水まわり。 */
.post_content .egao-reform-message { margin-bottom: 0; }
.egao-reform-message strong {
  color: var(--egao-ink);
  display: block;
  margin-top: .45em;
}
.post_content .egao-water-examples {
  margin-block: 38px 0;
  scroll-margin-top: 90px;
}
.post_content .egao-water-examples > h2 { margin-top: 0; }
.post_content .egao-water-pair {
  display: grid;
  gap: clamp(9px,3vw,28px);
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.post_content .egao-water-pair figure { margin: 0; }
.post_content .egao-water-pair img {
  aspect-ratio: 4 / 3;
  display: block;
  margin: 0;
  object-fit: cover;
  width: 100%;
}
.post_content .egao-water-pair figcaption {
  font-size: var(--egao-sm);
  text-align: left;
}
.post_content .egao-water-examples .egao-textlink { margin-top: 14px; }

@media (max-width: 781px) {
  .l-mainContent__inner:has(.egao-reform-opening) > .post_content { margin-top: 25px; }
  .post_content .egao-reform-opening.wp-block-columns { gap: 19px !important; }
  .post_content .egao-reform-opening .egao-page-lead-photo { order: -1; }
  .post_content .egao-water-pair { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .post_content .egao-water-pair figure:first-child { grid-column: 1 / -1; }
  .post_content .egao-water-pair figure:first-child img { aspect-ratio: 3 / 2; }
}

/* 段階2：下層ページの頭の釦の列（どこを押すか）。形はスマホのトップの釦（.egao-mobile-actions）と同じ：白地に線・高さ44px・字は中、主の釦だけオレンジに白抜き。 */
.post_content .egao-page-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}
.post_content .egao-page-jump a {
  align-items: center;
  background: #fff;
  border: 1px solid var(--egao-line);
  color: var(--egao-ink);
  display: flex;
  /* 同じ段の釦は同じ幅（もとの幅が全部同じ＝いちばん長い呼び名の幅。余りは等分）。最後の段が1つだけの時は横いっぱい */
  flex: 1 1 var(--egao-jump-min, 170px);
  font-size: var(--egao-md);
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  line-height: 1.2;
  min-height: 44px;
  padding: 6px 12px;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.post_content .egao-page-jump a:hover,
.post_content .egao-page-jump a:focus-visible {
  background: #f5e6d3;
  border-color: var(--egao-link);
}
.post_content .egao-page-jump .egao-jump-main {
  background: var(--egao-orange);
  border-color: var(--egao-orange);
  color: var(--egao-on-orange);
  flex: 1 0 100%;
}
.post_content .egao-page-jump .egao-jump-main:hover,
.post_content .egao-page-jump .egao-jump-main:focus-visible {
  background: var(--egao-orange-hover);
  border-color: var(--egao-orange-hover);
}
.post_content .egao-page-jump .egao-ico {
  color: var(--egao-link);
  display: inline-flex;
  flex: 0 0 16px;
  height: 16px;
  margin: 0 !important;
  width: 16px;
}
.post_content .egao-page-jump .egao-icon { height: 16px; width: 16px; }
.post_content .egao-page-jump .egao-jump-main .egao-ico { color: var(--egao-on-orange); }
.post_content > .egao-page-jump,
.post_content p + .egao-page-jump { margin-bottom: 28px; max-width: 774px; }
.post_content h2[id] { scroll-margin-top: 110px; }
@media (max-width: 599px) {
  .post_content h2[id] { scroll-margin-top: 86px; }
}

/* 文字のリンク（サイトの型 egao-textlink）の押せる高さを 44px に（元は 40px か 35px。上にだけ足す。字と下の線の間は変えない）。
   行の高さが低い所ほど多く足す（1lh＝その行の高さ。古いブラウザは1行目の 4px だけ効く）。 */
.post_content .egao-textlink a { padding-top: 4px; padding-top: max(4px, calc(38px - 1lh)); }

/* 施工事例の写真の組：写真の下に WordPress が重ねるぼかしの帯（説明を写真の上に載せる作りのための物）を外す。
   このサイトは説明を写真の下に置くので、帯が写真の下端と説明の字をにじませていた。 */
.post_content .wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before { content: none !important; }

/* 相談フォームの入力欄のラベルと同意の文：語の途中で折れないよう、文節で折る（対応していないブラウザは今までどおり）。 */
.post_content .egao-live-form label,
.post_content .egao-live-form .wpcf7-list-item-label { word-break: auto-phrase; }

/* いちばん幅の狭いスマホ（350px 以下）：大の字を 26px に（10字の語が1行に入り、見出しの最後の行が2〜3字だけになるのを防ぐ）。字は 26・18・15 の3段。 */
@media (max-width: 350px) {
  :root { --egao-lg: 26px; }
  .post_content h1,
  .post_content h2,
  .c-pageTitle,
  .c-postTitle__ttl { font-size: 26px !important; }
}

/* 599px 以下：全幅の帯（屋号の帯・読みものの帯・相談の帯・スマホのトップの節ほか）の右に白い1pxが出ていたのを直す（2026-11-18 r30）。
   本文の左右の余白が 24px と 26px で違うため、SWELL の全幅の決まり left:calc(50% - 50vw) だと帯が1px左へずれていた。 */
@media (max-width: 599px) {
  .post_content .alignfull { left: calc(50% - 50vw + 1px); }
}

/* 施工事例の写真の組：大きい写真の印（egao-case-main）が付いた写真は、何枚目でも横いっぱいに（平間校のAスタジオとBスタジオを同じ大きさで並べる・r30）。 */
.post_content .egao-case-gallery-native > figure.egao-case-main { grid-column: 1 / -1; }
@media (max-width: 599px) {
  .post_content .egao-case-gallery-native > figure.egao-case-main { grid-column: auto; }
}

/* 施工事例の札（2つ並び・782px 以上）：文の行数が違っても、下の「この施工事例を見る」の高さをそろえる（r30。上の文との間は 22px 以上を保つ）。 */
@media (min-width: 782px) {
  .post_content .egao-work-cards .egao-work-card:not(.egao-work-card-featured) > .wp-block-group__inner-container { display: flex; flex-direction: column; height: 100%; }
  .post_content .egao-work-cards .egao-work-card:not(.egao-work-card-featured) .egao-work-card-copy { flex: 1 1 auto; }
  .post_content .egao-work-cards .egao-work-card:not(.egao-work-card-featured) .egao-work-card-copy > .wp-block-group__inner-container { display: flex; flex-direction: column; height: 100%; }
  .post_content .egao-work-cards .egao-work-card:not(.egao-work-card-featured) .egao-work-card-copy .egao-textlink { margin-top: auto !important; }
  .post_content .egao-work-cards .egao-work-card:not(.egao-work-card-featured) .egao-work-card-copy p:has(+ .egao-textlink) { margin-bottom: 22px; }
}

/* 押せる高さを 44px に：記事の下の「工事のご相談 →」（34px だった）とフッターのリンク（41px だった）。 */
.egao-article-next a { padding-block: 5px; }
.l-footer__nav a { min-height: 44px; }

/* 費用の表（600px 以上）：左の欄の「（20坪・約66㎡の場合）」などが、欄からはみ出したり「の場合」だけ次の行に落ちたりしていた。左の欄の最小を 232px に（広い画面は今までどおり 1fr）。 */
@media (min-width: 600px) {
  .post_content .egao-price-table > div { grid-template-columns: minmax(232px, 1fr) 2.2fr; }
}

/* ページの中の行き先（見出し以外の節など）も、上の帯に隠れないように（相談ページの #inquiry-scope ほか）。 */
.post_content [id]:not(h2) { scroll-margin-top: 110px; }
@media (max-width: 599px) {
  .post_content [id]:not(h2) { scroll-margin-top: 86px; }
}
