/* =========================================================
   子どもピアノ教室 ページ上部（ot-kids-head）
   ・見出し（h2）の後ろで、線画のアニメーションが動くパーツです
   ・絵は kids-head.js が描きます（HTML には文字だけ）
   ・見た目の数字は、下の「調整用の変数」で変えられます
   ・背景の画像（ロゴを型押しした紙）は ot-kids-head--paper を付けた時だけ敷きます
   ========================================================= */

/* ---------- 調整用の変数 ---------- */
.ot-kids-head {
  --ot-kids-bg: #ffffff;          /* 背景の色（画像が無い時） */
  --ot-kids-text: #292d33;        /* 文字の色 */
  --ot-kids-label-color: #292d33; /* 「子どもピアノ教室」の色（キャッチと同じ） */
  --ot-kids-line: #292d33;        /* 絵の線の色 */
  --ot-kids-note: #292d33;        /* 音符の色（トップページの♪と同じ） */
  --ot-kids-content: 1080px;      /* 文字が並ぶ幅（Flatsome のサイト幅にそろえる） */

  /* PC（全体の高さ 約400px） */
  --ot-kids-pad-top: 0px;        /* 上の余白 */
  --ot-kids-scene-h: 360px;       /* 絵の高さ */
  --ot-kids-overlap: 120px;       /* 文字と絵が重なる量（絵の上の方は空いているので重ねる） */
  --ot-kids-label-size: clamp(32px, 3.9cqw, 42px); /* 「子どもピアノ教室」（幅1080px以上で42px） */
  --ot-kids-catch-size: clamp(22px, 2.4cqw, 26px); /* 「東戸塚で〜」（幅1080px以上で26px） */

  /* スマホ・767px以下（全体の高さ 約350px） */
  --ot-kids-pad-top-sp: 40px;
  --ot-kids-scene-h-sp: 250px;
  --ot-kids-overlap-sp: 57px;
  --ot-kids-label-size-sp: 30px;
  --ot-kids-catch-size-sp: 18px;  /* 本文（15px）より小さくしない。19px以上だと3行になる */

  container-type: inline-size;    /* 置かれた場所の幅で、PC／スマホを切り替える */
  position: relative;
  overflow: hidden;               /* 絵がはみ出して横スクロールにならないように */
  background: var(--ot-kids-bg);
  color: var(--ot-kids-text);
}

/* ---------- 文字の入る箱 ---------- */
.ot-kids-head__inner {
  position: relative;
  z-index: 1;                     /* 絵より手前に文字を出す */
  box-sizing: border-box;
  max-width: var(--ot-kids-content);
  margin: 0 auto;
  padding: var(--ot-kids-pad-top) 30px calc(var(--ot-kids-scene-h) - var(--ot-kids-overlap));
}

/* ---------- 見出し（h2）※文字は最初から表示。動かしません ---------- */
.ot-kids-head__title {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;           /* Flatsome の見出しの設定に左右されないように */
  color: var(--ot-kids-text);
}

/* 主役の文字「子どもピアノ教室」（トップページの h2 と同じゴシック・太さ500） */
.ot-kids-head__label {
  font-size: var(--ot-kids-label-size);
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--ot-kids-label-color);
}

/* その下の文字「東戸塚で〜宝物に。」（明朝） */
.ot-kids-head__catch {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: var(--ot-kids-catch-size);
  line-height: 1.8;
  letter-spacing: 0.06em;
}
/* 1行ずつ、言葉の途中で折り返さないように（span 1つが1行のまとまり） */
.ot-kids-head__catch > span { display: inline-block; }

/* ---------- 絵（地面・ピアノ・人・音符） ---------- */
.ot-kids-head__scene {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--ot-kids-scene-h);
  color: var(--ot-kids-line);
  pointer-events: none;
}
.ot-kids-head__svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 頭や服の中をぬって、後ろの線を隠す */
.ot-kids-head__svg .is-fill { fill: var(--ot-kids-fill, var(--ot-kids-bg)); }
/* 音符（トップページと同じ形の♪。ぬりつぶし） */
.ot-kids-head__svg .is-note { fill: var(--ot-kids-note); stroke: none; }

/* ---------- 背景の画像（ot-kids-head--paper） ----------
   ロゴを型押しした紙の画像を、ぼかして敷く
   ・画像のURLは otoiro-kids-head.php の OTOIRO_KIDS_HEAD_BG_URL で入れます
     （--ot-kids-paper-image。画像が無い時は紙の色の単色になります）
   ・--ot-kids-paper-blur：ぼかし　--ot-kids-paper-tone：色味
   ・--ot-kids-veil：上に重ねる白い膜（上の文字のところから、下の絵のところへだんだん濃く）
   ・この基本の形が「ぼかし強め」。子ども教室は ot-kids-head--soft を足して「ぼかし弱め＋白い膜」 */
.ot-kids-head--paper {
  --ot-kids-paper-image: none;
  --ot-kids-paper-color: #d5c3c3;               /* 紙の色（画像の色に近い） */
  --ot-kids-paper-blur: 14px;
  --ot-kids-paper-tone: saturate(1) brightness(1);
  --ot-kids-veil: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.55) 100%);
  --ot-kids-fill: rgba(255, 255, 255, 0.9);     /* 人の頭や服の中 */
  background: var(--ot-kids-paper-color);
  isolation: isolate;                           /* 画像と膜を、このパーツの中だけで重ねる */
}
/* 画像（ぼかせるように、別の層にする） */
.ot-kids-head--paper::before {
  content: "";
  position: absolute;
  inset: -40px;                                 /* ぼかした時に、ふちが白くならないように大きく */
  z-index: -2;
  background: var(--ot-kids-paper-image) center / cover no-repeat;
  filter: blur(var(--ot-kids-paper-blur)) var(--ot-kids-paper-tone);
}
/* 白い膜（画像の上、文字と絵の下） */
.ot-kids-head--paper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ot-kids-veil);
  pointer-events: none;
}
/* 子ども教室：ぼかし弱め＋白い膜 */
.ot-kids-head--soft {
  --ot-kids-paper-blur: 4px;
  --ot-kids-veil: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.75) 100%);
}
/* 色味を落ち着かせる（大人の教室で使う予定） */
.ot-kids-head--calm { --ot-kids-paper-tone: saturate(0.45) brightness(1.04); }

/* =========================================================
   バナー用の部品（Flatsome の「バナー」の中に、自分で置いて使う）
   ・背景は付けません（背景はバナーの画像・色を使います）
   ・文字：ot-kids-title（h2）　アニメーション：ot-kids-anim
   ・色は2種類：
       何も足さない → 黒（明るい背景用）
       --white を足す → 白（暗い背景用）
   ========================================================= */
.ot-kids-title,
.ot-kids-anim {
  /* 黒（明るい背景用） */
  --ot-kids-text: #292d33;              /* 文字の色 */
  --ot-kids-line: #292d33;              /* 絵の線の色 */
  --ot-kids-note: #292d33;              /* 音符の色 */
  --ot-kids-fill: rgba(255, 255, 255, 0.85); /* 人の頭や服の中 */
}
.ot-kids-title--white,
.ot-kids-anim--white {
  /* 白（暗い背景用） */
  --ot-kids-text: #ffffff;
  --ot-kids-line: #ffffff;
  --ot-kids-note: #ffffff;
  --ot-kids-fill: rgba(30, 22, 24, 0.45);
}

/* ---------- 文字（h2） ----------
   :not(#ot-x) … style.css の「.page-wrapper h2:not(…)」（太さ700・36px）に負けないための書き方
   （#ot-x という名前の部品は無いので、どの h2 にも当てはまり、指定だけが強くなります） */
.ot-kids-title:not(#ot-x) {
  --ot-kids-title-label-size: clamp(32px, 3.9vw, 42px);  /* 「子どもピアノ教室」 */
  --ot-kids-title-catch-size: clamp(22px, 2.4vw, 26px);  /* 「東戸塚で〜」 */
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  font-size: var(--ot-kids-title-label-size);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ot-kids-text);
}
/* 白の時は、読みやすいように薄い影（メイン画像の説明文と同じ） */
.ot-kids-title--white:not(#ot-x) { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
.ot-kids-title__label {
  font-size: var(--ot-kids-title-label-size);
  line-height: 1.4;
  letter-spacing: 0.08em;
}
.ot-kids-title__catch {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: var(--ot-kids-title-catch-size);
  line-height: 1.8;
  letter-spacing: 0.06em;
}
.ot-kids-title__catch > span { display: inline-block; }   /* span 1つが1行のまとまり */

/* ---------- アニメーション（線画） ---------- */
.ot-kids-anim {
  /* 絵の高さ。絵にぴったり（上下の余白なし）。人やピアノの大きさは ot-kids-head と同じ
     ※変えると絵全体の大きさが変わります（高さに合わせて拡大・縮小） */
  --ot-kids-anim-h: 194px;              /* 絵の高さ（PC） */
  --ot-kids-anim-h-sp: 135px;           /* 絵の高さ（スマホ） */
  position: relative;
  width: 100%;                          /* 置いた場所の幅いっぱいに描く */
  height: var(--ot-kids-anim-h);
  color: var(--ot-kids-line);
  pointer-events: none;
}

/* ---------- バナー用：スマホ（767px以下） ---------- */
@media screen and (max-width: 767px) {
  .ot-kids-title:not(#ot-x) { gap: 10px; }
  .ot-kids-title__label { font-size: 30px; }
  .ot-kids-title__catch { font-size: 18px; letter-spacing: 0.04em; }
  .ot-kids-anim { height: var(--ot-kids-anim-h-sp); }
}

/* ---------- スマホ（置かれた場所の幅が767px以下） ---------- */
@container (max-width: 767px) {
  .ot-kids-head__inner {
    padding: var(--ot-kids-pad-top-sp) 16px calc(var(--ot-kids-scene-h-sp) - var(--ot-kids-overlap-sp));
  }
  .ot-kids-head__title { gap: 10px; }
  .ot-kids-head__label { font-size: var(--ot-kids-label-size-sp); }
  .ot-kids-head__catch {
    font-size: var(--ot-kids-catch-size-sp);
    letter-spacing: 0.04em;
  }
  .ot-kids-head__scene { height: var(--ot-kids-scene-h-sp); }
}
