/* =========================================================
   style.css（整理版）
   目次
   01. Tokens（変数）
   02. Base（全体共通）
   03. Layout（container）
   04. Header（PC）
   05. Navigation（PC）
   06. Hamburger Button（3本線→×）
   07. SP Drawer（ドロワー本体）
   08. Footer（PC）
   09. Components（works.json用）
   10. Components（contact用）
   11.Components（policy pages）
   　　Privacy / Security 共通
   12. Responsive（SP上書きはここに集約）
   ========================================================= */


/* =========================
   01. Tokens（必要最低限）
   ========================= */
:root{
  --fs-32: 32px;
  --fs-24: 24px;
  --fs-20: 20px;
  --fs-16: 16px;
  --fs-14: 14px;
  --fs-12: 12px;
  --fs-10: 10px;

  --sp-4: 4px;
  --sp-8: 8px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;

  --c-text: #222222;
  --c-text-inverse: #ffffff;
  --c-bg: #dddddd;
  --c-surface: #ffffff;
  --c-border: rgba(34,34,34,0.16);
  --c-page: #ffffff;
  --c-footer: #f2f2f2;

  --container-w: 1200px;
  --radius-8: 8px;

  /* SPドロワー：ボタン位置計算用（header-innerのheightと合わせる） */
  --header-h: 100px;
  --btn-size: 40px;
}


/* =========================
   02. Base
   ========================= */
*{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  padding-top: var(--header-h);
  margin:0;
  color: var(--c-text);
  background: var(--c-page);
  font-size: var(--fs-16);
  line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
               "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
               "Yu Gothic", Arial, sans-serif;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.page-header{
  text-align: left;
  margin-bottom: 48px;
}

.page-title{
  margin: 0;
}

.page-title__img{
  display: block;
  height: 20px;     /* 全ページ共通のタイトル高さ */
  width: auto;
}

.page-lead{
  margin: 32px 0 0;
}

.page-section{
  --section-pt: 56px;
  --section-pb: 80px;
  padding: var(--section-pt) 0 var(--section-pb);
}


/* =========================
   03. Layout
   ========================= */
.container{
  width: min(100% - (var(--sp-24) * 2), var(--container-w));
  margin-inline: auto;
}


/* =========================
   04. Header（PC）
   ========================= */
.site-header{
  position: fixed;  /* ← sticky ではなく fixed */
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;

  /* 初期状態（最上部）は通常の背景 */
  background: var(--c-surface);

  /* スクロール時の切替が気持ちよくなるように */
  
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    -webkit-backdrop-filter 200ms ease,
    backdrop-filter 200ms ease;
}

/* スクロール時：Appleっぽいガラス表現 */
.site-header.is-scrolled{
  background: rgba(255,255,255,0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* backdrop-filter非対応ブラウザのフォールバック */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .site-header.is-scrolled{
    background: rgba(255,255,255,0.95);
  }
}

.header-inner{
  height: var(--header-h);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: var(--sp-16);
  padding: var(--sp-20) 0;
}

/* ロゴ（画像） */
.logo{
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.logo img{
  display: block;
  height: 28px;   /* PC基準 */
  width: auto;
}


/* =========================
   05. Navigation（PC）
   ========================= */
.header-nav{
  display:flex;
  align-items:center;
  gap: var(--sp-16);
}

.nav-list{
  list-style:none;
  display:flex;
  gap: var(--sp-16);
  margin:0;
  padding:0;
}

/* 画像メニュー */
.nav-list--img{
  display:flex;
  align-items:center;
  gap: 50px;
  margin:0;
  padding:0;
  list-style:none;
}

.nav-list--img a{
  display:inline-flex;
  align-items:center;
  padding: var(--sp-8) 0;
  position: relative; 
}

/* 現在ページ：2重下線（上=濃いグレー / 下=黄色） */
.nav-list--img a[aria-current="page"]{
  opacity: 1;
}

/* hoverで薄くなる既存挙動がある場合、選択中は薄くしない */
.nav-list--img a[aria-current="page"]:hover{
  opacity: 1;
}

/* 2重線本体：高さ 4px = 1px + 2px + 1px */
.nav-list--img a[aria-current="page"]::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 4px; /* 1px(上) + 2px(間) + 1px(下) */

  /* 上1px：濃いグレー / 間2px：透明 / 下1px：黄色 */
  background: linear-gradient(
    to bottom,
    #acacac 0 1px,
    transparent 1px 3px,
    #F2C200 3px 4px
  );

   /* ここからアニメーションの肝 */
  transform-origin: left;
  transform: scaleX(0);
  animation: nav-underline-draw 420ms cubic-bezier(.2,.8,.2,1) forwards;
  will-change: transform;
}

@keyframes nav-underline-draw{
  to{ transform: scaleX(1); }
}

/* 動きが苦手なユーザー向け：アニメーション無効化 */
@media (prefers-reduced-motion: reduce){
  .nav-list--img a[aria-current="page"]::after{
    animation: none;
    transform: scaleX(1);
  }
}

.nav-list--img img{
  display:block;
  height: 12px;
  width: auto;
}

.nav-list--img a:hover{ opacity: 0.75; }

.nav-list--img a[aria-current="page"]{
  border-bottom-color: rgba(34,34,34,0.6);
  opacity: 1;
}

.nav-divider{
  width:1px;
  height: 18px;
  background: var(--c-border);
  margin: 0 36px;
}

.nav-lang{
  font-weight: 600;
}


/* =========================
   06. Hamburger Button（3本線→×）
   PCは非表示、SPで表示
   ========================= */
.menu-btn{
  display:none;
  width: var(--btn-size);
  height: var(--btn-size);
  border: none;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  align-items:center;
  justify-content:center;
  padding: 0;
  z-index: 60; /* 常に前面 */
}

.menu-icon{
  position: relative;
  width: 32px;
  height: 20px;
  display: inline-block;
}

.menu-bar{
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #4D4D4D;
  border-radius: 999px;
  transition:
    transform 220ms cubic-bezier(.2,.8,.2,1),
    opacity 180ms ease,
    top 220ms cubic-bezier(.2,.8,.2,1);
}

/* 3本の配置 */
.menu-bar:nth-child(1){ top: 0; }
.menu-bar:nth-child(2){ top: 8px; }
.menu-bar:nth-child(3){ top: 16px; }

/* open時：× */
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(1){
  top: 6px;
  transform: rotate(45deg);
}
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(2){
  opacity: 0;
}
.menu-btn[aria-expanded="true"] .menu-bar:nth-child(3){
  top: 6px;
  transform: rotate(-45deg);
}

.menu-btn:active{
  transform: translateY(1px);
}


/* =========================
   07. SP Drawer（SP Menu Overlay）
   ========================= */
.sp-menu-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 90;
}
.sp-menu-backdrop[hidden]{
  display: none !important;
}

.sp-menu{
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(86vw, 360px);
  background: var(--c-surface);
  z-index: 100;

  transform: translateX(100%);
  transition: transform 180ms ease;
  overflow-y: auto;
  pointer-events: none;
}

.sp-menu[aria-hidden="false"]{
  transform: translateX(0);
  pointer-events: auto;
}

.sp-menu-body{
  padding: var(--sp-32);
  padding-top: 80px; /* メニュー開始位置（固定で調整してOK） */
}

.sp-menu-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction: column;
  gap: var(--sp-16);
  font-size: var(--fs-20);
  font-weight: 600;
}

.sp-menu-meta{
  margin-top: var(--sp-24);
  display:flex;
  flex-direction: column;
  gap: var(--sp-8);
  font-size: var(--fs-12);
}

.sp-menu-lang{
  margin-top: var(--sp-24);
  font-size: var(--fs-12);
  font-weight: 600;
}

/* 使っていないなら削除推奨（残すならここに置く） */
.menu-close{
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-border);
  background: transparent;
  border-radius: var(--radius-8);
  cursor: pointer;
  font-size: var(--fs-20);
  line-height: 1;
}


/* =========================
   08. Footer（PC）
   ========================= */
.site-footer{ 
  background: var(--c-footer);
  color: #606060;
  height: 240px;
  display: flex;
  align-items: stretch;
}

.footer-inner{
  position: relative;
  display: flex;
  align-items: center;
  padding-inline: 0;
  padding-block: 24px;
}

/* ★ここを変更：会社名（1行目）＋ナビ行（2行目）の2行グリッド */
.footer-left{
  display: grid;
  grid-template-columns: 1fr auto; /* 左：primary / 右：legal */
  grid-template-rows: auto auto;
  row-gap: 8px;
  align-items: center;
}

/* 会社名は1行目で全幅 */
.footer-company{
  grid-column: 1 / -1;
  font-size: var(--fs-14);
  margin: 0; /* 既存のmargin-bottomを消す */
}

/* primary は2行目左 */
.footer-nav-primary{
  grid-column: 1;
  display: flex;
  gap: 30px;
  font-size: var(--fs-14);
  flex-wrap: wrap; /* 画面が狭い時の保険 */
}

/* legal は2行目右（折り返しさせない） */
.footer-nav-legal{
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 30px;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: var(--fs-12);
}

/* ★区切り線：legal の先頭に入れる（primary の直後に見える） */
.footer-nav-legal::before{
  content: "｜";
  margin-left: 38px;   /* ←左側（primaryとの間） */
  margin-right: 6px;  /* ←右側（legalとの間） */
  opacity: 0.6;
  font-size: var(--fs-14);
}

/* コピーライト */
.footer-copy{
  position: absolute;
  right: 0;
  bottom: 16px;
  font-size: var(--fs-12);
  opacity: 0.45;
  text-align: right;
}



/* =========================
   09. Components（works.json用）
   ========================= */
.works{
}

.works-header{
  margin-bottom: 24px;
}

.works-title{
  margin: 0 0 8px;
  font-size: var(--fs-24);
  line-height: 1.2;
}

.works-lead{
  margin: 0;
  font-size: var(--fs-16);
  opacity: 0.75;
}

/* 3カラム指定（要件） */
.works-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-24);
}

/* Card */
.work-card{
  display: block;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
}

.work-card:hover{
  text-decoration: none;
}

.work-thumb{
  aspect-ratio: 1.91 / 1;
  background: rgba(34,34,34,0.04);
  overflow: hidden;
}

.work-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-body{
  padding: 14px 14px 16px;
}

.work-title{
  margin: 0 0 8px;
  font-size: var(--fs-16);
  line-height: 1.4;
  font-weight: 700;
}

.work-excerpt{
  margin: 0;
  font-size: var(--fs-12);
  line-height: 1.6;
  opacity: 0.8;

  /* 数行で省略（要件：数行） */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 読み込みエラー */
.works-error{
  margin-top: 16px;
  font-size: var(--fs-12);
  color: rgba(34,34,34,0.7);
}

/* =========================
   10. Components（contact用）
   ========================= */
.contact{
  --section-pb: 88px;
}

.contact-inner{
  position: relative;
}


/* フォーム */
.contact-form{
  max-width: 760px;
  margin-inline: auto;
}

.form-field{
  margin-top: 22px;
}

.form-label{
  display: block;
  font-size: var(--fs-12);
  font-weight: 700;
  opacity: 0.75;
  margin-bottom: 8px;
}

.req{
  color: #8B0000;
  font-weight: 700;
}



/* input/textareaは幅100%でOK（右padding不要に） */
.form-input,
.form-textarea{
  width: 100%;
  padding-right: 14px; /* 通常値に戻してOK（好みで） */
}



/* ステータス行（薄グレー、中央） */
.form-status{
  margin: 18px 0 0;
  text-align: center;
  font-size: var(--fs-12);
  color: rgba(34,34,34,0.55);
  min-height: 1.2em; /* 表示/非表示でガタつかない */
}

/* 同意カード（薄グレー背景＋全体クリック可能） */
.form-consent{
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.consent-card{
  width: min(520px, 92vw);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(34,34,34,0.06);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.consent-text{
  font-size: var(--fs-12);
  color: rgba(34,34,34,0.85);
}

.consent-checkbox{
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}


.form-input,
.form-textarea{
  width: 100%;
  border: 1px solid rgba(34,34,34,0.16);
  background: #fff;
  padding: 14px 14px;
  font-size: var(--fs-16);
  outline: none;
  border-radius: 4px; /* 角R小さめ */
}

.form-textarea{
  padding: 16px 14px;
  resize: vertical;
  min-height: 260px;
}

/* フォーカス（UX改善：入力中が分かりやすい） */
.form-input:focus,
.form-textarea:focus{
  border-color: rgba(34,34,34,0.45);
}

/* エラー表示 */
.field-error{
  margin: 8px 0 0;
  font-size: var(--fs-12);
  color: rgba(200, 0, 0, 0.78);
  min-height: 1.2em; /* レイアウトのガタつき防止 */
}

/* 同意 */
.form-consent{
  margin-top: 26px;
  text-align: center;
}

.consent-label{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-12);
}

.consent-checkbox{
  width: 18px;
  height: 18px;
}

/* 送信ボタン */
.form-actions{
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

.btn-submit{
  width: min(360px, 92vw);
  height: 56px;
  border: none;
  border-radius: 4px;
  background: #4D4D4D;
  color: #fff;
  font-size: var(--fs-16);
  font-weight: 700;
  cursor: pointer;
}

.btn-submit[disabled]{
  opacity: 0.35;
  cursor: not-allowed;
  color: rgba(255,255,255,0.5);
}

.status-alert{
  color: #8B0000; /* アスタリスクと同じ濃い赤 */
  font-weight: 700;
}

/* =========================
   11.Components（policy pages）
   Privacy / Security 共通
   ========================= */

.policy{
  max-width: 860px;
  margin-inline: auto;   /* ←中央寄せ */
  font-size: var(--fs-16);
  line-height: 1.7;
  text-align: left;
}

.policy-page{
  --policy-w: 860px;
}

.policy-page .page-header,
.policy-page .policy{
  max-width: var(--policy-w);
  margin-inline: auto;  /* センタリング */
  text-align: left;     /* 中身は左揃え */
}

/* 文章の基本余白 */
.policy p{
  margin: 0 0 var(--sp-16);
}

/* セクション区切り（条項ごと） */
.policy-section{
  padding-top: var(--sp-24);
  margin-top: var(--sp-24);
  border-top: 1px solid var(--c-border);
  border-top: none;
}
.policy-section:first-of-type{
  padding-top: 0;                /* 余白は上だけ欲しいので0のまま */
  margin-top: var(--sp-24);
  border-top: none;
}

/* 条項見出し */
.policy h2{
  margin: 0 0 var(--sp-16);
  font-size: var(--fs-16);
  line-height: 1.3;
  font-weight: 700;
}

/* 箇条書き */
.policy ul{
  margin: 0 0 var(--sp-16);
  padding-left: 1.2em;
}
.policy li{
  margin: 0 0 var(--sp-4);
}

/* 連絡先などのDL（汎用） */
.policy-dl{
  margin: 0;
  padding: var(--sp-16);
   border: none; 
  border-radius: 4px;
  background: rgba(34,34,34,0.03);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--sp-8) var(--sp-16);
  font-size: var(--fs-14);
  line-height: 1.8;
}
.policy-dl dt{
  margin: 0;
  font-weight: 700;
  opacity: 0.8;
}
.policy-dl dd{
  margin: 0;
}

/* 末尾の制定日/最終改定日など */
.policy-meta{
  font-size: var(--fs-12);
  opacity: 0.75;
}

/* リンク（ポリシー内は下線が分かりやすい） */
.policy a{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* SP */
@media (max-width: 767px){
  .policy{
    max-width: 100%;
    line-height: 1.85;
  }
  .policy-dl{
    grid-template-columns: 1fr;
  }
}

/* =========================
   12. Responsive（SP上書きはここに集約）
   ========================= */

@media (max-width: 1024px){
  .works-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px){

  .works{
    padding: 40px 0 64px;
  }
  .works-grid{
    grid-template-columns: 1fr;
  }

  /* Contact用 */
    .contact{
    padding: 40px 0 72px;
  }

  .form-textarea{
    min-height: 220px;
  }
  /* Header：SPはPCナビ非表示＋ハンバーガー表示 */
  .menu-btn{ display:inline-flex; }
  .header-nav{ display:none; }

    .page-title__img{
    height: 36px;
  }

    .page-section{
    --section-pt: 40px;
    --section-pb: 64px;
  }

    .contact{
    --section-pb: 72px;
  }

  /* ドロワーOPEN中：×ボタンをヘッダー内と同じ位置に固定
     ※ var未定義でも動くようフォールバック付き */
  .menu-btn{
    position: relative; /* 通常時 */
  }

  .menu-btn[aria-expanded="true"]{
    position: fixed;
    top: calc((var(--header-h, 100px) - var(--btn-size, 40px)) / 2);
    right: var(--sp-24);
    background: var(--c-surface);
    z-index: 110;
  }

  /* メニュー内ヘッダーがある場合の重なり対策 */
  .sp-menu-header{
    padding-right: calc(var(--sp-24) + 40px + var(--sp-16));
  }

  /* ドロワー：文字サイズ＆タップ領域 */
  .sp-menu-list{ font-size: 22px; }
  .sp-menu-meta{ font-size: 14px; }
  .sp-menu-lang{ font-size: 14px; }

  .sp-menu-list a{
    display: block;
    padding: 10px 0;
  }

  .sp-menu-meta a,
  .sp-menu-lang a{
    display: inline-block;
    padding: 8px 0;
  }


  /* Footer：SP高さ＆縦並び＆余白 */
  .site-footer{
    height: 400px;
  }

  .footer-inner{
    align-items: flex-start;
    padding-top: 40px; /* 上が詰まる場合はここ */
  }

  .footer-nav-primary,
  .footer-nav-legal{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Contact と Privacy の間隔 */
  .footer-nav-primary{
    margin-bottom: 16px;
  }

  /* フッター文字サイズ（SPだけ） */
  .footer-company{ font-size: 18px; }
  .footer-nav-primary{ font-size: 18px; }
  .footer-nav-legal{ font-size: 16px; }
  .footer-copy{ font-size: 12px; }

  /* ★SPでは2カラムgridを解除して1列に戻す */
.footer-left{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* ★SPは区切り線なし */
.footer-nav-legal::before{
  content: none;
}

}


