@charset "UTF-8";

/* 数字でわかる泰明商会（src/pages/data/index.astro の <style>） */

  .page-data{
    padding-top: 8rem;
    @media screen and (max-width: 768px) {
      padding-top: 5rem;
    }
    .data{
      ul{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
        @media screen and (max-width: 768px) {
          grid-template-columns: 1fr;
          gap: 1.5rem;
        }
        li{
          background-color: var(--white);
          position: relative;
          padding: 8rem 6rem;
          display: flex;
          justify-content: space-between;
          align-items: flex-end;
          @media screen and (max-width: 768px) {
            padding: 5rem 2.5rem 3rem;
          }
          h2{
            position: absolute;
            top: 3rem;
            left: 3rem;
            background-color: var(--bg-gray);
            border-radius: 100vmax;
            padding: 0.5em 1em;
            font-size: 2rem;
            @media screen and (max-width: 768px) {
              top: 2rem;
              left: 2rem;
              font-size: 1.4rem;
            }
          }
          .num{
            font-size: 11rem;
            @media screen and (max-width: 768px) {
              font-size: 6rem;
            }
            span{
              display: inline-block;
            }
            .countUp{
              line-height: 1;
              .countUp__slot{
                display: inline-block;
                height: 1lh;
                overflow: hidden;
                vertical-align: bottom;
                text-align: center;
              }
              .countUp__track{
                display: flex;
                flex-direction: column;
              }
            }
            .unit{
              font-size: 0.35em;
              margin-left: 0.25em;
            }
          }
          &.item01{
            img{
              width: 14.4rem;
              @media screen and (max-width: 768px) {
                width: 8.6rem;
              }
            }
          }
          &.item02{
            .num{
              .unit{
                margin-left: 0;
                font-size: 0.9em;
                transform: translateY(-0.1em);
              }
            }
            svg{
              width: 16rem;
              @media screen and (max-width: 768px) {
                width: 9.6rem;
              }
              .sweep{
                transition: stroke-dashoffset 0.9s cubic-bezier(.65,0,.35,1) 0.4s;
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
              .people{
                transition: opacity 0.6s ease 0.4s, translate 0.6s var(--easing) 0.4s;
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
            }
          }
          &.item03{
            padding: 10rem 3rem 3rem;
            display: block;
            @media screen and (max-width: 768px) {
              padding: 6.5rem 1.5rem 2rem;
            }
            svg{
              width: 100%;
              .bar{
                transform-box: fill-box;
                transform-origin: bottom;
                transition: scale 1s var(--easing) 0.4s;
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
              .label{
                transition: translate 1s var(--easing) 0.4s;
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
            }
          }
          &.item04{
            padding: 11rem 3rem 3rem;
            display: block;
            @media screen and (max-width: 768px) {
              padding: 6.3rem 1.5rem 3rem;
            }
            .num-canvas{
              position: absolute;
              z-index: 2;
              inset: 0;
              .num{
                position: absolute;
                text-align: center;
                font-size: 7rem;
                @media screen and (max-width: 768px) {
                  font-size: 3.6rem;
                }
                .sub{
                  font-size: 1.6rem;
                  @media screen and (max-width: 768px) {
                    font-size: 0.9rem;
                    white-space: nowrap;
                  }
                }
                .unit{
                  margin-left: 0;
                }
                &.num01{
                  left: 42.5rem;
                  top: 12rem;
                  @media screen and (max-width: 768px) {
                    left: 23.5rem;
                    top: 6.8rem;
                  }
                }
                &.num02{
                  left: 2.5rem;
                  top: 24rem;
                  @media screen and (max-width: 768px) {
                    left: 1rem;
                    top: 13.7rem;
                  }
                }
                &.num03{
                  left: 5rem;
                  top: 10.5rem;
                  @media screen and (max-width: 768px) {
                    left: 2.9rem;
                    top: 6rem;
                  }
                }
              }
            }
            svg{
              width: 28rem;
              margin-inline: auto;
              @media screen and (max-width: 768px) {
                width: 16rem;
              }
              /* 円グラフが 0→100% に伸び、その途中から引き出し線が円グラフ側から伸びる。
                 開始はカード（li）の .is-revealed で、数字のカウントアップと揃える */
              .sweep{
                transition: stroke-dashoffset 0.9s cubic-bezier(.65,0,.35,1);
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
              .draw{
                transition: stroke-dashoffset 0.5s var(--easing) 0.45s;
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
            }
          }
          &.item05{
            img{
              width: 15.4rem;
              @media screen and (max-width: 768px) {
                width: 9.2rem;
              }
            }
          }
          &.item06{
            img{
              width: 15rem;
              @media screen and (max-width: 768px) {
                width: 9rem;
              }
            }
          }
          &.item07{
            img{
              width: 14.2rem;
              @media screen and (max-width: 768px) {
                width: 8.5rem;
              }
            }
          }
          &.item08{
            img{
              width: 13.4rem;
              @media screen and (max-width: 768px) {
                width: 8rem;
              }
            }
          }
          &.item09{
            img{
              width: 13.8rem;
              @media screen and (max-width: 768px) {
                width: 8.3rem;
              }
            }
          }
        }
      }
    }
  }

  /* 出現前。JS が動かず .js-reveal が外れた場合は最初から完成形を出す */
  .js-reveal .item02:not(.is-revealed){
    .sweep{
      stroke-dashoffset: 100;
    }
    .people{
      opacity: 0;
      translate: 0 6px;
    }
  }
  .js-reveal .item03 svg:not(.is-revealed){
    .bar{
      scale: 1 0;
    }
    .label{
      translate: 0 calc(var(--h) * 1px);
    }
  }
  .js-reveal .item04:not(.is-revealed){
    .sweep{
      stroke-dashoffset: 100;
    }
    /* マイナス方向にずらすと線の終点（円グラフ側）から伸びる */
    .draw{
      stroke-dashoffset: -100;
    }
  }
