@charset "UTF_8";

body {
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  padding: 64px 32px 24px;
}

h1 {
  font-size: 32px;
}

.cp_box {
  width: 100%;
  max-width: 1024px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;

  section {
    position: relative;
    width: calc((100% - 64px) / 3);
    container-type: inline-size;

    h2 {
      font-size: 20px;
      margin: 16px 0 8px;
      line-height: 1.3;
    }

    h2, p, img {
      transition: .3s;
    }

    a {
      display: block;
      height: 100%;
      width: 100%;
      position: absolute;
      z-index: 100;
    }

    .thumbnail {
      border-radius: 16px;
      overflow: hidden;
      position: relative;
      display: block;

      &.end {
        &::before, &::after {
          background: #00000080;
          z-index: 1;
          width: 100%;
          height: 100%;
          display: block;
          position: absolute;
          top: 0;
          bottom: 0;
          margin: auto;
          content: "";
        }

        &::after {
          content: "終了しました";
          font-size: 32px;
          font-weight: bold;
          color: var(--white);
          text-shadow: 0px 0px 8px #000, 0px 0px 16px #000;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }
    }

    @media(hover:hover) {
      &:hover {
        cursor: pointer;
        color: var(--primary);

        img {
          transform: scale(1.05);
        }
      }
    }

    @container (max-width: 300px) {
      h2 {
        font-size: 18px;
      }

      & .thumbnail {
        border-radius: 12px;

        &.end {
          &::after {
            font-size: 28px;
          }
        }
      }
    }

    @container (max-width: 220px) {
      h2 {
        font-size: 16px;
      }

      & .thumbnail {
        border-radius: 8px;

        &.end {
          &::after {
            font-size: 24px;
          }
        }
      }
    }
  }
}

@media (max-width: 767px) {
  h1 {font-size: 24px;}
  .cp_box {
    column-gap: 24px;
    row-gap: 40px;

    section {
      width: calc((100% - 24px) / 2);
    }
  }
}

@media (max-width: 500px) {
  main {
    padding: 40px 24px;
    gap: 48px;
  }
  .cp_box {
    row-gap: 32px;

    section {
      width: 100%;
    }
  }
}
