@use 'utils/base' as *;
@use 'font' as *;
@use 'reset' as *;
@use 'libraries' as *;
@use 'helpers' as *;
@use 'common' as *;

:root {
  --section-padding: #{rem(100)};
  --inner-padding: #{rem(30)};

  @media screen and (max-width: rem($breakpoint-lg)) {
    --section-padding: #{rem(80)};
    --inner-padding: #{rem(24)};
  }
  @media screen and (max-width: rem($breakpoint-sm)) {
    --section-padding: #{rem(60)};
    --inner-padding: #{rem(20)};
  }
}

/* layout */
body {
  font-family: $font-family-default;
  color: $almost-black;
  letter-spacing: -0.05em;
  line-height: $line-height-base;
}
section {
  position: relative;
  overflow: hidden;
}
#wrap {
  position: relative;
}
.inner {
  max-width: rem(1200);
  padding-inline: var(--inner-padding);
  margin: 0 auto;
  box-sizing: content-box;
}

/* header */
:root {
  --header-height: #{rem(80)};
}
.header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: $zindex-fixed;
  transition:
    transform 0.5s,
    background-color 0.5s;

  &.is-scrolled {
    transform: translateY(-100%);
    background-color: rgb($primary-color, 0.5);
    backdrop-filter: blur(rem(10));
  }
  &.is-scroll-up {
    transform: translateY(0%);
  }
}
.header {
  display: flex;
  justify-content: center;
  height: var(--header-height);
  background-color: $white;
}
.header-inner {
  flex-grow: 1;
  display: flex;
  gap: rem(20);
  max-width: rem(1600);
}
.header-area {
  display: flex;
  align-items: center;
  &.area-side {
    flex-grow: 1;
    flex-basis: 0;
  }
  &.area-end {
    justify-content: end;
  }
}

.header-logo {
  img {
    display: block;
    width: auto;
    height: rem(40);
  }
  .logo-light {
    display: none;
  }
}
.header-nav-items {
  display: flex;
  flex-wrap: wrap;
  gap: rem(10) rem(50);
}

@media screen and (max-width: rem($breakpoint-md)) {
  :root {
    --header-height: #{rem(60)};
  }
  .header-wrapper {
    &.is-sitemap-open {
      position: fixed;
      z-index: $zindex-fixed + 2;
      transform: translateY(0%);
    }
  }
  .header-inner {
    padding-right: 0;
  }
  .header-logo {
    img {
      height: rem(24);
    }
  }

  .header-sitemap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: rem(60);
    height: rem(60);
    padding: rem(10);
    outline: none;
    .btn-icon {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      width: rem(24);
      height: rem(20);
    }
    .btn-line {
      width: 100%;
      height: 1px;
      background-color: currentColor;
      transition: all 0.3s;
    }

    .is-scrolled & .btn-line {
      background-color: currentColor;
    }
    .is-sitemap-open & {
      .btn-line {
        &:first-child {
          transform: translateY(calc(rem(10) - 50%)) rotate(45deg);
        }
        &:nth-child(2) {
          opacity: 0;
        }
        &:last-child {
          transform: translateY(calc(rem(-10) + 50%)) rotate(-45deg);
        }
      }
    }
  }

  .sitemap {
    display: none;
    position: fixed;
    inset: 0;
    z-index: $zindex-fixed + 1;
    padding-top: var(--header-height);
    background-color: $primary-color;
    color: $white;
    &.is-sitemap-open {
      display: block;
    }
  }
  .sitemap-inner {
    height: 100%;
    overflow-y: auto;
  }
  .sitemap-nav {
    padding: rem(60) 0;
  }
  .sitemap-list {
    display: flex;
    flex-direction: column;
    .list-item {
    }
    .list-btn {
      display: flex;
      align-items: center;
      height: rem(60);
      padding: 0 rem(50);
    }

    .list-btn.active {
      background-color: $white;
      color: $primary-color;
    }
  }
}

/* footer */
.footer {
  padding: var(--section-padding) 0;
  background-color: #eee;
}
.footer-inner {
  max-width: rem(1800);
}
.footer-policy-list {
  margin-bottom: rem(20);
  .list-item {
    &::before {
      content: ' · ';
      word-spacing: -0.3em;
      margin-inline: 0.5em;
    }
  }
  .list-item:first-child {
    &::before {
      content: none;
    }
  }
}
.footer-info {
  margin-bottom: rem(20);
}
.footer-info-list {
  margin: 0 rem(-10);
  .list-item {
    display: inline;
    margin: 0 rem(10);
  }
}

/* credits */
.credits {
  svg {
    fill: currentColor;
  }
  &:hover {
    color: #31b8b7;
  }

  .credits-logo.logo-view3 {
    svg {
      height: 0.8em;
    }
  }
  .credits-logo.logo-creative-view {
    svg {
      height: 1em;
    }
  }
}
