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

/* ------------------------------
　　フッター
------------------------------ */
.footer {
  margin: global.$footer-margin-top-md 0 0 0;
  border-top: global.$border-width-sm solid global.$color-gray20;

  .cta-visual + &,
  .cta + & {
    margin-top: 0;
  }
}

.footer-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 3rem 0;
}

.footer-item {
  display: flex;
  box-sizing: border-box;
  padding-right: calc(global.$unit-gutter-var / 2);
  padding-left: calc(global.$unit-gutter-var / 2);

  @if global.$enable-iphonex == true {
    padding-right: calc(env(safe-area-inset-right) + (global.$unit-gutter-var / 2));
    padding-left: calc(env(safe-area-inset-left) + (global.$unit-gutter-var / 2));
  }

  &.-navigation {
    display: none;
  }
}

/* 企業情報 */
.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: global.$color-text-side;
}

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

.footer-company-logo {
  margin: 0;
}

@media screen and (min-width: acms.$breakpoint-md-min) {
  .footer {
    margin: global.$footer-margin-top-lg 0 0 0;

    .cta-visual &,
    .cta & {
      margin-top: 0;
    }
  }

  .footer-group {
    flex-direction: row;
  }

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

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

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

.footer-address-name {
  margin: 0 0 5px;
  color: global.$color-text-side;
}

.footer-address-item {
  margin: 0;
  color: global.$color-text-side;
  font-size: map.get(global.$font-scales, body-s);
}

/* ナビゲーション */
.footer-item-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.footer-nav {
  margin: 0;
  font-size: map.get(global.$font-scales, body-s);
}

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

.footer-nav-item {
  font-weight: bold;
  font-size: map.get(global.$font-scales, body-m);

  .footer-nav-item {
    position: relative;
    margin: 0 0 0 1rem;
    font-weight: normal;
    font-size: map.get(global.$font-scales, body-s);

    &::before {
      position: absolute;
      top: 0.5em;
      left: -1rem;
      display: inline-block;
      border: 0.2rem solid transparent;
      border-left: 0.4rem solid rgb(0 0 0 / 30%);
      content: "";
    }
  }
}

.footer-nav-link {
  display: inline-block;
  margin: 0 0 1rem;
  color: global.$color-text;
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }

  .footer-nav-item .footer-nav-item & {
    margin: 0 0 0.5rem;
    color: global.$color-text-side;

    &:hover {
      color: global.$color-text;
    }
  }

  & + .footer-nav-group {
    margin-top: -5px;
  }
}

/* サブ項目 */
.footer-nav-side {
  display: flex;
  margin-top: auto;
  border-top: global.$border-width-sm solid global.$color-primary-light;
}

/* インラインナビゲーション */
.footer-nav-inline {
  display: flex;
}

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

.footer-nav-inline-item {
  margin: 1rem 2rem;

  &:first-child {
    margin-left: 0;
  }

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

.footer-nav-inline-link {
  @include global.link-color(global.$color-text-inverse);
}

.footer-bottom {
  padding: 1rem 0;
  border-top: global.$border-footer;
}

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

/* SNS */
.footer-bottom-sns {
  display: none;
}

.footer-sns {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin: 0.5rem 0 0 auto;
}

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

.footer-sns-item {
  margin: 0 0.25rem;

  &:first-child {
    margin-left: 0;
  }

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

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

@media screen and (min-width: acms.$breakpoint-md-min) {
  .footer-bottom-inner {
    display: flex;
    align-items: center;
  }

  .footer-copyright-text {
    margin: 0;
  }

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

  .footer-sns {
    display: none;
  }
}
