/* ============================================
   GrowUp スライド共通レイアウト

   責任分界：
   - このファイルは表示の骨格（キャンバス・スケール・印刷・スナップ・基本タイポ）
     と、限定された utility だけを置く
   - deck 個別ファイルからは値を上書きしない。
     直すときは template の変更として行い、全 decks への影響を前提にレビューする
   - utility は5つまで（.stack / .row / .cols-2 / .note / .table-compact）
     これ以上は増やさない。必要が出たらまず1案件で実証 → この5枠の入れ替えを検討
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-jp);
  color: var(--text-primary);
  background: #000;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- デッキ：scroll-snap で1枚ずつ送る ---------- */
.deck {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100vh;
  scroll-behavior: smooth;
}

/* ---------- スライド外枠：1枚=1画面 ---------- */
.slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

/* ---------- 1600×900 固定キャンバス + scale で表示合わせ ---------- */
.slide-inner {
  width: var(--canvas-w);
  height: var(--canvas-h);
  flex: 0 0 auto;
  position: relative;
  padding: var(--canvas-pad-y) var(--canvas-pad-x);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  background: var(--bg);
  transform: scale(var(--slide-scale, 1));
  transform-origin: center center;
}

/* ---------- スライド種別 ---------- */
.slide--title { background: var(--brand-primary); }
.slide--title .slide-inner {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  justify-content: center;
}
.slide--content .slide-inner { justify-content: center; }
.slide--closing { background: var(--brand-primary); }
.slide--closing .slide-inner {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  justify-content: center;
}

/* 右上アクセントバー（キャンバス内・スケールと一緒に縮む） */
.slide-inner::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 180px; height: 8px;
  background: var(--brand-accent);
}

/* ---------- ヘッダー / フッター（キャンバス内・px固定） ---------- */
.slide-header,
.slide-footer {
  position: absolute;
  left: var(--canvas-pad-x);
  right: var(--canvas-pad-x);
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  display: flex;
}
.slide-header {
  top: 36px;
  justify-content: space-between;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.slide-footer {
  bottom: 36px;
  justify-content: flex-end;
  font-family: var(--font-num);
}
.slide--title .slide-header,
.slide--title .slide-footer,
.slide--closing .slide-header,
.slide--closing .slide-footer { display: none; }

/* ---------- タイポグラフィ（px固定） ---------- */
.hero  { font-size: var(--fs-hero);  font-weight: 900; line-height: 1.1;  letter-spacing: -0.02em; }
.h1    { font-size: var(--fs-h1);    font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.h2    { font-size: var(--fs-h2);    font-weight: 700; line-height: 1.2; }
.h3    { font-size: var(--fs-h3);    font-weight: 700; line-height: 1.3; }
.body  { font-size: var(--fs-body);  line-height: 1.6; }
.small { font-size: var(--fs-small); line-height: 1.5; }
.tiny  { font-size: var(--fs-tiny);  line-height: 1.4; color: var(--text-muted); }

.muted    { color: var(--text-secondary); }
.on-brand { color: var(--text-on-brand); }
strong    { color: var(--brand-primary); font-weight: 700; }
.slide--title strong, .on-brand strong { color: var(--brand-accent); }

/* ---------- 共通ブロック ---------- */
.slide-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}
.title-body {
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text-primary);
  max-width: 1360px;
}

/* ---------- utility（5つ・上限固定） ---------- */
.stack  { display: flex; flex-direction: column; gap: var(--gap-md); }
.row    { display: flex; flex-direction: row;    gap: var(--gap-md); align-items: stretch; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-lg); }
.note   { font-size: var(--fs-small); color: var(--text-secondary); line-height: 1.5; }
.table-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.table-compact th,
.table-compact td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  line-height: 1.4;
}
.table-compact th {
  font-weight: 700;
  color: var(--brand-primary);
  border-bottom-color: var(--border-strong);
}

/* ---------- overflow 検知（開発時の安全装置） ---------- */
/*
  deck.html 側の検知スクリプトが、内容が 1600×900 をはみ出した
  .slide-inner に .is-overflow を付ける。書き手が画面で気づけるようにする。
  印刷では消す（PDF納品の事故防止）。
*/
.slide-inner.is-overflow {
  outline: 4px solid #e53e3e;
  outline-offset: -4px;
}
.slide-inner.is-overflow::before {
  content: "OVERFLOW";
  position: absolute;
  top: 8px; left: 8px;
  background: #e53e3e;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 8px;
  letter-spacing: 0.08em;
  z-index: 10;
}

/* ---------- ナビ表示 ---------- */
.nav-indicator {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 6px 12px;
  font-size: 14px;
  font-family: var(--font-num);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
}
.nav-indicator.visible { opacity: 1; }

/* ============================================
   Print: transform を外して 1600×900 の等倍出力
   ============================================ */
@media print {
  @page { size: 1600px 900px; margin: 0; }
  html, body {
    height: auto;
    overflow: visible;
    background: #fff;
  }
  .deck {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }
  .slide {
    height: 900px;
    width: 1600px;
    page-break-after: always;
    break-after: page;
    scroll-snap-align: none;
  }
  .slide-inner {
    transform: none !important;
  }
  .nav-indicator { display: none; }
  .slide-inner.is-overflow { outline: none; }
  .slide-inner.is-overflow::before { display: none; }
}
