@use "global/acms-common" as acms;
@use "global/common" as global;

/* ------------------------------
　　カレンダー
------------------------------ */
.calendar-table {
  width: 100%;
  margin: 0 0 15px;
  table-layout: fixed;

  td {
    padding: 1px;
    line-height: 2;
    color: global.$text-color-light;
    text-align: center;

    @include acms.font-size(14);
  }

  .week {
    color: global.$text-color-base;

    &.sat {
      color: global.$week-color-sat;
    }

    &.sun {
      color: global.$week-color-sun;
    }
  }

  .success {
    a {
      display: inline-block;
      width: 100%;
      height: 100%;
      background-color: global.$key-color;

      @include global.link-color(#FFF);
      @include global.transition-opacity;

      &:hover {
        opacity: global.$opacity-hover;
      }
    }
  }
}

/* ------------------------------
　　月間カレンダー
------------------------------ */
.calendar-month {
  padding: 20px 10px;
  margin: 0 0 30px;
  border: 1px solid global.$border-color-base;

  .year {
    margin: 0 0 3px;
    font-weight: bold;
    text-align: center;

    @include acms.font-size(12);
  }

  .month {
    margin: 0 0 10px;
    font-weight: bold;
    text-align: center;

    @include acms.font-size(20);
  }

  .link-outer {
    margin: 0;
    text-align: center;
  }

  .link {
    @include acms.font-size(14);
    @include global.link-color(global.$text-color-light);
    @include global.only-underline-on-hover;
  }
}

/* ------------------------------
　　年間カレンダー
------------------------------ */
.calendar-year {
  .year-nav {
    position: relative;
    padding: 0;
    margin: 0 0 50px;
    text-align: center;
    list-style: none;
  }

  .year-nav-center {
    margin: 0 10px;
    font-weight: bold;
    color: global.$text-color-base;

    @include acms.font-size(28);
  }

  .year-nav-prev-link,
  .year-nav-next-link {
    position: absolute;

    @include global.link-color(global.$text-color-base);
    @include global.only-underline-on-hover;

    span {
      @include acms.font-size(20);
    }
  }

  .year-nav-prev-link {
    top: 9px;
    left: calc(50% - 80px);
  }

  .year-nav-next-link {
    top: 9px;
    right: calc(50% - 80px);
  }

  .year-table {
    display: block;
    margin: 0 -15px;
  }

  .year-table-month {
    box-sizing: border-box;
    width: 100%;
    padding: 0 15px 35px;
  }

  .month-date-outer {
    margin: 0 0 10px;
    text-align: center;
  }

  .month-date {
    font-weight: bold;

    @include acms.font-size(20);
    @include global.link-color(global.$text-color-base);
    @include global.only-underline-on-hover;
  }
}

@include acms.media-breakpoint-up(sm) {
  .calendar-year {
    .year-table {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      justify-content: space-between;
    }

    .year-table-month {
      width: calc(100% / 2);
    }
  }
}

@include acms.media-breakpoint-up(md) {
  .calendar-year {
    .year-table-month {
      width: calc(100% / 3);
    }
  }
}
