/* =========================================================
 * footer.css : サイト共通フッター
 * SPアコーディオンは全列クローズが初期状態。
 * ========================================================= */

.site-footer {
  background: var(--color-bg-dark);
  color: var(--color-bg-white);
  position: relative;
}

/* ----- ページ上部に戻る（SP表示） ----- */
.site-footer__back-to-top {
  display: none;
}

@media (max-width: 1024px) {
  .site-footer__back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    font-family: var(--font-jp);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--color-bg-white);
    transition: opacity var(--transition-base);
  }

  .site-footer__back-to-top:hover {
    opacity: 0.85;
  }

  .site-footer__back-to-top__arrow {
    width: 10px;
    height: 7px;
    background-color: currentColor;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }
}

.site-footer__inner {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: 29px var(--container-pad-sp) 68px;
  display: grid;
  gap: 5px;
}

@media (min-width: 1025px) {
  .site-footer__inner {
    grid-template-columns: 332px 1fr;
    gap: 55px;
    padding: 50px 100px 95px;
    max-width: 1440px;
  }
}

/* ブランド列: ロゴ + 住所。SPは gap 15 / 住所に上下padding。
   PCは下の@mediaで gap 26 に戻す。 */
.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

@media (min-width: 1025px) {
  .site-footer__brand { gap: 26px; }
}

.site-footer__logo {
  width: 164px; /* SP: 164x40 */
  height: auto;
}

@media (min-width: 1025px) {
  .site-footer__logo { width: 218px; } /* PC: 218x53 */
}

.site-footer__address {
  font-family: var(--font-jp);
  font-weight: 400;
  /* SP: 14px / lh24 */
  font-size: 14px;
  line-height: 24px;
  padding-block: 11px 10px; /* 上下余白（93 = 11+72+10） */
  color: var(--color-bg-white);
}

@media (min-width: 1025px) {
  .site-footer__address {
    font-size: 14px;
    line-height: 28px; /* PC: lh28 */
    padding-block: 0;
  }
}

.site-footer__address p {
  margin: 0;
}

.site-footer__nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 80px;
}

/* PC: ナビ列はブランド（ロゴ・住所）より 47px 下から始まる。
   grid の stretch のため margin-top だと高さが削られる → padding-top で行を伸ばす。 */
@media (min-width: 1025px) {
  .site-footer__nav { padding-top: 47px; }
}

@media (min-width: 768px) {
  .site-footer__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1025px) {
  .site-footer__nav {
    grid-template-columns: 140px 192px 143px 1fr;
  }
}

/* 中間幅(1025〜1439px)の流動化。1440固定設計で1025で切替わるが、間の幅では
   ブランド332px・padding100px・ナビの固定列(140/192/143)+gap80px が収まらず、
   4列目「各種フォーム」が画面外へ溢れて横スクロールしていた。
   → 1440は凍結したまま、この帯だけ padding/gap/列を可変にして4列を詰める。 */
@media (min-width: 1025px) and (max-width: 1439px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 332px) 1fr; /* ブランド列も縮められるように */
    column-gap: clamp(24px, 3vw, 55px);
    padding-inline: clamp(24px, 5vw, 100px);
  }
  .site-footer__nav {
    grid-template-columns: auto auto auto auto; /* 内容幅・縮小可 */
    column-gap: clamp(20px, 2.5vw, 80px);
  }
  .site-footer__col { min-width: 0; }
  .site-footer__col-list--service { width: auto; } /* 208px固定を解除 */
}

.site-footer__col {
  /* <details> 要素として使用 */
  margin: 0;
}

.site-footer__col-title {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--color-bg-white);
  margin: 0;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.site-footer__col-title::-webkit-details-marker {
  display: none;
}

.site-footer__col-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 2.1;
  letter-spacing: 0.04em;
  color: var(--color-bg-white);
}

@media (min-width: 1025px) {
  /* サービス列のリンク箱は w=208px で、見出し箱(176px)より広く列間gap(80px)へはみ出す設計。
     グリッド列(192px)に収めると「ｰ Web集客コンサルティング」が折れて「グ」だけの行ができる。 */
  .site-footer__col-list--service { width: 208px; }

  .site-footer__col {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .site-footer__col-title {
    font-size: 14px;
    font-weight: 400;
    padding-bottom: 14px;
    /* Figma(フッター列見出しの下線)は白1px。以前 accent(金)だった＝色違い（全ページ波及）。 */
    border-bottom: 1px solid var(--color-bg-white);
    line-height: 1;
    cursor: default;
    user-select: text;
  }
  .site-footer__col-title::after {
    display: none;
  }
  .site-footer__col-list {
    font-size: 14px;
    line-height: 2;
  }
}

/* ----- SP: アコーディオン UI ----- */
@media (max-width: 1024px) {
  .site-footer__col {
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  }

  .site-footer__col-title {
    height: 60px;
    font-weight: 400;
    font-size: 16px;
    /* SP: 見出しは lh24 / ls0。base の lh1.4・ls0.04em を打ち消す。 */
    line-height: 24px;
    letter-spacing: normal;
    padding-right: 4px;
  }

  .site-footer__col-title::after {
    content: "";
    width: 10px;
    height: 6px;
    background-color: currentColor;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transition: transform var(--transition-base);
    flex-shrink: 0;
  }

  .site-footer__col[open] > .site-footer__col-title::after {
    transform: rotate(180deg);
  }

  .site-footer__col-list {
    padding-block: 8px 24px;
    padding-left: 6px;
  }
}

.site-footer__col-list a {
  color: var(--color-bg-white);
  transition: color var(--transition-base);
}

.site-footer__col-list a:hover {
  color: var(--color-accent);
}

.site-footer__sub-list {
  padding-left: 18px;
}

@media (min-width: 1025px) {
  /* PCのフッター「サービス」列の子項目は 14px 字下げする。
     ※SPはアコーディオンで別レイアウト。ベースの18pxを据え置く。 */
  .site-footer__sub-list { padding-left: 14px; }
}

.site-footer__col-list--service .site-footer__group {
  margin-top: 0;
}

.site-footer__col-list--service .site-footer__group + .site-footer__group {
  margin-top: 0;
}

.site-footer__group-title {
  font-weight: 400;
}

/* Bottom copyright bar */
.site-footer__bottom {
  background: var(--color-bg-deep-beige);
  color: var(--color-bg-dark);
  padding-block: 16px; /* SP: 上下16px → 16+38+16=70 */
}

@media (min-width: 1025px) {
  /* PC: 58px（18+22+18） */
  .site-footer__bottom { padding-block: 18px; }
}

.site-footer__bottom-inner {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad-sp);
  display: flex;
  flex-direction: column;
  /* SP: gap 0。リンク行(10px)が上、コピーライト(8px)が下。
     マークアップはPC基準(コピーライト→リンク)なので order で入れ替える。 */
  gap: 0;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-en);
  line-height: 22px;
}

@media (max-width: 1024px) {
  /* SP: fs8 だが行の箱は h=16。帯の中身 38 = リンク22 + コピーライト16 なので 16px を明示する。 */
  .site-footer__copyright { order: 2; font-size: 8px; line-height: 16px; }
  .site-footer__legal     { order: 1; font-size: 10px; gap: 24px; }  /* SP: 10px lh22 / gap 24 / fw400 */
}

@media (min-width: 1025px) {
  .site-footer__bottom-inner { font-size: 12px; } /* PC: 12px lh22 */
}

@media (min-width: 768px) {
  .site-footer__bottom-inner {
    flex-direction: row;
  }
}

@media (min-width: 1025px) {
  .site-footer__bottom-inner {
    padding-inline: 0;
  }
}

.site-footer__copyright {
  font-weight: 400;
}

.site-footer__legal {
  display: flex;
  gap: 30px;
  /* SP=400 / PC=700。base(=SP)を400にし、PCで700へ。
     以前は無条件で700にしていたため、SPの@media override(source上より前)を
     source-orderで打ち消してSPも700になっていた。 */
  font-weight: 400;
}

@media (min-width: 1025px) {
  .site-footer__legal { font-weight: 700; }
}

.site-footer__legal a {
  color: var(--color-bg-dark);
  transition: opacity var(--transition-base);
}

.site-footer__legal a:hover {
  opacity: 0.7;
}
