/* ============================================================
   TOFU CONSULTING — 共通スタイル
   デザイン変数はこの :root ブロックを編集するだけで全ページに反映
   ============================================================ */

:root {
  /* --- カラー --- */
  --color-bg:          #FFFFFF;
  --color-bg-soft:     #F5F7FA;
  --color-bg-dark:     #0F2A47;
  --color-text:        #1F2933;
  --color-text-sub:    #5B6770;
  --color-accent:      #0F4C81;
  --color-accent-dark: #0A3560;
  --color-accent-light:#E8F0FA;
  --color-border:      #E2E8F0;
  --color-white:       #FFFFFF;

  /* --- タイポグラフィ --- */
  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-en:   'Inter', var(--font-base);

  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md:   1.125rem;  /* 18px */
  --fs-lg:   1.25rem;   /* 20px */
  --fs-xl:   1.5rem;    /* 24px */
  --fs-2xl:  2rem;      /* 32px */
  --fs-3xl:  2.5rem;    /* 40px */
  --fs-4xl:  3rem;      /* 48px */
  --fs-hero: clamp(2.5rem, 6vw, 4.5rem);

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;
  --fw-bold:   700;

  --lh-tight:  1.2;
  --lh-normal: 1.6;
  --lh-loose:  1.8;

  /* --- スペーシング --- */
  --sp-xs:  0.25rem;   /* 4px */
  --sp-sm:  0.5rem;    /* 8px */
  --sp-md:  1rem;      /* 16px */
  --sp-lg:  1.5rem;    /* 24px */
  --sp-xl:  2rem;      /* 32px */
  --sp-2xl: 3rem;      /* 48px */
  --sp-3xl: 4rem;      /* 64px */
  --sp-4xl: 5rem;      /* 80px */
  --sp-section: 6rem;  /* 96px */

  /* --- 角丸 --- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* --- シャドウ --- */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);

  /* --- レイアウト --- */
  --max-width: 1200px;
  --header-h: 72px;

  /* --- トランジション --- */
  --transition: 0.2s ease;
}

/* ============================================================
   リセット・ベース
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-base);
  font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ============================================================
   レイアウト共通
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}
.section {
  padding: var(--sp-section) 0;
}
.section--soft { background: var(--color-bg-soft); }
.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-white);
}

/* セクション見出し */
.section-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-sm);
}
.section-label--light { color: rgba(255,255,255,0.6); }

.section-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-md);
}
.section-title--light { color: var(--color-white); }

.section-text {
  color: var(--color-text-sub);
  max-width: 640px;
  line-height: var(--lh-loose);
}
.section-text--light { color: rgba(255,255,255,0.7); }

.section-head {
  margin-bottom: var(--sp-3xl);
}

/* ============================================================
   ボタン
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition);
  min-height: 48px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border: 2px solid var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-accent-light);
}
.btn-outline-white {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline-white:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--color-white);
}
.btn-white {
  background: var(--color-white);
  color: var(--color-accent);
  border: 2px solid var(--color-white);
}
.btn-white:hover {
  background: var(--color-accent-light);
}
.btn-lg { padding: 1rem 2.25rem; font-size: var(--fs-base); }
.btn-sm { padding: 0.5rem 1.25rem; font-size: var(--fs-xs); }

/* ============================================================
   ヘッダー
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-md); }

.header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-xl);
}
.header__logo {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.header__logo span { color: var(--color-text); }

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}
.header__nav a {
  font-size: var(--fs-sm);
  color: var(--color-text-sub);
  font-weight: var(--fw-medium);
  transition: color var(--transition);
  position: relative;
}
.header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.header__nav a:hover { color: var(--color-accent); }
.header__nav a:hover::after, .header__nav a.active::after { transform: scaleX(1); }
.header__nav a.active { color: var(--color-accent); }

.header__cta { flex-shrink: 0; }

/* ハンバーガー */
.header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
  background: none;
  border: none;
}
.header__hamburger span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.header__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__hamburger.open span:nth-child(2) { opacity: 0; }
.header__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* モバイルメニュー */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  background: var(--color-white);
  padding: var(--sp-xl) var(--sp-lg);
  border-bottom: 1px solid var(--color-border);
  z-index: 999;
  flex-direction: column;
  gap: var(--sp-md);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: var(--fs-md);
  color: var(--color-text);
  font-weight: var(--fw-medium);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--color-border);
}
.mobile-menu .btn { width: 100%; justify-content: center; margin-top: var(--sp-sm); }

/* ページ上部オフセット */
.page-body { padding-top: var(--header-h); }

/* ============================================================
   フッター
   ============================================================ */
.footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.8);
}
.footer__cta {
  background: var(--color-accent);
  padding: var(--sp-3xl) var(--sp-lg);
  text-align: center;
}
.footer__cta-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  margin-bottom: var(--sp-sm);
}
.footer__cta-sub {
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--sp-xl);
}
.footer__cta-phone {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  margin-bottom: var(--sp-xs);
}
.footer__cta-hours { font-size: var(--fs-sm); color: rgba(255,255,255,0.7); margin-bottom: var(--sp-lg); }
.footer__cta-btns { display: flex; gap: var(--sp-md); justify-content: center; flex-wrap: wrap; }

.footer__main {
  padding: var(--sp-3xl) var(--sp-lg);
}
.footer__grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-3xl);
}
.footer__brand { grid-column: span 1; }
.footer__logo {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  margin-bottom: var(--sp-md);
}
.footer__tagline {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--sp-lg);
  line-height: var(--lh-loose);
}
.footer__sns {
  display: flex;
  gap: var(--sp-md);
}
.footer__sns a {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm);
  transition: background var(--transition), border-color var(--transition);
}
.footer__sns a:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); }

.footer__col-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  margin-bottom: var(--sp-md);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.footer__nav-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.footer__nav-list a {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer__nav-list a:hover { color: var(--color-white); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--sp-lg) var(--sp-lg);
}
.footer__bottom-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
}
.footer__copy { font-size: var(--fs-xs); color: rgba(255,255,255,0.4); }
.footer__links { display: flex; gap: var(--sp-lg); }
.footer__links a { font-size: var(--fs-xs); color: rgba(255,255,255,0.4); transition: color var(--transition); }
.footer__links a:hover { color: rgba(255,255,255,0.8); }

/* 上部へスクロールボタン */
.scroll-top {
  position: fixed;
  bottom: var(--sp-xl);
  right: var(--sp-xl);
  width: 44px; height: 44px;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 900;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); }

/* ============================================================
   ページヘッダー（下層ページ共通）
   ============================================================ */
.page-header {
  background: var(--color-bg-dark);
  padding: var(--sp-3xl) var(--sp-lg);
  text-align: center;
}
.page-header__label {
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--sp-sm);
}
.page-header__title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  margin-bottom: var(--sp-sm);
}
.page-header__sub {
  font-size: var(--fs-base);
  color: rgba(255,255,255,0.6);
}
.breadcrumb {
  display: flex;
  justify-content: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.4);
}
.breadcrumb a { color: rgba(255,255,255,0.5); transition: color var(--transition); }
.breadcrumb a:hover { color: rgba(255,255,255,0.8); }
.breadcrumb span { color: rgba(255,255,255,0.3); }

/* ============================================================
   カード共通
   ============================================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--color-bg-soft);
}
.card__body { padding: var(--sp-lg); }
.card__meta {
  font-size: var(--fs-xs);
  color: var(--color-text-sub);
  margin-bottom: var(--sp-sm);
  display: flex;
  gap: var(--sp-md);
  align-items: center;
}
.card__tag {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-sm);
}
.card__excerpt {
  font-size: var(--fs-sm);
  color: var(--color-text-sub);
  line-height: var(--lh-loose);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--color-accent);
  margin-top: var(--sp-md);
  transition: gap var(--transition);
}
.card__link:hover { gap: var(--sp-sm); }

/* ============================================================
   グリッド
   ============================================================ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-xl); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-xl); }

/* ============================================================
   画像ローダー (Pixabay / Pexels 動的取得)
   ============================================================ */
.img-placeholder {
  background: linear-gradient(135deg, var(--color-bg-soft) 0%, var(--color-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-sub);
  font-size: var(--fs-sm);
}
.img-placeholder::after { content: '画像を読み込み中...'; }

/* ============================================================
   フェードインアニメーション
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   ユーティリティ
   ============================================================ */
.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.mt-sm  { margin-top: var(--sp-sm); }
.mt-md  { margin-top: var(--sp-md); }
.mt-lg  { margin-top: var(--sp-lg); }
.mt-xl  { margin-top: var(--sp-xl); }
.mt-2xl { margin-top: var(--sp-2xl); }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
    --sp-section: 4rem;
    --fs-hero: clamp(2rem, 8vw, 3rem);
  }
  .header__nav, .header__cta { display: none; }
  .header__hamburger { display: flex; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--sp-xl); }
  .footer__cta-btns { flex-direction: column; align-items: center; }
  .footer__bottom-inner { flex-direction: column; text-align: center; }
  .scroll-top { bottom: var(--sp-md); right: var(--sp-md); }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--sp-md); }
}
