/* ==========================================================
   KGF 公式サイト
   方針: 罫線と余白で区切る / 左寄せ・非対称 / 装飾は最小限
   色: 生成りの紙色 × 焦げ茶の文字 × 煉瓦色のアクセント（温かく柔らかく）
   ========================================================== */

:root {
  --bg: #f8f3ea;            /* 生成り */
  --bg-soft: #f0e6d6;       /* 砂色。お問い合わせとフッターだけに使う */
  --text: #3a312a;          /* 焦げ茶。真っ黒にしない */
  --heading: #2e2620;
  --muted: #6c6055;
  --accent: #984a2b;        /* 煉瓦色。リンク・見出しの細線・ボタンのみ */
  --accent-dark: #7f3d23;
  --rule: #e3d8c6;
  --placeholder: #ebe0cd;
  --selection: #ecd7c3;

  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 38em;           /* 本文 1行あたり約38字 */
  --section-space: clamp(72px, 10vw, 136px);
  --radius: 6px;             /* 写真の角だけ、ほんの少し丸める */
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.045em;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  body { font-size: 17px; }
}

::selection { background: var(--selection); color: var(--heading); }

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { color: var(--heading); }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
a:hover { color: var(--accent-dark); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nowrap { white-space: nowrap; }

/* ---------- ヘッダー ---------- */

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 20px 0;
}
@media (min-width: 768px) {
  .site-header__inner { padding-block: 20px 18px; }
}

.logo {
  display: inline-flex;
  flex-direction: column;
  color: var(--heading);
  text-decoration: none;
  line-height: 1.4;
}
.logo:hover { color: var(--heading); }
.logo__kind {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.logo__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.08em;
}

/* スマホ：画面幅いっぱいの帯に4つを等分で並べ、区切り線でメニューだとわかるようにする */
.site-nav {
  width: calc(100% + var(--gutter) * 2);
  margin-inline: calc(var(--gutter) * -1);
  margin-top: 10px;
  border-block: 1px solid var(--rule);
  background: #fffaf1;
}
.site-nav ul {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.3fr;   /* 「お問い合わせ」だけ文字数が多いので少し広く */
}
.site-nav li + li { border-left: 1px solid var(--rule); }
@media (min-width: 768px) {
  .site-nav {
    width: auto;
    margin: 0;
    border: 0;
    background: none;
  }
  .site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 28px; }
  .site-nav li + li { border-left: 0; }
}
.site-nav a {
  display: block;
  padding: 13px 2px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }
@media (min-width: 768px) {
  .site-nav a {
    display: inline-block;
    padding: 4px 0;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--text);
    border-bottom: 1px solid transparent;
  }
  .site-nav a:hover { border-bottom-color: currentColor; }
}

/* ---------- メインビジュアル ---------- */
/* 斜めに傾けた写真枠を四隅に散らし、中央に法人名とキャッチコピー。
   枠の形は「一歩踏み出す／前へ進む」から。差し色は配色の4色だけを使う */

/* スマホ：枠と文字を上から順に並べ、中身の高さで決まるようにする（余白が間延びしない） */
.hero__stage {
  position: relative;
  max-width: 1600px;
  margin-inline: auto;
  overflow: hidden;
  display: grid;
  grid-template-columns: 4% 54% 1fr 29% 5%;
  padding-top: 8px;
  --ridge-h: 30px;               /* 山並みの帯の高さ。線同士は重なってよい */
  --ridge-gap: 10px;             /* 写真（差し色を含む）と帯のすき間 */
  padding-bottom: calc(var(--ridge-h) + var(--shift) + var(--ridge-gap));
}

.frame {
  position: relative;
  margin: 0;
  transform: skewX(-10deg);
  animation: frame-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
/* 枠の右下に、同じ形の差し色を少しずらして重ねる */
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 10px;
  background: var(--frame-color);
  transform: translate(var(--shift), var(--shift));
}
.frame__img {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: var(--placeholder);
}
/* 写真は逆向きに傾けて、まっすぐ見せる */
.frame__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: skewX(10deg) scale(1.22);
}

.hero__stage, .frame { --shift: 10px; }
.frame--a { --frame-color: var(--accent); grid-area: 1 / 2; aspect-ratio: 3 / 2; }
.frame--b { --frame-color: #5b7a8c;       grid-area: 1 / 4; align-self: end; aspect-ratio: 4 / 3; animation-delay: 0.12s; }
.frame--c { --frame-color: #c9a24a;       display: none; }
.frame--d { --frame-color: #7c8c5a;       grid-area: 3 / 1 / 4 / -1; justify-self: end; width: 54%; margin-right: 8%; aspect-ratio: 16 / 10; animation-delay: 0.24s; }
.frame--a .frame__img img { object-position: 50% 70%; }

@keyframes frame-in {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .frame { animation: none; }
}

/* 下の帯：山並みの線。左から右へ描かれていく。幅の広い画面でも端から端まで */
.hero { overflow-x: clip; }
.hero__ridge {
  position: absolute;
  left: calc(50% - 50vw);
  bottom: 0;
  display: block;
  width: 100vw;
  height: var(--ridge-h);
}
/* 線の太さは画面幅で伸び縮みさせない。描かれていく動きは、帯ごと左から右へ見せていく
   （線ごとの破線アニメーションは、横に引き伸ばすと途中で途切れるため使わない） */
.hero__ridge {
  clip-path: inset(0 100% 0 0);
  animation: ridge-reveal 2.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}
.ridge-ground { fill: var(--bg-soft); }
.ridge {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.ridge--1 { stroke: #5b7a8c; }
.ridge--2 { stroke: #7c8c5a; }
.ridge--3 { stroke: #c9a24a; }
.ridge--4 { stroke: var(--accent); }
@keyframes ridge-reveal { to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  .hero__ridge { animation: none; clip-path: none; }
}

/* 画像未配置のあいだは背景色だけを見せる */
img.is-missing { visibility: hidden; }

.hero__text {
  grid-area: 2 / 1 / 3 / -1;
  position: relative;
  z-index: 1;
  padding-block: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-inline: var(--gutter);
  text-align: center;
  pointer-events: none;
}

.hero__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: min(6vw, 30px);
  line-height: 1.5;
  letter-spacing: 0.08em;
}
.hero__kind {
  display: block;
  margin-bottom: 4px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.42em;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.hero__catch {
  font-family: var(--serif);
  font-weight: 500;
  font-size: min(4vw, 16px);
  line-height: 2;
  letter-spacing: 0.1em;
}

.hero__lead {
  padding-block: clamp(24px, 5vw, 64px) var(--section-space);
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

@media (min-width: 768px) {
  .site-nav a { font-size: 14px; }

  /* ヘッダーと合わせて一画面に収まる高さ */
  .hero__stage {
    display: block;
    height: clamp(660px, min(82vw, 100svh - 84px), 860px);
    padding: 0;
    container-type: size;
    overflow: visible;        /* 枠の大きさを、ステージの高さからも制限する */
    --ridge-h: clamp(40px, 4.5vw, 64px);
    --ridge-gap: 14px;
    --shift: 14px;
  }
  /* PC・タブレット：枠を四隅に散らし、文字は中央に重ねる */
  .frame { position: absolute; --shift: 14px; }
  /* 下の枠は、差し色まで含めて帯の上に収める */
  .frame--c, .frame--d { --above-ridge: calc(var(--ridge-h) + var(--shift) + var(--ridge-gap)); }
  /* 横長で高さの低い画面でも、写真が中央の文字にかからないよう高さの上限を付ける
     上の枠：文字の上端（中央 − 約120px）より上に収める
     下の枠：文字の下端（中央 + 約120px）より下、帯より上に収める */
  .frame--a { left: 5%;  top: 5cqh;   width: min(28%, (45cqh - 140px) * 1.5); }
  .frame--b { right: 7%; top: 4cqh;   width: min(19%, (46cqh - 140px) * 4 / 3); }
  .frame--c { display: block; left: 15%; bottom: var(--above-ridge); width: min(13%, 50cqh - 134px - var(--above-ridge)); aspect-ratio: 1 / 1; animation-delay: 0.36s; }
  .frame--d { right: 5%; bottom: var(--above-ridge); width: min(26%, (50cqh - 134px - var(--above-ridge)) * 1.6); margin-right: 0; }
  .hero__text { position: absolute; inset: 0; padding-block: 0; }

  .hero__name { font-size: clamp(30px, 3.4vw, 48px); }
  .hero__catch { font-size: clamp(16px, 1.45vw, 20px); }
  .hero__lead { font-size: 16px; }
}

/* ---------- セクション共通 ---------- */

.section__grid {
  display: grid;
  gap: 32px;
  padding-block: var(--section-space);
  border-top: 1px solid var(--rule);
}

.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.6;
  letter-spacing: 0.08em;
}
/* 見出しの上に、短い細線を一本だけ */
.section__title::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-bottom: 18px;
  background: var(--accent);
}

.prose p { max-width: var(--measure); }
.prose p + p { margin-top: 1.5em; }

/* 「KGFとは」の最初の段落は、読み出しとして少し大きく明朝で */
#about .prose p:first-child {
  font-family: var(--serif);
  font-size: 1.12em;
  max-width: 34em;           /* 他の段落と同じ幅にそろえる（38em ÷ 1.12） */
  line-height: 2;
  color: var(--heading);
}

@media (min-width: 960px) {
  .section__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: 56px;
  }
  .section__title,
  .section__side { grid-column: 1; }
  .section__body { grid-column: 2; }
}

/* ---------- 写真枠 ---------- */

.photo {
  background: var(--placeholder);
  overflow: hidden;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo--wide {
  aspect-ratio: 16 / 9;
  margin-top: 28px;
  margin-inline: calc(var(--gutter) * -1);   /* スマホでは端まで */
}

@media (min-width: 960px) {
  /* 本文列から始まり、右の余白まで広げる。角は少し丸める */
  .photo--wide {
    grid-column: 2;
    margin-top: 48px;
    margin-left: 0;
    margin-right: calc(var(--gutter) * -1);
    aspect-ratio: 16 / 8;
    border-radius: var(--radius);
  }
}

/* ---------- 取り組み ---------- */
/* 箱で囲まず、罫線と大きな番号で区切る（雑誌の目次のような組み方）。
   番号の色だけ、メインビジュアルと同じ4色を順に使う */

.plan-list {
  counter-reset: plan;
  border-bottom: 1px solid var(--rule);
}
.plan-list li {
  --num-color: var(--accent);
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr);
  column-gap: 14px;
  padding-block: 26px 28px;
  border-top: 1px solid var(--rule);
  counter-increment: plan;
}
.plan-list li:nth-child(4n + 2) { --num-color: #5b7a8c; }
.plan-list li:nth-child(4n + 3) { --num-color: #b08a35; }
.plan-list li:nth-child(4n + 4) { --num-color: #6f7f4e; }

.plan-list li::before {
  content: counter(plan, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--num-color);
  padding-top: 2px;
}
.plan-list h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.plan-list p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
}

@media (min-width: 768px) {
  .plan-list h3 { font-size: 18px; }
}

/* PC：見出しを上に置き、3列×2段。列の間は縦の細線で区切る */
@media (min-width: 960px) {
  #plans .section__grid { grid-template-columns: minmax(0, 1fr); row-gap: 56px; }
  #plans .section__side,
  #plans .section__body { grid-column: 1; }

  .plan-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 0;
    border-top: 1px solid var(--rule);
  }
  .plan-list li {
    display: block;
    padding: 36px 36px 44px;
    border-top: 0;
    border-left: 1px solid var(--rule);
  }
  .plan-list li:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
  .plan-list li:nth-child(n + 4) { border-top: 1px solid var(--rule); }
  .plan-list li::before {
    display: block;
    margin-bottom: 22px;
    font-size: 44px;
    padding-top: 0;
  }
  .plan-list h3 { margin-bottom: 10px; }
}

/* ---------- KGFの強み ---------- */
/* 4項目を罫線で区切る。PCでは2列×2段 */

.strength-list { border-bottom: 1px solid var(--rule); }
.strength-list li {
  padding-block: 24px 26px;
  border-top: 1px solid var(--rule);
}
.strength-list h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--heading);
  margin-bottom: 8px;
}
.strength-list h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 12px;
  vertical-align: 0.2em;
  border-radius: 50%;
  background: var(--accent);
}
.strength-list p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
}
.strength-note {
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

@media (min-width: 768px) {
  .strength-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
  }
  .strength-list h3 { font-size: 18px; }
}

/* ---------- 団体概要 ---------- */

.profile__row {
  display: grid;
  gap: 4px;
  padding-block: 20px 22px;
  border-top: 1px solid var(--rule);
}
.profile__row:last-child { border-bottom: 1px solid var(--rule); }

.profile dt {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.profile .person {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.06em;
  letter-spacing: 0.14em;
  color: var(--heading);
  margin-bottom: 6px;
}
.profile .role {
  display: block;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted);
}

@media (min-width: 768px) {
  .profile__row {
    grid-template-columns: 9em minmax(0, 1fr);
    column-gap: 32px;
  }
  .profile dt { padding-top: 0.3em; }
}

/* ---------- お問い合わせ（ここから下だけ砂色の面にして、締めくくる） ---------- */

#contact {
  background: var(--bg-soft);
}
#contact .section__grid {
  border-top: 0;
}

.button {
  display: inline-block;
  padding: 15px 38px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}
.button:hover {
  background: var(--accent-dark);
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}

/* フォーム：ラベルは上、入力欄は少し明るい面に細い枠線 */
.contact-form {
  display: grid;
  gap: 22px;
  max-width: var(--measure);
  margin-top: 36px !important;
}
.field { display: grid; gap: 8px; }
.field label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--heading);
}
.field__req,
.field__opt {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
}
.field__req { color: var(--accent); }
.field__opt { color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;               /* iPhone で入力時に拡大されない大きさ */
  line-height: 1.7;
  color: var(--text);
  background: #fffaf1;
  border: 1px solid #d6c8b2;
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 10em; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(152, 74, 43, 0.15);
}
.field.is-invalid input,
.field.is-invalid textarea { border-color: #b3261e; }
.field__error {
  font-size: 13px;
  color: #b3261e;
}

/* ボット用の欄は画面に出さない（HTML側にも hidden を付けている） */
.field--trap {
  display: none !important;
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__note {
  font-size: 13px;
  color: var(--muted);
}
.contact-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}
.contact-form .button {
  border: 0;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.contact-form .button:disabled { opacity: 0.6; cursor: default; }
.contact-form__status {
  font-size: 14px;
  color: var(--muted);
}
.contact-form__status.is-success { color: #4d5f34; font-weight: 500; }
.contact-form__status.is-error { color: #b3261e; }

/* ---------- フッター ---------- */

.site-footer {
  background: var(--bg-soft);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 28px 44px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.site-footer__name {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--heading);
  letter-spacing: 0.08em;
}
.site-footer small { font-size: inherit; }
