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

/* ------------------------------
　　ページャー
------------------------------ */
.pager {
  margin: 0 -0.25rem 2.5rem;
  padding: 0;
  font-size: map.get(global.$font-scales, heading-ss);
  text-align: center;
  list-style: none;

  li {
    display: inline-block;
    margin: 0 0.25rem 0.5rem;

    &.cur { /* 現在いる位置 */
      box-sizing: border-box;
      width: 3rem;
      height: 3rem;
      padding: 0.25rem;
      color: global.$color-text-primary;
      background: global.$color-white;
      border: global.$border-width-md solid global.$color-primary;
      border-radius: global.$border-radius-lg;
    }

    span:not([class]) {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
    }
  }
}

.pager-link {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 3rem;
  height: 3rem;
  padding: 0.25rem;
  color: global.$color-text-inverse;
  text-decoration: none;
  background: global.$color-primary;
  border: 2px solid transparent;
  border-radius: global.$border-radius-lg;

  &:any-link {
    color: global.$color-text-inverse;
  }

  &:hover {
    color: global.$color-text-inverse;
    text-decoration: none;
    background: global.$color-primary-hover;
  }

  .svg-arrow-line {
    fill: global.$color-text-inverse;
  }
}

.pager-link-forward {
  float: right;
}

.pager-link-prev {
  float: left;
}

/* 前後リンク */
.serial-nav {
  margin: 0 0 4rem;
  border-top: global.$border-width-sm solid global.$color-gray40;
}

.serial-nav-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.serial-nav-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  line-height: global.$line-height-base;
  border-bottom: global.$border-width-sm solid global.$color-gray40;

  a {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    padding: 1rem;
    color: global.$color-text;
    text-decoration: none;

    &:hover,
    &:visited,
    &:focus,
    &:active {
      color: inherit;
      text-decoration: none;
    }

    &:hover {
      text-decoration: none;
      background: global.$color-gray10;
    }
  }
}

.serial-nav-item-prev {
  text-align: left;

  a {
    align-items: flex-start;
  }

  svg {
    margin: 0 0.5rem 0 0;
  }
}

.serial-nav-item-next {
  text-align: right;

  a {
    align-items: flex-end;
  }

  svg {
    margin: 0 0 0 0.5rem;
  }
}

.serial-nav-item-index {
  display: none;
  width: auto;
  font-weight: bold;
  font-size: map.get(global.$font-scales, body-m);
  white-space: nowrap;

  a {
    align-items: center;
    justify-content: center;
  }
}

.serial-nav-arrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.5rem;
  font-weight: bold;
  font-size: map.get(global.$font-scales, body-m);

  svg {
    box-sizing: border-box;
    width: 1.25rem;
    height: 1.25rem;
    padding: 6px;
    background: global.$color-secondary;
    border-radius: global.$border-radius-circle;
  }
}

.serial-nav-index {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-weight: bold;
  font-size: map.get(global.$font-scales, body-m);

  a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem 1.25rem;
    color: global.$color-text;

    &:hover,
    &:visited,
    &:focus,
    &:active {
      color: inherit;
      text-decoration: none;
    }

    &:hover {
      text-decoration: none;
      background: global.$color-gray10;
    }
  }
}

@media screen and (min-width: acms.$breakpoint-md-min) {
  .serial-nav {
    margin: 0 0 4rem;
  }

  .serial-nav-list {
    flex-direction: row;
  }

  .serial-nav-item {
    width: 50%;

    a {
      padding: 2rem;
      border: 0;
    }
  }

  .serial-nav-arrow {
    font-size: map.get(global.$font-scales, heading-ss);
  }

  .serial-nav-item-index {
    display: flex;
    width: auto;

    a {
      padding: 2rem 2.5rem;
    }
  }

  .serial-nav-index {
    display: none;
  }
}
