/* =========================================================
   下層ページの上部（ot-page-head）
   子どもピアノ教室・大人のピアノ教室・講師紹介など、同じ形で使い回します
   ---------------------------------------------------------
   ・並び：英字ラベル → 見出し（h1・♪付き）→ キャッチ（h2・明朝）→ 短い線 → 写真の帯 → 文章
   ・PC：最初は写真を「引きで小さく」見せ、約0.5秒後に、アップしながら横に広がる
         広がったら、写真の左（木の壁）の上にキャッチが白で出る（JS がキャッチを写真の帯の中へ移す）
         文章は写真の下に黒で出る
   ・スマホ：写真は最初から大きく（横長で低め）。キャッチは見出しの下、文章は写真の下
   ・文字と写真はページに貼る HTML に書きます（UX Builder の「HTML」要素で書き換え）
   ・♪と写真の上の暗い膜は page-head.js が足します（HTML には書きません）
   ・写真の見せ方（どこを大きく見せるか）は HTML の data-○○ で写真ごとに変えられます
     スマホで写真のどこを見せるかは、写真の帯に style="--ot-page-head-sp-img-w: …" のように書いて写真ごとに変えられます
   ・人が写真の左寄りにいる写真は ot-page-head--catch-right（キャッチを右に出す。このファイルのいちばん下）
   ・写真の左はしで切れる物の境目をぼかすときは ot-page-head--fade-left（同じく、いちばん下）
   ・2026-11-22：キャッチを写真の上に出す形を標準にし、前の形（文章を写真の上に出す形）は消しました
     （前の形の控え：page-head/控え/2026-11-22_標準化前/）
   ========================================================= */

/* ---------- 調整用の変数 ---------- */
.ot-page-head {
  --ot-page-head-bg: #ffffff;          /* 背景 */
  --ot-page-head-text: #292d33;        /* 文字の色 */
  --ot-page-head-sub: #6b6560;         /* 英字ラベルの色 */
  --ot-page-head-width: 1020px;        /* 文字と写真の幅（PC） */
  --ot-page-head-pad-top: 8px;         /* 上の余白（PC） */
  --ot-page-head-pad-top-sp: 24px;     /* 上の余白（スマホ） */

  --ot-page-head-name-size: 26px;      /* 見出し「子どもピアノ教室」（PC） */
  --ot-page-head-name-size-sp: 22px;   /* 見出し（スマホ） */
  /* キャッチ・明朝（PC：写真の上）。帯が狭い時は小さくなる（18px〜24px） */
  --ot-page-head-catch-photo-size: clamp(18px, 2.35cqw, 24px);
  --ot-page-head-catch-size: 20px;     /* キャッチ（PC で JS が動かず、見出しの下にある時） */
  --ot-page-head-catch-size-sp: 17px;  /* キャッチ（スマホ） */
  --ot-page-head-lead-size: 17px;      /* 文章「境木本町の〜」（PC） */
  --ot-page-head-lead-size-sp: 16px;   /* 文章（スマホ）※15pxより小さくしない */

  --ot-page-head-band-ratio: 803 / 155; /* 写真の帯の形（横 / 縦）PC */
  --ot-page-head-band-ratio-sp: 2.6 / 1; /* 写真の帯の形（スマホ） */
  /* スマホで写真のどこを見せるか（写真の幅・左・上。人の所を大きめに、女の子の頭が切れないように） */
  --ot-page-head-sp-img-w: 140%;
  --ot-page-head-sp-img-left: -40%;
  --ot-page-head-sp-img-top: -10%;
  /* 写真の左を暗くする膜（白いキャッチを読みやすくする。左ほど濃く、先生の頭の右側まで薄くかけて、帯の左から80%で消える） */
  --ot-page-head-shade: linear-gradient(90deg, rgba(40, 22, 15, 0.55) 0%, rgba(40, 22, 15, 0.42) 40%, rgba(40, 22, 15, 0.3) 56%, rgba(40, 22, 15, 0.16) 68%, rgba(40, 22, 15, 0.07) 75%, rgba(40, 22, 15, 0) 80%);

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

/* WordPress が自動で入れる <br> や空の段落で、崩れないようにする（文章の中の <br> は残す） */
.ot-page-head > br,
.ot-page-head__inner > br,
.ot-page-head p:empty {
  display: none;
}

/* ---------- 文字の箱 ---------- */
.ot-page-head__inner {
  box-sizing: border-box;
  max-width: calc(var(--ot-page-head-width) + 60px);
  margin: 0 auto;
  padding: var(--ot-page-head-pad-top) 30px 72px;
}

/* 英字ラベル（● Kids Piano Lesson） */
.ot-page-head__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--ot-page-head-sub);
}
.ot-page-head__label::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* 見出し（h1。このページのいちばん大きな見出し）
   :not(#ot-x) … Flatsome の見出しの指定に負けないための書き方（#ot-x という部品は無い）
   ・文字の大きさは中の「子どもピアノ教室」（__name）で決めているので、ここでは見た目を変えない
   ・font-size / line-height … 行の高さの基準（Flatsome の h2 の 1.6em・1.3 と同じ値。
     スマホの 549px 以下は 1.2em。Flatsome と同じ切り替え） */
.ot-page-head__title:not(#ot-x) {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: 1.6em;
  line-height: 1.3;
  font-weight: 500;
  text-transform: none;
  color: var(--ot-page-head-text);
}
@media (max-width: 549px) {
  .ot-page-head__title:not(#ot-x) { font-size: 1.2em; }
}
.ot-page-head__name {
  position: relative;
  display: inline-block;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  font-size: var(--ot-page-head-name-size);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
}

/* キャッチ（h2）
   :not(#ot-x) … Flatsome の h2 の指定（大きさ・太さ・色・余白）に負けないための書き方 */
.ot-page-head__catch:not(#ot-x) {
  display: block;
  width: auto;
  max-width: none;
  margin: 14px 0 0;
  padding: 0;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  font-size: var(--ot-page-head-catch-size);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ot-page-head-text);
}
/* span 1つが1行（ot-page-head__catch-line）
   ・ot-page-head__catch-line--pc を付けた行は、PC だけ1行にし、スマホでは前の行とつなげる
   ※ span にはクラス名を付ける。クラス名の無い span は、WordPress の保存で消える */
.ot-page-head__catch > span { display: block; }

/* 短い線（1px）
   :not(#ot-x) … Flatsome の hr の指定（薄い色・余白）に負けないための書き方 */
.ot-page-head__rule:not(#ot-x) {
  display: block;
  width: 40px;
  max-width: 40px;
  height: 1px;
  margin: 24px 0 32px;
  padding: 0;
  border: 0;
  opacity: 1;
  background: var(--ot-page-head-text);
}

/* ♪（トップページと同じ形。JS が見出しの横に足して、はねさせてから止める） */
.ot-page-head__note {
  position: absolute;
  left: 100%;
  bottom: 0.55em;
  width: 0.62em;
  height: 0.92em;
  margin-left: 0.35em;
  color: var(--ot-page-head-text);
}
.ot-page-head__note svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.ot-page-head.is-play .ot-page-head__note { animation: ot-page-head-hop 2.2s cubic-bezier(0.3, 0.7, 0.4, 1) both; }
@keyframes ot-page-head-hop {
  0%   { transform: translate(-240px, 0); opacity: 0; }
  10%  { opacity: 1; }
  25%  { transform: translate(-170px, -36px); }
  40%  { transform: translate(-110px, 0); }
  58%  { transform: translate(-55px, -24px); }
  74%  { transform: translate(0, 0); }
  84%  { transform: translate(0, -7px); }
  100% { transform: translate(0, 0); opacity: 1; }
}

/* ---------- 写真の帯 ----------
   広がった時の形で作っておき、最初の小さい形は JS が「縮める＋切り抜く」で作ります */
.ot-page-head__band {
  position: relative;
  margin: 0;
  aspect-ratio: var(--ot-page-head-band-ratio);
  overflow: hidden;
}
.ot-page-head__img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0;
  transform-origin: 0 0;
}
/* JS が動き始めるまでは、写真を隠しておく（小さい形になる前の大きい写真が一瞬見えないように） */
.ot-page-head.is-ready .ot-page-head__band { visibility: visible; }
.ot-page-head.is-js:not(.is-ready) .ot-page-head__band { visibility: hidden; }

/* 写真の左を暗くする膜（JS が足す。広がるにつれて出てくる） */
.ot-page-head__shade {
  position: absolute;
  inset: 0;
  background: var(--ot-page-head-shade);
  opacity: 0;
  pointer-events: none;
}

/* PC：写真の帯の中のキャッチ（JS が移す。左の木の壁の上に白で出す） */
.ot-page-head__band .ot-page-head__catch:not(#ot-x) {
  position: absolute;
  left: 7.5%;
  top: 50%;
  margin: 0;
  font-size: var(--ot-page-head-catch-photo-size);
  line-height: 1.75;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(30, 16, 10, 0.5);
  transform: translate(0, -50%);
}
/* 写真が広がり終わるまで隠しておき、ふわっと出す */
.ot-page-head.is-js .ot-page-head__band .ot-page-head__catch:not(#ot-x) {
  opacity: 0;
  transform: translate(0, calc(-50% + 8px));
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.ot-page-head.is-js.is-text .ot-page-head__band .ot-page-head__catch:not(#ot-x) {
  opacity: 1;
  transform: translate(0, -50%);
}

/* ---------- 文章「境木本町の〜」（写真の下に黒） ---------- */
.ot-page-head__lead {
  margin: 32px 0 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  font-size: var(--ot-page-head-lead-size);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.05em;
  color: var(--ot-page-head-text);
}
/* 言葉のまとまり（ot-page-head__phrase）の途中で折り返さない
   ※ span にはクラス名を付ける。クラス名の無い span は、WordPress の保存で消える */
.ot-page-head__lead > span { display: inline-block; }
/* JS が動く時は、写真が広がり終わるまで隠しておき、ふわっと出す */
.ot-page-head.is-js .ot-page-head__lead {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.ot-page-head.is-js.is-text .ot-page-head__lead {
  opacity: 1;
  transform: none;
}

/* ---------- スマホ（置かれた場所の幅が767px以下） ---------- */
@container (max-width: 767px) {
  .ot-page-head__inner { padding: var(--ot-page-head-pad-top-sp) 16px 48px; }
  .ot-page-head__name { font-size: var(--ot-page-head-name-size-sp); }
  .ot-page-head__catch:not(#ot-x) {
    margin-top: 10px;
    font-size: var(--ot-page-head-catch-size-sp);
  }
  /* PC は3行、スマホは2行（--pc の行を前の行につなげる） */
  .ot-page-head__catch > .ot-page-head__catch-line--pc { display: inline; }
  .ot-page-head__label { margin-bottom: 14px; }
  .ot-page-head__rule:not(#ot-x) { margin: 20px 0 24px; }
  .ot-page-head__band { aspect-ratio: var(--ot-page-head-band-ratio-sp); clip-path: none !important; }
  .ot-page-head__img {
    width: var(--ot-page-head-sp-img-w);
    left: var(--ot-page-head-sp-img-left);
    top: var(--ot-page-head-sp-img-top);
    transform: none !important;     /* スマホは動かさない（JS の指定を消す） */
  }
  .ot-page-head__shade { display: none; }
  .ot-page-head__lead {
    margin-top: 20px;
    font-size: var(--ot-page-head-lead-size-sp);
    line-height: 2;
  }
}

/* ---------- キャッチを写真の右に出す形（ot-page-head--catch-right）2026-11-22 追加 ----------
   使い方：<section class="ot-page-head ot-page-head--catch-right">
   ・人が写真の左寄りにいて、右の壁が空いている写真用（大人のピアノ教室）
   ・PC：キャッチを写真の右に白で出し、暗くする膜も右から敷く。スマホは標準と同じ */
.ot-page-head--catch-right {
  /* 写真の右を暗くする膜（右ほど濃く、帯の右から54%で消える＝人の顔にはかけない） */
  --ot-page-head-shade: linear-gradient(270deg, rgba(40, 22, 15, 0.55) 0%, rgba(40, 22, 15, 0.42) 25%, rgba(40, 22, 15, 0.25) 38%, rgba(40, 22, 15, 0.1) 46%, rgba(40, 22, 15, 0) 54%);
}
.ot-page-head--catch-right {
  --ot-page-head-catch-right: calc(7.5% + 38px);  /* キャッチの右の空き（帯の右はしから。38px ≒ 1cm 左へ寄せた） */
}
.ot-page-head--catch-right .ot-page-head__band .ot-page-head__catch:not(#ot-x) {
  left: auto;
  right: var(--ot-page-head-catch-right);
}

/* ---------- 写真の左はしをぼかす（ot-page-head--fade-left）2026-11-22 追加 ----------
   使い方：<section class="ot-page-head ot-page-head--fade-left">
   ・写真の左はしで切れる物（ピアノ・いすなど）の境目を目立たなくする
   ・見えている写真の左はしに付いてくる（最初の小さい写真の時も）。位置は page-head.js が入れる */
.ot-page-head--fade-left {
  --ot-page-head-fade-left-w: 20%;     /* ぼかす幅（帯の幅に対して） */
  /* ぼかしの色：茶色の膜（写真の左はしを暗くして、木の壁・ピアノ・いすをなじませる） */
  --ot-page-head-fade-left: linear-gradient(90deg, rgba(40, 22, 15, 0.6) 0%, rgba(40, 22, 15, 0.3) 45%, rgba(40, 22, 15, 0) 100%);
}
.ot-page-head--fade-left .ot-page-head__band::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ot-page-head-clip-l, 0px);
  width: var(--ot-page-head-fade-left-w);
  background: var(--ot-page-head-fade-left);
  pointer-events: none;
}
@container (max-width: 767px) {
  .ot-page-head--fade-left .ot-page-head__band::after { left: 0; }
}

/* ---------- 「視差効果を減らす」設定の端末では、動かさずに最後の形で表示 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ot-page-head.is-play .ot-page-head__note { animation: none; }
  .ot-page-head .ot-page-head__lead,
  .ot-page-head .ot-page-head__catch:not(#ot-x) { transition: none !important; }
}
