/* assets/css/main.css（モックの assets/css/main.css）: 全ページ共通の変数・リセット・枠 */
:root {
  --pink: #ff09ed;
  --pink-40: rgba(255, 0, 255, 0.4);
  --dark: #28181a;
  --ink: #222;
  --font-din: 'DIN 2014', 'Barlow', sans-serif;
  --font-jp: 'Zen Kaku Gothic New', sans-serif;
  --font-display: 'WDXL Lubrifont JP N', 'Zen Kaku Gothic New', sans-serif;

  /* sticky なサイトヘッダー / 枠の見出し行の高さ。sticky の top 計算に使う */
  --header-h: 87px;
  --head-h: 43px;
  /* 枠線の太さ。上辺は見出し行と一緒に sticky で動く */
  --frame-bw: 3px;
  /* MENU 列の上端余白。枠ごとに上書きする */
  --menu-pt: 32px;
  /* WordPress の管理バーぶんの高さ（ログイン中だけ body.admin-bar で上書き） */
  --admin-h: 0px;
}

body.admin-bar {
  --admin-h: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --admin-h: 46px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  /* ページ遷移中に文書の高さが 0 になってもスクロールバー分で幅が変わらないように */
  scrollbar-gutter: stable;
}

body {
  background: #fff;
  font-family: var(--font-din);
  color: var(--pink);
  /* PC only */
  min-width: 1100px;
}

/* WORKS ページは黒地（SP で一覧の下に白が見えないように） */
body.is-works {
  background: #000;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
}

/* クリック後に方向キーなどを押すとブラウザのフォーカス枠が出るので消す。
   :where() で詳細度 0 にして、各要素で付けている outline（色ドットの輪など）はそのまま効かせる */
:where(:focus-visible) {
  outline: none;
}

.page {
  position: relative;
  width: 100%;
  /* clip (not hidden): hidden creates a scroll container and breaks position: sticky */
  overflow-x: clip;
}

/* ページ本体（SiteFrame.vue）。KV は sticky で貼り付いたまま、この本体が上に被さってスクロールする */
.page-body {
  position: relative;
  z-index: 1;
  background: #fff;
}

/* KV とヘッダーの間の余白（デザインの 36px）。KV を隠すため本体側に持たせる */
.page-body.has-opening {
  padding-top: 36px;
}

/* 右端の縦書き（COLOR）。最初は 1 つ目の枠の右隣（枠の上端の高さ）にいて、スクロールでそこまで来たら sticky で貼り付く。
   .side-rail は枠の右の余白（.frame の margin-right）に、1 つ目の枠の上端からフッターの上端まで敷く（top / bottom は main.js が入れる）。
   フッターまで来たら貼り付きが外れて、本体と一緒に上へ流れていく */
.side-rail {
  position: absolute;
  top: var(--rail-top, 0px);
  bottom: var(--rail-bottom, 0px);
  right: 0;
  z-index: 25;
  display: flex;
  justify-content: center;
  width: var(--rail-w, 4.653%); /* 枠の右の余白（67 / 1440） */
  pointer-events: none;
}

.side-caption {
  position: sticky;
  top: calc(135px + var(--admin-h));
  align-self: flex-start;
  pointer-events: auto;
  writing-mode: vertical-rl;
  font-family: var(--font-din);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--pink);
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   COLOR: サイトの色の切り替え（inc/template-tags.php の _studio_color_dots、動きは main.js）
   PC は右端の縦書き（COLOR + 丸 2 つを縦に）、SP はハンバーガーの左に丸 2 つを横に
   --------------------------------------------------------------- */
.color-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  writing-mode: horizontal-tb;
}

.color-switch .color-label {
  writing-mode: vertical-rl;
}

.color-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.color-dot {
  display: block;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  /* 選択中は外側に線の輪 */
  outline: 1.5px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.2s, transform 0.2s;
}

.color-dot:hover {
  transform: scale(1.12);
}

.color-dot.pink {
  background: #ff09ed;
}

.color-dot.black {
  background: #000;
}

html:not([data-color='black']) .color-dot.pink,
html[data-color='black'] .color-dot.black {
  outline-color: var(--pink);
}

/* ---------------------------------------------------------------
   SCROLL 列の定規（inc/site-data.php の _studio_scroll_ruler）。
   列の左端から、10px ごとに短い線 / 50px ごとに中くらいの線 / 100px ごとに長い線 + 数値
   --------------------------------------------------------------- */
.scroll-cell {
  display: flex;
  flex-direction: column;
}

.scroll-ruler {
  --o: 6px; /* 0 の数値が上で切れないように、目盛りの起点を少し下げる */
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(currentColor 1px, transparent 1px) 0 var(--o) / 18px 100px repeat-y,
    linear-gradient(currentColor 1px, transparent 1px) 0 var(--o) / 11px 50px repeat-y,
    linear-gradient(currentColor 1px, transparent 1px) 0 var(--o) / 6px 10px repeat-y;
}

.scroll-ruler span {
  position: absolute;
  left: 24px;
  top: calc(var(--y) + var(--o));
  transform: translateY(-50%);
  font-family: var(--font-din);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* SP のハンバーガー（右 16.4px / 上 30px / 幅 42.6px / 高さ 15px）の左に並べる */
.sp-color {
  display: none;
}

/* 黒地に置く画像は、ブラックのときだけ白抜きの版に差し替える（表示は元の display のまま。pc-only などと両立させる） */
html:not([data-color='black']) .for-black {
  display: none !important;
}

html[data-color='black'] .for-pink {
  display: none !important;
}

/* pink CTA bar (frame-width link) */
.view-more {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 99px;
  margin-left: 1.528%;
  margin-right: 4.653%;
  background: var(--pink);
  cursor: pointer;
}

.view-more:hover {
  background: #000;
}

.view-more span {
  font-family: var(--font-din);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
}

/* 画像の上に掛かるピンクの幕。親に is-in が付くと右へ開く（--i で順番にずらす） */
.curtain {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--pink);
  transform-origin: right;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.66, 0, 0.34, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.is-in > .curtain {
  transform: scaleX(0);
}

/* 上へ開くタイプ */
.curtain.up {
  transform-origin: top;
}

.is-in > .curtain.up {
  transform: scaleY(0);
}

/* 幕の下の画像も、幕が開く向きへ少しずれながら現れる（枠は動かさない）。
   幕と同じ時間・カーブ・遅れで動かすので、ずれて空いた部分は常にまだ開いていない幕の下にある。
   transform は反転（img.flip）などで使っているので、個別プロパティの translate で動かす */
.works-table .pic > img,
.works-table .pic > .vid,
.member-frame .pic > img,
.member-frame-sp .pic > img {
  transition: translate 0.6s cubic-bezier(0.66, 0, 0.34, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* TOP の WORKS（表組み）: 幕は右へ開くので、画像は左から右へ */
.works-table .pic:not(.is-in) > img,
.works-table .pic:not(.is-in) > .vid {
  translate: -12% 0;
}

/* MEMBER: 幕は上へ開くので、画像は下から上へ */
.member-frame .pic:not(.is-in) > img,
.member-frame-sp .pic:not(.is-in) > img {
  translate: 0 14%;
}

/* SP だけ: 画面の縦の真ん中の左右に置く目印（太さ 1px、幅 5px） */
.center-mark {
  display: none;
}

/* TOP: 読み込めて再生が始まるまでは動画を隠し、下に敷いた静止画のサムネを見せる（main.js の S.watchMedia） */
video.is-media-loading {
  opacity: 0 !important;
}

/* 読み込み中の動画の上に重ねる青いベタ面 + LOADING（main.js の S.watchMedia） */
.media-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1cfee4;
  pointer-events: none;
}

.media-loading span {
  font-family: var(--font-din);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--pink);
  animation: media-loading-blink 1s steps(1, end) infinite;
}

/* 大きい置き場所（KV / 詳細のメイン動画 / WORKS の CRT）は文字も大きく */
.hero-cell .media-loading span,
.player .media-loading span,
.crt-screen .media-loading span {
  font-size: 20px;
  letter-spacing: 3px;
}

.player .media-loading {
  border-radius: 8px;
}

.crt-screen .media-loading {
  border-radius: 40px;
}

@keyframes media-loading-blink {
  50% {
    opacity: 0.35;
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------------------------------------------------------------
   frame: 全ページ共通の枠組み（1440px デザインの 22px / 67px マージン）

   ヘッダーと見出し行（MENU / PICTURE / ...）は sticky で固定し、
   「枠の中だけがスクロールしている」ように見せる。
   grid item は grid area に閉じ込められて sticky が効かないので、
   見出し行は本体グリッドと列定義（--cols）だけ揃えた別グリッドにしている。
   --------------------------------------------------------------- */
.frame {
  margin-left: 1.528%; /* 22 / 1440 */
  margin-right: 4.653%; /* 67 / 1440 */
  border: var(--frame-bw) solid var(--pink);
  /* 上辺は .frame-head 側で引く（sticky で一緒に固定されるように） */
  border-top: none;
}

.frame-head {
  position: sticky;
  top: calc(var(--header-h) + var(--admin-h));
  z-index: 20;
  display: grid;
  grid-template-columns: var(--cols);
  background: #fff;
  border-top: var(--frame-bw) solid var(--pink);
  border-bottom: 1px solid var(--pink);
}

.frame-head .label {
  display: flex;
  align-items: center;
  height: var(--head-h);
  padding-left: 17px;
  border-right: 1px solid var(--pink);
  font-family: var(--font-din);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  line-height: 1;
}

.frame-head .label:last-child {
  border-right: none;
}

.frame-body {
  display: grid;
  grid-template-columns: var(--cols);
}

.frame-body .cell {
  border-right: 1px solid var(--pink);
  border-bottom: 1px solid var(--pink);
  min-width: 0;
}

/* 枠の外周に重なる罫線は消す */
.frame-body .cell.no-r {
  border-right: none;
}

.frame-body .cell.no-b {
  border-bottom: none;
}

/* MENU 列（FrameMenu.vue）。追従するメニューは枠の下端から 120px 手前で止める（下の余白） */
.frame-menu {
  grid-column: 1;
  grid-row: 1 / -1;
  padding: var(--menu-pt) 0 120px 17px;
  border-bottom: none;
}

.frame-menu .menu-list {
  position: sticky;
  /* sticky なヘッダー + 枠線 + 見出し行のぶんだけ下げる */
  top: calc(var(--admin-h) + var(--header-h) + var(--frame-bw) + var(--head-h) + var(--menu-pt));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--font-din);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  line-height: 1;
}

.menu-list a {
  transition: 0s;
}

.menu-list a:hover {
  transform: translateX(6px);
}

/* ページ未実装の項目はリンクにせず灰色にする */
.menu-list .disabled {
  color: #999;
  cursor: default;
}

/* ---------------------------------------------------------------
   ページ遷移（assets/js/transitions.js）
   前のページに掛ける薄黒いオーバーレイと、次のページの初期位置
   --------------------------------------------------------------- */
.sheet-dim {
  position: absolute;
  inset: 0;
  z-index: 1000;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

/* 遷移で来たページは描画前から画面の下に置いておき、JS がせり上げる */
html.sheet-enter .page,
html.sheet-enter .page2 {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 100;
  transform: translateY(100%);
  box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.4);
}

/* ---------------------------------------------------------------
   SP（〜767px）。Figma の SP 版は 828px（@2x）なので値は 1/2 にしている
   --------------------------------------------------------------- */
@media (min-width: 768px) {
  .sp-only {
    display: none !important;
  }
}

@media (max-width: 767px) {
  :root {
    --header-h: 63px;
    --head-h: 41.5px;
    --frame-bw: 2px;
  }

  .pc-only {
    display: none !important;
  }

  body {
    min-width: 0;
  }

  .page-body.has-opening {
    padding-top: 21.5px;
  }

  .side-rail {
    display: none;
  }

  /* 枠: 左右 10.5px、線 2px、見出し行 41.5px */
  .frame {
    margin-left: 10.5px;
    margin-right: 10.5px;
  }

  .frame-head .label {
    padding-left: 12.5px;
    font-size: 12px;
    letter-spacing: 1px;
  }

  /* MENU 列はハンバーガーに置き換わる */
  .frame-menu {
    display: none;
  }

  .we-marquee .we-track,
  .we-track {
    font-size: 48px;
    gap: 16px;
  }

  .view-more {
    height: 61px;
    margin-left: 10.5px;
    margin-right: 10.5px;
  }

  .view-more span {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .crt-screen .media-loading {
    border-radius: 6vw;
  }

  .sp-color {
    display: flex;
    flex-direction: row;
    position: absolute;
    right: calc(16.4px + 42.6px + 18px);
    top: 30px;
    height: 15px;
    gap: 13px;
  }

  .sp-color .color-dot {
    width: 12px;
    height: 12px;
    outline-offset: 2.5px;
  }

  .center-mark {
    display: block;
    position: fixed;
    top: 50%;
    z-index: 40;
    width: 5px;
    height: 1px;
    background: var(--pink);
    pointer-events: none;
  }

  /* WORKS ページと、TOP の KV（オープニング）が画面の真ん中にかかっているあいだは出さない（main.js が kv-passed を付ける） */
  body.is-works .center-mark,
  body.kind-top:not(.kv-passed) .center-mark {
    display: none;
  }

  .center-mark.left {
    left: 0;
  }

  .center-mark.right {
    right: 0;
  }
}

/* ---------------------------------------------------------------
   ページ遷移（cross-document View Transitions）
   前のページのスナップショットを暗くして少し上へずらしながら、次のページが下から紙のように重なる。
   両方の文書が opt-in している同一オリジンのナビゲーションだけで動く。
   非対応ブラウザは assets/js/transitions.js の JS 版にフォールバック
   --------------------------------------------------------------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
  animation-duration: 720ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-fill-mode: both;
}

/* 前のページ: 暗くしながら少し上へずらす（縮めない） */
::view-transition-old(root) {
  animation-name: sheet-leave;
}

/* 次のページ: 下からせり上がる */
::view-transition-new(root) {
  animation-name: sheet-enter;
  box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.4);
}

@keyframes sheet-leave {
  from {
    transform: none;
    filter: brightness(1);
  }
  to {
    transform: translateY(-12%);
    filter: brightness(0.55);
  }
}

@keyframes sheet-enter {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ---------------------------------------------------------------
   COLOR: ブラック（<html data-color="black">）
   var(--pink) を黒にしてサイト全体を黒基調にする。
   ピンクの上で黒に変わっていたホバーや、黒地にピンク（= 黒）で見えなくなる文字だけ個別に直す
   --------------------------------------------------------------- */
html[data-color='black'] {
  --pink: #000;
  --pink-40: rgba(0, 0, 0, 0.4);
}

/* 色の切り替えは画面全体のクロスフェード（ページ遷移用の ::view-transition の動きを打ち消す） */
html.color-vt::view-transition-old(root) {
  animation: none;
}

html.color-vt::view-transition-new(root) {
  animation: color-fade-in 0.4s ease both;
  box-shadow: none;
}

@keyframes color-fade-in {
  from {
    opacity: 0;
  }
}

/* ピンク → 黒だったホバーは灰色に */
html[data-color='black'] .view-more:hover,
html[data-color='black'] .frame1 .strip .arrow:hover {
  background: #555;
}

/* TOP の映像ウォール: 左右の列はピンクの代わりに白黒にする */
html[data-color='black'] .opening .tile .tint,
html[data-color='black'] .works-table .list .tint {
  mix-blend-mode: saturation;
}

html[data-color='black'] .opening .opening-progress {
  color: #fff;
}

/* SP メニュー: 黒地に白文字 */
html[data-color='black'] .sp-menu .list,
html[data-color='black'] .sp-menu .tagline {
  color: #fff;
}

html[data-color='black'] .sp-menu .list .disabled {
  color: rgba(255, 255, 255, 0.45);
}

html[data-color='black'] .sp-menu .close span {
  background: #fff;
}

/* フッター: 黒地に白文字 */
html[data-color='black'] .site-footer .footer-nav,
html[data-color='black'] .site-footer .copyright,
html[data-color='black'] .site-footer .contact-track {
  color: #fff;
}

/* MEMBER の画像なし（ピンクの線のシルエット） */
html[data-color='black'] img[src*='silhouette'] {
  filter: grayscale(1) brightness(0);
}

/* CONTACT（SP はラベルと入力欄の線が明るいピンク） */
html[data-color='black'] .contact-frame .field label {
  color: var(--pink);
}

html[data-color='black'] .contact-frame .field textarea {
  border-color: var(--pink);
}

/* WORKS: 地も黒。ピンクだった文字・枠は白に、CRT の枠は灰色に */
html[data-color='black'] .page2 .crt-frame,
html[data-color='black'] .page2 .dial-pointer {
  filter: grayscale(1) brightness(0.3);
}

html[data-color='black'] .page2 .head-chip.cat,
html[data-color='black'] .page2 .pill-cat .dd-btn,
html[data-color='black'] .page2 .pill-cat .dd-opt[aria-selected='true'],
html[data-color='black'] .page2 .view-detail:hover span {
  color: #fff;
}

@media (max-width: 767px) {
  html[data-color='black'] .page2 .view-detail span {
    color: #000;
  }

  html[data-color='black'] .page2 .view-detail:hover span {
    color: #fff;
  }

  html[data-color='black'] .page2 .channel.active .ch-thumb {
    border-color: #fff;
  }

  html[data-color='black'] .page2 .channel.active .ch-label {
    color: #fff;
  }

  /* CRT のヒーローは真っ黒だと一覧と区別がつかないので、少しだけ明るく */
  html[data-color='black'] .page2 .crt-group {
    background: #111;
  }
}
