@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;
    color: global.$text-color-light;

    @include acms.font-size(14);

    line-height: 2;
    text-align: center;
  }

  .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 {
  margin: 0 0 30px;
  padding: 20px 10px;
  border: 1px solid global.$border-color-base;

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

    @include acms.font-size(12);

    text-align: center;
  }

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

    @include acms.font-size(20);

    text-align: center;
  }

  .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;
    margin: 0 0 50px;
    padding: 0;
    text-align: center;
    list-style: none;
  }

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

    @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;
  }
}

@media screen and (min-width: acms.$breakpoint-sm-min) {
  .calendar-year {
    .year-table {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      justify-content: space-between;
    }

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

@media screen and (min-width: acms.$breakpoint-md-min) {
  .calendar-year {
    .year-table-month {
      width: calc(100% / 3);
    }
  }
}
