
/* ============================================================
   4.HOURS — GOOGLE-LIKE PULL TO REFRESH V2
   ============================================================ */

:root{
  --fh-ptr-offset:0px;
}

body.fh-ptr-active{
  overscroll-behavior-y:none !important;
}

.fh-ptr-moving-surface{
  transform:
    translate3d(
      0,
      var(--fh-local-ptr-offset,0px),
      0
    ) !important;

  will-change:transform;
}

body.fh-ptr-animate
.fh-ptr-moving-surface{
  transition:
    transform
    .22s
    cubic-bezier(.22,.75,.28,1)
    !important;
}

#fourHoursPullRefresh{
  --fh-ptr-progress:0;

  position:fixed;

  top:
    calc(
      max(
        10px,
        env(safe-area-inset-top,0px)
      ) +
      8px
    );

  left:50%;

  z-index:2147483000;

  width:46px;
  height:46px;

  display:grid;
  place-items:center;

  transform:
    translate3d(
      -50%,
      calc(
        -70px +
        (
          var(--fh-ptr-progress) *
          70px
        )
      ),
      0
    )
    scale(
      calc(
        .72 +
        (
          var(--fh-ptr-progress) *
          .28
        )
      )
    );

  opacity:
    var(--fh-ptr-progress);

  pointer-events:none;

  transition:
    opacity .08s linear;
}

#fourHoursPullRefresh.is-visible{
  opacity:1;
}

.fh-ptr-google-spinner{
  width:42px;
  height:42px;

  display:grid;
  place-items:center;

  border-radius:50%;

  background:#ffffff;

  box-shadow:
    0 3px 9px rgba(0,0,0,.22),
    0 8px 25px rgba(0,0,0,.18);
}

.fh-ptr-google-spinner span{
  width:21px;
  height:21px;

  display:block;

  border-radius:50%;

  border:
    3px solid
    #dadce0;

  border-top-color:#4285f4;
  border-right-color:#34a853;
  border-bottom-color:#fbbc05;
  border-left-color:#ea4335;

  transform:
    rotate(
      calc(
        var(--fh-ptr-progress) *
        270deg
      )
    );
}

#fourHoursPullRefresh.is-ready
.fh-ptr-google-spinner{
  transform:scale(1.06);
}

#fourHoursPullRefresh.is-refreshing{
  --fh-ptr-progress:1;
}

#fourHoursPullRefresh.is-refreshing
.fh-ptr-google-spinner span{
  animation:
    fhGooglePullRefreshSpin
    .72s
    linear
    infinite;
}

@keyframes fhGooglePullRefreshSpin{
  to{
    transform:rotate(360deg);
  }
}

/*
  On garde le scroll vertical normal partout.
  Seul le geste tactile depuis le sommet est intercepté par le JS.
*/
html,
body{
  overscroll-behavior-x:none;
}


#fourHoursPullRefresh.is-complete
.fh-ptr-google-spinner{
  background:#ffffff;
}

#fourHoursPullRefresh.is-complete
.fh-ptr-google-spinner span{
  width:18px;
  height:10px;
  border:0;
  border-left:3px solid #34a853;
  border-bottom:3px solid #34a853;
  border-radius:0;
  transform:rotate(-45deg);
  animation:none;
}
