/* =========================================================
   ROTHA · NOSSA HISTÓRIA — linha do tempo (horizontal no desktop, vertical no mobile)
   Reaproveita os tokens/nav/botões de site.css. Paleta oficial apenas.
   ========================================================= */

/* item de navegação da página atual (navbar em site.css) */
.nav-link[aria-current="page"]{color:var(--ink)}
.nav-link[aria-current="page"]::after{width:100%}

/* ---------- INTRO ---------- */
.hist-intro{position:relative;min-height:100svh;display:flex;flex-direction:column;justify-content:center;
  padding:calc(var(--frame) + var(--gut));background:var(--steel-soft);overflow:hidden}
.hist-intro .kick{display:flex;align-items:center;gap:.7rem;margin-bottom:1.4rem;
  font-weight:600;letter-spacing:.2em;text-transform:uppercase;font-size:.74rem;color:var(--ink-45)}
.hist-intro .kick .dot{width:7px;height:7px;border-radius:50%;background:var(--vinho);box-shadow:0 0 0 4px rgba(141,31,34,.14)}
.hist-intro h1{font-family:var(--display);font-weight:400;text-transform:uppercase;line-height:.9;letter-spacing:.01em;
  font-size:clamp(3rem,9vw,8.5rem);color:var(--ink);max-width:16ch}
.hist-intro h1 em{font-style:normal;color:var(--vinho)}
.hist-intro .lead{margin-top:clamp(1.4rem,2.5vw,2rem);max-width:54ch;color:var(--ink-70);
  font-size:clamp(1rem,1.2vw,1.18rem);line-height:1.6}
.hist-cue{position:absolute;left:calc(var(--frame) + var(--gut));bottom:calc(var(--frame) + 1.4rem);
  display:flex;align-items:center;gap:.9rem;font-weight:600;letter-spacing:.16em;text-transform:uppercase;font-size:.7rem;color:var(--ink-45)}
.hist-cue .track{width:52px;height:1px;background:var(--ink-14);position:relative;overflow:hidden}
.hist-cue .track i{position:absolute;left:-40%;top:0;height:100%;width:40%;background:var(--ink);animation:slide 2.4s var(--ease) infinite}

/* ---------- TRILHA HORIZONTAL (desktop) ---------- */
.hist{position:relative;height:100svh;overflow:hidden;background:var(--paper);border-top:1px solid var(--ink-14)}
.hist-track{position:relative;display:flex;align-items:stretch;width:max-content;height:100svh}
/* spine + preenchimento (linha que se forma) */
.hist-line{position:absolute;left:0;top:80%;height:2px;width:100%;background:var(--ink-14);z-index:0}
.hist-line-fill{position:absolute;inset:0;background:var(--vinho);transform:scaleX(0);transform-origin:left}
/* capítulos (eras) */
.hist-chapter{position:relative;flex:0 0 auto;width:min(82vw,700px);height:100svh;
  display:flex;flex-direction:column;justify-content:center;gap:.55rem;
  padding:0 clamp(2rem,5vw,5.5rem);z-index:1}
.hist-chapter:first-of-type{padding-left:calc(var(--frame) + var(--gut))}
.hist-kick{font-weight:600;letter-spacing:.18em;text-transform:uppercase;font-size:.72rem;color:var(--vinho)}
.hist-year{font-family:var(--display);font-weight:400;line-height:.82;letter-spacing:.01em;
  font-size:clamp(4rem,10vw,9rem);color:var(--ink)}
.hist-year .ph{color:var(--titanio)}
.hist-title{font-family:var(--display);font-weight:400;text-transform:uppercase;line-height:.92;letter-spacing:.01em;
  font-size:clamp(1.7rem,3.2vw,2.9rem);color:var(--ink);margin-top:.2rem}
.hist-title em{font-style:normal;color:var(--vinho)}
.hist-text{max-width:46ch;color:var(--ink-70);line-height:1.62;font-size:clamp(.98rem,1.1vw,1.1rem)}
.hist-quote{margin-top:.4rem;max-width:44ch;font-family:var(--display);font-weight:400;line-height:1.05;
  font-size:clamp(1.3rem,2vw,1.8rem);color:var(--ink);letter-spacing:.01em}
.hist-quote cite{display:block;margin-top:.7rem;font-family:var(--font);font-style:normal;
  font-size:.72rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-45)}
/* eras sem ano confirmado: o titulo assume o peso que o numero teria.
   Nao inventamos data - ver o comentario na linha do tempo de nossa-historia.html. */
.hist-chapter--era .hist-title{font-size:clamp(2.1rem,5vw,4.1rem);line-height:.9;margin-top:.35rem}
.hist-chapter--era .hist-text{max-width:44ch}

/* moldura de imagem (placeholder — receberá foto no futuro) */
.hist-figure{margin-top:.5rem;width:min(100%,440px);aspect-ratio:16/10;max-height:26vh;
  border:1px solid var(--ink-14);border-radius:14px;background:var(--steel);
  display:flex;align-items:center;justify-content:center;
  font-weight:600;letter-spacing:.2em;text-transform:uppercase;font-size:.66rem;color:var(--ink-30)}
.hist-figure{overflow:hidden}
.hist-figure img{width:100%;height:100%;object-fit:cover}
/* nó na linha do tempo */
.hist-node{position:absolute;left:clamp(2rem,5vw,5.5rem);top:80%;width:15px;height:15px;border-radius:50%;
  background:var(--paper);border:2px solid var(--vinho);transform:translate(-50%,-50%);z-index:2;
  box-shadow:0 0 0 5px rgba(141,31,34,.10)}
.hist-chapter:first-of-type .hist-node{left:calc(var(--frame) + var(--gut))}
/* último capítulo: CTA */
.hist-actions{margin-top:1.1rem;display:flex;align-items:center;gap:1.4rem;flex-wrap:wrap}

/* ---------- LAPTOPS BAIXOS: o conteudo tem que caber ACIMA da spine ----------
   A spine e os nos ficam em top:80%. Em telas de 720-900px de altura o capitulo
   (centralizado) passava por baixo da linha e o texto era cortado por ela.
   Aqui a tipografia passa a escalar por vh, que e exatamente a restricao. */
@media(min-width:861px) and (max-height:940px){
  .hist-chapter{gap:.4rem}
  .hist-year{font-size:clamp(3.4rem,12vh,9rem)}
  .hist-title{font-size:clamp(1.5rem,4.6vh,2.9rem)}
  .hist-chapter--era .hist-title{font-size:clamp(1.9rem,6.4vh,4.1rem)}
  .hist-text{font-size:clamp(.875rem,1.85vh,1.02rem);line-height:1.58}
  .hist-quote{font-size:clamp(1.05rem,3vh,1.8rem)}
  .hist-quote cite{margin-top:.5rem}
  .hist-actions{margin-top:.85rem}
}

/* ---------- MOBILE / REDUZIDO: vertical, sem pin ---------- */
@media(max-width:860px){
  .hist{height:auto;overflow:visible}
  .hist-track{flex-direction:column;width:100%;height:auto;transform:none !important}
  .hist-line{display:none}
  /* width:100% + margin-left somava 34px alem da tela; auto deixa a margem
     descontar da largura */
  .hist-chapter{width:auto;height:auto;min-height:auto;justify-content:flex-start;gap:.6rem;
    padding:clamp(2.4rem,9vw,3.6rem) calc(var(--frame) + var(--gut));
    margin-left:calc(var(--frame) + var(--gut));border-left:2px solid var(--ink-14);
    opacity:0;transform:translateY(26px);transition:opacity .8s var(--ease),transform .8s var(--ease)}
  .hist-chapter:first-of-type{padding-left:clamp(1.4rem,6vw,2.4rem)}
  .hist-chapter.in{opacity:1;transform:none}
  .hist-node{left:calc(var(--frame) + var(--gut));top:clamp(2.4rem,9vw,3.6rem);
    background:var(--vinho);box-shadow:0 0 0 5px rgba(141,31,34,.12)}
  .hist-chapter:first-of-type .hist-node{left:calc(var(--frame) + var(--gut))}
  .hist-figure{max-height:none;width:100%}
}
@media(prefers-reduced-motion:reduce){
  .hist-chapter{opacity:1;transform:none}
  .hist-cue .track i{animation:none}
}
