@use "sass:map";
@use "global/acms-common" as acms;
@use "global/common" as global;

/* ------------------------------
　　フッター
------------------------------ */
.footer {
  margin-block-start: var(--footer-margin-top);
  border-top: var(--border-width-sm) solid var(--color-gray20);

  .form-search-button {
    min-width: initial;
  }
}

/* 背景色付きCTAがフッター上にある時は上余白を詰める */
.cta-visual-section + .footer {
  margin-block-start: 0;
}

/* フッターメインコンテンツレイアウト
----------------------------- */
.footer-group {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  padding: 3rem 0;
}

.footer-item {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;

  &.-navigation {
    gap: 1.5rem;
  }
}

/* サイト情報
----------------------------- */
.footer-item-title {
  display: flex;
  flex-direction: column;
  width: 100%;
  font-size: map.get(global.$font-scales, body-s);
}

.footer-company-catch {
  margin: 0 0 0.5rem;
  color: var(--color-text-2nd);
}

.footer-company-title {
  margin: 0 0 1rem;
  font-size: map.get(global.$font-scales, heading-s);
  line-height: var(--line-height-none);
}

.footer-company-logo {
  max-height: 2rem;
  margin: 0;
}

@include acms.media-breakpoint-up(md) {
  .footer-group {
    flex-direction: row;
    gap: 3.5rem;
    padding: 3.5rem 0;

  }

  .footer-item {
    &.-address {
      width: calc(4 / 12 * 100%);
    }

    &.-navigation {
      width: calc(8 / 12 * 100%);
    }
  }
}

/* 所在地 */
.footer-address {
  margin-top: auto;
  font-style: normal;
}

.footer-address-name {
  margin: 0 0 0.5rem;
  font-size: map.get(global.$font-scales, body-m);
  line-height: var(--line-height-base);
  color: var(--color-text-2nd);

}

.footer-address-item {
  margin: 0 0 0.5rem;
  font-size: map.get(global.$font-scales, body-s);
  color: var(--color-text-2nd);

  a {
    color: inherit;

    &:any-link {
      text-decoration: underline dotted 1px;
      text-underline-offset: 3px;
    }

    @media (hover: hover) {
      &:hover {
        text-decoration: none;
      }
    }
  }
}

/* ナビゲーション
----------------------------- */
.footer-item-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  justify-content: space-between;
  width: 100%;

  @include acms.media-breakpoint-up(lg) {
    gap: 2rem;
  }
}

.footer-nav {
  flex: 1 0 calc(50% - 1rem);
  margin: 0;
  font-size: map.get(global.$font-scales, body-s);
  line-height: var(--line-height-base);

  @include acms.media-breakpoint-up(lg) {
    flex: 1 0 calc(25% - 2rem);
  }
}

.footer-nav-group {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-nav-item {
  margin: 0 0 1rem;
  font-size: map.get(global.$font-scales, body-s);
  font-weight: bold;
  color: var(--color-text);
}

.footer-nav-item .footer-nav-item {
  position: relative;
  margin: 0;
  font-weight: normal;
  color: var(--color-text-2nd);
}

.footer-nav-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;

  @media (hover: hover) {
    &:any-link:hover {
      text-decoration: underline dotted 1px;
      text-underline-offset: 3px;
    }
  }
}

.footer-nav-link + .footer-nav-group {
  margin-top: 0.5rem;

  .footer-nav-group {
    margin-top: 0;
  }
}

.footer-nav-item .footer-nav-item .footer-nav-link {
  position: relative;
  padding: 0.5rem 0 0.5rem 1rem;

  &::before {
    position: absolute;
    top: calc(50% - 0.5rem);
    left: 0;
    box-sizing: border-box;
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-block-start: 1px; /* アイコンとテキストの垂直方向位置調整 */
    content: "";
    background-image: url("#{global.$root-theme-img}icon-color/list-before-gray.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.375rem;
  }
}

/* 検索フォーム
----------------------------- */
.footer-item .form-search {
  @include acms.media-breakpoint-up(md) {
    display: flex;
  }

  .form-search-label {
    display: block;
    font-weight: bold;

    @include acms.media-breakpoint-down(md) {
      margin-bottom: 0.5rem;
      line-height: initial;
    }
  }
}

/* コピーライト・SNS
----------------------------- */
.footer-bottom-inner {
  display: flex;
  align-items: center;
  padding-bottom: 1.5rem;
}

/* コピーライト */
.footer-copyright-text {
  margin: 0;
  font-size: map.get(global.$font-scales, body-s);
  font-weight: bold;
  line-height: var(--line-height-base);
}

/* SNS */
.footer-bottom-sns {
  display: block;
  margin-left: auto;
}

.footer-sns-group {
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-sns-item {
  &:first-child {
    margin-left: 0;
  }

  &:last-child {
    margin-right: 0;
  }
}

.footer-sns-link {
  display: inline-block;
  vertical-align: top;
}
