/* /assets/css/base.css（全文：Black Edition + swap helper 追記） */
/* =========================================================
   fudosha.net base.css（整理後）
   - Fonts
   - Tokens
   - Base / reset-ish
   - Accessibility helpers
   - JS enhancement（共通の“機能だけ”）
   ========================================================= */
@import url("./motion.css?"); /* motion tokens */

/* 移動前Latestを見せない（JSでmountするまで） */
html.js #siteLatest,
html.js #siteLatest .latest{
  visibility: hidden;
}


/* 追加：移動前Commentを見せない（JSでmountするまで）
   - Comment を hero に移動してオーバーレイ化するのはトップページだけ。
   - 固定ページは siteContent 内に残し、motion.css でフェード順を制御する。
*/
html.js body[data-page="main"] #siteComment,
html.js body[data-page="main"] #siteComment .mini-note{
  visibility: hidden;
}

/* -------------------------
   1) Fonts
   ------------------------- */
@font-face{
  font-family: "MOBO";
  src: url("../fonts/MOBO-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Guanine";
  src: url("../fonts/Guanine.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* tspc98（元は latest.css に閉じていたが、comment等でも使うため共通へ移動） */
@font-face{
  font-family: "tspc98";
  src: url("/assets/fonts/tspc98.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "misaki";
  src: url("/assets/fonts/misaki_gothic_2nd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "wapuro";
  src: url("/assets/fonts/wapuro-mincho.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------
   2) Design tokens / variables
   ------------------------- */
:root{
  --bg: rgb(245,245,245);

  /* layout width (PC default) */
  --bgw-base-pc: 60%;
  --max-base-pc: 1100px;

  /* global desktop scaling (visual scale != layout scale) */
  --pc-ui-scale: 1;
  --pc-layout-scale: 1;

  --bgw: var(--bgw-base-pc);
  --bg-size: 100% auto;

  /* colors */
  --text: rgba(15, 18, 28, 0.92);
  --muted: rgba(15, 18, 28, 0.62);
  --line: rgba(15, 18, 28, 0.14);

  /* surfaces */
  --glass: rgba(255,255,255,0.58);
  --glass-strong: rgba(255,255,255,0.74);

  /* effects */
  --shadow: 0 10px 30px rgba(15, 18, 28, 0.12);
  --radius: 14px;

  /* layout */
  --max: var(--max-base-pc);

  /* nav typography */
  --nav-pc-font: "Guanine", "MOBO", Arial, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  --nav-font: "MOBO", Arial, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;

  /* PC menu */
  --nav-pc-size: calc(17px * var(--pc-ui-scale));
  --nav-pc-lh: 1;
  --nav-pc-track: 0.14em;
  --nav-pc-font-color: rgba(15, 18, 28, 0.92);
  --nav-pc-hover-color: rgba(143, 178, 241, 1);

  /* SP overlay */
  --nav-sp-bgcolor: rgba(56,71,108,0.8);
  --nav-sp-size: 25px;
  --nav-sp-lh: 1.1;
  --nav-sp-track: 0.14em;
  --nav-sp-font-color: rgba(245, 245, 245, 1);
  --nav-sp-hover-color: rgba(143, 178, 241, 1);

  /* ヘッダ以下の位置調整用（content.css側で使う） */
  --header-offset-sp: 150px; /* SPで固定ヘッダーが占有する高さ */

  /* Black Edition helpers (footer etc) */
  --footer-rule-color: rgba(15,18,28,0.92);
  --footer-text-color: rgba(15,18,28,0.92);
}

/* SP: background width = 100% */
@media (max-width: 767px){
  :root{
    --bgw: 90%;
    --bg-size: 100% auto;
  }
}

/* Desktop-wide tuning (global visual scale + layout scale)
   - 目的: PC全体を「ブラウザ75%表示に近い見え方」へ寄せる
   - 幅だけでなく高さ差も吸収するため、viewport heightで段階調整 */
@media (min-width: 768px){
  :root{
    --pc-ui-scale: .86;
    --pc-layout-scale: .90;

    --bgw: calc(var(--bgw-base-pc) * var(--pc-layout-scale));
    --max: calc(var(--max-base-pc) * var(--pc-layout-scale));
  }

  html{
    font-size: calc(16px * var(--pc-ui-scale));
  }
}

/* tall desktop: 少し戻す（広い画面で縮みすぎないように） */
@media (min-width: 1366px) and (min-height: 980px){
  :root{
    --pc-ui-scale: .92;
    --pc-layout-scale: .95;
  }
}

/* notebook/FHD系（ブラウザUI込みで高さが苦しいことが多い） */
@media (min-width: 768px) and (max-height: 920px){
  :root{
    --pc-ui-scale: .80;
    --pc-layout-scale: .86;
  }
}

/* かなり低いviewport（ノートPC + UI厚め + 表示倍率環境） */
@media (min-width: 768px) and (max-height: 820px){
  :root{
    --pc-ui-scale: .75;
    --pc-layout-scale: .82;
  }
}

/* -------------------------
   2.9) Black Edition (theme)
   ---------------------------------------------------------
   Enable:
   - body[data-theme="black"]
   - OR (current) /network/ /history/ pages
     (body[data-page="network"], body[data-page="history"])
   ========================================================= */

body[data-theme="black"]{
  --bg: rgb(0,0,0);
  --footer-rule-color: rgba(245,245,245,0.92);
  --footer-text-color: rgba(245,245,245,0.92);
}

/* Theme asset swap helper
   - light asset:  class="theme-swap--light"
   - black asset:  class="theme-swap--black"
*/
body[data-theme="black"] .theme-swap--light{
  display: none !important;
}
body:not([data-theme="black"]) .theme-swap--black{
  display: none !important;
}

/* SP header logo swap (menu open/close) */
html.menu-open .menu-swap--closed{ display:none !important; }
html:not(.menu-open) .menu-swap--open{ display:none !important; }

/* -------------------------
   3) Base / reset-ish
   ------------------------- */
*{
  box-sizing: border-box;
}

html,
body{
  height: 100%;
}

html{
  font-size: 16px;
}

body{
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "MOBO", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* SP: prevent overflow sources */
@media (max-width: 767px){
  html,
  body{
    width: 100%;
    overflow-x: hidden;
  }

  img,
  svg,
  video,
  canvas{
    max-width: 100%;
    height: auto;
  }
}

/* menu open時：iOSで背景スクロールが抜けるのを抑える（JSロックの保険） */
html.menu-open,
html.menu-open body{
  height: 100%;
  overflow: hidden;
}

/* -------------------------
   4) Accessibility helpers
   ------------------------- */
.skip-link{
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 10px 12px;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 9999;
}

.skip-link:focus{
  left: 10px;
}

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* =========================================================
   JS enhancement（共通）
   ========================================================= */
html.js .banner-grid .banner{
  display: none;
}