/*
 * 土屋興業 HP 共通スタイル
 *
 * デザインの幅: PC 1440px / SP 390px
 * 切り替えの幅:
 *   - 1199px 以下: header をハンバーガーメニューにする（PC の header は横に約 1390px 要るため。1200〜1365px は電話番号をアイコンだけにして収める）
 *   - 767px 以下: SP のレイアウトにする
 *
 * 並び: 基本 → 変数 → 共通のパーツ → header → 下層ページの見出し → footer → 各ページ
 */

/* ---------- 基本 ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.05em;
  color: var(--color-text);
  background: var(--color-white);
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

/* ---------- 変数 ---------- */

:root {
  /* 色（デザインの画像から拾った値） */
  --color-text: #282828;
  --color-brown: #2c1e11;      /* 見出し・ボタン・コピーライトの帯 */
  --color-accent: #de5e31;     /* 資料請求・お問い合わせ */
  --color-tel: #022387;        /* 電話のアイコン */
  --color-beige: #efece8;      /* セクションの背景 */
  --color-gray: #f4f4f4;       /* footer の背景 */
  --color-white: #fff;

  /* 文字 */
  --font-sans: "Noto Sans JP", sans-serif;
  --font-serif: "Noto Serif JP", serif;

  /* 幅 */
  --content-width: 1120px;
  --gutter: 24px;              /* SP の左右の余白 */

  --header-height: 71px;
}

@media (max-width: 1199px) {
  :root {
    --header-height: 60px;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 38px;
  }
}

/* ---------- 共通のパーツ ---------- */

/* 中身の幅をそろえる箱 */
.container {
  width: min(var(--content-width), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* 茶色の四角いボタン（「詳しく見る」など） */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 55px;
  padding: 0 24px;
  color: var(--color-white);
  background: var(--color-brown);
  letter-spacing: 0.1em;
  transition: opacity 0.2s;
}

.button:hover {
  opacity: 0.8;
}

/* 家の形の見出し（左に家のアイコン、右へ伸びる下線）
 * 使い方: <h2 class="house-heading">見出し</h2>
 * 番号入り: <h3 class="house-heading house-heading--num">
 *             <span class="house-heading__num" aria-hidden="true">01</span>
 *             <span class="house-heading__title">見出し</span></h3>
 * 色や大きさはページ側で変数を上書きして変える（--house-heading-color など）
 */
.house-heading {
  --house-heading-color: var(--color-brown);   /* アイコンと下線の色 */
  --house-heading-size: 32px;
  --house-heading-spacing: 0.03em;
  --house-heading-gap: 16px;
  --house-heading-icon-w: 69px;                /* 家のアイコンの大きさ（番号なし） */
  --house-heading-icon-h: 61px;
  --house-heading-overhang: 9px;               /* アイコンが下線より下に出る分 */
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--house-heading-gap);
  padding-bottom: var(--house-heading-overhang);
  font-size: var(--house-heading-size);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: var(--house-heading-spacing);
  color: var(--color-text);
}

.house-heading::before {
  content: "";
  flex-shrink: 0;
  width: var(--house-heading-icon-w);
  height: var(--house-heading-icon-h);
  margin-bottom: calc(var(--house-heading-overhang) * -1);
  background-color: var(--house-heading-color);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 69 61' fill='none' stroke='%23000' stroke-linejoin='miter'%3E%3Cpath d='M1 29 34.5 1 68 29H52v31M17 60V29H1'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 69 61' fill='none' stroke='%23000' stroke-linejoin='miter'%3E%3Cpath d='M1 29 34.5 1 68 29H52v31M17 60V29H1'/%3E%3C/svg%3E") no-repeat center / contain;
}

.house-heading::after {
  content: "";
  position: absolute;
  /* 下線は、アイコンの右の足（viewBox の x=52）の左端から始める。足と線がつながって見える */
  left: calc(var(--house-heading-icon-w) * 51.5 / 69);
  right: 0;
  bottom: 0;
  border-bottom: 1px solid var(--house-heading-color);
}

/* 番号入り: 家の形の中に番号。右に題と線が伸びる */
.house-heading--num {
  --house-heading-line: 1px;                   /* 下線とアイコンの線の太さ */
  --house-heading-num-h: 60px;
  --house-heading-num-color: var(--color-brown);
  --house-heading-num-lh: 29px;
  --house-heading-num-pb: 0px;
  --house-heading-num-spacing: 0.05em;
  --house-heading-title-size: 22px;
  --house-heading-title-lh: 1.5;
  --house-heading-title-spacing: 0.08em;
  --house-heading-title-pl: 28px;
  --house-heading-title-pb: 8px;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0;
  align-items: end;
  min-height: var(--house-heading-num-h);
  padding-bottom: 0;
  font-size: var(--house-heading-title-size);
  letter-spacing: normal;
}

.house-heading--num::before,
.house-heading--num::after {
  content: none;
}

.house-heading__num {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: var(--house-heading-num-h);
  padding-bottom: var(--house-heading-num-pb);
  font-size: 22px;
  line-height: var(--house-heading-num-lh);
  letter-spacing: var(--house-heading-num-spacing);
  color: var(--house-heading-num-color);
}

.house-heading__num::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--house-heading-color);
  -webkit-mask: var(--house-heading-num-mask) center / 70px 100% no-repeat;
  mask: var(--house-heading-num-mask) center / 70px 100% no-repeat;
}

.house-heading--num {
  --house-heading-num-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 60' fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M16 59.5V32H1L35 1l34 31H54v27.5'/%3E%3C/svg%3E");
}

/* 線が太い版（SUNDAY LATTEHOUSE）。アイコンの高さは 62px */
.house-heading--bold {
  --house-heading-line: 1.5px;
  --house-heading-num-h: 62px;
  --house-heading-num-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 62' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M16 61V32H1L35 1L69 32H54V61'/%3E%3C/svg%3E");
}

.house-heading__title {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-left: -16px;
  padding: 0 0 var(--house-heading-title-pb) var(--house-heading-title-pl);
  font-size: var(--house-heading-title-size);
  line-height: var(--house-heading-title-lh);
  letter-spacing: var(--house-heading-title-spacing);
  border-bottom: var(--house-heading-line) solid var(--house-heading-color);
}

.house-heading__title span {
  display: block;
}

@media (max-width: 767px) {
  .house-heading {
    --house-heading-size: 24px;
    --house-heading-spacing: 0.04em;
    --house-heading-gap: 4px;
  }
}

/* スクリーンリーダー向けにだけ読ませる文字 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
}

.header__logo img {
  width: 203px;
}

.header__nav {
  display: flex;
  align-items: center;
}

.header__menu {
  display: flex;
  gap: 0;
}

.header__menu a {
  display: block;
  padding: 6px 6px 9px;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.header__menu a:hover,
.header__menu a[aria-current] {
  border-bottom-color: var(--color-brown);
}

/* 「土屋興業とは」のサブメニュー（PC は hover / フォーカスで開く。ハンバーガーでは常に表示） */
.header__menu > li {
  position: relative;
}

.header__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-beige);
  box-shadow: 0 4px 12px rgb(44 30 17 / 0.1);
  /* visibility: hidden にすると Tab で入れないので、透明にして触れなくする */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.header__menu > li:hover > .header__submenu,
.header__menu > li:focus-within > .header__submenu {
  opacity: 1;
  pointer-events: auto;
}

.header__submenu li + li {
  border-top: 1px solid var(--color-beige);
}

.header__menu .header__submenu a {
  padding: 12px 16px;
  white-space: nowrap;
  border-bottom: 0;
  transition: color 0.2s, background-color 0.2s;
}

.header__menu .header__submenu a:hover,
.header__menu .header__submenu a[aria-current="page"] {
  color: var(--color-accent);
  background: var(--color-gray);
}

.header__tel {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  font-size: 14px;
  letter-spacing: 0;
}

.header__tel svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.header__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 55px;
  padding: 0 14px;
  font-size: 14px;
  letter-spacing: 0.06em;
  border: 2px solid var(--color-accent);
  transition: opacity 0.2s;
}

.header__cta:hover,
.header__banner:hover {
  opacity: 0.8;
}

.header__cta--outline {
  color: var(--color-accent);
  background: var(--color-white);
}

.header__cta--fill {
  color: var(--color-white);
  background: var(--color-accent);
}

.header__banner img {
  width: 91px;
}

/* セルコホームのバナー（横長なので高さで抑える） */
.header__banner--selco img {
  width: 172px;
  height: 40px;
}

/* PC の header: ロゴと右の並びの間に余った幅を、メニューの項目の間に配る。
   メニューが詰まって見えるという指摘（2026-11-29）への対応。
   ロゴとの間は最低 24px 空け、広い画面で間が開きすぎないよう幅に上限を付ける */
@media (min-width: 1200px) {
  .header__nav {
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
  }

  .header__menu {
    flex: 1;
    justify-content: space-between;
    max-width: 620px;
    margin-left: 24px;
  }

  .header__menu a {
    white-space: nowrap;
  }
}

/* 1536px 以上は余裕があるので、ボタンの左右の余白を Figma どおり 24px に戻し、
   バナーの高さを資料請求・お問い合わせのボタン（55px）にそろえる
   （1440px ではメニューの余白が取れなかったので、切り替えを 1440px から上げた。2026-11-29） */
@media (min-width: 1536px) {
  .header__cta {
    padding: 0 24px;
  }

  .header__banner--selco img {
    width: auto;
    height: 55px;
  }
}

/* 1200〜1365px は横に入らないので、電話番号の数字を隠してアイコンだけにする（読み上げは残す） */
@media (min-width: 1200px) and (max-width: 1365px) {
  .header__tel-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* 1200〜1279px はさらに、メニューの余白を詰める */
@media (min-width: 1200px) and (max-width: 1279px) {
  .header__menu a {
    padding-right: 4px;
    padding-left: 4px;
  }
}

/* 1200〜1439px は、バナーを小さくし、ボタンの余白を詰めて、メニューの余白に回す
   （2026-11-29 に 1279px までから 1439px までに広げた） */
@media (min-width: 1200px) and (max-width: 1439px) {
  .header__cta {
    padding: 0 10px;
  }

  .header__banner--selco img {
    width: 138px;
    height: 32px;
  }

  .header__banner:not(.header__banner--selco) img {
    width: 76px;
  }
}

/* ハンバーガーのボタン（1199px 以下で出す） */
.header__toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.header__toggle span {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 1.5px;
  background: var(--color-brown);
  transition: transform 0.3s, opacity 0.3s;
}

.header__toggle span:nth-child(1) { top: 14px; }
.header__toggle span:nth-child(2) { top: 21px; }
.header__toggle span:nth-child(3) { top: 28px; }

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

@media (max-width: 1199px) {
  .header__toggle {
    display: block;
  }

  /* メニューは header の下に全面で開く（開いたときのデザインはまだ無いので仮） */
  .header__nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    padding: 24px var(--gutter) 40px;
    overflow-y: auto;
    background: var(--color-white);
    border-top: 1px solid var(--color-beige);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .header.is-open .header__nav {
    visibility: visible;
    opacity: 1;
  }

  .header__menu {
    flex-direction: column;
    gap: 0;
  }

  .header__menu a {
    padding: 16px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--color-beige);
  }

  .header__menu a:hover,
  .header__menu a[aria-current] {
    border-bottom-color: var(--color-beige);
    color: var(--color-accent);
  }

  /* サブメニューは「土屋興業とは」の下に一段下げて並べる（常に表示） */
  .header__submenu {
    position: static;
    min-width: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
  }

  .header__submenu li + li {
    border-top: 0;
  }

  .header__menu .header__submenu a {
    padding: 14px 4px 14px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--color-beige);
  }

  .header__menu .header__submenu a:hover,
  .header__menu .header__submenu a[aria-current="page"] {
    background: none;
  }

  .header__tel {
    justify-content: center;
    margin: 32px 0 0;
    font-size: 18px;
  }

  .header__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 24px 0 0;
  }

  .header__banner {
    align-self: center;
    margin-top: 12px;
  }

  .header__banner img {
    width: 120px;
  }

  .header__banner--selco img {
    width: 215px;
    height: 50px;
  }

  /* メニューを開いている間は後ろをスクロールさせない */
  body.is-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 767px) {
  .header__inner {
    padding: 0 var(--gutter);
  }

  .header__logo img {
    width: 134px;
  }
}

/* ---------- 下層ページの見出し・パンくず ---------- */

.page-heading {
  display: flex;
  align-items: center;
  height: 223px;
  background: var(--color-beige) center / cover no-repeat;
}

/* 見出しの背景の画像はページごと（素材の header0x.webp） */
.page-heading--about        { background-image: url(../images/about/header01.webp); }
.page-heading--sunday       { background-image: url(../images/sunday-lattehouse/header02.webp); }
.page-heading--renovation   { background-image: url(../images/renovation/header03.webp); }
.page-heading--reform-jirei { background-image: url(../images/reform-jirei/header04.webp); }

.page-heading__title {
  font-family: var(--font-serif);
  font-size: 41px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  color: #34261f;
}

.breadcrumb {
  margin-top: 12px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.breadcrumb li + li::before {
  content: "";
  display: inline-block;
  margin: 0 8px 1px 9px;
  border-block: 4px solid transparent;
  border-left: 5px solid var(--color-text);
  vertical-align: middle;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .page-heading {
    height: 113px;
  }

  .page-heading__title {
    width: 100%;
    font-size: 22px;
    letter-spacing: 0;
    text-align: center;
  }

  .breadcrumb {
    margin-top: 7px;
  }

  .breadcrumb ol {
    letter-spacing: 0.06em;
  }

  .breadcrumb li + li::before {
    margin: 0 4px 1px 4px;
  }
}

/* ---------- footer ---------- */

.footer {
  background: var(--color-gray);
}

.footer__inner {
  display: flex;
  gap: 95px;
  padding: 45px 0 40px;
}

.footer__company img {
  width: 300px;
}

.footer__company--jutaku img {
  width: 368px;
}

.footer__logo {
  display: block;
  width: fit-content;
  transition: opacity 0.2s;
}

.footer__logo:hover,
.footer__copyright-link:hover {
  opacity: 0.8;
}

.footer__copyright-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer__company address {
  margin-top: 16px;
  font-size: 14px;
  font-style: normal;
  line-height: 2.1;
}

.footer__links {
  margin-left: auto;
  font-size: 14px;
}

.footer__links li + li {
  margin-top: 20px;
}

.footer__links a:hover {
  text-decoration: underline;
}

.footer__copyright {
  padding: 16px var(--gutter);
  font-size: 14px;
  text-align: center;
  color: var(--color-white);
  background: var(--color-brown);
}

@media (max-width: 1199px) {
  .footer__inner {
    gap: 40px;
  }
}

@media (max-width: 767px) {
  .footer__inner {
    flex-direction: column;
    gap: 33px;
    padding: 40px 0 39px;
  }

  /* SP ではリンクが一番上に来る */
  .footer__links {
    order: -1;
    margin-left: 0;
    margin-bottom: -4px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  .footer__links li + li {
    margin-top: 18px;
  }

  .footer__company img {
    width: 250px;
  }

  .footer__company--jutaku img {
    width: 308px;
  }

  .footer__company address {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.85;
  }

  .footer__copyright {
    padding: 12px var(--gutter);
    font-size: 12px;
    letter-spacing: 0.035em;
  }
}

/* ---------- 各ページ ---------- */
/* ページごとのスタイルは、段階 4 でここから下に足す */

/* 見出しの背景（会社案内・施工事例） */
.page-heading--company     { background-image: url(../images/about/header01.webp); }
.page-heading--sekoujirei  { background-image: url(../images/sekoujirei/header06.webp); }

/* 仮のページの中身（実装したら置き換える） */
.placeholder {
  margin-block: 32px 80px;
  padding: 32px 24px;
  border: 2px dashed #b5a898;
  font-size: 15px;
  line-height: 1.8;
  color: #6b5f55;
}

.placeholder__title {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 700;
}

.placeholder__text + .placeholder__text,
.placeholder__links {
  margin-top: 12px;
}

.placeholder__links ul {
  margin: 4px 0 4px 1.5em;
}

.placeholder a {
  text-decoration: underline;
}
