/*
Theme Name: sbcc
Description: sbcc 公式サイト用の最小テーマ
Version: 0.9.0
Text Domain: sbcc
Requires PHP: 8.0
*/

:root {
  /* 色 */
  --color-bg: #ffffff;
  --color-bg-alt: #f3f5f8;
  --color-hero-bg: #f7f6f4;
  --color-navy: #16233f;
  --color-gold: #b4863a;
  --color-gold-text: #8a6420;
  --color-text: var(--color-navy);
  --color-text-muted: rgba(22, 35, 63, 0.72);
  --color-line: rgba(22, 35, 63, 0.3);
  --color-line-soft: rgba(22, 35, 63, 0.25);
  --color-rule: rgba(22, 35, 63, 0.35);

  /* 余白・幅 */
  --content-max: 1200px;
  --page-x: clamp(20px, 4vw, 64px);

  /* 下層ページ(トップ以外)の幅。本文の列(見出し・段落・リスト・表・目次)は --content-width で中央に置く。
     2列のカードと区切り線は --content-wide。いまは本文幅と同じ(カードの左右の端を見出し・段落にそろえる)。
     カード・区切り線だけを本文の列より広げるときは、--content-wide に幅(以前は 1200px)を指定する */
  --content-width: 960px;
  --content-wide: var(--content-width);
  --anchor-offset: 24px;
  --label-gap: clamp(56px, 10vw, 160px);

  /* フォント */
  --font-serif: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  overflow-wrap: anywhere;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--color-gold);
  text-underline-offset: 4px;
}

:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 3px;
}

/* スキップリンク(フォーカス時だけ表示) */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--color-bg);
  color: var(--color-navy);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ボタン */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 14px 32px;
  border: 1px solid var(--color-navy);
  background: transparent;
  color: var(--color-navy);
  font: 500 14px/1.5 var(--font-serif);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.button:hover,
.button:focus-visible {
  background: var(--color-navy);
  color: var(--color-bg);
}

/* 本文中のテキストリンク */
.text-link {
  color: var(--color-navy);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* 中身だけを最大幅に収める共通枠 */
.site-header__catch,
.site-header__inner,
.section__inner,
.hero__inner,
.site-footer__inner {
  width: 100%;
  max-width: calc(var(--content-max) + (var(--page-x) * 2));
  margin-inline: auto;
  padding-inline: var(--page-x);
}

/* ヘッダー */
.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--color-line-soft);
  background: var(--color-bg);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding-block: 20px;
}

/* ヘッダーの上の帯:キャッチフレーズ(一般設定)。文字の左端はロゴと同じ(共通枠)。
   文ごとの span(inc/text.php の sbcc_sentences())を inline-block にして、幅が足りないときは文の切れ目で折り返す */
.site-header__bar {
  padding-block: 6px;
  background: var(--color-navy);
  color: var(--color-bg);
}

.site-header__catch {
  margin-block: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  word-break: auto-phrase;
}

.site-header__catch-sentence {
  display: inline-block;
}

/* ロゴと、その右の小さな文字(サイトのタイトルの「｜」より後ろ) */
.site-header__brand {
  display: flex;
  flex: none;
  align-items: baseline;
}

.site-header__logo {
  color: var(--color-navy);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-decoration: none;
}

.site-header__sub {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
}

/* サイトのタイトルの「｜」(見た目だけの区切り。aria-hidden)。ヘッダー・フッターとも、後ろの小さな文字と同じ大きさで、紺を薄くした色。
   全角の「｜」は字形の左右に約半角ずつの空きがあるので、負の margin で前後の見た目の余白を約 0.4em にそろえる */
.site-header__sep,
.site-footer__sep {
  margin-inline: -0.1em;
  color: rgba(22, 35, 63, 0.45);
  font-weight: 400;
}

/* スマホ:帯の文字を小さくし、最大2行まで(3行目以降は隠す) */
@media (max-width: 768px) {
  .site-header__bar {
    padding-block: 5px;
  }

  .site-header__catch {
    max-height: calc(1.6em * 2);
    overflow: hidden;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .site-header__sub {
    font-size: 12px;
  }
}

@media (max-width: 374px) {
  .site-header__catch {
    font-size: 10px;
    letter-spacing: 0.02em;
  }
}

/* メイン */
.site-main {
  display: block;
}

/* 投稿・アーカイブ・既定テンプレートの固定ページ(index.php)。本文の列は、下層ページと同じ幅で中央に置く */
.site-main > article,
.site-main > p {
  max-width: calc(var(--content-width) + (var(--page-x) * 2));
  margin: 0 auto;
  padding: 48px var(--page-x);
}

/* 下層ページの枠(カード・区切り線があるページ)。3列のグリッドで、真ん中が本文の列(--content-width)、左右は --content-wide までの広がり
   (いまは --content-wide が本文幅と同じなので、左右の列の幅は 0)。
   子は本文の列に置き、カードの並びだけ左右いっぱい(wide)に置く(各ページのCSSで grid-column: wide を指定)。
   区切り線は枠の ::before(絶対配置)なので、--content-wide の幅。列の間隔は 0(縦の間隔は各ページのCSSが margin / row-gap で取る) */
.support-overview__inner,
.about__inner,
.sbcc-consult-inner {
  display: grid;
  grid-template-columns: [wide-start] minmax(0, 1fr) [content-start] min(var(--content-width), 100%) [content-end] minmax(0, 1fr) [wide-end];
  align-content: start;
  column-gap: 0;
  width: 100%;
  max-width: calc(var(--content-wide) + (var(--page-x) * 2));
  margin-inline: auto;
}

.support-overview__inner > *,
.about__inner > *,
.sbcc-consult-inner > * {
  grid-column: content;
}

/* セクション共通 */
.section {
  --line: var(--color-line);
  background: var(--color-bg);
  scroll-margin-top: var(--anchor-offset);
}

.section--alt {
  background: var(--color-bg-alt);
}

.section__inner {
  display: flex;
  flex-direction: row-reverse;
  gap: var(--label-gap);
  padding-block: 72px;
}

/* 縦書きラベル(右)。縦線はラベルの左側、上寄せで置く */
.section__label {
  flex: none;
  align-self: flex-start;
  margin: 0;
  padding-left: 32px;
  border-left: 1px solid var(--line);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.5;
  writing-mode: vertical-rl;
}

/* 縦書きラベル内の半角2文字を正立させる */
.tcy {
  text-combine-upright: all;
}

/* 白背景のセクションが続く箇所だけ、コンテナ内に収めた区切り線を入れる(front-page.php で .section--divided を明示した2か所) */
.section--divided .section__inner {
  position: relative;
}

.section--divided .section__inner::before {
  content: "";
  position: absolute;
  top: 0;
  right: var(--page-x);
  left: var(--page-x);
  height: 1px;
  background: var(--color-line-soft);
}

/* 内容(左)。ラベル列と縦線を除いた幅いっぱいを使う */
.section__body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--body-gap, 28px);
  align-items: flex-start;
  min-width: 0;
}

.section__body::before {
  display: none;
}

/* 段落の文章だけは、1行が長くなりすぎないようにする */
.section__text {
  max-width: 38em;
  margin: 0;
  font-size: 16px;
  line-height: 1.95;
  word-break: auto-phrase;
  text-wrap: balance;
}

/* フッター(サイトマップ型)。広い幅:左にブランド、縦線、右に3グループ。
   ブランド列の幅(225px。1200px 以上は、キャッチフレーズを収めるため 400px)・縦線・ブランド列と内容の間隔(--label-gap)は、#consult / #know のタイトル列(sections.css の .section--label-left)と同じ値(400px のときは、タイトル列より広い)。
   右端も、それらの内容の右端と揃う(.site-footer__inner は .section__inner と同じ枠) */
.site-footer {
  border-top: 1px solid var(--color-navy);
  background: var(--color-bg);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  column-gap: var(--label-gap);
  padding-block: 56px 24px;
}

/* 広い幅(1200px 以上):ブランド列を広げ、キャッチフレーズを1文1行(2行)で収める。
   1199px 以下は 225px のまま(400px にすると、1100px 前後で右の3グループの1列が約 140px になり、ラベルが2行に折れるため)。キャッチフレーズは文節の途中で折り返さない(word-break: auto-phrase) */
@media (min-width: 1200px) {
  .site-footer__inner {
    grid-template-columns: 400px minmax(0, 1fr);
  }
}

.site-footer__brand {
  padding-right: 32px;
  border-right: 1px solid var(--color-line);
}

.site-footer__name {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
}

/* サイトのタイトルの「｜」より後ろ(「ITサポートデスク」)。ブランド列の幅に1行で収まる大きさ */
.site-footer__name-sub {
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* キャッチフレーズ(一般設定)。1文ずつ新しい行から始める(inc/text.php の sbcc_sentences()) */
.site-footer__catch {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.8;
  word-break: auto-phrase;
}

.site-footer__catch-sentence {
  display: block;
}

/* キャッチフレーズと「全国からのご相談を…」の間の区切り線(.site-footer__bottom の上の線と同じ見た目) */
.site-footer__catch + .site-footer__lead {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-line-soft);
}

.site-footer__lead {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.8;
}

/* ラベル・案内文は、<wbr>(inc/text.php)の位置だけで折り返す */
.site-footer__lead,
.site-footer__nav a,
.site-footer__text {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(32px, 3.5vw, 48px);
}

.site-footer__heading {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.site-footer__nav ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.7;
}

.site-footer a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s ease;
}

.site-footer a:hover {
  text-decoration-color: var(--color-gold);
}

/* リンクのない項目(リンク先が未作成)。リンクと見分けがつくよう、色を薄くする(白の背景で 4.5:1 以上) */
.site-footer__text {
  color: rgba(22, 35, 63, 0.65);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--color-line-soft);
}

.site-footer__copyright,
.site-footer__privacy {
  margin: 0;
  font-size: 13px;
}

/* 中間の幅(タブレット):ブランドが上の行、その下に3グループ(縦線なし)。縦線あり(PC)は 941px 以上で、#support・#contact の2列→1列と同じ幅。
   実測:縦線ありのとき、最長のラベルが2行以内・文節の途中で切れずに収まるのは、1列が約 128px 以上(画面 820px)。941px では1列が約 160px(2行になるのは「対応エリア・サポート方法」「sbccが大切にしていること」の2つ) */
@media (max-width: 940px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__brand {
    padding-right: 0;
    border-right: 0;
    margin-bottom: 32px;
  }
}

/* スマホ */
@media (max-width: 768px) {
  /* セクション:ラベルが上、短い横線、内容が下(縦書きは維持) */
  .section__inner {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    padding-block: 44px;
    text-align: center;
  }

  .section__label {
    align-self: center;
    padding-left: 0;
    border-left: 0;
    font-size: 20px;
  }

  .section__body {
    flex: 0 0 auto;
    width: 100%;
    align-items: center;
  }

  .section__body::before {
    content: "";
    display: block;
    flex: none;
    width: 48px;
    height: 1px;
    background: var(--line);
  }

  .section__text {
    font-size: 15px;
    line-height: 1.9;
  }

  /* フッター:中央寄せの縦1列。順番は、ブランド、3グループ、最下部。グループの間に細い線を入れる */
  .site-footer__inner {
    padding-block: 40px 24px;
    text-align: center;
  }

  .site-footer__nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__group + .site-footer__group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-line-soft);
  }

  .site-footer__nav ul {
    gap: 0;
    font-size: 15px;
  }

  .site-footer__nav li {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  .site-footer__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .site-footer__bottom {
    flex-direction: column;
    gap: 4px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .site-footer a {
    transition: none;
  }
}
