/* sub-page.css - Double-Block System Skeleton */

/* -------------------------------------------------------------------------- *
 * サブページ（body.sub-page）
 * -------------------------------------------------------------------------*/

/* --- A. ページ背景 + LP/クリエイティブで使い回すホバー用グラデ --- */
body.sub-page {
  --works-hover-gradient: linear-gradient(135deg, #a575fc, #9a5efc, #5f1fdb);
  background: linear-gradient(180deg, #f5f8ff 0%, var(--bg) 38%, var(--bg) 100%);
}

/* --- B. 上部バー：スクロールしても見える sticky、トップと同じ黒ヘッダー --- */
/* .sub-page .detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--concrete-mid);
  background-image: var(--concrete-bg-image);
  border-bottom: var(--nav-chrome-border-bottom);
  box-shadow: var(--nav-chrome-shadow);
} */

.sub-page .detail-header__inner {
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sub-page .detail-back {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sub-page .detail-back:hover {
  color: #fff;
}

.sub-page .detail-back:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 4px;
  border-radius: 2px;
}

.sub-page .detail-brand {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  align-items: bottom;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 10px;
}

/* --- C. 本文エリア：中央寄せ・最大幅制限（読みやすいカラム幅） --- */
.sub-page .detail-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* 小見出し（英字）・H2・リード：メイン LP セクションと Others で共通クラスを再利用 */
.sub-page .detail-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sub-page .detail-title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-on-white);
  line-height: 1.35;
  margin-bottom: 14px;
  padding-bottom: 16px;
  position: relative;
}

.sub-page .detail-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-grad-line-h);
}

.sub-page .detail-lede {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-on-white-muted);
  margin-bottom: 40px;
}

/* リスト枠：上下に区切り線（カード風の行） */
.sub-page .work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--accent-border);
}

.sub-page .work-list__item {
  border-bottom: 1px solid var(--accent-border);
}

/* --- D. LP・HP 外部リンク行：2列グリッド（左: タイトル+URL / 右: 矢印） ---
 * クリエイティブ行は <a> ではなく .works-creative__block のためここには当たらない。
 */
.sub-page a.work-list__link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 4px;
  margin: 0 -12px;
  padding: 22px 12px;
  text-decoration: none;
  color: var(--ink-on-white);
  transform: scale(1);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    color 0.35s ease,
    transform 0.5s ease;
  border-radius: 8px;
}

.sub-page a.work-list__link:hover {
  background: var(--works-hover-gradient);
  box-shadow: 0 8px 32px var(--accent-glow);
  color: #fff;
  transform: scale(1.04);
}

.sub-page a.work-list__link:hover .work-list__arrow {
  color: #fff;
  opacity: 1;
}

.sub-page a.work-list__link:focus-visible {
  outline: 2px solid var(--hero-blue-4);
  outline-offset: 2px;
}

/* LP・HP 一覧（.work-list--web 内の名前のみグリッド列に配置） */
.sub-page .work-list--web .work-list__name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  grid-column: 1;
  grid-row: 1;
}

.sub-page .work-list__host {
  font-size: 0.8rem;
  color: var(--text-muted);
  grid-column: 1;
  grid-row: 2;
  word-break: break-all;
}

.sub-page .work-list__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--hero-blue-5);
  opacity: 0.85;
  transform: translate(2px, -2px);
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Others セクション：上に余白 + 区切り線で LP ブロックと分離 */
.sub-page .works-others {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--accent-border);
}

/* --- E. クリエイティブ実績：縦並び（タイトル → 画像ボタン） ---
 * .works-creative__zoom … 見た目をリセットした button。ホバーで LP と同系の影＋拡大。
 * .works-creative__overlay … サムネ上の紫グラデ（--works-hover-gradient）。
 * .works-creative__img--* … ロゴ/フライヤー/マップで縦基準 or 横基準が異なるため修飾子で分岐。
 */
.sub-page .works-others .works-creative__block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0 -12px;
  padding: 22px 12px;
  border-radius: 8px;
  color: var(--ink-on-white);
}

.sub-page .works-others .work-list__name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  max-width: 100%;
}

.sub-page .works-others .works-creative__zoom {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  text-align: left;
  border-radius: 10px;
  transition:
    transform 0.35s ease,
    box-shadow 0.2s ease;
}

.sub-page .works-others .works-creative__zoom:focus-visible {
  outline: 2px solid var(--hero-blue-4);
  outline-offset: 4px;
}

.sub-page .works-others .works-creative__thumb {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 10px;
}

.sub-page .works-others .works-creative__overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--works-hover-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.sub-page .works-others .works-creative__zoom:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.sub-page .works-others .works-creative__zoom:hover .works-creative__overlay {
  opacity: 0.88;
}

.sub-page .works-others .works-creative__thumb .works-creative__img {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.sub-page .works-others .works-creative__img--logo,
.sub-page .works-others .works-creative__img--map {
  height: 240px;
  width: auto;
}

.sub-page .works-others .works-creative__img--flyer {
  width: 240px;
  height: auto;
}

/* --- F. ライトボックス（JS: initWorksCreativeLightbox） ---
 * [hidden] … display:none。開いているときだけ fixed で全面表示。
 * __backdrop … 暗転＋ぼかし。クリックで閉じる。
 * __shell … 閉じるボタン行 + 画像枠の縦並び。pointer-events の trick:
 *   親を none にして子だけ auto → 余白クリックは背面へ抜ける（閉じやすくする）。
 * __top … 閉じるボタンを画像と重ねないよう上段に配置。
 * __img … 実物比率のまま収まるよう max-width / max-height でビューポート内に収める。
 */
.sub-page .works-lightbox[hidden] {
  display: none;
}

.sub-page .works-lightbox:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 28px;
  box-sizing: border-box;
}

.sub-page .works-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 24, 0.82);
  backdrop-filter: blur(8px);
}

.sub-page .works-lightbox__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: min(96vw, 1280px);
  max-height: min(96vh, 920px);
  pointer-events: none;
}

.sub-page .works-lightbox__shell > * {
  pointer-events: auto;
}

.sub-page .works-lightbox__top {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  min-height: 44px;
}

.sub-page .works-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(40, 32, 58, 0.95), rgba(25, 20, 42, 0.98));
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.sub-page .works-lightbox__close:hover {
  transform: scale(1.06);
  border-color: rgba(165, 117, 252, 0.55);
  background: linear-gradient(145deg, rgba(95, 31, 219, 0.55), rgba(40, 32, 58, 0.98));
}

.sub-page .works-lightbox__close:focus-visible {
  outline: 2px solid var(--hero-blue-4);
  outline-offset: 3px;
}

.sub-page .works-lightbox__close-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.sub-page .works-lightbox__close-icon::before,
.sub-page .works-lightbox__close-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 22px;
  border-radius: 1px;
  background: currentColor;
}

.sub-page .works-lightbox__close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.sub-page .works-lightbox__close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.sub-page .works-lightbox__frame {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  border-radius: 12px;
}

.sub-page .works-lightbox__img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(78vh, calc(96vh - 120px));
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* アニメーションを減らす設定のときは拡大・トランジションをオフ */
@media (prefers-reduced-motion: reduce) {
  .sub-page .works-others .works-creative__zoom,
  .sub-page .works-others .works-creative__overlay,
  .sub-page .works-lightbox__close {
    transition: none;
  }

  .sub-page .works-others .works-creative__zoom:hover {
    transform: none;
  }
}

.sub-page .detail-footnote {
  margin-top: 48px;
  margin-bottom: 96px;  
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* フッターは画面下に固定（本文に padding-bottom で被り回避は main 側の設計に依存） */
.sub-page .footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
}

/* --- G. 狭い画面：LP 行を 1 列にし、矢印を 3 行目へ（タイトル → URL → ↗） --- */
@media (max-width: 480px) {
  .sub-page .detail-main {
    padding-top: 40px;
  }

  .sub-page a.work-list__link {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .sub-page .work-list__arrow {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    margin-top: 4px;
  }
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--nav-header-bg);
  background-image: var(--nav-header-bg-image);
  /* border-bottom: var(--nav-chrome-border-bottom); */
  box-shadow: var(--nav-chrome-shadow);
}

.detail-header .logo,
.detail-header .logo-name,
.detail-header .nav-links a {
  color: rgba(255, 255, 255, 0.92);
}

.detail-header .nav-links a:hover,
.detail-header .logo:hover .logo-name {
  color: #fff;
}

.u-sp-only {
  display: none;
}


.detail-header .nav {
  height: 56px;
}

/* ロゴのスタイル */
.detail-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

/* .detail-header .logo-mark {
  width: 52px;
  height: 52px;
} */

/* Homeに戻る */
.detail-header .detail-back {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}

.detail-header.detail-back:hover {
  color: #fff;
}

.detail-header .detail-brand {
  display: none;
}

/* 左グループ */
.header-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 右グループ */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* PC時（768px以上）はトップページ同様にdisplay: contents; とする */
.sub-page .nav-mobile-overlay {
  display: contents;
}

.sub-page-main {
  padding-bottom: 100px; /* 下端の余白 */
}

.detail-header .logo-name {
  color: #fff; /* ダーク背景に合わせる */
  font-size: 1rem;
  font-weight: 500;
}

/* ハンバーガー：PCでも表示させるための詳細度上書き */
.sub-page .nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.sub-page .nav-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.sub-page .nav-toggle-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1px;
  transition: transform 0.28s ease, top 0.28s ease, background 0.2s ease;
}

.sub-page .nav-toggle-line:nth-child(1) {
  top: 16px;
}

.sub-page .nav-toggle-line:nth-child(2) {
  top: 26px;
}

.sub-page .nav-toggle.is-open .nav-toggle-line:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.sub-page .nav-toggle.is-open .nav-toggle-line:nth-child(2) {
  top: 21px;
  transform: rotate(-45deg);
}

/* 各セクション（Block A / Block B）の共通設定 */
.sub-page-block {
  padding-top: 60px; /* [重要] 上部余白。セクションごとの区切りを強調 */
}

/* 見出しの装飾（ABOUT / SERVICE等で共通） */
.sub-title-common {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-top: 64px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.sub-title-common::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 2rem;
  background: var(--accent-grad-line-v);
  margin-right: 10px;
  vertical-align: bottom;
}

/* --- アニメーション：即時表示（reveal-now）と時間差演出 --- */

/* 1. ベースとなるアニメーションの定義 */
.reveal-now { 
  opacity: 0; 
  animation: revealNow 0.8s var(--reveal-ease) forwards; 
  /* ページ読み込み完了から動き出すまでの基礎待機時間 */
  --reveal-delay: 0.1s; 
}

/* 2. キーフレーム：下からスッと浮き上がる動き */
@keyframes revealNow {
  from { 
    opacity: 0; 
    /* --start-x や --start-y が指定されていればその方向から、なければその場で[cite: 7] */
    transform: translate3d(var(--start-x, 0), var(--start-y, 0), 0); 
  }
  to { 
    opacity: 1; 
    transform: translate3d(0, 0, 0); 
  }
}

/* 3. 【追加】右側パートへの「溜め（ディレイ）」の設定 */
/* 
   視覚的に「右側」にある要素だけを抽出して、
   開始時間を 0.1s(基本) + 0.4s = 合計 0.5s まで遅らせます。
*/

.reveal-from--right { 
  --start-x: 1.0rem; 
}

.reveal-from--left { 
  --start-x: -1.0rem; 
}

/* アニメーション：スクロール軽量設定 */
.sub-page .sub-page-block .reveal-on-scroll {
  --reveal-duration: 3.2s;
  --reveal-delay: 0.1s;
}

.sub-page .about-footer-cta .reveal-on-scroll {
  --reveal-duration: 3.2s; /* 3.2s から大幅に短縮 */
  --reveal-delay: 0.1s;    /* 0.4s から短縮し、即座に発火させる */
}

/* Block A: 2カラムグリッドの基盤[cite: 7] */
.side-by-side-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
}

/* 反転用クラス（SERVICE / VISION用） */
.side-by-side-grid.is-reversed {
  grid-template-columns: 1.2fr 1fr;
}

.side-by-side-grid.is-reversed .grid-text-part { 
  order: 2; 
}

.side-by-side-grid.is-reversed .grid-photo-part { 
  order: 1; 
}

/* 通常のグリッド：2番目の要素（写真側）を遅らせる[cite: 7] */
.side-by-side-grid > *:nth-child(2) {
  --reveal-delay: 0.8s;
}

/* 反転したグリッド：1番目の要素（テキスト側）を遅らせる */
.side-by-side-grid.is-reversed > *:nth-child(1) {
  --reveal-delay: 0.8s;
}

/* 反転時のテキスト側（左側）は即座に出したいので 0.1s を明示 */
.side-by-side-grid.is-reversed > *:nth-child(2) {
  --reveal-delay: 0.1s;
}

/* Block B: テーブルの基盤 */
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table tr { 
  border-bottom: 1px solid #000; 
}

.detail-table th { 
  width: 250px; 
  text-align: left; 
  padding: 32px 0; 
  color: var(--text-muted); 
  font-weight: 500; 
}

.detail-table td { 
  padding: 32px 0; 
}

/* .detail-table th { 
  width: 250px; 
  text-align: left; 
  padding: 32px 0; 
  color: var(--text-muted); 
  font-weight: 500; 
}

.detail-table td { 
  padding: 32px 0; 
} */

/* レスポンシブ基盤 */
@media (max-width: 768px) {
  /* .detail-table th, .detail-table td {
    display: block;
    width: 100%;
    padding: 16px 0; 
  }

  .detail-table th { 
    border-bottom: none; 
    padding-bottom: 0; 
  } */
  
  /* .detail-header__inner {
    grid-template-columns: 1fr auto 44px;
    padding: 0 16px;
  } */

  .detail-header .logo { 
    min-width: auto; 
  }

  /* .detail-header .logo-name { 
    display: none; 
  } */

  .sub-page .nav-toggle {
    display: flex;
  }

  /* メニューオーバーレイを有効化する（contents を解除） */
  .sub-page .nav-mobile-overlay {
    display: flex; /* styles.css のスマホ設定と同期 */
  }

  .u-sp-only {
    display: block;
  }

  .side-by-side-grid, 
  .side-by-side-grid.is-reversed { 
    grid-template-columns: 1fr;
    gap: 40px; 
  }

  .grid-text-part { 
    order: 2; 
  }

  .grid-photo-part {
    order: 1; 
  }
}
