/* ============================================
   FuseIoT — Release Notes (changelog)
   Masthead compacto + timeline com trilho que
   se desenha no scroll (GSAP scaleY scrub)
   ============================================ */

/* ============================================
   Estados de entrada [data-animate] — escopados
   ============================================ */
.page-release-notes [data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-expo-out),
              transform 0.8s var(--ease-expo-out);
}

.page-release-notes [data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Curva decorativa (mesma anatomia do Fórum)
   ============================================ */
.page-release-notes .forum__curve {
  position: absolute;
  inset: 0;
  z-index: var(--z-curves, 20);
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ============================================
   Masthead compacto
   ============================================ */
.rn-masthead {
  position: relative;
  background: var(--bg-primary);
  padding-top: clamp(140px, 16vh, 190px);
}

.rn-masthead__inner {
  position: relative;
  z-index: var(--z-content, 30);
}

.rn-masthead__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: clamp(18px, 2.5vw, 32px);
}

.rn-masthead__kicker {
  color: var(--text-primary);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  min-height: 1.4em;
}

.rn-masthead__deck {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 280px;
  text-align: right;
}

.rn-masthead__title {
  font-size: clamp(2.75rem, 6.5vw, 7.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--text-primary);
  margin-bottom: clamp(28px, 3.5vw, 48px);
}

.rn-masthead__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: clamp(20px, 3vw, 40px);
  /* reserva altura para os pills renderizados pós-fetch (evita salto) */
  min-height: 41px;
}

.rn-filter.is-active {
  background-color: var(--pill-bg-dark);
  border-color: var(--pill-bg-dark);
  color: var(--text-on-dark);
}

/* ============================================
   Seção da timeline
   ============================================ */
.rn-section {
  background: var(--bg-primary);
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: var(--section-gap-large);
}

/* ============================================
   Timeline — trilho vertical que se desenha
   --rn-rail-center / --rn-pad ajustam o trilho no responsivo
   ============================================ */
.rn-timeline {
  --rn-rail-center: 10px;
  --rn-pad: 64px;
  position: relative;
  max-width: 880px;
  padding-left: var(--rn-pad);
}

.rn-timeline__rail {
  position: absolute;
  left: calc(var(--rn-rail-center) - 1px);
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: rgba(26, 26, 26, 0.08);
  transform-origin: top center; /* GSAP anima scaleY 0 -> 1 com scrub */
}

/* ============================================
   Release
   ============================================ */
.rn-release {
  position: relative;
  padding: clamp(28px, 4vw, 44px) 0;
}

.rn-release + .rn-release {
  border-top: 1px solid rgba(26, 26, 26, 0.06);
}

/* --- Nó na cor do produto, ancorado no trilho --- */
.rn-release__node {
  position: absolute;
  top: calc(clamp(28px, 4vw, 44px) + 4px); /* alinha com o centro óptico da versão */
  left: calc(-1 * var(--rn-pad) + var(--rn-rail-center) - 10px);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 5px solid var(--bg-primary); /* respiro entre nó e trilho */
  box-sizing: border-box;
}

/* o mais recente pulsa (keyframe pulse-dot vem de css/base.css) */
.rn-release__node--current {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* --- Cabeçalho: versão + ATUAL + produto + data --- */
.rn-release__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.rn-release__version {
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.rn-release__current {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-on-dark);
  background: var(--pill-bg-dark);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
}

.rn-release__tag {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
}

.rn-release__date {
  margin-left: auto;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Título da release --- */
.rn-release__title {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-primary);
  margin-top: 18px;
}

/* --- Linhas de mudança --- */
.rn-release__changes {
  margin-top: 18px;
}

.rn-change {
  display: grid;
  grid-template-columns: 8px 92px 1fr;
  column-gap: 16px;
  align-items: start;
  padding: 14px 0;
}

.rn-change + .rn-change {
  border-top: 1px solid rgba(26, 26, 26, 0.07); /* hairline entre linhas */
}

.rn-change__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
}

.rn-change__type {
  white-space: nowrap;
  padding-top: 2px;
}

.rn-change__text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================
   Estados de erro / vazio (ForumShared.renderError)
   Markup compartilhado — forum.css não é carregado aqui
   ============================================ */
.page-release-notes .forum-error {
  /* compensa o recuo do trilho para centralizar o cartão */
  margin-left: calc(-1 * var(--rn-pad, 0px));
  text-align: center;
  padding: clamp(56px, 10vw, 120px) 20px;
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: var(--radius-container);
  background: var(--bg-alternate);
}

.page-release-notes .forum-error__marks {
  display: block;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: var(--text-muted);
  margin-bottom: 20px;
  user-select: none;
}

.page-release-notes .forum-error__kicker {
  color: var(--text-primary);
  margin-bottom: 14px;
}

.page-release-notes .forum-error__body {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0 auto 28px;
}

.page-release-notes .forum-error__body:last-child {
  margin-bottom: 0;
}

/* ============================================
   Responsivo — trilho a 16px da esquerda
   ============================================ */
@media (max-width: 768px) {
  .rn-masthead {
    padding-top: 120px;
  }

  .rn-masthead__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .rn-masthead__deck {
    text-align: left;
    max-width: 340px;
  }

  .rn-timeline {
    --rn-rail-center: 16px;
    --rn-pad: 44px;
  }

  .rn-release__date {
    margin-left: 0;
    width: 100%;
  }

  .rn-change {
    grid-template-columns: 8px 1fr;
    grid-template-areas:
      "dot type"
      ".   text";
    row-gap: 4px;
  }

  .rn-change__dot { grid-area: dot; }
  .rn-change__type { grid-area: type; }
  .rn-change__text { grid-area: text; }
}

@media (max-width: 480px) {
  .rn-release__version {
    font-size: 1.5rem;
  }
}
