.hero.hero--editorial {
  display: block;
  height: auto;
  min-height: 0;
  padding: 0;
  background: #0f2a4a;
  /* 一番左の写真の下端が水平に切れないよう、縦ははみ出しを許して下のセクション（同じ背景色・z-index: 2）の上に重ねる。横は画面端で切る */
  z-index: 3;
  overflow: visible;
  overflow-x: clip;
}

.hero-editorial__stage {
  position: relative;
  width: min(100%, 160svh);
  max-width: 1672px;
  height: 100svh;
  margin-inline: auto;
}

.hero-editorial__heading {
  position: absolute;
  z-index: 2;
  top: max(124px, 17%);
  left: 6.3%;
}

@media (min-width: 768px) {
  .content-site .hero--editorial .eyebrow { margin-bottom: 6px; font-size: 18px; }
}

.hero-editorial__title {
  margin: 0;
  font-size: clamp(42px, min(5.3vw, 8.48svh), 88px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .05em;
  white-space: nowrap;
}

.hero-editorial__photos {
  position: absolute;
  inset: 100px auto 48px calc(50% - 50vw);
  --photo-height: 46%;
  --photo-step: 10%;
  --photo-rise: 14px;
  --photo-pitch: 20%;
  --photo-start: -1%;
  width: 100vw;
}

.hero-editorial__photo {
  position: absolute;
  width: 22%;
  height: var(--photo-height);
  /* --photo-pos は今いる段（0が左端、4が右端）。出現後はこの値を動かして右隣の段へ送る */
  --photo-pos: var(--photo-index);
  left: calc(var(--photo-start) + var(--photo-pos) * var(--photo-pitch));
  top: calc((4 - var(--photo-pos)) * var(--photo-step) + (2 - var(--photo-pos)) * var(--photo-rise));
  overflow: hidden;
  /* 切り抜きの形は index.css の「斜めの写真枠」で定義。ここでは傾きだけ指定する */
  --slant-x: 13%;
  --slant-y: 7%;
  --slant-s: 0.017;
}

.hero-editorial__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-editorial__photo--1 { --photo-index: 0; }
.hero-editorial__photo--2 { --photo-index: 1; }
.hero-editorial__photo--3 { --photo-index: 2; }
.hero-editorial__photo--4 { --photo-index: 3; }
.hero-editorial__photo--5 { --photo-index: 4; }
/* 送り用の複製（js/content.js が追加）。出番までは画面の右外で待つ */
.hero-editorial__photo--clone { --photo-pos: 6; }
.hero-editorial__photo img { object-position: center; }
.hero-editorial__photo--1 img { object-position: 0% center; }
.hero-editorial__photo--3 img { object-position: 0% center; }
.hero-editorial__photo--4 img { object-position: 18% center; }
.hero-editorial__photo--5 img { object-position: 78% center; }

@media (min-width: 768px) {
  /* 写真同士の隙間を広げるため幅を少し狭める。中心がずれないよう、狭めた分の半分だけ右へ寄せる */
  .hero-editorial__photo { width: 21.5%; margin-left: .25%; }

  /* コピーと重なる左3段だけ、写真の上側を暗くする。段を移るときは濃さも一緒に変わる */
  .hero-editorial__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 42, 74, .55), rgba(15, 42, 74, .3) 25%, transparent 55%);
    opacity: clamp(0, 3 - var(--photo-pos), 1);
    pointer-events: none;
  }
}

/* 出現の動き。隠れた状態は @keyframes の始点にだけ書き、動きを止める設定（prefers-reduced-motion）では最初から表示される */

/* メインコピー：1文字ずつ、下から斜めにせり上がる。文字の分割は js/content.js */
.hero-editorial__char,
.hero-editorial__char > span {
  display: inline-block;
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(.36, .14, 0, 1);
  animation-delay: calc(.3s + var(--char-index) * .03s);
  animation-fill-mode: backwards;
}

/* 動いている間だけ、行の下にはみ出した部分を隠す */
.hero-editorial__char { animation-name: hero-char-clip; }
.hero-editorial__char > span { animation-name: hero-char-in; }

/* 分割が済むまではコピーを隠す。スクリプトが動かなかった場合は2秒後にそのまま表示する */
.has-js .hero-editorial__title:not(.is-split) { animation: hero-title-hold 2s steps(1, end) backwards; }

/* 写真：左（下の段）から順に、下から上へ出る */
.hero-editorial__photo {
  animation: hero-photo-in .6s cubic-bezier(.2, .8, .2, 1) calc(.1s + var(--photo-index) * .09s) backwards;
}

/* 写真：出現後、3.4秒ごとに全体が右隣の段へ1つずつ送られる。右端の写真は画面の外へ抜け、左端には次の写真が入る。
   5枚＋複製5枚の計10枚が同じ道のりを1段ずつずれて回る（--photo-seg が道のりの何番目から始めるか）。
   送る間隔を変えるときは、34s（＝間隔×10）と -3.4s（＝間隔）を一緒に変える */
@property --photo-pos {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.hero-editorial__photos.is-flowing .hero-editorial__photo {
  animation:
    hero-photo-in .6s cubic-bezier(.2, .8, .2, 1) calc(.1s + var(--photo-index) * .09s) backwards,
    hero-photo-flow 34s cubic-bezier(.65, 0, .35, 1) calc(var(--photo-seg) * -3.4s) infinite;
}

@keyframes hero-photo-flow {
  0%, 7.4% { --photo-pos: -2; }
  10%, 17.4% { --photo-pos: 0; }
  20%, 27.4% { --photo-pos: 1; }
  30%, 37.4% { --photo-pos: 2; }
  40%, 47.4% { --photo-pos: 3; }
  50%, 57.4% { --photo-pos: 4; }
  60%, 100% { --photo-pos: 6; }
}

@keyframes hero-char-clip {
  from, to { clip-path: inset(-.3em -.3em 0 -.3em); }
}

@keyframes hero-char-in {
  from { opacity: 0; transform: translate(0, 100%) skewX(12deg); }
}

@keyframes hero-title-hold {
  from { opacity: 0; }
}

@keyframes hero-photo-in {
  from { opacity: 0; transform: translateY(90px); }
}

.hero-editorial__details {
  position: absolute;
  z-index: 2;
  bottom: 64px;
  left: 56%;
  width: 40%;
}

.hero-editorial__body {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.9;
}

.content-site .hero--editorial .hero-actions {
  /* 幅を半々にすると「キャリアマップを見る」が入りきらず折り返すので、文字数に応じて配分する */
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 18px;
  padding: 0;
}

.content-site .hero--editorial .hero-actions .btn {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  height: 58px;
  white-space: nowrap;
  padding-inline: 10px;
  font-size: 14px;
  gap: 8px;
  /* 色は content.css の共通ルール（.btn-link / .btn-link--sub の濃い背景用）に従う */
}

/* ボタン文字の前のアイコン。線の色は文字色に追従する */
.hero--editorial .btn__icon {
  flex-shrink: 0;
  width: 1.4em;
  height: 1.4em;
}

.hero--editorial .btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (min-width: 1101px) and (min-height: 761px) {
  .hero-editorial__photos { --photo-height: 62%; --photo-step: 7%; }
}

@media (min-width: 1101px) {
  .hero-editorial__photos { --photo-step: clamp(66px, 11svh, 110px); }
  .hero-editorial__photo { top: calc((4 - var(--photo-pos)) * var(--photo-step) - 28px); }
  /* 画面の高さが低いとステージ幅（160svh）が縮むので、ボタン2つが1行に収まる幅は確保する */
  .hero-editorial__details { left: auto; right: 4%; width: max(34%, 390px); }
}

@media (min-width: 1673px) {
  .hero-editorial__body { font-size: 17px; }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .hero-editorial__title { font-size: clamp(46px, 5.5vw, 60px); }
  .hero-editorial__photos { --photo-height: 44%; --photo-step: 10%; }
  .hero-editorial__details { left: 53%; width: 43%; }
  .hero-editorial__body { font-size: 14px; }
  .content-site .hero--editorial .hero-actions .btn { font-size: 12px; }
}

@media (max-width: 767px) {
  .hero-editorial__stage {
    display: grid;
    grid-template-rows: auto minmax(170px, 1fr) auto;
    width: 100%;
    height: auto;
    min-height: max(100svh, 600px);
    padding: 104px 24px 24px;
    overflow-x: clip;
  }

  .hero-editorial__heading {
    position: relative;
    inset: auto;
  }

  .content-site .hero--editorial .eyebrow { margin-bottom: 4px; font-size: 14px; }

  .hero-editorial__title {
    font-size: clamp(36px, 11.6vw, 64px);
    line-height: 1.3;
    letter-spacing: 0;
    text-shadow: 0 2px 14px rgba(15, 42, 74, .6);
  }

  .hero-editorial__photos {
    position: relative;
    inset: auto;
    width: 100vw;
    height: auto;
    margin: -36px 0 14px calc(50% - 50vw);
  }

  .hero-editorial__photos {
    --photo-height: 80%;
    --photo-step: 5%;
    --photo-rise: 3px;
    --photo-pitch: 22%;
    --photo-start: -5%;
  }


  .hero-editorial__details {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .hero-editorial__body { font-size: 14px; line-height: 1.9; }
  /* ボタンは横並び。2つ目まで最初の画面に収めるため。幅は文字数に応じて配分し、折り返さない */
  .content-site .hero--editorial .hero-actions { display: flex; gap: 8px; margin-top: 16px; }
  .content-site .hero--editorial .hero-actions .btn { flex: 1 1 auto; width: auto; height: 52px; font-size: 12px; padding-inline: 8px; gap: 5px; white-space: nowrap; }
}

@media (max-width: 374px) {
  .hero-editorial__stage { padding-inline: 18px; }
  .hero-editorial__body { font-size: 13px; }
}

/* 横並びが入りきらない幅では縦に積む */
@media (max-width: 359px) {
  .content-site .hero--editorial .hero-actions { flex-direction: column; gap: 10px; }
  .content-site .hero--editorial .hero-actions .btn { flex: none; width: 100%; font-size: 14px; padding-inline: 10px; gap: 8px; }
}
