:root{
  --border: 3px;
  --text: #000;
  --bg: #fff;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

@font-face{
  font-family: "GennoNijimiMincho";
  /* ここは実ファイルに合わせてください */
  src: url("/assets/fonts/genno-nijimi-mincho.otf") format("opentype");
  font-display: swap;
}

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: "GennoNijimiMincho", serif;
}

/* button reset（余計な線の再発防止） */
button{
  border:0;
  outline:none;
  box-shadow:none;
  background:transparent;
  padding:0;
  font:inherit;
  color:inherit;
  -webkit-appearance:none;
  appearance:none;
  cursor:pointer;
}
button::-moz-focus-inner{ border:0; padding:0; }
button:disabled{ opacity:.25; cursor:default; pointer-events:none; }

.page{
  position: relative;
  min-height: 100vh;
  padding-bottom: 120px;
}

/* Header */
.header{ position:relative; height:160px; }

.site-title{
  position:absolute;
  left:123.5px;
  top:50px;
  border:var(--border) solid #000;
  padding:8px 16px;
  font-size:44px;
  line-height:1;
}

.nav{
  position:absolute;
  right:123.5px;
  top:50px;
  display:flex;
  gap:50px;
  font-size:28px;
  line-height:1;
}

.nav-link{
  display:inline-block;
  padding-bottom:6px;
  border-bottom:var(--border) solid transparent;
}
.nav-link.is-active{ border-bottom-color:#000; }

/* Work select */
.work-select{
  position:relative;
  height:320px;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  margin-top:10px;
}

.work-card{
  position:relative;
  width:260px;
  height:260px;
  border:var(--border) solid #000;
  background:transparent;
}

#workTitle{
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: normal;     /* 1列にするなら normal でOK */
  overflow: hidden;        /* はみ出し防止 */
  display: block;
  height: 100%;
}

.work-card__author{
  position:absolute;
  right:8px;
  bottom:8px;
  writing-mode:vertical-rl;
  text-orientation:upright;
  font-size:22px;
  line-height:1;
}

/* 作品選択 ▼ */
.work-select__chev{
  position:absolute;
  left:50%;
  top:0px;
  transform: translateX(calc(260px/2 + 20px));
  width:0;height:0;
  border-left:10px solid transparent;
  border-right:10px solid transparent;
  border-top:14px solid #000;
  z-index: 5;
}

/* Tabs（横位置は中央固定、縦位置はJSでtopを入れる） */
.type-tabs{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top: 0;                 /* JSで設定 */
  width: 425.5px;
  display:flex;
  justify-content:space-between;
  z-index: 2;
}

/* タブサイズは同一に固定 */
.type-tabs .tab{
  width:140px;
  height:44px;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  border:var(--border) solid #000;
  font-size:22px;
  background:transparent;
}
.type-tabs .tab.is-active{
  background:#000;
  color:#fff;
}

/* Grid */
.grid-wrap{
  display:flex;
  justify-content:center;
  margin-top:135px;
}

.grid{
  width: calc(4 * 260px + 3 * 35px);
  display:grid;
  grid-template-columns:repeat(4,260px);
  gap:35px;
}

.thumb{
  width:260px;
  height: calc(260px * 3508 / 2480);
  border:var(--border) solid #000;
  overflow:hidden;
}

.thumbBtn{ width:100%; height:100%; }
.thumbBtn img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

/* Pager */
.pager{
  margin-top:100px;
  display:flex;
  justify-content:center;
  gap:120px;
  align-items:center;
}

.pager-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:26px;
}

.tri{
  width:0;height:0;
  border-top:14px solid transparent;
  border-bottom:14px solid transparent;
}
.tri-left{ border-right:20px solid #000; }
.tri-right{ border-left:20px solid #000; }

/* ================= Modal ================= */
.modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:999;
}
.modal.is-open{ display:block; }

.modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.35);
}

.modal__panel{
  position:absolute;
  left:50%;
  top:50%;

  /* ★中央寄せ + 20%拡大 を同時に */
  transform: translate(-50%,-50%) scale(1.5);
  transform-origin: center center;

  width:800px;
  height:600px;
  background:#fff;
  border:var(--border) solid #000;
}

.modal__close{
  position:absolute;
  right:18px;
  top:14px;
  font-size:32px;
  line-height:1;
}

/* ★ ここが途切れ防止の要：bottom:50pxで高さ確定 */
.modal__content{
  position:absolute;
  left:50px;
  top:50px;
  right:50px;
  bottom:50px;
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:50px;
}

.modal__left{
  position:relative;
  display:flex;
  justify-content:center;
  align-items:center;
}

.modal__graphicFrame{
  width:100%;
  aspect-ratio:2480/3508;
  max-height:100%;
  height:auto;
  border:var(--border) solid #000;
  display:flex;
  justify-content:center;
  align-items:center;
  overflow:hidden;
  background:#fff;
}

.modal__graphicFrame img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
}

.modal__workLink{
  position:absolute;
  right:-18px;
  bottom:0px;
  border:var(--border) solid #000;
  background:#fff;
  color:#000;
  text-decoration:none;
  padding:6px 8px;
  writing-mode:vertical-rl;
  text-orientation:upright;
  font-size:18px;
}

/* 本文：横スクロール容器（grid内で潰れないように min-height:0） */
.modal__right{
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  min-height: 0;

  display: flex;          /* ★ ここ */
  align-items: center;    /* ★ 縦方向の中間点 */
}

/* 本文：max-contentで文末まで伸びる（テキストサイズは触らない） */
.modal__text{
  writing-mode: vertical-rl;
  text-orientation: mixed;

  width: max-content;   /* 維持 */
  height: auto;         /* ★ ここ（100%をやめる） */

  max-width: none;
  max-height: none;
  overflow: visible;

  font-size: 24px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  transform: translateY(var(--modal-text-y));
}



/* 読点赤 */
.comma-red{ color:#c00; }

/* 左右ナビ三角：枠線から20px離す（34+20=54） */
.modalNav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:0;height:0;
  border-top:22px solid transparent;
  border-bottom:22px solid transparent;
}
.modalNav--prev{ left:-54px; border-right:34px solid #000; }
.modalNav--next{ right:-54px; border-left:34px solid #000; }

/* クリック領域拡張 */
.modalNav::before{
  content:"";
  position:absolute;
  left:-26px;
  top:-26px;
  width:52px;
  height:52px;
  background:transparent;
}

/* ================= Work Select Modal ================= */
.workModal{
  position:fixed;
  inset:0;
  display:none;
  z-index:1000;
}
.workModal.is-open{ display:block; }

.workModal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.35);
}

.workModal__panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:380px;
  height:520px;
  background:#fff;
  border:var(--border) solid #000;
  padding:24px 22px;
}

.workModal__close{
  position:absolute;
  right:18px;
  top:14px;
  font-size:32px;
  line-height:1;
}

.workModal__list{
  margin-top:36px;
  height: calc(520px - 24px*2 - 36px);
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:26px;
}

.workOpt{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  column-gap:18px;
  cursor:pointer;
}

.workOpt__title{
  font-size:28px;
  line-height:1.1;
  padding:6px 10px;
  border:var(--border) solid transparent;
}

.workOpt__author{
  font-size:16px;
  line-height:1.1;
}

.workOpt.is-active .workOpt__title{
  background:#000;
  color:#fff;
}

:root{
  --modal-text-y: 15px;   /* ★ ここを +/− で微調整（+で下、-で上） */
}

/* =======================
   TOP hero (<= 1233.5px)
   ======================= */

/* Topでは左上のsite-title枠を消す（指示） */
.topPage .site-title{
  display: none;
}

/* Topのヘッダーは archive と同一を使う：余計なTop用header上書きがあれば無効化する */
.topPage .header{
  /* archiveのheader定義に任せる。ここでは上書きしない */
}

/* ヒーロー領域：縦1233.5pxまでの範囲（ここでは画像＋縦タイトルのみ） */
.topHero{
  position: relative;
  height: 988px; /* ★これで「merosuの200px下」に次のセクションが来る */
}

/* A版比率：高さ613固定 → 幅は 613*(2480/3508) */
:root{
  --a4w-from-h613: 433.06px; /* 計算値（約433.1） */
}

/* 画像共通（merosu/ginga） */
.topHero .heroImg{
  position: absolute;
  height: 613px;                 /* 指示 */
  width: var(--a4w-from-h613);   /* A版比率 */
  border: var(--border) solid #000;
  background: #fff;
  overflow: hidden;
}
.topHero .heroImg img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

/* merosu：左辺が中心線から65px左 */
/* ginga：上辺が上から270px */
.topHero .heroImg--ginga{
  top: 25px;      /* ★指定 */
  right: 50%;
  left: auto;
  z-index: 1;
}

/* merosu：gingaより150px下（= 420px） */
.topHero .heroImg--merosu{
  top: 175px;      /* ★270 + 150 */
  left: calc(50% - 65px);
  z-index: 2;
}

/* 右の縦タイトル枠（115×910、右余白123.5、navから100px下） */
.topHero .heroTitleBar{
  position: absolute;
  right: 123.5px;
  top: 0px;                    /* メニューから100px（navがtop=50なので、厳密には差分で調整可） */
  width: 115px;
  height: 760px;
  border: var(--border) solid #000;
  background:#fff;
  display:flex;
  justify-content:center;
  align-items:center;
}

/* 縦タイトル文字（96px） */
.topHero .heroTitleText{
  font-size: 80px;               /* 指示 */
  line-height: 1;
  writing-mode: vertical-rl;
  text-orientation: upright;
  /* 枠内に収めるため、はみ出す場合は縮小（保険） */
  max-height: 100%;
}

/* ===== Top page nav styling (black, underline only Top) ===== */
.topPage .nav a{
  color: #000 !important;
  text-decoration: none !important;   /* 青リンクの下線も消す */
}

.topPage .nav a:visited{
  color: #000 !important;
}

.topPage .nav a:hover{
  color: #000 !important;
}

/* 下線は is-active のみ（TopページではTopだけに is-active を付ける） */
.topPage .nav-link{
  border-bottom: var(--border) solid transparent;
}
.topPage .nav-link.is-active{
  border-bottom-color: #000;
}

/* ========== 目次枠（1200×800） ========== */
.tocArea{
  position: relative;
  width: 1200px;   /* 指示 */
  height: 800px;   /* 指示 */
  margin: 0 auto;  /* 水平中央 */
  border: var(--border) solid #000;
  background: #fff;
}

/* 目次ラベル（150×60、左上：左右とも60の余白） */
.tocLabel{
  position: absolute;
  left: 60px;      /* 水色 60 */
  top: -30px;      /* 枠線に被せる（高さ60の半分） */
  width: 150px;    /* 水色 150 */
  height: 60px;    /* 水色 60 */
  border: var(--border) solid #000;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px; /* 目次はこのサイズでOK。必要なら21に変更 */
}

/* 目次カード共通（294×416） */
.tocCard{
  position: absolute;
  width: 294px;   /* 指示 */
  height: 416px;  /* 指示 */
  border: var(--border) solid #000;
  background: #fff;

  writing-mode: vertical-rl;
  text-orientation: upright;

  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 36px; /* カード内は36 */
  transition: transform 120ms ease;
  transform: scale(1);
}
.tocCard:hover{ transform: scale(1.03); }
.tocCard:disabled{
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

/* 中間レイヤー：中央配置（上から180） */
.tocCard--center{
  left: calc(50% - 294px/2);
  top: 180px;          /* 水色 180 */
  z-index: 2;          /* 中間レイヤー */
}

/* 上レイヤー（右）：中心カード右辺に25px重なり、さらに35px下 */
.tocCard--right{
  left: calc(50% - 294px/2 + 294px - 25px); /* ★右辺から25重なり */
  top: calc(180px + 35px);                  /* ★35下げ */
  z-index: 3;                               /* 上レイヤー */
}

/* 下レイヤー（左）：中心カード左辺に25px重なり、さらに70px下 */
.tocCard--left{
  left: calc(50% - 294px/2 - (294px - 25px)); /* ★左辺から25重なり */
  top: calc(180px + 70px);                    /* ★70下げ */
  z-index: 1;                                 /* 下レイヤー */
}

/* =======================
   Top: Research (exact)
   ======================= */

/* 外側の囲い：1200×800 */
.researchArea{
  width: 1200px;
  height: 800px;
  margin: 100px auto 0; /* ここは前後関係で後で調整可 */
  position: relative;
}

.researchOuter{
  position: relative;
  width: 1200px;
  height: 800px;
  border: var(--border) solid #000;
  background: #fff;
}

/* 「研究について」ラベル：左辺から-60px */
.researchTitle{
  position: absolute;
  left: -60px;     /* 指定：左辺から60px左 */
  top: -30px;      /* ★枠線に被せる（高さ60相当の半分） */
  border: var(--border) solid #000;
  background: #fff;
  padding: 8px 16px;
  font-size: 36px;
  z-index: 5;
}

/* 見出し枠（936×190） */
.researchHeadlineWrap{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100px;     /* ここは現状維持 */
  width: 936px;
  height: 190px;
}

/* 「研究内容」ラベル：左辺から-60px（同様） */
.researchSubTitle{
  position: absolute;
  left: -60px;
  border: var(--border) solid #000;
  background: #fff;
  padding: 6px 12px;
  font-size: 36px;
}
.researchSubTitle--content{
  top: 0px;
}

/* 見出しテキスト枠：936×190（線あり） */
.researchHeadline{
  position: absolute;
  left: 0px;
  top: 0px;
  width: 936px;
  height: 190px;
  border: var(--border) solid #000;
  background: #fff;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size: 36px;
}

/* 説明枠（936×380）：見出し枠から 68.5px 下 */
.researchDescWrap{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100px + 190px + 68.5px); /* 現状維持 */
  width: 936px;
  height: 380px;
  border: var(--border) solid #000;
  background: #fff;
}

/* 「研究対象」ラベル：左辺から-60px（同様） */
.researchSubTitle{
  position: absolute;
  left: -60px;  /* 枠の左辺から60px左 */
  border: var(--border) solid #000;
  background: #fff;
  padding: 6px 12px;
  font-size: 36px;
  z-index: 5;
}
/* buntai-imi.png：説明枠の左辺から125px（＝left:125）・上から45px下。線なし */
.researchImi{
  position: absolute;
  left: 125px;
  top: 45px;
  width: var(--imi-w);   /* ★変数 */
  height: 190px;         /* ここは仮のまま（指定が無いので） */
  object-fit: contain;
  border: none;
}

/* teigi.png：imiの右辺 + 125px に left を置く。説明枠の下辺から20px上に bottom を置く。線なし */
.researchTeigi{
  position: absolute;

  /* imiの右辺 + 125px */
  left: calc(125px + var(--imi-w) + 125px);

  /* 研究説明枠（researchDescWrap）の下辺から20px上に下端 */
  bottom: 20px;

  width: 250px;          /* ★指定 */
  height: 420px;         /* ★指定 */
  object-fit: contain;
  border: none;

  /* 枠外に出ても表示する（念のため） */
  overflow: visible;
}

/* 説明文（21px）：線なし／位置は枠内下部 */
.researchBodyText{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 30px;
  width: 650px;      /* 好みで調整 */
  font-size: 21px;
  line-height: 1.6;
}
:root{
  --imi-w: 450px; /* ★暫定。必要ならここだけ変える */
}
/* 研究について：右へ120px */
.researchTitle{
  transform: translateX(120px);
}

/* 研究内容：右へ120px、上へ30px */
.researchSubTitle--content{
  transform: translate(120px, -30px);
}

/* 研究対象：右へ120px、上へ30px */
.researchSubTitle--target{
  transform: translate(120px, -30px);
}

/* ===== nav link reset (prevent blue + double underline) ===== */
.nav a.nav-link,
.nav a.nav-link:visited,
.nav a.nav-link:hover,
.nav a.nav-link:active{
  color: #000;
  text-decoration: none;   /* 既定の下線を消す */
}

/* is-active の下線は border-bottom のみで表現 */
.nav .nav-link{
  border-bottom: var(--border) solid transparent;
  padding-bottom: 6px;     /* 既存の見た目維持 */
}
.nav .nav-link.is-active{
  border-bottom-color: #000;
}

/* =======================
   Top: Comma section (title + frame)
   ======================= */

/* 読点ブロック全体：研究について外枠(1200×800)の下から130px */
.commaArea{
  width: 1200px;
  height: 800px;
  margin: 130px auto 0; /* 指定：研究について外枠の下辺から130px下 */
  position: relative;
}

/* 外枠（1200×800） */
.commaOuter{
  position: relative;
  width: 1200px;
  height: 800px;
  border: var(--border) solid #000;
  background: #fff;
}

/* タイトル画像（115×200）
   外枠上辺が「画像の中心高さ」に来る → 画像上辺 = -100px
   左：外枠左辺から60px
*/
.commaTitleImg{
  position: absolute;
  left: 60px;     /* 指定 */
  top: -60px;    /* ★外枠上辺が画像の中心に来る */
  width: 200px;   /* 指定 */
  height: 115px;  /* 指定 */
  border: var(--border) solid #000; /* 指示：黒線で囲う */
  background:#fff;
  overflow:hidden;
  z-index: 2;
}
.commaTitleImg img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

/* 「読点」ラベル（100×60）
   画像右上から：右に30、上に30
   → left = 60 + 115 + 30
   → top  = -100 - 30
*/
.commaLabel{
  position: absolute;
  left: calc(60px + 115px + 20px);
  top: calc(-100px + 10px);
  width: 100px;  /* 指定 */
  height: 60px;  /* 指定 */
  border: var(--border) solid #000;
  background:#fff;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size: 36px; /* 指定 */
  z-index: 3;      /* 上レイヤー */
}

/* =======================
   Top: Comma section inner
   ======================= */

/* 左右の図（共通） */
.commaFig{
  position: absolute;
  border: var(--border) solid #000; /* 線3px */
  background:#fff;
  overflow:hidden;
}
.commaFig img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
}

/* 左図：550×450 / top=150 / left=50 */
.commaFig--left{
  width: 550px;
  height: 450px;
  left: 50px;
  top: 150px;
}

/* 右図：450×450 / top=150 / left=左図右+80 */
.commaFig--right{
  width: 450px;
  height: 450px;
  left: calc(50px + 550px + 80px);
  top: 150px;
}

/* 図の上に被せるタグ（高さ60、文字サイズ36、幅は内容に合わせる） */
.commaFigTag{
  position: absolute;
  height: 60px;
  border: var(--border) solid #000;
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0 18px;   /* 横幅は文字数に合わせる＝paddingで調整 */
  font-size: 36px;
  z-index: 5;
  white-space: nowrap;
}

/* 左タグ：画像上辺とタグ中心一致 → top = 150 - 30 = 120
   left = 画像左 + 60 = 110
*/
.commaFigTag--left{
  left: calc(50px + 60px);
  top: calc(150px - 30px);
}

/* 右タグ：画像左 + 60 / top同様 */
.commaFigTag--right{
  left: calc((50px + 550px + 80px) + 60px);
  top: calc(150px - 30px);
}

/* 下の本文（21px）
   画像下に配置：top = 150 + 450 + 40 くらいから開始（画像の見た目に合わせて調整）
*/
.commaBodyText{
  position: absolute;
  left: 60px;
  right: 60px;
  top: calc(150px + 450px + 10px);
  font-size: 21px;
  line-height: 1.6;
}

/* =======================
   DEP (係り受け) section
   ======================= */

/* セクション：読点の下から150px */
.depArea{
  width: 1200px;
  margin: 150px auto 0;
  position: relative;
}

/* 外枠：1200×1200（拡張で+350） */
.depOuter{
  width: 1200px;
  height: 1650px;             /* 縮小状態 */
  position: relative;
  border: var(--border) solid #000;
  background:#fff;

  /* 可変ボックス高さを変数で管理（縮小=350 / 拡張=700） */
  --depbox-h: 350px;
}
.depOuter.is-expanded{
  height: 2000px;             /* 拡張状態 */
  --depbox-h: 700px;
}


/* タイトル：横は文字数に追従、高さ115、文字96
   外枠上辺が長方形中心に重なる → top=-57.5
   左辺は外枠から-60
*/
.depTitle{
  position: absolute;
  left: 60px;
  top: -57.5px;
  height: 115px;
  border: var(--border) solid #000;
  background: #fff;

  font-size: 96px;       /* 指定 */
  line-height: 1;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  z-index: 5;
}

/* 可変ボックス：1075×700（拡張で+350）
   外枠上辺から130
   左右中央寄せ（要求仕様）
*/
.depBox{
  position: absolute;
  top: 130px;
  width: 1075px;
  height: 350px;          /* ★ 700 → 350 */
  border: var(--border) solid #000;
  background:#fff;

  left: 50%;
  transform: translateX(-50%);
}

.depBox.is-expanded{
  height: 700px;          /* ★ 1050 → 700（350 + 350） */
}

/* ボックスタグ：高さ60 / 文字36 / 幅は文字数に追従
   （要求：タイトル表記/＋以外は左右中央）
   ボックス上辺に中心を合わせる → top=-30
*/
.depBoxTag{
  position: absolute;
  top: -30px;
  height: 60px;
  border: var(--border) solid #000;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-size: 36px;
  white-space: nowrap;
  z-index: 6;

  /* 右寄せ：ボックス右端に揃える（必要なら微調整） */
  left: auto;
  transform: none;
  right: 725px;
}

/* 画像：ボックス上辺から40 / 1000×275 / 線なし
   （要求：左右中央）
*/
.depKakariImg{
  position: absolute;
  top: 40px;
  width: 1000px;
  height: 275px;
  object-fit: contain;
  border: none;

  left: 50%;
  transform: translateX(-50%);
}

/* ＋ボタン：50×50
   ボックス下辺と中心合わせ → bottom=-25
   右端から25内側（外枠基準）→ depBox基準で計算
   ※ここだけ中央揃えの対象外（要求仕様）
*/
.depExpandBtn{
  position: absolute;
  bottom: -25px;
  width: 50px;
  height: 50px;

  /* depBox(1075)は外枠(1200)中央。外枠右端までの余白は (1200-1075)/2=62.5
     外枠右端から25内側 → depBox右端から (62.5-25)=37.5 外側へ出す
  */
  right: 25px;

  border: var(--border) solid #000;
  background: #fff;
  font-size: 36px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 7;
}

.depKakari2Frame,
.depExplainBox{
  display: none; /* 縮小は非表示 */
}

.depBox.is-expanded .depKakari2Frame,
.depBox.is-expanded .depExplainBox{
  display: block; /* 拡張で表示 */
}
.depKakari2Frame{
  position: absolute;
  width: 550px;
  height: 225px;
  border: var(--border) solid #000;
  background:#fff;
  overflow:hidden;

  /* 右辺 = 中心線 + 50px */
  left: calc(50% + 50px - 550px);

  /* kakariuke1の下(40+275=315) + 35 = 350 */
  top: calc(40px + 275px + 35px);
  z-index: 3;
}

.depKakari2Img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

.depExplainBox{
  position: absolute;
  width: 500px;
  height: 275px;
  border: var(--border) solid #000;
  background:#fff;

  left: 50%; /* 左辺が中心線に接する */
  top: calc((40px + 275px + 35px) + 35px); /* kakariuke2の上辺 + 35 */

  font-size: 21px;
  line-height: 1.2;
  padding: 18px;
   /* ★中央配置 */
  display: flex;
  align-items: center;      /* 縦中央 */
  justify-content: center;  /* 横中央 */
  text-align: left; 

  z-index: 2; /* kakariuke2の下 */
  overflow: hidden; /* 指定が無いので、枠外は切る */
}

.depExplainBox{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 0;
}

.depExplainInner{
  text-align: left;  /* 左揃えのまま */
}

/* 縮小時は必ず非表示 */
.depExplainBox{
  display: none !important; /* ★縮小時に確実に隠す */
}

/* 拡張時だけ表示＋中央寄せ */
.depBox.is-expanded .depExplainBox{
  display: flex !important;      /* ★ここで表示 */
  align-items: center;           /* 縦中央 */
  justify-content: center;       /* 横中央 */
  text-align: left;              /* 行自体は左揃えのまま（必要ならcenter） */
}

/* depExplainBox 自体の見た目（display以外） */
.depExplainBox{
  position: absolute;
  width: 500px;
  height: 275px;
  border: var(--border) solid #000;
  background:#fff;

  left: 50%;
  top: calc((40px + 275px + 35px) + 35px);

  font-size: 21px;
  line-height: 1.2;

  padding: 0;        /* 中央寄せ運用なので0推奨 */
  z-index: 2;
  overflow: hidden;
}

/* =======================
   DEP MOD (二、修飾に基づく配置)
   ======================= */

/* depOuterで --depbox-h を持っている前提（縮小=350 / 拡張=700） */
.depModBox{
  position: absolute;
  width: 1075px;
  height: 800px;
  border: var(--border) solid #000;
  background:#fff;

  /* depBox(top=130)の下に100 */
  top: calc(130px + var(--depbox-h) + 100px);

  left: 50%;
  transform: translateX(-50%);
}

/* 見出しタグ */
.depModTag{
  position: absolute;
  left: 60px;
  top: -30px;              /* 高さ60の中心がボックス上辺 */
  height: 60px;
  border: var(--border) solid #000;
  background:#fff;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0 18px;
  font-size: 36px;
  white-space: nowrap;
  z-index: 5;
}

/* 画像枠：400×300（確定） */
.depModImg{
  position: absolute;
  width: 400px;
  height: 300px;
  border: var(--border) solid #000;
  background:#fff;
  overflow:hidden;
  box-sizing: border-box;
}
.depModImg img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

/* 上段：上辺=75 */
.depModImg--3,
.depModImg--4{
  top: 75px;
}

/* 下段：上段の下辺(75+300=375) + 75 = 450 */
.depModImg--5,
.depModImg--6{
  top: 450px;
}

/* 中央線は depModBox の 50% */
/* kakariuke3/6：右辺 = 中央+37.5 → left = 50% + 37.5 - 400 */
.depModImg--3,
.depModImg--6{
  left: calc(50% + 37.5px - 400px);
}

/* kakariuke4/5：左辺 = 中央-37.5 → left = 50% - 37.5 */
.depModImg--4,
.depModImg--5{
  left: calc(50% - 37.5px);
}
/* 横の隙間 = 75px を保証（各画像400px） */
.depModImg--3,
.depModImg--6{
  left: calc(50% - 37.5px - 400px); /* 左画像 */
}

.depModImg--4,
.depModImg--5{
  left: calc(50% + 37.5px);         /* 右画像 */
}

.depModBodyText{
  position: absolute;

  /* depModBox の下に配置（topは depModBoxのtop + 800 + 80） */
  top: calc((130px + var(--depbox-h) + 100px) + 800px + 50px);

  left: 60px;
  right: 60px;

  font-size: 21px;
  line-height: 1.7;
}
/* ===== modal vertical text overflow fix ===== */

/* 右カラム：横スクロールのみ、縦は切らない（= 親が高さを持つ前提） */
.modal__right{
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  display: block;
}

/* 余計なラッパがクリップしているケースを潰す */
.modal__textWrap{
  height: 100%;
  overflow: visible;   /* ★ここが hidden だと上下が切れる */
}

/* 本文：縦書き。縦方向（height）はパネルに合わせる */
.modal__text{
  writing-mode: vertical-rl;
  text-orientation: mixed;

  height: 100%;         /* ★上下をパネル内に収める */
  width: max-content;   /* 横に伸びてスクロール */
  overflow: visible;

  line-height: 1.4;     /* 以前の値のままでOK */
  letter-spacing: 0.04em;
}

.work-card{
  position: relative; /* 念のため */
}

#workTitle{
  position: absolute;
  inset: 0;                 /* 正方形いっぱいを“測定箱”にする */
  display: flex;
  align-items: center;       /* 中央 */
  justify-content: center;   /* 中央 */
  writing-mode: vertical-rl;
  text-orientation: upright;
  text-align: center;
  overflow: hidden;
}