@charset "UTF-8";

/* 100年の歩み（src/pages/history/index.astro の <style>） */

  .subpage-mv-image{
    .accent{
      color: var(--black);
    }
    h1{
      font-family: var(--font-mincho);
      font-weight: 700;
    }
  }
  .page-history{
    padding-top: 8rem;
    @media screen and (max-width: 768px) {
      padding-top: 5rem;
    }
    .history{
      li{
        position: relative;
        &+ li{
          margin-top: 4rem;
          @media screen and (max-width: 768px) {
            margin-top: 2rem;
          }
        }
        .images{
          position: absolute;
          inset: 0;
          pointer-events: none;
          z-index: 0;
          @media screen and (max-width: 768px) {
            display: none; 
          }
          .diamond{
            &.cls1{
              --w: 15rem; --x: 4; --y: 100;
            }
            &.cls2{
              --w: 18rem; --x: 100; --y: 0; --parallax: 0.2;
            }
            &.cls3{
              --w: 3.6rem; --x: 106; --y: -14;
            }
            &.cls4{
              --w: 9rem; --x: 25; --y: -5;
            }
            &.cls5{
              --w: 15rem; --x: 100; --y: 5;
            }
            &.cls6{
              --w: 18rem; --x: 0; --y: 10; --parallax: 0.2;
            }
            &.cls7{
              --w: 3.6rem; --x: 6; --y: -4;
            }
          }
        }
        time{
          position: relative;
          display: block;
          text-align: center;
          font-size: 11rem;
          font-family: var(--font-lato);
          color: var(--accent);
          font-weight: 300;
          letter-spacing: -0.05em;
          @media screen and (max-width: 768px) {
            font-size: 6rem;
            text-align: left;
          }
        }
        /* SP は左に線、右にテキスト → 画像の縦積み */
        .item-wrap{
          position: relative;
          margin-top: 5rem;
          display: flex;
          align-items: center;
          height: 49rem;
          justify-content: space-between;
          @media screen and (max-width: 768px) {
            margin-top: 3rem;
            display: grid;
            grid-template-columns: 0.8rem minmax(0, 1fr);
            gap: 3rem;
            align-items: stretch;
            height: auto;
            padding-left: 1rem;
          }
          .texts{
            width: 48rem;
            padding-bottom: 6rem;
            transition: opacity 0.8s ease 0.2s, translate 1.2s var(--easing) 0.2s;
            @media screen and (max-width: 768px) {
              grid-area: 1 / 2;
              width: auto;
              padding-bottom: 0;
            }
            @media (prefers-reduced-motion: reduce) {
              transition: none;
            }
            h2{
              font-size: 2.8rem;
              line-height: 1.5;
              font-weight: 500;
              color: var(--accent);
              white-space: nowrap;
              font-feature-settings: "palt";
              @media screen and (max-width: 768px) {
                font-size: 1.8rem;
                white-space: normal;
              }
            }
            .readText{
              margin-top: 0.75em;
              line-height: 1.6;
            }
          }
          .between{
            width: 0.8rem;
            height: 100%;
            position: relative;
            container-type: size; /* 終点ドットの移動量を 100cqh（自身の高さ）で指定するため */
            transition: opacity 0.6s ease;
            @media screen and (max-width: 768px) {
              grid-area: 1 / 1 / 3;
              width: 0.6rem;
              height: 100%;
            }
            @media (prefers-reduced-motion: reduce) {
              transition: none;
            }
            .dot{
              display: block;
              width: 0.8rem;
              height: 0.8rem;
              aspect-ratio: 1;
              border-radius: 50%;
              background-color: var(--accent);
              position: absolute;
              left: 0;
              @media screen and (max-width: 768px) {
                width: 0.6rem;
                height: 0.6rem;
              }
              &.start{
                top: 0;
              }
              /* 線（scale）と同じくコンポジタで動かすため top ではなく translate で動かす */
              &.end{
                bottom: 0;
                transition: translate 1.8s cubic-bezier(.3,.5,.1,1);
                @media (prefers-reduced-motion: reduce) {
                  transition: none;
                }
              }
            }
            .line{
              width: 1px;
              height: 100%;
              position: absolute;
              left: calc(50% - 0.5px);
              top: 0;
              background-color: var(--accent);
              transform-origin: top;
              transition: scale 1.8s cubic-bezier(.3,.5,.1,1);
              @media (prefers-reduced-motion: reduce) {
                transition: none;
              }
            }
          }
          figure{
            width: 48rem;
            aspect-ratio: 960 / 660;
            position: relative;
            transition: opacity 0.8s ease 0.4s, translate 1.2s var(--easing) 0.4s;
            @media screen and (max-width: 768px) {
              grid-area: 2 / 2;
              width: 100%;
              aspect-ratio: auto; /* Safari で幅がはみ出るため、SP は比率を img に持たせる */
              margin-bottom: 5rem;
            }
            @media (prefers-reduced-motion: reduce) {
              transition: none;
            }
            img{
              object-fit: contain;
              height: 100%;
              @media screen and (max-width: 768px) {
                height: auto;
                aspect-ratio: 960 / 660;
              }
            }
            figcaption{
              font-size: 1.4rem;
              line-height: 1.35;
              margin-top: 1.2rem;
              @media screen and (max-width: 768px) {
                position: absolute;
                top: calc(100% + 1rem);
                font-size: 1.2rem;
                margin-top: 0;
                text-align: right;
                right: 0;
              }
            }
          }
        }
        &:nth-of-type(2n+1){
          .item-wrap{
            flex-direction: row;
            figcaption{
              text-align: right;
            }
          }
        }
        &:nth-of-type(2n){
          .item-wrap{
            flex-direction: row-reverse;
          }
        }
      }
    }
  }
  .js-reveal .page-history .history li .item-wrap:not(.is-revealed){
    .between{
      opacity: 0;
    }
    .dot.end{
      translate: 0 calc(100% - 100cqh);
    }
    .line{
      scale: 1 0;
    }
    .texts,
    figure{
      opacity: 0;
      translate: 0 2.4rem;
    }
  }
