/* =============================================
   大一産業 TOP ヒーロー（縦スライド・45/10/45）
   - front-page でのみ enqueue（is_front_page）
   - クラスは dc-hero- 接頭辞で Tailwind/他CSSから隔離
   - 旧 .slide / .indicator 系とは別系統
   ============================================= */

:root {
  --dc-hero-header-h: 4rem; /* header.php の h-16 = 64px に一致 */
  --dc-hero-center-w: 10vw; /* 中央コピー列の幅（PC） */
  --dc-hero-side-w: 45vw;   /* 左右写真列の幅（PC） */
  --dc-hero-anim: 900ms;    /* 縦スライドのトランジション時間 */
  --dc-hero-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.dc-hero {
  display: flex;
  width: 100%;
  /* ヒーロー高さ=85vh。fixed ヘッダー分を引いて画面内に収め、
     ヘッダーと重ならないよう margin-top で押し下げる。
     下限/上限を設けて極端な縦長/横長を防ぐ。 */
  height: calc(85vh - var(--dc-hero-header-h));
  min-height: 480px;
  max-height: 900px;
  margin-top: var(--dc-hero-header-h); /* fixed ヘッダー分を押し下げる */
  background: #ffffff;
  overflow: hidden;
}

/* --- 左右の写真列（縦スライド） --- */
.dc-hero__col {
  position: relative;
  width: var(--dc-hero-side-w);
  height: 100%;
  overflow: hidden;
  background: #eef2f7;
}

/* スライドを縦に積むトラック。translateY でカテゴリを切替える */
.dc-hero__track {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  /* JS が --dc-hero-count を実際の枚数に設定する */
  height: calc(100% * var(--dc-hero-count, 4));
  transform: translateY(0);
  transition: transform var(--dc-hero-anim) var(--dc-hero-ease);
  will-change: transform;
}

.dc-hero__slide {
  position: relative;
  width: 100%;
  height: calc(100% / var(--dc-hero-count, 4));
  flex: 0 0 auto;
  overflow: hidden;
}

.dc-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 縦長枠を実写真でも破綻させない */
  display: block;
}

/* カテゴリバッジ（左列＝左下、右列＝右下） */
.dc-hero__badge {
  position: absolute;
  bottom: 1.25rem;
  z-index: 2;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0e2b79; /* primary */
  background: rgba(255, 255, 255, 0.92);
  border-radius: 0.375rem;
  box-shadow: 0 2px 10px rgba(14, 43, 121, 0.12);
}
.dc-hero__col--left .dc-hero__badge {
  left: 1.25rem;
}
.dc-hero__col--right .dc-hero__badge {
  right: 1.25rem;
}

/* --- 中央コピー（縦書き2行） --- */
.dc-hero__center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--dc-hero-center-w);
  height: 100%;
  padding: 2rem 0;
  background: #ffffff;
  flex: 0 0 auto;
}

.dc-hero__copy {
  /* コンテナは横書き座標系のまま、2つの行を横並びの列にする。
     DOM順は line1→line2 だが、row-reverse で視覚的に line1=右・line2=左
     （縦書きの自然な右→左の段組み）にする。 */
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: center;
  gap: 0.4em; /* 2列（縦書きブロック）の列間。詰めて2列を寄せる（重ならない範囲） */
  margin: 0;
  color: #1e293b; /* slate-800 相当・本文より少し濃く */
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.6rem);
  letter-spacing: 0.18em; /* ゆったりした字間 */
  text-align: center;
}
/* 各行を独立した縦書きブロックにする（vertical-rl の1列） */
.dc-hero__copy-line {
  writing-mode: vertical-rl;
  text-orientation: upright;
  line-height: 1.9; /* 縦書きの字間（列内の文字送り） */
}

/* =============================================
   レスポンシブ・フォールバック
   ============================================= */

/* タブレット（768〜1023px）: 写真をやや広く、中央列を細く */
@media (max-width: 1023px) {
  :root {
    --dc-hero-center-w: 14vw;
    --dc-hero-side-w: 43vw;
  }
  .dc-hero__copy {
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    letter-spacing: 0.12em;
  }
}

/* スマホ（767px以下）: 縦積みへ切替。
   コピーを上、写真を1枚（左列の現在カテゴリ）下に表示。
   縦書きは小画面で読みにくいため横書きへフォールバック。 */
@media (max-width: 767px) {
  .dc-hero {
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .dc-hero__center {
    order: -1; /* コピーを最上部へ */
    width: 100%;
    height: auto;
    padding: 2rem 1.25rem 1.5rem;
  }
  .dc-hero__copy {
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    letter-spacing: 0.06em;
  }
  /* スマホは縦書きを解除して横書き2行に戻す */
  .dc-hero__copy-line {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    line-height: 1.6;
  }
  /* スマホは左列のみ全幅表示（右列は非表示にして縦を抑える） */
  .dc-hero__col {
    width: 100%;
    height: 56vw; /* 横長の見えやすい比率 */
    min-height: 240px;
    max-height: 420px;
  }
  .dc-hero__col--right {
    display: none;
  }
}

/* モーション配慮: 自動送り停止時の見え方（JSが送りを止める）。
   トランジション自体も無効化して不意の動きを避ける。 */
@media (prefers-reduced-motion: reduce) {
  .dc-hero__track {
    transition: none;
  }
}
