/* ==========================================================
   NOSSA HISTÓRIA: contador em fita de rotuladora + linha do tempo
   ========================================================== */

/* ---------- contador ---------- */

#contador {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem .7rem;
  margin-bottom: 1rem;
}

.fita {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .55rem .3rem .5rem;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 45%, rgba(0, 0, 0, .14)),
    var(--batom);
  color: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 8px 14px -8px rgba(80, 0, 20, .55);
  transform: rotate(var(--r, 0deg));
  font-family: var(--fonte-ui);
  /* letras "em relevo" como na rotuladora */
  text-shadow: 0 1px 0 rgba(0, 0, 0, .28), 0 -1px 0 rgba(255, 255, 255, .22);
}

.fita:nth-child(even) { background: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 45%, rgba(0, 0, 0, .16)), var(--caneta); }

.fita__numero {
  font-weight: 800;
  font-size: clamp(1.7rem, 8vw, 2.4rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.fita__nome {
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .08em;
  opacity: .92;
}

.contador__desde {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: .3rem;
}

@media (min-width: 720px) {
  #contador { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- linha do tempo ---------- */

.linha-tempo {
  position: relative;
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 0;
}

/* o fio pontilhado, desenhado à caneta */
.linha-tempo::before {
  content: '';
  position: absolute;
  top: .5rem;
  bottom: 1rem;
  left: 11px;
  border-left: 2px dashed rgba(39, 71, 163, .45);
}

.momento {
  position: relative;
  padding-left: 2.6rem;
  opacity: 0;
  transform: translateY(22px) rotate(calc(var(--r, 0deg) * 3)) scale(.97);
  transition: opacity .7s ease, transform .8s cubic-bezier(.3, .7, .3, 1.2);
}

.momento + .momento { margin-top: 2.6rem; }

.momento.revelado { opacity: 1; transform: rotate(var(--r, 0deg)); }

.momento__marca {
  position: absolute;
  left: 0;
  top: .2rem;
  width: 24px;
  height: 24px;
  color: var(--batom);
  transform: rotate(calc(var(--r, 0deg) * -1));
}

.momento__marca svg { width: 100%; height: 100%; fill: currentColor; }

.momento__pagina {
  position: relative;
  padding: 1.6rem 1.25rem 1.3rem;
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(1.75rem - 1px), rgba(198, 219, 239, .7) calc(1.75rem - 1px) 1.75rem) 0 1.1rem,
    #fffefb;
  border-radius: 2px;
  box-shadow: var(--sombra-papel);
}

.momento__pagina .washi { top: -11px; left: 50%; margin-left: -46px; --r: -3deg; }
.momento:nth-child(even) .momento__pagina .washi { --r: 4deg; }

.momento__data { --r: -2deg; margin-bottom: .7rem; }

.momento__titulo {
  font-size: 1.32rem;
  line-height: 1.25;
  margin-bottom: .45rem;
}

.momento__texto { line-height: 1.75rem; }

.momento__pagina .foto {
  --proporcao: 4 / 3;
  margin-top: 1rem;
  border: 6px solid #fff;
  box-shadow: 0 1px 3px rgba(58, 39, 49, .2);
  transform: rotate(1deg);
}

.momento--fim { padding-top: .1rem; }
.momento--fim .mao { font-size: 1.05rem; }

@media (min-width: 768px) {
  /* no desktop a linha do tempo respira além da coluna de texto */
  .linha-tempo { margin-inline: calc(50% - min(29rem, 50vw - 1.5rem)); }
  .linha-tempo::before { left: 50%; margin-left: -1px; }

  .momento {
    width: calc(50% - 2.4rem);
    padding-left: 0;
  }

  .momento:nth-child(even) { margin-left: auto; }
  .momento + .momento { margin-top: -4.5rem; }

  .momento__marca { left: auto; right: -3.15rem; top: 1rem; }
  .momento:nth-child(even) .momento__marca { right: auto; left: -3.15rem; }

  .momento--fim { width: auto; margin-left: auto !important; margin-right: auto; padding-top: 4.5rem; text-align: center; }
  .momento--fim .momento__marca { left: 50% !important; right: auto; top: 3rem; margin-left: -12px; }
}
