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

/* ------------------------------
　　ベース
------------------------------ */
html {
  scroll-behavior: smooth;
  font-family: global.$font-base;
  line-height: global.$line-height-lg;
  color: global.$color-text;
  scroll-padding-top: global.$header-height-fixed + 2rem;
  background: global.$color-white;
}

body {
  margin: 0;
}

/* リンクの設定 */
a {
  border: none;

  &[href^="tel:"] {
    color: currentcolor;
    text-decoration: none;
    border-bottom: global.$border-width-sm dashed;

    &:hover {
      text-decoration: none;
      border: 0;
    }
  }
}

/* コンテナー */
.acms-container {
  max-width: global.$container;
  padding-right: calc(var(--theme-gap-x) / 2);
  padding-left: calc(var(--theme-gap-x) / 2);

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

  .acms-container {
    padding: 0;
  }
}

.container-md {
  box-sizing: border-box;
  max-width: global.$container-md;
  padding-right: calc(var(--theme-gap-x) / 2);
  padding-left: calc(var(--theme-gap-x) / 2);
  margin: 0 auto;

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

.container-sm {
  --gutter: var(--theme-gap-sm-x);

  box-sizing: border-box;
  max-width: global.$container-sm;
  padding-right: calc(var(--theme-gap-x) / 2);
  padding-left: calc(var(--theme-gap-x) / 2);
  margin: 0 auto;

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

/* グリッドシステム
----------------------------- */
.acms-cssgrid {
  --acms-gap: var(--theme-gap-x);
}

/* レイアウト
----------------------------- */
.layout-two-columns {
  display: flex;
  flex-direction: column;
  gap: 5rem 0;
}

@include acms.media-breakpoint-up(md) {
  .layout-two-columns {
    flex-direction: row;
    gap: 0 32px;

    .layout-main {
      width: calc(100% - 350px);
    }

    .layout-side {
      width: 350px;
    }
  }
}

main {
  margin: 0 0 5rem;
}

@include acms.media-breakpoint-up(md) {
  main {
    margin: 0 0 6.5rem;
  }
}

/* 固定コンテンツ */
.sticky-contents {
  position: fixed;
  bottom: 0;
  z-index: global.$zindex-fixed-contents;
  box-sizing: border-box;
  display: none;
  width: 100%;
  padding: 1rem 0;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.3s, transform 0.2s;

  &.is-centered {
    text-align: center;
  }

  &.is-show {
    opacity: 1;
    transform: translateY(0);
  }

  &.is-active {
    display: block;
  }
}
