/* =========================================================
   画面内の操作の見た目（templates/_ui.html と public/js/main.js に対応）
   色・ボタンは style.css の変数と .btn をそのまま使う
   ========================================================= */

/* ---------- 募集状況の印（エントリー表・応募シート） ---------- */
.status {
  display: inline-block;
  padding: 1px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}
.status--closed { border-color: var(--ink-sub); background: #eeeeee; color: var(--ink-sub); }

/* ---------- 無効のボタン（募集終了） ---------- */
.btn[disabled] { background: #eeeeee; color: var(--ink-sub); cursor: not-allowed; justify-content: center; padding: 10px 18px; min-height: 42px; border: 0; font: inherit; font-weight: 700; font-size: 14px; }
.btn[disabled]:hover { opacity: 1; }

/* ---------- 応募シート ---------- */
.sheet {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}
.sheet::backdrop { background: rgba(0, 0, 0, .55); }
.sheet__inner { padding: 24px 28px 28px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sheet__title { font-size: 20px; font-weight: 700; }
.sheet__close {
  flex: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}
.sheet__close span::before,
.sheet__close span::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 2px;
  background: var(--ink);
  transform: rotate(45deg);
}
.sheet__close span::after { transform: rotate(-45deg); }
.sheet__note { margin-top: 8px; font-size: 13px; color: var(--ink-sub); }
.sheet__course { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.sheet__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 16px; font-weight: 700; line-height: 1.5; }
.sheet__meta { font-size: 13px; color: var(--ink-sub); }
.sheet__offices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }

/* ---------- 画面下の応募バー（スマホのみ） ---------- */
.apply-bar { display: none; }

@media (max-width: 768px) {
  /* シートは画面下から出す */
  .sheet {
    width: 100%;
    max-width: none;
    max-height: 85vh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
  }
  .sheet__inner { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .sheet[open] { animation: sheet-up .25s ease-out; }

  .apply-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform .25s ease-out, visibility .25s;
  }
  .apply-bar[hidden] { display: none; }
  .apply-bar.is-shown { transform: none; visibility: visible; }
  .apply-bar .btn { padding-top: 6px; padding-bottom: 6px; }
  .apply-bar .btn__icon { width: 34px; height: 34px; }
  /* フッターの最後の文字がバーに隠れないように */
  .has-apply-bar body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

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

@media (prefers-reduced-motion: reduce) {
  .apply-bar { transition: none; }
  .sheet[open] { animation: none; }
}

/* ---------- PCの目次：子のある項目の開閉ボタン（templates/base.html の .nav__toggle、public/js/main.js） ---------- */
/* ボタンの見た目をリンクにそろえる */
.nav__toggle { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.nav__toggle--label { font-size: var(--fs-small); font-weight: 700; padding: 0 14px; }
@media (min-width: 1361px) {
  /* 親がリンクの項目：▼はリンクから外して、横のボタンに付ける */
  .has-sub > a.nav__link { padding-right: 4px; }
  .has-sub > a.nav__link::after { display: none; }
  .nav__toggle:not(.nav__toggle--label) { display: flex; align-items: center; justify-content: center; align-self: stretch; width: 28px; margin-right: 6px; }
  .nav__toggle:not(.nav__toggle--label)::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
  .nav__toggle:hover { color: var(--accent-light); }
  .nav__toggle[aria-expanded="true"]:not(.nav__toggle--label)::after { transform: translateY(2px) rotate(-135deg); }
  /* フォーカスしただけでは開かない（開くのはボタン）。マウスはカーソルを置けば開く。Escape で閉じたら、カーソルが離れるまで閉じたまま */
  .header__nav.has-toggle .has-sub:not(.is-open):focus-within > .nav__sub,
  .header__nav.has-toggle .has-sub.is-dismissed:not(.is-open) > .nav__sub { visibility: hidden; opacity: 0; transform: translateY(-4px); }
  .header__nav.has-toggle .has-sub:not(.is-dismissed):hover > .nav__sub,
  .header__nav.has-toggle .has-sub.is-open > .nav__sub { visibility: visible; opacity: 1; transform: none; }
}
@media (max-width: 1360px) {
  /* ≡のメニューでは子の項目は最初から開いているので、横のボタンは出さない。名前がボタンの項目（関連書籍）は見出しとして見せる */
  .nav__toggle:not(.nav__toggle--label) { display: none; }
  .nav__toggle--label { width: 100%; padding: 16px 0; font-size: var(--fs-body); text-align: left; cursor: default; }
}

/* ---------- スマホ用メニュー（public/js/main.js の setMenu） ---------- */
/* 開いている間は ≡ を × にする */
.header__menu span { transition: transform .2s, opacity .2s; }
.header__menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header__menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* 裏の画面をスクロールさせない。画面下の応募バーは隠す */
html.is-menu-open, html.is-menu-open body { overflow: hidden; }
html.is-menu-open .apply-bar { display: none; }
@media (prefers-reduced-motion: reduce) { .header__menu span, .nav__sub { transition: none; } }

/* ---------- 図の順番の遅れ（templates/figures/。CSP で style="" が使えないので、クラスで --d・--i を渡す） ---------- */
.nbs-seg__dot.is-d0 { --d: 0; }
.nbs-seg__dot.is-d1 { --d: 1; }
.nbs-seg__dot.is-d2 { --d: 2; }
.nbs-seg__dot.is-d3 { --d: 3; }
.is-i0:is(.nb-check__step, .nb-check__arrow, .nb-define__q) { --i: 0; }
.is-i1:is(.nb-check__step, .nb-check__arrow, .nb-define__q) { --i: 1; }
.is-i2:is(.nb-check__step, .nb-check__arrow, .nb-define__q) { --i: 2; }
.is-i3:is(.nb-check__step, .nb-check__arrow, .nb-define__q) { --i: 3; }

/* ---------- パンくず・フッターのリンク：押せる高さを24px以上に ---------- */
.breadcrumb a,
.footer__cols a { display: inline-flex; align-items: center; min-height: 24px; }

/* フッター：スマホの2列で、長いリンク名が隣の列にかぶらないように（2026-10-30） */
.footer__cols > li { min-width: 0; }
.footer__cols a { max-width: 100%; overflow-wrap: anywhere; }

/* ---------- 改行（2026-11-02 表示点検）。文字は変えない ---------- */
/* よくある質問・記事内リンク・アルファドライブの数字欄：語の途中で折らない */
summary:not(.ts-what *, .ts-nbs *), .feature-link span:not(.ts-what *, .ts-nbs *), dt:not(.ts-nbs *), .office-map__caption, .campus-map__caption { word-break: auto-phrase; text-wrap: balance; }
figcaption:not(.ts-nbs *) { word-break: auto-phrase; }
/* word-break: auto-phrase が効かないブラウザ（iPhone の Safari など）：build.py の phrase_breaks が入れた <wbr> だけで折る */
@supports not (word-break: auto-phrase) {
  :is(h1, h2, h3, h4, summary, dt, th, figcaption, .feature-link span, .explainer__link .btn span, .ts-prose__item strong):not(.ts-what *, .ts-nbs *) { word-break: keep-all; overflow-wrap: break-word; }
}
/* 関東・関西のキャンパス表：番号だけの行を作らない（番号は左に置き、大学名は番号の右で折る）。キャンパス名は語の途中で折らない */
.campus-table tbody td { word-break: keep-all; overflow-wrap: normal; }
@media (max-width: 760px) {
  .campus-time .campus-table tbody th[scope="rowgroup"] { position: relative; padding-left: 23px; }
  .campus-time .campus-table tbody th[scope="rowgroup"] .campus-table__num { position: absolute; left: 4px; top: 6px; margin-right: 0; }
}

/* ---------- 100%表示で詰める（2026-11-02）：メニューと見出しを小さくし、上下の余白を約2/3に。style.css は変えず、ここで上書きする。ページ別CSSの固定値はそれぞれのファイルで合わせた ---------- */
:root {
  --fs-h2: clamp(26px, 3vw, 32px);
  --fs-h3: clamp(18px, 1.6vw, 20px);
  --section-space: 60px;
}
.head { margin-bottom: 28px; }
.breadcrumb { padding-top: 16px; }
.breadcrumb + .section { padding-top: 32px; }
.siblings { padding: 32px 0; }
.next-read { padding: 40px 0; }
.footer__inner { padding-top: 40px; padding-bottom: 40px; }
.figure { margin: 28px 0 8px; }
.explainer__hero { padding: 0 0 48px; }
.explainer__hero-inner { padding-top: 32px; }
.explainer__hero--short { padding-bottom: 44px; }
.explainer__hero--short .explainer__hero-inner { padding-top: 36px; }
.explainer__hero--light { padding-bottom: 52px; }
.explainer__hero--light .explainer__hero-inner { padding-top: 36px; }
.explainer__herofig { margin: 32px 0 0; }
.explainer__block { padding: 64px 0; }
.explainer__flow { margin-top: 32px; }
.explainer__rows { margin-top: 32px; }
.explainer__list { margin-top: 28px; }
.explainer__pair { margin-top: 28px; }
.walls { margin-top: 32px; }
.walls__item { gap: 44px; padding: 44px 0; }
.wmeth { gap: 48px; }
.wmeth__note { margin-top: 32px; }
.voice-pager { padding-top: 28px; padding-bottom: 52px; }
.voices-career__flow { margin-top: 28px; }
.voices-career__sub { margin-top: 48px; }
.voices-career__staff { margin-top: 28px; }
.work-top { padding-bottom: 68px; }
@media (min-width: 769px) {
  :root { --header-height: 72px; --fs-display: clamp(34px, 3.6vw, 44px); }
  .work-top__title { font-size: clamp(30px, 3.6vw, 44px); }
  .explainer__title { font-size: clamp(34px, 5vw, 44px); }
  .explainer__hero-inner.has-art .explainer__title { font-size: clamp(32px, 3.8vw, 44px); }
  .explainer__hero--short .explainer__title { font-size: clamp(30px, 4.2vw, 44px); }
  .explainer__hero--light .explainer__title { font-size: clamp(30px, 4.2vw, 44px); }
  .explainer__hero--light .explainer__hero-inner.has-art .explainer__title { font-size: clamp(28px, 3.4vw, 44px); }
  .event__title { font-size: var(--fs-h2); }
  .wmeth__title { font-size: clamp(22px, 2.2vw, 24px); }
  .wcase__num { font-size: clamp(44px, 4.4vw, 60px); }
}
@media (max-width: 768px) {
  :root { --section-space: 44px; }
  .breadcrumb { padding-top: 12px; }
  .breadcrumb + .section { padding-top: 24px; }
  .head { margin-bottom: 24px; }
  .siblings { padding: 28px 0; }
  .next-read { padding: 32px 0; }
  .footer__inner { row-gap: 32px; padding-top: 36px; padding-bottom: 36px; }
  .explainer__hero, .explainer__hero--short { padding-bottom: 36px; }
  .explainer__hero-inner, .explainer__hero--short .explainer__hero-inner, .explainer__hero--light .explainer__hero-inner { padding-top: 24px; }
  .explainer__hero--light { padding-bottom: 40px; }
  .explainer__block { padding: 44px 0; }
  .walls__item { gap: 24px; padding: 32px 0; }
  .wmeth { gap: 40px; }
  .voice-pager { padding-bottom: 40px; }
  .voices-career__sub { margin-top: 40px; }
  .work-top { padding-bottom: 44px; }
  .vl-list { padding-bottom: 44px; }
}
