/* ==========================================================
   下層ページ共通のスタイル
   ページの見出し・ページ内の目次・区切り（block）・写真と文章の2列・カード・実績のポイント・写真の並び
   common.css の後に読み込む
   ========================================================== */

/* ページの見出しの枠と本文の色の帯は同じ幅（.container）にし、
   中の文字は同じ余白（--panel-pad）だけ内側から始める */
:root { --panel-pad: 72px; }

/* ─── パンくず ───────────────────────────── */
.breadcrumb { margin-bottom: 24px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "/" / ""; margin: 0 10px; color: var(--line); }
.breadcrumb a { padding-block: 4px; border-bottom: 1px solid transparent; transition: border-color .3s ease; }
.breadcrumb a:hover { border-bottom-color: currentColor; }

/* ─── ページの見出し（色の付いた角丸の枠に、ページ名・キャッチ・写真） ─── */
.page-hero { padding: 24px 0 56px; }
.page-hero__panel {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: center;
  padding: 64px var(--panel-pad); border-radius: 48px; background: var(--paper-deep);
}
.page-hero__title { font-size: clamp(26px, 3.4vw, 40px); word-break: keep-all; overflow-wrap: anywhere; }
.page-hero__catch {
  margin-top: 36px; font-size: clamp(19px, 2.2vw, 24px); font-weight: 500; line-height: 1.6;
  letter-spacing: 0.08em; font-feature-settings: "palt"; word-break: auto-phrase;
}
.page-hero__sub { margin-top: 6px; font-size: 14px; letter-spacing: 0.1em; color: var(--ink-soft); line-height: 1.6; }
.page-hero__lead { margin-top: 24px; font-size: 15px; line-height: 2; letter-spacing: 0.02em; line-break: strict; text-wrap: pretty; }
.page-hero__lead p + p { margin-top: 1em; }
.page-hero .more-links { margin-top: 28px; }

.page-hero__visual { position: relative; align-self: stretch; min-height: 240px; }
.page-hero__photo {
  position: relative; z-index: 1; height: 100%; min-height: 320px;
  border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; background: var(--paper);
}
.page-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.page-hero__visual .s1 { z-index: 2; width: 112px; height: 56px; background: var(--mustard); left: -36px; bottom: 32px; }
.page-hero__visual .s2 { z-index: 2; width: 60px; height: 60px; border-radius: 10px; background: var(--sage); right: -14px; bottom: -14px; }
/* 写真の無いページは積み木の図形だけを置く */
.page-hero__visual--shapes .s1 { width: 200px; height: 100px; left: auto; right: 72px; bottom: 0; background: var(--terracotta); opacity: .9; }
.page-hero__visual--shapes .s2 { width: 88px; height: 88px; right: 8px; bottom: 0; }
.page-hero__visual--shapes .s3 { width: 72px; height: 64px; right: 120px; bottom: 112px; background: var(--mustard); }

/* ─── ページ内の目次 ───────────────────────── */
.toc { padding-bottom: 24px; }
.toc .container, .block .container { padding-inline: var(--panel-pad); }
.toc__label { font-size: 12px; letter-spacing: 0.12em; color: var(--ink-soft); line-height: 1.4; }
.toc__list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.toc__list a {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 16px 8px 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  font-size: 13px; line-height: 1.4; letter-spacing: 0.04em;
  transition: border-color .3s ease, background .3s ease;
}
.toc__list a:hover { border-color: var(--ink); }
.toc__list svg { width: 14px; height: 14px; flex: none; color: var(--ink-soft); }

/* ─── 区切り（見出しごとのまとまり） ─────────────── */
.block { padding: 72px 0; scroll-margin-top: 76px; }
/* 1つおきに色の帯にする（ページの見出しの枠と同じ幅の角丸） */
.block--tint {
  width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; border-radius: 48px; background: var(--paper-deep);
  padding: 80px 0;
}
.block--tint > .container { width: 100%; }

/* 文章だけの区切りは、左に見出し・右に本文 */
.block__grid { display: grid; grid-template-columns: minmax(0, 18em) minmax(0, 1fr); gap: 56px; align-items: start; }
.block__grid .block__title { font-size: clamp(19px, 2vw, 22px); }
.block__grid > .block__head { margin-bottom: 0; position: sticky; top: 108px; }
.block__grid > .article { max-width: none; }
.block__grid + .cards { margin-top: 48px; }
.block__head { margin-bottom: 40px; display: grid; gap: 12px; }
.block__head--row { grid-template-columns: 1fr auto; align-items: end; }
.block__en {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-en); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.4; color: var(--ink-soft);
}
.block__en::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.block__title {
  font-size: clamp(21px, 2.6vw, 28px); font-weight: 500; line-height: 1.55;
  letter-spacing: 0.06em; font-feature-settings: "palt"; word-break: keep-all; overflow-wrap: anywhere;
}

/* ─── 本文の文字組み ───────────────────────── */
.article { max-width: 46em; font-size: 15px; line-height: 2; letter-spacing: 0.02em; line-break: strict; }
.article > * + * { margin-top: 1.2em; }
.article h3 {
  margin-top: 40px; font-size: 18px; font-weight: 500; line-height: 1.6;
  letter-spacing: 0.04em; font-feature-settings: "palt"; word-break: auto-phrase;
}
/* h2.minor はお知らせの記事の小見出し（記事のページは h1 の下に h3 を置かないため） */
.article h2.minor, .article h3.minor, .article h4 {
  margin-top: 32px; margin-bottom: 0; padding-left: 18px; position: relative;
  font-size: 16px; font-weight: 500; line-height: 1.7; letter-spacing: 0.04em;
}
.article h2.minor::before, .article h3.minor::before, .article h4::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.article > :first-child, .article > h2.minor:first-child { margin-top: 0; }
.article h2.minor + *, .article h3 + *, .article h4 + * { margin-top: 12px; }
.article a:not(.link-arrow) { border-bottom: 1px solid currentColor; }
.article a:not(.link-arrow):hover { border-bottom-color: transparent; }
.article strong { font-weight: 700; }
.article .lead { font-size: 17px; line-height: 1.8; letter-spacing: 0.04em; }
.article .label { font-size: 12px; line-height: 1.4; letter-spacing: 0.12em; color: var(--ink-soft); }
.article .label + h3 { margin-top: 8px; }

/* 写真 */
figure { margin: 0; }
.article .photo img { width: auto; max-width: 100%; border-radius: var(--radius); background: var(--paper); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; border-radius: 12px; background: var(--paper); }
/* 改築の手順図（図と矢印を縦に並べる） */
.steps-figure { display: grid; justify-items: center; gap: 8px; }
.steps-figure img { width: 520px; max-width: 100%; }
.steps-figure .steps-figure__arrow { width: 160px; }

/* 表（会社概要など） */
.table-wrap { overflow-x: auto; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; border-top: 1px solid var(--line); }
.article th, .article td { padding: 16px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article th { width: 9em; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.article th:empty { border-bottom-color: transparent; }

/* 関連ページへのリンク */
.more-links { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.article .more-links { margin-top: 24px; }
.more-links .link-arrow::after {
  content: ""; width: 16px; height: 16px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ─── 写真と文章の2列 ──────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.split--flip .split__photo { order: -1; }
.split--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.split__photo img { width: 100%; border-radius: var(--radius); background: var(--paper); }
.split .article { max-width: none; }

/* ─── カード（小見出しごとのまとまり） ─────────────── */
.cards { display: grid; gap: 20px; margin-top: 40px; }
.article + .cards { margin-top: 48px; }
.block__head + .cards { margin-top: 0; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-item { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.block--tint .card-item { border-color: transparent; }
.card-item__photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper); }
.card-item__photo img { width: 100%; height: 100%; object-fit: cover; }
.card-item__body { padding: 28px 28px 32px; font-size: 14px; line-height: 1.9; letter-spacing: 0.02em; }
.card-item__body > * + * { margin-top: 12px; }
.card-item__body h3 { font-size: 17px; font-weight: 500; line-height: 1.6; letter-spacing: 0.04em; font-feature-settings: "palt"; word-break: auto-phrase; }
.card-item__body h3.minor { padding-left: 18px; position: relative; }
.card-item__body h3.minor::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.card-item__body h3 a { border-bottom: 1px solid var(--line); transition: border-color .3s ease; }
.card-item__body h3 a:hover { border-bottom-color: var(--ink); }
.card-item__body .label { font-size: 12px; letter-spacing: 0.12em; color: var(--ink-soft); line-height: 1.4; }
.card-item__body .label + h3 { margin-top: 6px; }
.card-item__body .more-links { margin-top: 20px; }
/* カードの下に置く、ページ全体の関連リンク */
.block__links { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }

/* ─── 完成までの流れ（横に並べて矢印でつなぐ） ─────── */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 32px; counter-reset: none; }
* + .flow, * + .gallery, * + .steps-figure, .flow + *, .gallery + *, .steps-figure + * { margin-top: 32px; }
.flow__step {
  position: relative; display: grid; gap: 10px; align-content: start;
  min-height: 108px; padding: 20px 20px 22px; border-radius: 16px; background: var(--white); border: 1px solid var(--line);
}
.block--tint .flow__step { border-color: transparent; }
/* 次の手順への矢印（行の最後には付けない） */
.flow__step:not(:last-child)::after {
  content: ""; position: absolute; right: -24px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background: var(--ink-soft);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.flow__step:nth-child(4n)::after { display: none; }
.flow__no { font-family: var(--font-en); font-size: 22px; font-weight: 300; letter-spacing: 0.08em; line-height: 1; color: var(--terracotta); }
.flow__text { font-size: 14px; line-height: 1.6; letter-spacing: 0.04em; }

/* ─── 実績の詳細: 設計のポイント ───────────────── */
.points { display: grid; gap: 20px; }
.points--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.points--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.point { padding: 32px 32px 36px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.point__no { font-family: var(--font-en); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--terracotta); line-height: 1.4; }
.point__title {
  margin-top: 12px; font-size: 18px; font-weight: 500; line-height: 1.6;
  letter-spacing: 0.04em; font-feature-settings: "palt"; word-break: auto-phrase;
}
.point__body { margin-top: 14px; font-size: 14px; line-height: 1.9; }

/* 写真の並び（大きい1枚＋3列） */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* 枠の比率を figure で決め、写真は枠いっぱいに切り抜く（縦長の写真でも行の高さが崩れない） */
.photo-grid figure { position: relative; aspect-ratio: 3 / 2; }
.photo-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 14px; background: var(--paper); }
.photo-grid .is-big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.photo-grid .is-wide { grid-column: span 2; aspect-ratio: auto; }
.photo-grid figure:only-child { aspect-ratio: 2 / 1; }
/* 2枚だけのときは2列にして、3列目が空かないようにする */
.photo-grid:has(> figure:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 設計実績のカード（実績の一覧・ほかの設計実績） */
.work-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; }
.work-cards--small { gap: 36px 24px; }
.work-cards--small .work__title { font-size: 15px; }

/* ─── お問い合わせの帯の上に余白を取る ───────────── */
.contact { margin-top: 64px; background: transparent; }

/* ─── お知らせの一覧 ─────────────────────────── */
.news-list { border-top: 1px solid var(--line); }
.news-list a { display: grid; grid-template-columns: 7.5em 1fr 20px; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); line-height: 1.7; transition: padding .3s ease; }
.news-list a:hover { padding-left: 10px; }
.news-list__date { font-family: var(--font-en); font-size: 14px; letter-spacing: 0.08em; color: var(--ink-soft); white-space: nowrap; }
.news-list__title { font-size: 15px; }
.news-list svg { width: 16px; height: 16px; color: var(--ink-soft); }

/* ─── お知らせの記事 ─────────────────────────── */
/* 記事名は長いので、ほかのページの見出しより小さくする */
/* 記事名は空白を含むことがあるので、keep-all ではなく文節で折り返す */
/* auto-phrase に対応していないブラウザ（Safari 等）は normal で折り返す */
.page-hero__title--news { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.6; word-break: normal; word-break: auto-phrase; }
.news-date { margin-top: 20px; font-family: var(--font-en); font-size: 14px; letter-spacing: 0.08em; color: var(--ink-soft); }
.news-article { padding-top: 16px; }
.news-article .photo-grid { margin-top: 0; }
.news-article__back { margin-top: 56px; }
/* 写真だけの記事（同じ比率の写真を2列に並べる） */
.photo-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 現行サイトで小さく載せていた画像 */
.article .photo--small img { width: 300px; }
/* 写真にリンクがあるときは下線を付けない */
.article .photo a { display: inline-block; border-bottom: 0; }

/* ─── 小さい写真と文章の組（写真を引き伸ばさない） ─── */
.media-rows { margin-top: 8px; display: grid; gap: 40px; }
.article + .media-rows { margin-top: 40px; }
.media-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 48px; align-items: center; }
.media-row__photo img { width: auto; max-width: 100%; height: auto; border-radius: var(--radius); background: var(--paper); }
.media-row__text.article { max-width: none; }
.block__photo img { width: 100%; height: auto; border-radius: var(--radius); background: var(--paper); }

/* ─── 文字入りの横長画像（切り抜かずに元の比率で） ─── */
.banners { display: grid; justify-items: start; gap: 20px; }
.banner img { width: auto; max-width: 100%; height: auto; }
.card-item__body .photo img { width: 100%; height: auto; border-radius: 12px; background: var(--paper); }

/* ─── 箇条書き（現行サイトの「・」「■」の行をまとめたもの） ─── */
.article .num-head { margin-top: 32px; font-weight: 500; }
.article .num-head:first-child { margin-top: 0; }
.article .dot-list { margin-top: 8px; border-top: 1px solid var(--line); }
.article .dot-list li { position: relative; padding: 14px 0 14px 20px; border-bottom: 1px solid var(--line); line-height: 1.8; }
.article .dot-list li::before { content: ""; position: absolute; left: 2px; top: calc(14px + 0.9em - 3px); width: 6px; height: 6px; border-radius: 50%; background: var(--terracotta); }
.dot-list__sub { display: block; margin-top: 2px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); }

/* ─── お問い合わせのページ（フォームは T-005 で追加） ─── */
.contact-page__lead { max-width: 46em; margin-inline: auto; text-align: center; font-size: 15px; line-height: 2; letter-spacing: 0.02em; }
.contact-ways { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.contact-way { padding: 40px 40px 44px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.contact-way__title { margin-top: 14px; font-size: 18px; font-weight: 500; line-height: 1.5; letter-spacing: 0.06em; }
.contact-way__main { margin-top: 20px; line-height: 1.6; }
.contact-way__main a { font-family: var(--font-en); font-weight: 300; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: 0.04em; text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-way__main a:hover { border-bottom-color: currentColor; }
.contact-way__suffix { margin-left: 8px; font-size: 14px; }
.contact-way__note { margin-top: 12px; font-size: 14px; line-height: 1.9; color: var(--ink-soft); }

/* ─── タブレット ───────────────────────────── */
@media (max-width: 1000px) {
  :root { --panel-pad: 40px; }
  .page-hero__panel { padding: 48px var(--panel-pad); gap: 40px; }
  .block__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .block__grid > .block__head { position: static; }
  .cards--3, .points--3, .work-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow__step:nth-child(4n)::after { display: block; }
  .flow__step:nth-child(2n)::after { display: none; }
}

/* ─── スマートフォン ───────────────────────── */
@media (max-width: 760px) {
  .page-hero { padding: 16px 0 40px; }
  :root { --panel-pad: 24px; }
  .page-hero__panel { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 36px var(--panel-pad) 28px; border-radius: 32px; }
  .page-hero__photo { min-height: 0; aspect-ratio: 4 / 3; }
  .page-hero__visual--shapes { min-height: 96px; }
  .page-hero__visual--shapes .s1 { width: 120px; height: 60px; right: 64px; }
  .page-hero__visual--shapes .s2 { width: 52px; height: 52px; }
  .page-hero__visual--shapes .s3 { width: 44px; height: 40px; right: 96px; bottom: 68px; }
  .page-hero__catch { margin-top: 28px; }

  .toc__list a { font-size: 12px; padding: 8px 12px 8px 14px; }

  .block { padding: 56px 0; scroll-margin-top: 64px; }
  .block--tint { border-radius: 32px; padding: 56px 0; }
  .contact { margin-top: 40px; }
  .block__head { margin-bottom: 28px; }
  .block__head--row { grid-template-columns: minmax(0, 1fr); }

  .split, .split--flip { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .split--flip .split__photo { order: 0; }
  .cards--2, .cards--3, .points--2, .points--3, .work-cards { grid-template-columns: minmax(0, 1fr); }
  .card-item__body, .point { padding: 24px 22px 28px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* スマホは2列。大きい写真は横いっぱいにし、それ以外は1枚ずつ並べる */
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo-grid .is-big { grid-row: auto; aspect-ratio: 3 / 2; }
  .photo-grid .is-wide { grid-column: auto; aspect-ratio: 3 / 2; }
  .photo-grid figure:first-child { grid-column: 1 / -1; }
  /* 枚数が偶数のときは1枚目を全幅にしない（最後の行の右に空きが出るため） */
  .photo-grid:has(> figure:nth-child(even):last-child) figure:first-child { grid-column: auto; }
  .article th { width: 6.5em; padding-left: 0; }
  .news-list a { grid-template-columns: minmax(0, 1fr) 20px; gap: 4px 16px; padding: 18px 0; }
  .news-list__date, .news-list__title { grid-column: 1; }
  .news-list svg { grid-column: 2; grid-row: 1 / span 2; }
  .news-article { padding-top: 16px; }
  .news-article__back { margin-top: 40px; }
  .contact-page__lead { text-align: left; }
  .media-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .contact-page__br { display: none; }
  .contact-ways { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 32px; }
  .contact-way { padding: 28px 24px 32px; }
  .contact-way__suffix { display: block; margin: 6px 0 0; }

  /* 流れは縦に並べ、矢印を下向きにする */
  .flow { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flow__step { min-height: 0; grid-template-columns: 3em 1fr; align-items: center; }
  .flow__step::after, .flow__step:nth-child(n)::after { display: block; right: auto; left: 50%; top: auto; bottom: -18px; margin: 0 0 0 -8px; transform: rotate(90deg); }
  .flow__step:last-child::after { display: none; }
}
