/*
 * 各ページの題の部分（線画と縦書きの題字）の高さをそろえる（2026-10-27 宮の指示。題字・線画の大きさは変えない）。
 * PC（幅1140px 以上＝どのページの線画も最大の大きさで出る幅）で、上の帯の下から前書き・本文の始まりまで（題の部分）を 510px にそろえ、
 * 線画と題字の枠をその中の上下の中央に置く（2026-10-27 宮の指示「タイトルエリアで中央に来るように」。前は題字の中心を 235px にそろえていた）。
 * 線画の枠は top でずらし（並びの高さは変えない）、すぐ下の前書き・本文の上の余白で始まりの位置を合わせる。
 * 値は各ページの線画の枠の高さと題字の位置（2026-10-27 に測った値）から出したもの。線画や題字を差し替えたら測り直す。
 * タブレットの幅（768〜1139px）は前のまま。スマホは下の節。
 */
@media screen and (min-width: 1140px) {
  /* 授与所（各言語版も） */
  body .p-juyosho__hero:not(.p-contact__hero) { top: 98px; }
  body .p-juyosho__hero:not(.p-contact__hero) ~ .p-juyosho__lead { margin-top: 233px !important; }

  /* お問い合わせ（各言語版も）：線画は少し小さくしたまま（2026-10-27）、題字は Figma の大きさ（幅44px）に戻して枠の中央に置く */
  body .p-contact__hero { top: 36px; }
  body .p-contact__hero .p-contact__hero-title:not(.p-juyosho__hero-title--text) { top: 50%; width: 44px; transform: translateY(-50%); }
  body .p-juyosho__lead.p-contact__lead { margin-top: 130px !important; }

  /* 参拝のご案内 */
  body .p-sanpai__hero { top: 11px; }
  body .p-sanpai__hero ~ .p-sanpai__lead { margin-top: 59px !important; }

  /* 年間行事 */
  body .p-gyoji2__hero-frame { top: 21px; }
  body .p-gyoji2__hero ~ .p-gyoji2__event:first-of-type { margin-top: 80px !important; }

  /* 由緒・御祭神 */
  body .p-shrine--shakaku .p-shrine__hero-frame { top: 61px; }
  body .p-shrine--shakaku .p-shrine__hero ~ .p-shrine__lead { margin-top: 160px !important; }
  body .p-shrine--saijin .p-shrine__hero-frame { top: 61px; }
  body .p-shrine--saijin .p-shrine__hero ~ .p-shrine__accs { margin-top: 160px !important; }

  /* 祈願祭・解除の儀 */
  body .p-kigan__hero { top: 20px; }
  body .p-kigan__hero ~ .p-kigan__section:first-of-type { margin-top: 90px !important; }

  /* 四季の会 */
  body .p-shiki-guide__hero { top: 19px; }
  body .p-shiki-guide__hero ~ .p-shiki-guide__intro { margin-top: 56px !important; }

  /* 安倍晴明暦（2026-10-27 Figma に合わせて線画と題字を入れたときに足した） */
  body .p-abe-koyomi__hero { top: 25px; }
  body .p-abe-koyomi__hero ~ .p-abe-koyomi__section:first-of-type { margin-top: 127px !important; }

  /* 暦想雑記（2026-10-28 Figma に合わせて線画と題字を入れたときに足した） */
  body .p-zakki__hero { top: 40px; }
  body .p-zakki__hero ~ .p-zakki__lead { margin-top: 159px !important; }
}

/*
 * スマホ（幅767px 以下。2026-10-27 宮の指示「スマホでも題の部分の高さをそろえて」）。線画の枠は画面の幅に合わせて大きさが変わるので、
 * 幅375px と 430px で測った値から、幅に比例する式（vw）で出す。上の帯の下から前書き・本文の始まりまでを、幅375px で 280px（430px で 318px）にそろえ、
 * 線画と題字の枠をその中の上下の中央に置く。題字と線画の大きさは変えない
 */
@media screen and (max-width: 767px) {
  /* 題字（日本語の画像）の字の大きさを全ページでそろえる：幅28px（年間行事・由緒・御祭神と同じ。画面の幅によらない。2026-10-27 宮の指示「スマホの題字の文字の大きさがバラバラだから統一して」）。
     線画の枠に対する割合で置いていたページは、題字の中心を前と同じ位置（枠に対する割合）に保つ。各言語版の文字の題字（--text）は別 */
  body .p-juyosho__hero:not(.p-contact__hero) .p-juyosho__hero-title:not(.p-juyosho__hero-title--text) { left: 55.68%; top: 52.17%; width: 28px; transform: translate(-50%, -50%); }
  body .p-contact__hero .p-contact__hero-title:not(.p-juyosho__hero-title--text) { left: 44.24%; top: 49.98%; width: 28px; transform: translate(-50%, -50%); }
  body .p-sanpai__hero .p-sanpai__hero-title:not(.p-sanpai__hero-title--text) { left: 50%; top: 48.1%; width: 28px; transform: translate(-50%, -50%); }
  body .p-abe-koyomi__hero .p-abe-koyomi__hero-title { left: 51.94%; top: 51.77%; width: 28px; transform: translate(-50%, -50%); }
  body .p-zakki__hero .p-zakki__hero-title { left: 46.35%; top: 55.19%; width: 28px; transform: translate(-50%, -50%); }
  body .p-shiki-guide__hero .p-shiki-guide__hero-title:not(.p-shiki-guide__hero-title--text) { width: 28px; }
  body .p-kigan__hero .p-kigan__hero-title:not(.p-kigan__hero-title--text) { width: 28px; } /* 祈願祭 26px・解除の儀 30px だった */

  body .p-juyosho__hero:not(.p-contact__hero) { top: calc(18.18vw - 9.18px); }
  body .p-juyosho__hero:not(.p-contact__hero) ~ .p-juyosho__lead { margin-top: calc(36.36vw + 5.64px) !important; }

  body .p-contact__hero { top: calc(18.18vw - 28.18px); }
  body .p-juyosho__lead.p-contact__lead { margin-top: calc(36.36vw - 17.36px) !important; }

  body .p-sanpai__hero { top: calc(10.91vw - 8.41px); }
  body .p-sanpai__hero ~ .p-sanpai__lead { margin-top: calc(21.82vw + 7.18px) !important; }

  body .p-gyoji2__hero-frame { top: calc(14.55vw - 2.05px); }
  body .p-gyoji2__hero ~ .p-gyoji2__event:first-of-type { margin-top: calc(29.09vw + 9.91px) !important; }

  body .p-shrine__hero-frame { top: calc(10vw - 3.5px); }
  body .p-shrine--shakaku .p-shrine__hero ~ .p-shrine__lead,
  body .p-shrine--saijin .p-shrine__hero ~ .p-shrine__accs { margin-top: calc(20vw + 7px) !important; }

  body .p-kigan__hero { top: calc(4.55vw - 4.05px); }
  body .p-kigan__hero ~ .p-kigan__section:first-of-type { margin-top: calc(9.09vw + 15.91px) !important; }

  body .p-shiki-guide__hero { top: calc(15.45vw - 1.45px); }
  body .p-shiki-guide__hero ~ .p-shiki-guide__intro { margin-top: calc(30.91vw + 10.09px) !important; }

  body .p-abe-koyomi__hero { top: calc(17.27vw - 7.37px); }
  body .p-abe-koyomi__hero ~ .p-abe-koyomi__section:first-of-type { margin-top: calc(34.55vw + 9.25px) !important; }
  /* 暦想雑記（2026-10-28）：線画の枠の高さは (100vw − 32px) × 274.38 / 787.55 */
  body .p-zakki__hero { top: calc(17.13vw - 7.97px); }
  body .p-zakki__hero ~ .p-zakki__lead { margin-top: calc(34.25vw + 8.06px) !important; }
}
