/* ──────────────────────────────────────────────────────────
   site.css — 手書きの層
   design-base.css はデザインボードから機械生成したもの。触らない。
   ボードは PC 1280px / SP 390px の固定幅で描かれているので、
   実際の画面幅で成立させるための指定をここに置く。
   ────────────────────────────────────────────────────────── */

:root{
  --gut: 56px;          /* セクションの左右余白。広い画面では中央寄せに化ける */
  --wrap: 1080px;       /* 本文の最大幅。ボードの 1280 - 56*2 */
  --bar: 0px;           /* SPの追従バーぶんの逃げ */
}
@media (min-width:1281px){
  :root{ --gut: calc((100vw - var(--wrap)) / 2); }
}
@media (max-width:767px){
  :root{ --gut: 16px; --bar: 64px; }
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
img{ max-width:100%; height:auto; }
body{ overflow-x: hidden; padding-bottom: var(--bar); }

/* ボードの固定幅指定を実画面に馴らす ------------------------------- */
.sec, .cta, .ft{ width:100%; }
.ph.im{ background-size:cover; background-position:center; background-repeat:no-repeat; }

/* 写真枠は固定pxで描かれている。幅は伸縮、高さは比率で持たせる */
@media (max-width:1279px){
  .ph[style*="width:"]{ width:100% !important; max-width:100%; }
}
@media (max-width:767px){
  /* aspect-ratio と min-height を併せると、高さから幅が逆算されて箱を割る。
     幅を先に決め切ってから比率で高さを出させる。 */
  .ph[style*="height:"]{
    height:auto !important; min-height:0 !important;
    width:100% !important; aspect-ratio: 4 / 3;
  }
}

/* 段組み ---------------------------------------------------------- */
@media (max-width:1023px){
  .g5{ grid-template-columns:repeat(3,minmax(0,1fr)); }
  .g4{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  /* 横並びは、タブレット幅の時点で積む。片方が固定幅のものが多いため */
  .row{ flex-direction:column; gap:16px; }
  .row > *{ width:100% !important; flex-shrink:1 !important; }
}
@media (max-width:767px){
  .g5,.g4,.g3{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .g2{ grid-template-columns:1fr; }
  table{ font-size:13px; }
  th,td{ padding:10px 8px; }
}

/* ヘッダー -------------------------------------------------------- */
.hd{ position:sticky; top:0; z-index:50; background:#fff; border-bottom:1px solid var(--line);
     height:88px; padding:0 var(--gut); display:flex; align-items:center; gap:24px; }
.hd__logo{ display:flex; align-items:center; gap:10px; flex-shrink:0; text-decoration:none; color:var(--ink); }
.hd__mark{ width:44px; height:44px; border-radius:12px; background:var(--blue);
           display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.hd__name{ font-size:19px; font-weight:800; margin:0; line-height:1.2; }
.hd__sub{ font-size:10px; font-weight:700; color:var(--blue); margin:0; letter-spacing:.18em; }
.hd__nav{ flex-grow:1; display:flex; gap:22px; justify-content:center; }
.hd__nav a{ font-size:15px; font-weight:700; color:var(--ink); white-space:nowrap; }
.hd__cta{ display:flex; align-items:center; gap:12px; flex-shrink:0; }
.hd__burger{ display:none; width:44px; height:44px; flex-shrink:0; background:#fff;
             border:1px solid var(--line); border-radius:12px; align-items:center; justify-content:center; cursor:pointer; }

@media (max-width:1100px){
  .hd__nav{ display:none; }
  .hd__burger{ display:flex; }
  .hd{ justify-content:space-between; }
}
@media (max-width:767px){
  .hd{ height:64px; padding:0 16px; gap:12px; }
  .hd__mark{ width:38px; height:38px; border-radius:11px; }
  .hd__name{ font-size:17px; }
  .hd__sub{ font-size:9px; }
  .hd__cta{ display:none; }
}

/* 引き出しメニュー */
.drawer{ position:fixed; inset:0; z-index:60; display:none; }
.drawer[data-open="1"]{ display:block; }
.drawer__veil{ position:absolute; inset:0; background:rgba(18,85,143,.45); }
.drawer__panel{ position:absolute; top:0; right:0; width:min(320px,86vw); height:100%;
                background:#fff; padding:20px 20px 40px; overflow-y:auto;
                box-shadow:-4px 0 24px rgba(18,85,143,.18); }
.drawer__close{ width:44px; height:44px; border:1px solid var(--line); border-radius:12px;
                background:#fff; cursor:pointer; font-size:20px; font-family:inherit; color:var(--blue-d); }
.drawer__list{ list-style:none; margin:20px 0 0; padding:0; }
.drawer__list li + li{ border-top:1px solid var(--line); }
.drawer__list a{ display:flex; align-items:center; min-height:56px; font-size:16px; font-weight:700; color:var(--ink); }

/* 中身の最大幅。ボードでは 1168px 固定で描かれている ---------------- */
.wrap, .fwrap{ width:100% !important; max-width:var(--wrap); margin:0 auto; box-sizing:border-box; }

/* セクションの左右余白は、CSS側で指定されているものも可変にする ----
   .sec は「直書きで padding を持つもの」と「持たないもの」が混在している。
   持たないものは design-base.css の 56px 固定のままになり、広い画面で
   中身が両端まで広がってしまう。ここで全部まとめて可変にする。
   直書きを持つ側は、そちらが優先されるので値は変わらない。 */
.sec, .secG, .secCta, .secW, .cta, .sp{ padding-left:var(--gut); padding-right:var(--gut); }

/* 横に並べた要素は、狭い画面で縮めるか積む ------------------------
   ボードは「横に並ぶ」前提で flex-grow:1 / flex-shrink:0 が直書きされている。
   flex は既定で中身より小さくならないので、min-width:0 を与えて縮めさせる。 */
@media (max-width:1279px){
  .fldL{ width:100% !important; flex-shrink:1 !important; }
  /* 折り返させるのは横並びだけ。縦並びに wrap を当てると、
     段が横に増える前提になって幅が最大内容量で決まってしまう */
  main [style*="display:flex"]:not([style*="flex-direction:column"]){ flex-wrap:wrap; }
  main [style*="flex-grow:1"]{ min-width:0; flex-basis:0; }
  main [style*="flex-shrink:0"]{ flex-shrink:1 !important; min-width:0; }
  main [style*="white-space:nowrap"]{ white-space:normal !important; }
}

/* ボードの固定px幅が画面を割らないようにする ---------------------- */
@media (max-width:1279px){
  main [style*="width:"]:not(svg):not(.num):not(.bx):not(.qm):not(.am):not(.swap){ max-width:100%; }
}
/* ボタンは min-width で実寸が決まっている。狭い画面では外す */
@media (max-width:1023px){
  .btnA, .btnB, .btnS{ min-width:0 !important; max-width:100%; }
}

/* ファーストビュー ------------------------------------------------
   ボードでは「写真を絶対配置で右端に敷き、その上に文章を重ねる」構造。
   画面が広いほど文章と写真が離れてしまうので、ふつうの横並びに組み直す。 */
@media (min-width:1024px){
  .fv{
    height:auto !important;
    display:flex; align-items:center; gap:56px;
    padding:56px var(--gut);
  }
  /* 1つめの子＝写真の層。絶対配置をやめて右のカラムにする */
  .fv > div:first-child{
    position:static !important; inset:auto !important;
    order:2; flex:0 0 42%;
    display:block !important; padding:0 !important;
  }
  /* 写真は 4:3。枠をその比率にしておけば、どこも切り取られない */
  .fv > div:first-child .ph{
    width:100% !important; height:auto !important;
    aspect-ratio: 4 / 3;
    background-position:center !important;
    border-radius:20px;
  }
  /* 2つめの子＝文章。幅の固定をやめて残りを使う */
  .fv > div:last-child{
    order:1; flex:1 1 auto;
    width:auto !important; height:auto !important;
    padding:0 !important;
  }
}

/* タブレット以下は縦に積む */
@media (max-width:1023px){
  .fv{ height:auto !important; padding:0 0 32px; }
  .fv > div:first-child{
    position:static !important; inset:auto !important;
    display:block !important; padding:0 !important;
  }
  .fv > div:first-child .ph{
    width:100% !important; height:auto !important;
    aspect-ratio: 4 / 3; max-height:380px;
    background-position:center 22% !important; border-radius:0;
  }
  .fv > div:last-child{
    width:100% !important; height:auto !important;
    padding:32px var(--gut) 0 !important;
  }
  .fv .h1{ font-size:32px !important; }
  .fv p[style*="font-size:24px"]{ font-size:18px !important; }
}
@media (max-width:767px){
  .fv > div:first-child .ph{ max-height:none !important; }
  .fv .h1{ font-size:26px !important; }
  .fv p[style*="font-size:24px"]{ font-size:16px !important; }
  .fv .pill{ font-size:11px; }
}

/* フッター -------------------------------------------------------- */
.ft{ background:var(--blue-d); color:#fff; padding:56px var(--gut) 0; }
.ft .wrap{ width:100%; max-width:var(--wrap); margin:0 auto; }
.ft__cols{ display:flex; gap:24px; align-items:flex-start; margin-bottom:40px; }
.ft__brand{ width:320px; flex-shrink:0; }
.ft__grid{ flex-grow:1; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; }
.fh{ font-size:13px; font-weight:800; color:#fff; margin:0 0 10px; letter-spacing:.04em; }
.fl{ font-size:13px; line-height:2.1; color:#B9D2E6; margin:0; }
.flk{ color:#B9D2E6; }
.fcap{ font-size:12px; line-height:1.65; color:#B9D2E6; margin:0; }
.ft__band{ border-top:1px solid rgba(185,210,230,.35); padding-top:32px; margin-bottom:32px; }
.ft__end{ border-top:1px solid rgba(185,210,230,.35); padding-top:24px; padding-bottom:32px; }

@media (max-width:1023px){
  .ft__cols{ flex-direction:column; }
  .ft__brand{ width:100%; }
  .ft__grid{ width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:767px){
  .ft{ padding:40px 16px 0; }
  .ft__grid{ grid-template-columns:1fr; gap:20px; }
  .ft__band .row{ gap:12px; }
}

/* SPの追従バー ---------------------------------------------------- */
.barWrap{ display:none; }
@media (max-width:767px){
  .barWrap{ position:fixed; left:0; right:0; bottom:0; z-index:40; height:64px;
            display:flex; background:#fff; border-top:1px solid var(--line);
            box-shadow:0 -2px 12px rgba(18,85,143,.12); }
  .barWrap .btnA, .barWrap .btnB{ width:auto; border-radius:0; height:64px; margin:0; }
}

/* 動く部品 -------------------------------------------------------- */
.faqA{ display:none; }
.faqOpen .faqA{ display:flex; }
.faqQ{ cursor:pointer; }

/* 印刷 ------------------------------------------------------------ */
@media print{
  .hd, .barWrap, .drawer{ display:none !important; }
}

/* 表は狭い画面で横スクロール（build-theme.js が .tscroll で包む） --- */
.tscroll{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.tscroll > table{ min-width:560px; }
@media (max-width:767px){
  .tscroll > table{ min-width:460px; }
}

/* 縦に積んだ箱の中身が、箱より広くならないようにする ---------------- */
@media (max-width:1279px){
  main [style*="flex-direction:column"] > *{ max-width:100%; min-width:0; }
  main .card > *{ max-width:100%; }
}

/* 1行の長さを抑える ------------------------------------------------
   ボードは1280px固定で描かれているので、中央寄せの文章が
   1行96文字まで伸びていた。日本語で追える長さは35〜45文字。
   箱の幅は変えず、文章の行だけ詰める。
   max-width なので、もともと狭いカードの中では何も起きない。 */
@media (min-width:768px){
  .lead, .ctaLead{ max-width:40em; margin-left:auto; margin-right:auto; }
  .bd{ max-width:44em; }
  .cap, .sm{ max-width:58em; }

  /* もともと中央寄せの文は、箱も中央に置かないと左に寄って見える */
  .bd[style*="text-align:center"],
  .cap[style*="text-align:center"],
  .sm[style*="text-align:center"]{ margin-left:auto; margin-right:auto; }

  /* 表・入力欄・ボタンの中は対象外。幅いっぱいで正しい */
  td .bd, th .bd, td .cap, td .sm, .btnA .bd, .faqQ .bd{ max-width:none; }
}

/* 「項目と値」の表は引き伸ばさない（build-theme.js が .tdef を付ける） */
@media (min-width:768px){
  .tdef{ max-width:880px; }
  .tdef th{ width:220px; }
}

/* 写真の拡大率 ----------------------------------------------------
   枠に直書きされた background:#xxx の一括指定が、design-base.css の
   background-size:cover を打ち消していた。画像が原寸で置かれ、
   枠からはみ出した部分が切れる。直書きより強く指定して上書きする。 */
.ph.im{
  background-size:cover !important;
  background-position:center;
  background-repeat:no-repeat !important;
}
