/* ==============================================================
   株式会社ウェルスペック コーポレートサイト（F案 エディトリアル）
   base.css — 全ページ共通
     トークン / リセット / ヘッダー / ボタン / 問い合わせパネル /
     フッター / 追従CTA / モーション
   ページ固有のスタイルは top.css（トップ）と sub.css（下層）に置く。
   ============================================================== */

:root {
  --logo: url("/assets/img/logo.png");

  --ink:      #17150f;
  --ink-2:    #4a463c;
  --ink-3:    #7d786c;
  --line:     #ded8cc;
  --paper:    #f7f5f0;
  --band:     #eeeae0;
  --cta:      #c2440f;
  --cta-dark: #9c360b;
  --cta-soft: #ffb27a;

  --jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --en: "Archivo", "Noto Sans JP", system-ui, sans-serif;

  --gutter: clamp(18px, 4vw, 64px);
  --maxw: 1300px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--jp);
  font-size: 15.5px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;

  /* 禁則処理。行頭に 、。や小書き文字が来ないようにする */
  line-break: strict;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cta); outline-offset: 3px; }

/* 見出しや短い文は文節の途中で折り返さない（「大阪・東／京」のような切れ方を防ぐ）。
   html に lang="ja" が必要。対応していないブラウザでは従来どおりの折り返しになる。 */
h1, h2, h3, h4, dt, a, .t { word-break: auto-phrase; }

/* 本文（段落・箇条書き）は両端をそろえる。日本語の本文組みの標準的な形で、
   新聞や書籍と同じく「行はどこで折ってもよい代わりに、右端をそろえる」。

   本文に auto-phrase を使わないのは、行が文節の切れ目で早めに終わるため。
   左揃えだと右端がばらばらになり、両端そろえと併せると足りないぶんが
   字間に配られて「こ れ ま で 会 社 の」のように伸びてしまう。
   見出しや数行のリード文では、そもそも行が短いのでこの問題が出ない。

   切らせたくない語はこれまでどおり .nobr で括る。 */
p, li, dd { word-break: normal; text-align: justify; }

/* ただし .nobr（折り返しを禁じた語）を含む段落は左そろえに戻す。
   切れない塊があると行がそこで早めに終わり、足りないぶんが字間に配られて
   「要 件 定 義 か ら 開 発」のように伸びるため。
   :has() に対応していないブラウザでは両端そろえのままになる。 */
p:has(.nobr), li:has(.nobr), dd:has(.nobr) { text-align: left; }

/* auto-phrase は中黒（・）での分割までは止められず、Chromium 以外では効かない。
   割れてほしくない語句は .nobr で明示的に括る（<br> で固定すると幅が変わったとき
   別の場所で崩れるため使わない）。 */
.nobr { white-space: nowrap; }

/* 電話をかけられない環境では、電話番号をリンクとして扱わない。
   ふだんは site.js が <a> を文字に置き換えるが、JavaScript が動かない
   場合の備えとしてここでも押せないようにしておく。
   （デスクトップの Chrome は tel: を Google のページへ渡すことがあり、
     押した人が知らないページへ飛んでしまうため） */
@media (hover: hover) and (pointer: fine) {
  a[href^="tel:"] { pointer-events: none; color: inherit; text-decoration: none; cursor: text; }
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

[id] { scroll-margin-top: 96px; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; font-size: 13px; font-weight: 700; text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 8px; }

/* ---------- header ---------- */

header.site { position: sticky; top: 0; z-index: 60; background: rgba(247,245,240,.92); backdrop-filter: blur(12px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; border-bottom: 1px solid var(--ink); }

.logo { display: block; width: 92px; height: 44px; background: var(--logo) center / 290% auto no-repeat; flex: none; text-indent: -9999px; overflow: hidden; }

/* ナビが入りきらない幅では横スクロールする。スクロールできることが分かるよう、
   右端にぼかしと矢印を出し、端まで動かすと消す（制御は site.js）。 */
.gnav-wrap { position: relative; display: flex; min-width: 0; }
.gnav-wrap::after {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 46px; pointer-events: none;
  background: linear-gradient(to right, rgba(247,245,240,0), rgba(247,245,240,.96) 62%);
  opacity: 0; transition: opacity .25s;
}
.gnav-hint {
  position: absolute; right: 8px; top: 50%; z-index: 1; transform: translateY(-50%);
  pointer-events: none; opacity: 0; transition: opacity .25s;
  font-family: var(--en); font-size: 17px; font-weight: 700; line-height: 1; color: var(--cta);
}
.gnav-wrap.can-scroll::after,
.gnav-wrap.can-scroll .gnav-hint { opacity: 1; }
.gnav-wrap.can-scroll .gnav-hint { animation: navHint 1.5s ease-in-out 3; }
@keyframes navHint { 0%, 100% { transform: translate(0, -50%); } 50% { transform: translate(5px, -50%); } }

.gnav { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 24px); min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 12px; padding-right: 8px; }
.gnav::-webkit-scrollbar { display: none; }

.gnav a.link { font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.gnav a.link:hover,
.gnav a.link[aria-current="page"] { border-bottom-color: var(--cta); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px;
  font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--ink); border-radius: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.btn::after { content: "→"; font-family: var(--en); }
.btn.solid { background: var(--cta); border-color: var(--cta); color: #fff; }
.btn.solid:hover { background: var(--cta-dark); border-color: var(--cta-dark); }
.btn:not(.solid):hover { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 8px 16px; font-size: 12px; }
.btn.back::after { content: ""; }
.btn.back::before { content: "←"; font-family: var(--en); }

/* ---------- チップ（事例の拠点・状態など） ---------- */

.chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1; padding: 5px 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.chip.live { border-color: var(--cta); color: var(--cta); }
.chip.done { border-color: var(--ink-3); color: var(--ink-2); }

/* ---------- 問い合わせ／採用パネル（全ページ末尾） ---------- */

.end { border-top: 2px solid var(--ink); padding-block: clamp(44px, 6vw, 84px); }
.end .dual { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.end .panel { background: var(--paper); padding: clamp(24px, 3vw, 38px); display: flex; flex-direction: column; gap: 12px; }
.end .panel.primary { background: var(--ink); color: var(--paper); }
.end .panel.primary p { color: #c9c3b6; }
.end .label { font-family: var(--en); font-size: 10.5px; font-weight: 700; letter-spacing: .2em; color: var(--cta); }
.end .panel.primary .label { color: var(--cta-soft); }
.end h2 { font-size: clamp(20px, 2.4vw, 27px); font-weight: 700; line-height: 1.5; margin: 0; text-wrap: balance; }
.end p { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.end a { align-self: flex-start; margin-top: auto; }
.end .panel.primary .btn:not(.solid) { border-color: var(--paper); color: var(--paper); }
.end .panel.primary .btn:not(.solid):hover { background: var(--paper); color: var(--ink); }

/* ---------- footer ---------- */

/* 上から「会社情報＋サイト内ナビ」「方針のリンク」「コピーライト」の3段。
   段ごとに細罫で区切り、詰まって見えないよう余白を大きめに取る。 */
footer.site { border-top: 2px solid var(--ink); background: var(--band); }

.foot-main {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(28px, 4vw, 64px);
  padding-block: clamp(36px, 4.5vw, 60px);
}

.foot-logo {
  display: block; width: 104px; height: 50px; margin-bottom: 18px;
  background: var(--logo) center / 290% auto no-repeat;
  text-indent: -9999px; overflow: hidden;
}

.foot-office { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-office > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 4px 14px; }
.foot-office dt { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); padding-top: 2px; }
.foot-office dd { margin: 0; font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.foot-office a { text-decoration: none; }
.foot-office a:hover { color: var(--cta); }

.foot-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: clamp(20px, 2.6vw, 36px); }
.foot-h {
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--ink-3);
}
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-nav a { font-size: 13.5px; text-decoration: none; border-bottom: 1px solid transparent; }
.foot-nav a:hover { color: var(--cta); border-bottom-color: var(--cta); }
.foot-nav .ext::after { content: "↗"; font-family: var(--en); font-size: 10.5px; margin-left: 5px; color: var(--ink-3); }

/* 方針のリンクとSNSを同じ段に置く（左: 方針 / 右: SNS） */
.foot-sub {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px clamp(24px, 3vw, 40px);
  padding: clamp(20px, 2.4vw, 28px) 0;
  border-top: 1px solid var(--line);
}
.foot-policy {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 3.4vw, 52px);
}
.foot-policy a {
  font-size: 13px; text-decoration: none; color: var(--ink-2);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.foot-policy a:hover { color: var(--cta); border-bottom-color: var(--cta); }

.foot-sns { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.foot-sns a {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); border-radius: 50%;
  transition: color .2s, background .2s, border-color .2s;
}
.foot-sns a:hover, .foot-sns a:focus-visible { color: #fff; background: var(--ink); border-color: var(--ink); }

.foot-bottom { background: var(--ink); color: var(--paper); padding-block: 14px; }
.foot-bottom .copy { font-family: var(--en); font-size: 12px; letter-spacing: .08em; }

@media (max-width: 860px) {
  .foot-main { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 720px) {
  .foot-sub { flex-direction: column; align-items: flex-start; }
  .foot-policy { gap: 12px 24px; }
  .foot-policy li { width: calc(50% - 12px); }
}
@media (max-width: 420px) {
  .foot-policy li { width: 100%; }
  .foot-office > div { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- スクロールで現れる要素 ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.shown { opacity: 1; transform: none; }
/* JSが動かない環境では最初から見せる */
html:not(.js-on) .reveal { opacity: 1 !important; transform: none !important; }

/* ---------- モーション ---------- */

@keyframes wsRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes wsPan  { from { background-position: 50% 38%; } to { background-position: 50% 56%; } }
@keyframes wsSlide { to { transform: translateX(-100%); } }

.ws-in { animation: wsRise .8s cubic-bezier(.2,.75,.25,1) both; }

.ws-line { display: block; overflow: hidden; }
.ws-line > span { display: block; animation: wsRise .9s cubic-bezier(.2,.75,.25,1) both; }

.ws-bar {
  position: fixed; left: 0; top: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--cta); z-index: 300; pointer-events: none;
}

.ws-pan { animation: wsPan 26s ease-in-out infinite alternate; }
.ws-count { font-variant-numeric: tabular-nums; }

/* ---------- 追従CTA（お問い合わせ／採用サイト） ----------
   ある程度スクロールしたら画面右端からスライドインする。
   問い合わせパネル（#contact）やフッターに差しかかったら引っ込める。 */

.ws-float {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 120;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.ws-float-in {
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(105%);
  transition: transform .5s cubic-bezier(.22, .61, .36, 1), opacity .34s ease, visibility .34s;
}
.ws-float.is-on .ws-float-in {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}
.ws-float-b {
  display: flex;
  align-items: center;
  gap: 12px;
  writing-mode: vertical-rl;
  min-height: 158px;
  padding: 24px 15px;
  border-radius: 8px 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(23,21,15,.18);
  transition: transform .28s cubic-bezier(.22, .61, .36, 1), background-color .28s ease, box-shadow .28s ease;
}
.ws-float-b .ws-float-ar {
  writing-mode: horizontal-tb;
  transform: rotate(90deg);
  font-size: 14px;
  line-height: 1;
  opacity: .9;
}
.ws-float-b:hover,
.ws-float-b:focus-visible {
  transform: translateX(-5px);
  box-shadow: 0 10px 30px rgba(23,21,15,.26);
}
.ws-float-b:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.ws-float-b.primary { background: var(--cta); color: #fff; }
.ws-float-b.primary:hover,
.ws-float-b.primary:focus-visible { background: var(--cta-dark); }
.ws-float-b.ghost {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-right: 0;
}
.ws-float-b.ghost:hover,
.ws-float-b.ghost:focus-visible { background: var(--band); }

/* スマートフォンでは画面下部の2分割バーに切り替える */
@media (max-width: 720px) {
  .ws-float { align-items: flex-end; inset: auto 0 0 0; }
  .ws-float-in {
    flex-direction: row;
    width: 100%;
    gap: 0;
    transform: translateY(100%);
    box-shadow: 0 -6px 24px rgba(23,21,15,.18);
  }
  .ws-float.is-on .ws-float-in { transform: translateY(0); }
  .ws-float-b {
    flex: 1;
    justify-content: center;
    writing-mode: horizontal-tb;
    min-height: 0;
    padding: 15px 8px;
    border-radius: 0;
    letter-spacing: .06em;
    box-shadow: none;
  }
  .ws-float-b .ws-float-ar { transform: none; font-size: 13px; }
  .ws-float-b.ghost { border: 0; }
  .ws-float-b:hover,
  .ws-float-b:focus-visible { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ws-in, .ws-line > span { animation: none !important; opacity: 1 !important; transform: none !important; }
  .ws-pan { animation: none !important; }
  .ws-bar { display: none; }
  .ws-float-in {
    transform: none !important;
    transition: opacity .01ms linear, visibility .01ms linear;
  }
  .ws-float-b { transition: background-color .01ms linear; }
  .ws-float-b:hover,
  .ws-float-b:focus-visible { transform: none; }
}

/* ---------- お知らせ（トップ・一覧・記事で共通） ---------- */

.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-list li { border-bottom: 1px solid var(--line); }
.news-list a {
  display: grid; align-items: baseline; gap: 4px 16px;
  /* 分類の列幅を固定して、タイトルの左端を揃える */
  grid-template-columns: max-content 132px minmax(0, 1fr);
  padding: clamp(14px, 1.8vw, 20px) 0; text-decoration: none; color: inherit;
}
.news-list a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.news-list time { font-family: var(--en); font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
.news-list .cat {
  justify-self: start;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1;
  padding: 5px 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); white-space: nowrap;
}
.news-list .t { font-size: 15px; font-weight: 700; line-height: 1.7; }
.news-empty { color: var(--ink-2); margin: 0; padding: 24px 0; border-block: 1px solid var(--line); }

/* 分類の絞り込み */
.news-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(18px, 2.4vw, 26px); }
.chip-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; line-height: 1;
  padding: 9px 13px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); text-decoration: none;
}
.chip-link b { font-family: var(--en); font-size: 11px; color: var(--ink-3); }
.chip-link:hover { border-color: var(--ink-3); }
.chip-link.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-link.on b { color: rgba(255,255,255,.72); }

@media (max-width: 640px) {
  .news-list a { grid-template-columns: max-content minmax(0, 1fr); }
  .news-list .t { grid-column: 1 / -1; }
}
