/* style-historia-v2.css - Página "Nossa História" (historia.html) no layout novo. Prefixo hi-
   Carregar depois de css/style.css, css/style-home-v2.css e css/style-equipe-v2.css
   (reaproveita zh-btn, zh-secao, zh-cabecalho-secao, zh-cta, eq-hero, eq-cta...). */

/* ---------- Hero: a fachada de Ibaté aparece inteira à direita e se funde ao azul à esquerda ---------- */
.hi-hero { position: relative; display: flex; align-items: center; min-height: clamp(440px, 38vw, 660px); overflow: hidden; background: #0a1d42; }
/* A própria foto some aos poucos na borda esquerda (máscara), então não aparece corte em nenhuma largura de tela */
.hi-hero::after { content: ''; position: absolute; top: 0; bottom: 0; right: 0; aspect-ratio: 752 / 500; max-width: 74%; background: url('../img/OndeVaiEstudar/ibate1.jpg') center / cover no-repeat; transform-origin: 65% 55%; animation: hi-kb 18s cubic-bezier(.2, .7, .2, 1) both;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .12) 14%, rgba(0, 0, 0, .45) 30%, rgba(0, 0, 0, .85) 48%, #000 62%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .12) 14%, rgba(0, 0, 0, .45) 30%, rgba(0, 0, 0, .85) 48%, #000 62%); }
.hi-hero::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #0a1d42 0%, #0a1d42 26%, rgba(10, 29, 66, .78) 40%, rgba(10, 29, 66, .4) 54%, rgba(10, 29, 66, .12) 68%, rgba(10, 29, 66, 0) 80%), linear-gradient(0deg, rgba(10, 29, 66, .7), transparent 40%), linear-gradient(180deg, rgba(10, 29, 66, .45), transparent 22%), radial-gradient(circle at 12% 10%, rgba(252, 193, 1, .14), transparent 40%); }
@keyframes hi-kb { from { transform: scale(1.14); filter: saturate(.6) brightness(.8); } to { transform: none; filter: none; } }
.hi-hero .eq-hero-centro { position: relative; z-index: 2; padding: clamp(48px, 6vw, 80px) var(--zh-pad); text-align: left; }
.hi-hero .zh-hero-centro > * { max-width: min(52vw, 640px); margin-left: 0; margin-right: 0; }
.hi-hero .zh-hero-botoes { justify-content: flex-start; }
.hi-legenda { position: absolute; z-index: 2; right: 22px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(10, 29, 66, .6); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px); }
.hi-legenda i { color: var(--zh-amarelo); }

/* ---------- Mosaico: história e números ---------- */
.hi-bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.hi-t { display: flex; flex-direction: column; justify-content: flex-end; padding: 26px; border-radius: 20px; background: #fff; border: 1px solid var(--zh-borda); box-shadow: 0 4px 14px rgba(10, 29, 66, .06); transition: transform .3s var(--zh-ease), box-shadow .3s; }
.hi-t:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(10, 29, 66, .14); }
.hi-t > i { margin-bottom: auto; padding-bottom: 18px; font-size: 26px; color: var(--zh-azul); }
.hi-t strong { font-size: clamp(36px, 4vw, 52px); font-weight: 800; line-height: 1; color: var(--zh-navy); }
.hi-t > span { margin-top: 8px; font-size: 14.5px; font-weight: 600; color: var(--zh-cinza); }
.hi-texto { grid-column: span 2; grid-row: span 2; justify-content: flex-start; color: #fff; border: 0; background: radial-gradient(circle at 90% 0, rgba(252, 193, 1, .22), transparent 45%), linear-gradient(135deg, var(--zh-navy), var(--zh-navy-2)); }
.hi-texto small { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--zh-amarelo); }
.hi-texto h2 { margin-top: 8px; font-size: clamp(26px, 3vw, 38px); font-weight: 800; line-height: 1.15; color: #fff; }
.hi-texto p { margin-top: 14px; font-size: 15px; line-height: 1.7; color: #c9d6f2; }
.hi-texto > p:first-of-type::first-letter { float: left; margin: 6px 12px 0 0; font-size: 60px; font-weight: 800; line-height: .8; color: var(--zh-amarelo); }
.hi-texto details { margin-top: 6px; }
.hi-texto summary { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14.5px; font-weight: 700; color: var(--zh-amarelo); cursor: pointer; list-style: none; }
.hi-texto summary::-webkit-details-marker { display: none; }
.hi-texto summary:focus-visible { outline: 3px solid #6aa5ff; outline-offset: 3px; border-radius: 6px; }
.hi-texto summary i { transition: transform .3s; }
.hi-texto details[open] summary i { transform: rotate(180deg); }
.hi-texto details[open] summary .hi-mais { display: none; }
.hi-texto details:not([open]) summary .hi-menos { display: none; }
.hi-amarelo { border: 0; background: var(--zh-amarelo); }
.hi-amarelo > i, .hi-amarelo > span { color: var(--zh-navy); }

/* ---------- Linha do tempo cinematográfica (animações guiadas pela rolagem) ----------
   O JS define em cada marco: --e (entrada 0→1), --f (preenchimento do ano 0→1) e --p (posição na tela 0→1);
   na lista: --tl (quanto da linha central já foi desenhada). */
.hi-secao-tl { overflow: clip; background: radial-gradient(ellipse at 50% 0, #fff 0, var(--zh-fundo) 60%); }
.hi-tl { --tl: 0; position: relative; display: grid; gap: clamp(72px, 10vw, 150px); padding: 30px 0 60px; }
.hi-trilho { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(10, 29, 66, .08); }
.hi-trilho i { position: absolute; top: 0; left: 0; right: 0; height: calc(var(--tl) * 100%); border-radius: 2px; background: linear-gradient(180deg, rgba(252, 193, 1, 0), var(--zh-amarelo) 12%, #6aa5ff); box-shadow: 0 0 18px rgba(252, 193, 1, .55); }
.hi-trilho i::after { content: ''; position: absolute; bottom: -8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--zh-amarelo); box-shadow: 0 0 0 6px rgba(252, 193, 1, .22), 0 0 28px 4px rgba(252, 193, 1, .85); }

.hi-row { --e: 0; --f: 0; --p: .5; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(64px, 9vw, 140px); align-items: center; scroll-margin-top: 120px; }
.hi-row:nth-of-type(even) .hi-midia { order: 2; }
.hi-no { position: absolute; top: 50%; left: 50%; z-index: 2; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: #fff; border: 3px solid #c9d5ec; transition: background .4s, border-color .4s, box-shadow .4s, transform .4s var(--zh-ease); }
.hi-row.is-passou .hi-no { background: var(--zh-amarelo); border-color: #fff; transform: scale(1.25); box-shadow: 0 0 0 5px rgba(252, 193, 1, .3), 0 0 22px rgba(252, 193, 1, .8); }

/* Foto: abre como uma janela (clip-path), desaproxima (scale) e tem leve parallax; no mouse, inclina em 3D com brilho */
.hi-midia { position: relative; margin: 0; filter: drop-shadow(0 34px 34px rgba(10, 29, 66, calc(var(--e) * .3))); transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(calc((1 - var(--e)) * 60px)); transition: transform .6s var(--zh-ease); will-change: transform; }
.hi-midia.is-mouse { transition-duration: .12s; }
.hi-clip { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 24px; background: linear-gradient(135deg, var(--zh-navy), var(--zh-navy-2)); clip-path: inset(calc((1 - var(--e)) * 16%) calc((1 - var(--e)) * 22%) round 24px); }
.hi-clip img { width: 100%; height: 112%; margin-top: -6%; object-fit: cover; transform: scale(calc(1.4 - var(--e) * .4)) translateY(calc((var(--p) - .5) * -9%)); filter: saturate(calc(.4 + var(--e) * .6)); }
.hi-clip.hi-logo { background: #fff; }
.hi-clip.hi-logo img { height: 100%; margin: 0; padding: 9%; object-fit: contain; }
.hi-brilho { position: absolute; inset: 0; border-radius: 24px; pointer-events: none; opacity: 0; background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 50%); mix-blend-mode: soft-light; transition: opacity .35s; }
.hi-midia.is-mouse .hi-brilho { opacity: 1; }
.hi-chip { position: absolute; left: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(10, 29, 66, .62); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(12px); opacity: var(--e); transform: translateY(calc((1 - var(--e)) * 24px)) translateZ(40px); }
.hi-chip i { color: var(--zh-amarelo); }

/* Texto: meta com linha que cresce, ano que sobe dígito por dígito e se preenche, título palavra por palavra, parágrafo desfocado → nítido */
.hi-txt { transform: translateY(calc((1 - var(--e)) * 50px)); }
.hi-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--zh-azul); }
.hi-meta::after { content: ''; height: 2px; width: calc(var(--e) * 56px); border-radius: 2px; background: var(--zh-amarelo); }
.hi-ano { position: relative; display: inline-block; margin-top: 10px; font-size: clamp(72px, 9.5vw, 136px); font-weight: 800; line-height: .92; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.hi-ano > span { display: flex; }
.hi-ano > span > span { display: inline-block; overflow: hidden; padding: 0 .01em .04em; }
.hi-ano b { display: inline-block; font-weight: inherit; transform: translateY(110%) rotate(8deg); transition: transform 1s cubic-bezier(.16, 1, .3, 1) calc(var(--d) * 80ms); }
.hi-row.is-in .hi-ano b { transform: none; }
.hi-ano-c { color: transparent; -webkit-text-stroke: 2px rgba(10, 29, 66, .16); }
.hi-ano-f { position: absolute; inset: 0; color: var(--zh-amarelo); -webkit-text-stroke: 2px var(--zh-amarelo); text-shadow: 0 10px 30px rgba(252, 193, 1, .25); clip-path: inset(-10% calc(100% - var(--f) * 100%) -10% 0); }
.hi-txt h3 { margin-top: 14px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--zh-navy); }
.hi-txt h3 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.hi-txt h3 .w b { display: inline-block; font-weight: inherit; transform: translateY(105%); transition: transform .9s cubic-bezier(.16, 1, .3, 1) calc(250ms + var(--d) * 55ms); }
.hi-row.is-in .hi-txt h3 .w b { transform: none; }
.hi-txt > p:last-child { margin-top: 16px; max-width: 470px; font-size: 16.5px; line-height: 1.65; color: var(--zh-cinza); }
.zh-js .hi-txt > p:last-child { opacity: 0; filter: blur(10px); transform: translateY(18px); transition: opacity 1s ease .55s, filter 1s ease .55s, transform 1s cubic-bezier(.16, 1, .3, 1) .55s; }
.zh-js .hi-row.is-in .hi-txt > p:last-child { opacity: 1; filter: none; transform: none; }
/* Sem JS: tudo visível e parado */
html:not(.zh-js) .hi-row { --e: 1; --f: 1; }
html:not(.zh-js) .hi-ano b, html:not(.zh-js) .hi-txt h3 .w b { transform: none; }

/* Índice de anos fixo à direita (aparece só enquanto a linha do tempo está na tela) */
.hi-anos { position: fixed; top: 50%; right: 20px; z-index: 900; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-radius: 16px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(10, 29, 66, .08); backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(10, 29, 66, .12); opacity: 0; transform: translate(24px, -50%); pointer-events: none; transition: opacity .45s, transform .45s var(--zh-ease); }
.hi-anos.is-vis { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.hi-anos a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 3px 6px; font-size: 12px; font-weight: 700; color: #9aa6bd; font-variant-numeric: tabular-nums; text-decoration: none; }
.hi-anos a span { max-width: 0; overflow: hidden; opacity: 0; transition: max-width .35s var(--zh-ease), opacity .3s; }
.hi-anos:hover a span, .hi-anos a.is-ativo span { max-width: 40px; opacity: 1; }
.hi-anos a i { flex: none; width: 8px; height: 8px; border-radius: 4px; background: #c9d5ec; transition: height .35s var(--zh-ease), background .35s; }
.hi-anos a.is-passou i { background: #f3d77a; }
.hi-anos a.is-ativo { color: var(--zh-navy); }
.hi-anos a.is-ativo i { height: 22px; background: var(--zh-amarelo); box-shadow: 0 0 12px rgba(252, 193, 1, .7); }
.hi-anos a:focus-visible { outline: 3px solid #6aa5ff; outline-offset: 2px; border-radius: 6px; }

/* ---------- Missão, visão e valores ---------- */
.hi-mvv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.hi-mvv-card { position: relative; padding: 32px 28px; border-radius: var(--zh-raio); background: #fff; border: 1px solid var(--zh-borda); border-top: 4px solid var(--zh-amarelo); box-shadow: 0 4px 14px rgba(10, 29, 66, .06); transition: transform .3s var(--zh-ease), box-shadow .3s; }
.hi-mvv-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(10, 29, 66, .14); }
.hi-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; font-size: 22px; color: var(--zh-navy); background: var(--zh-amarelo); transition: transform .4s var(--zh-ease); }
.hi-mvv-card:hover .hi-ic { transform: rotate(-8deg) scale(1.08); }
.hi-mvv-card h3 { margin-top: 18px; font-size: 20px; font-weight: 800; color: var(--zh-navy); }
.hi-mvv-card blockquote { margin: 12px 0 0; font-size: 15.5px; font-style: italic; color: var(--zh-cinza); }
.hi-mvv-card ul { display: grid; gap: 8px; margin-top: 14px; }
.hi-mvv-card li { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 600; color: var(--zh-texto); }
.hi-mvv-card li i { color: #1f9d55; }

/* ---------- Visão de futuro ---------- */
.hi-futuro { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hi-futuro strong { display: block; margin-top: 8px; font-size: clamp(64px, 8vw, 112px); font-weight: 800; line-height: .9; color: var(--zh-amarelo); }
.hi-futuro h2 { margin-top: 12px; font-size: clamp(26px, 3vw, 40px); font-weight: 800; color: #fff; }
.hi-futuro p { margin-top: 14px; font-size: 16.5px; color: #c9d6f2; }
.hi-futuro-logo { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 30px 60px rgba(0, 0, 0, .3); }
.hi-futuro-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10%; }

.hi-cta-txt { margin-top: 12px; max-width: 640px; color: #c9d6f2; }
.hi-cta-botoes { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
    .hi-bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .hi-hero .zh-hero-centro > * { max-width: none; }
    .hi-hero::after { left: 0; max-width: none; aspect-ratio: auto; background-position: 30% center; -webkit-mask-image: none; mask-image: none; }
    .hi-hero::before { background: linear-gradient(180deg, rgba(10, 29, 66, .55) 0%, rgba(10, 29, 66, .78) 45%, rgba(10, 29, 66, .94) 100%); }
    .hi-legenda { display: none; }
    .hi-mvv, .hi-futuro { grid-template-columns: 1fr; }
    /* Linha do tempo no celular: linha à esquerda, foto em cima e texto embaixo */
    .hi-trilho { left: 11px; }
    .hi-row { grid-template-columns: 1fr; gap: 22px; padding-left: 40px; }
    .hi-row:nth-of-type(even) .hi-midia { order: 0; }
    .hi-no { left: 11px; }
    .hi-anos { display: none; }
    .hi-ano { font-size: clamp(64px, 18vw, 96px); }
}
@media (max-width: 600px) {
    .hi-bento { grid-template-columns: 1fr 1fr; }
    .hi-texto { grid-column: span 2; grid-row: auto; }
    .zh-hero-botoes .zh-btn, .hi-cta-botoes .zh-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .hi-row { --e: 1 !important; --f: 1 !important; --p: .5 !important; }
    .hi-tl { --tl: 1 !important; }
    .hi-ano b, .hi-txt h3 .w b { transform: none !important; transition: none !important; }
    .zh-js .hi-txt > p:last-child { opacity: 1; filter: none; transform: none; transition: none; }
    .hi-hero::after { animation: none; }
}
