@charset "utf-8";

.p-footer {
  background-color: #3c3c3c;
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-feature-settings: "palt";
  letter-spacing: .025em;
  --_border-color: #666;
  --_border-width: 1px;
}

:where(.p-footer *) {
  max-height: 100%;
}

/* -----------------------------------------------
* Project: Footer Top
* -------------------------------------------------- */

.p-footer-top {
  padding-inline: 36px;
  font-size: 14px;
  --ft-gap: 50px;
  --ft-narrow: fit-content;
  --ft-wide-min: 480px;
  --ft-wide-max: 980px;
  --ft-list-gap: var(--ft-gap);
  --ft-list-max-h: 250px;


  @media (769px <=width < 1150px) {
    padding-inline: 12px;
    font-size: 13.5px;
    --ft-gap: 30px;
  }
}

.p-footer-top a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;

  &:hover {
    color: var(--gaia-color-secondary);
  }
}

.p-footer-top__inner {
  padding-block: 54px 2px;
  max-width: 1120px;

  @media (min-width: 769px) {
    padding-block: 70px 18px;
  }
}



.p-footer-top__sections {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: var(--_border-width) solid var(--_border-color);

  @media (min-width: 769px) {
    padding-bottom: 44px;
    width: 100%;
  }
}

.p-footer-top__section {
  border-top: var(--_border-width) solid var(--_border-color);
}

/* SP: 見出し行のみ表示（右矢印付き） */
.p-footer-top__heading a {
  position: relative;
  display: block;
  padding: 16px 24px 16px 2px;
}

.p-footer-top__heading a::after {
  content: '';
  position: absolute;
  right: 5px;
  top: 50%;
  --_size: 12px;
  width: var(--_size);
  height: var(--_size);
  border-right: var(--_border-width) solid currentColor;
  border-top: var(--_border-width) solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.p-footer-top__links {
  display: none;
}

/* PC: リンク群展開 */
@media (min-width: 769px) {

  /* PCは不規則幅のためflex-wrapで配置。auto-fitの均等感を排除 */
  .p-footer-top__sections {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--ft-gap);
    row-gap: var(--ft-gap);

    /* 最後のセクションに余白 */
    &:after {
      content: '';
      width: auto;
      flex:1;
      min-width: 18%;
      height: 0;
    }
  }

  .p-footer-top__section {
    flex: 1 1 var(--ft-narrow);

    &:not(:has(.p-footer-top__links)) {
      max-width: fit-content;
    }
  }

  /* 子に10件目があるセクションは横幅を広く（企業情報を想定） */
  .p-footer-top__section:has(> .p-footer-top__links > :nth-child(10)) {
    min-width:50%;

    /* 子にバッジがあるセクションは横幅を更に広く（サービスを想定） */
    &:has([data-badge]) {
      min-width:70%;
    }
  }

  .p-footer-top__section {
    border-top: 0;
    padding: 0;
  }

  .p-footer-top__heading a {
    padding: 0 0 1em 0;
    width: fit-content;
  }

  /* リンク群がある場合は下線を引く */
  .p-footer-top__heading:has(~.p-footer-top__links) {
    border-bottom: 1px solid var(--_border-color);
  }

  .p-footer-top__heading a::after {
    display: none;
  }

  .p-footer-top__links {
    display: grid;
    gap: 10px;
    margin-top: 14px;
  }

  /* 2列にしたいリストはflexの column wrap で縦詰め（Columnsに近い並び） */
  .p-footer-top__section:has(> .p-footer-top__links > :nth-child(10)) .p-footer-top__links {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px var(--ft-list-gap);
    max-height: var(--ft-list-max-h);
  }

}

/* -----------------------------------------------
* Project: Footer Bottom
* -------------------------------------------------- */

.p-footer-bottom {
  font-size: 12px;

  @media (min-width: 769px) {
    font-size: 14px;
  }
}

.p-footer-bottom a {
  text-decoration: none;
  color: inherit;
}

.p-footer-bottom__inner {
  padding: 30px 20px 40px;
  max-width: 1120px;

  @media (min-width: 769px) {
    padding: 30px 0px 40px;
  }
}

/* Top area: brand + offices */
.p-footer-bottom__top {
  display: grid;
  gap: 30px;

  @media (min-width: 769px) {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 45px;
  }
}

.p-footer-bottom__brand {
  display: grid;
  gap: 12px;
  justify-items: center;

  @media (min-width: 769px) {
    justify-items: start;
  }
}

.p-footer-bottom__logo img {
  display: block;
  width: 100%;
  /* フッター背景に対して白ロゴに変換 */
  filter: brightness(0) invert(1);

  @media (min-width: 769px) {
    width: 380px;
  }
}

.p-footer-bottom__info {
  margin-top: calc(.5em - .5lh);
}

.p-footer-bottom__office {
  text-align: center;

  @media (min-width: 769px) {
    letter-spacing: 0.02em;
    text-align: left;
  }

  &+& {
    margin-top: 1lh;

    @media (min-width: 769px) {
      margin-top: 0;
    }
  }
}

/* SNS */
.p-footer-bottom__sns {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.p-footer-bottom__sns-link {
  display: grid;
  place-items: center;
  --_size: 40px;
  width: var(--_size);
  height: var(--_size);
}

.p-footer-bottom__sns-link img {
  display: block;
  width: 100%;
  height: auto;
}

/* Footer menu */
.p-footer-bottom__nav {
  margin-top: 22px;
}

.p-footer-bottom__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  justify-items: center;

  @media (min-width: 769px) {
    grid-auto-flow: column;
    justify-content: center;
    gap: 0;
  }
}

.p-footer-bottom__menu-item {
  padding-inline: .8em;

  @media (min-width: 769px) {

    &+& {
      position: relative;

      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        height: 70%;
        transform: translateY(-50%);
        border-left: 1px solid var(--gaia-color-secondary);
      }
    }
  }
}

.p-footer-bottom__menu-link {
  &:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}



/* Copyright */
.p-footer-bottom__copyright {
  margin: 22px 0 0;
  text-align: center;
}