/* Protege — efeito de páginas (desktop): cada seção vira uma tela e a próxima sobe como uma cortina.
   Só vale com html.is-paged, ativado por assets/js/pages.js (telas largas, sem "reduzir movimento").
   Para remover o efeito, tire os links de pages.css e pages.js do index.html. */

html.is-paged, html.is-paged body { height: 100%; overflow: hidden; }
.is-paged .page { height: 100%; overflow: visible; }

.is-paged .topbar { position: fixed; top: 0; right: 0; left: 0; z-index: 100; }

.is-paged .pane {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  padding-top: var(--header);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); visibility: hidden;
  scrollbar-width: none;
}
.is-paged .pane::-webkit-scrollbar { display: none; }
.is-paged .pane.is-current { z-index: 2; visibility: visible; }
.is-paged .pane > .hero, .is-paged .pane > section, .is-paged .pane > footer { flex: 1 0 auto; }

/* Início: a faixa de serviços encosta no rodapé da tela */
.is-paged .pane--first .hero { min-height: 0; }
.is-paged .pane--first .hero__grid { min-height: 0; }
.is-paged .pane--first .marquee { flex: none; }

/* Seções mais baixas que a tela: conteúdo centralizado */
.is-paged .consulting, .is-paged .clinic, .is-paged .training, .is-paged .services,
.is-paged .business, .is-paged .contact { display: flex; flex-direction: column; justify-content: center; }
.is-paged .consulting > .wrap, .is-paged .clinic > .wrap, .is-paged .training > .wrap,
.is-paged .services > .wrap, .is-paged .business > .wrap, .is-paged .contact > .wrap { width: min(var(--wrap), calc(100% - (var(--gutter) * 2))); }
.is-paged .about { display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.is-paged .institutional { min-height: 0; }

/* Ajuste automático (pages.js): reduz a tela inteira se o conteúdo passar da altura */
.is-paged .pane > * { zoom: var(--fit, 1); }

/* Espaçamentos verticais menores: cada tela precisa caber inteira */
.is-paged .consulting, .is-paged .clinic, .is-paged .training, .is-paged .business, .is-paged .institutional { padding-block: clamp(28px, 6vh, 72px); }
.is-paged .contact { padding: clamp(28px, 5vh, 64px) 0 20px; }
.is-paged .foot { margin-top: clamp(24px, 5vh, 56px); }
.is-paged .about__inner { padding-block: clamp(28px, 6vh, 72px); }
.is-paged .display { font-size: clamp(2.3rem, min(5vw, 9vh), 5.4rem); }
.is-paged .business__content .display { font-size: clamp(2.2rem, min(4.6vw, 8.5vh), 5rem); }
.is-paged .clinic__text > p:not(.eyebrow) { margin-top: clamp(14px, 3vh, 32px); }
.is-paged .exam-list { margin: clamp(14px, 3vh, 34px) 0; }
.is-paged .exam-list li { padding: clamp(6px, 1.1vh, 10px) 0; }
.is-paged .tagbar { margin: clamp(16px, 3.5vh, 34px) 0 clamp(12px, 2.5vh, 22px); }

/* Partes que viraram telas próprias: sem a margem que as separava */
.is-paged .consulting__gallery, .is-paged .team, .is-paged .facilities, .is-paged .courses { margin-top: 0; }

/* Cinco frentes (dentro de "Por que a Protege"): esfera do tamanho da altura da tela */
.is-paged .about .sphere-canvas { width: min(36vw, calc(100svh - var(--header) - 90px), 600px); height: min(36vw, calc(100svh - var(--header) - 90px), 600px); }

/* Consultoria · fotos */
.is-paged .consulting__gallery { grid-template-rows: repeat(2, calc((100svh - var(--header) - 14px - 2 * clamp(28px, 6vh, 72px)) / 2)); }

/* Clínica: foto da recepção e corpo clínico com altura limitada pela tela */
.is-paged .photo-block img { max-height: calc(100svh - var(--header) - 2 * clamp(28px, 6vh, 72px)); }
.is-paged .team__list img { aspect-ratio: auto; height: min(calc(100svh - var(--header) - 300px), 400px); min-height: 180px; }

/* Treinamento · estrutura: 2 linhas de 3 fotos que ocupam a tela */
.is-paged .training.is-split:has(.facilities) { padding-block: clamp(14px, 2.5vh, 28px); }
.is-paged .facilities { width: 100%; }
.is-paged .facilities li, .is-paged .facilities li:nth-child(n+4) { min-height: 0; height: calc((100svh - var(--header) - 14px - 2 * clamp(14px, 2.5vh, 28px)) / 2); grid-column: span 4; }

/* Início: respiro menor para caber com a faixa de serviços */
.is-paged .pane--first .hero__grid { padding-block: clamp(24px, 5vh, 56px); }

/* Treinamento · cursos: linhas mais baixas */
.is-paged .course-table td { padding-block: clamp(8px, 1.6vh, 18px); }

/* Loja e jurídico: foto do tamanho da tela */
.is-paged .business__media, .is-paged .business__media img { min-height: 0; height: calc(100svh - var(--header) - 2 * clamp(28px, 6vh, 72px)); }

/* Tablet (768–900px): mantém as colunas lado a lado do desktop dentro das telas */
@media (max-width: 900px) {
  .is-paged .institutional { display: flex; padding-top: clamp(28px, 6vh, 72px); }
  .is-paged .institutional__bg { top: 0; right: 0; left: auto; width: 60%; height: 100%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38%); mask-image: linear-gradient(90deg, transparent 0, #000 38%); }
  .is-paged .institutional__head { width: min(100%, 46%); }
  .is-paged .about__inner { padding-bottom: clamp(28px, 6vh, 72px); }
  .is-paged .about__sphere { position: absolute; inset: 0 0 0 48%; margin-top: 0; }
  .is-paged .about .sphere-scene { height: 100%; min-height: 0; }
  .is-paged .about .sphere-canvas { width: min(44vw, calc(100svh - var(--header) - 90px)); height: min(44vw, calc(100svh - var(--header) - 90px)); }
  .is-paged .about .sphere-center { width: 20vw; }
  .is-paged .about .sphere-center h2 { font-size: 1.1rem; }
  .is-paged .about .sphere-center p { display: none; }
  .is-paged .about .sphere-label { min-width: 0; padding: 8px; font-size: .5rem; }
  .is-paged .about .sphere-label::before, .is-paged .about .sphere-label::after { display: none; }
  .is-paged .about .sphere-label--one { top: 12%; left: 4%; }
  .is-paged .about .sphere-label--two { top: 47%; left: 0; }
  .is-paged .about .sphere-label--three { top: auto; bottom: 12%; left: 4%; }
  .is-paged .about .sphere-label--four { top: 22%; right: 8%; }
  .is-paged .about .sphere-label--five { top: auto; bottom: 22%; right: 8%; }
  .is-paged .about__text { width: 52%; padding-right: 24px; }
  .is-paged .consulting__head, .is-paged .training__head { grid-template-columns: minmax(0,1fr) minmax(0,.9fr); gap: 32px; align-items: end; }
  .is-paged .clinic__grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; }
  .is-paged .photo-block { width: 100%; margin: 0; }
  .is-paged .business__grid, .is-paged .business--legal .business__grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; }
  .is-paged .contact__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* Entrada do texto depois da cortina */
@keyframes pane-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.is-paged .pane.is-entering :is(.eyebrow, .hero h1, .display, .subhead, .hero__lead, .hero__actions, .about__copy, .tagbar, .business__copy, .consulting__copy, .institutional__head > p, .contact__big) {
  animation: pane-rise .9s cubic-bezier(.22,1,.3,1) .38s both;
}

/* Indicador lateral de telas */
.pager { position: fixed; top: 50%; right: clamp(10px, 1.4vw, 24px); z-index: 90; display: flex; flex-direction: column; gap: 4px; transform: translateY(-50%); }
.pager button { position: relative; display: block; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.pager button::before { content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; background: rgba(255,255,255,.92); border: 1px solid rgba(0,0,0,.45); border-radius: 50%; transform: translate(-50%,-50%); transition: width .3s, height .3s, background .3s; }
.pager button:hover::before { background: var(--yellow); }
.pager button[aria-current="true"]::before { width: 13px; height: 13px; background: var(--green-bright); border-color: rgba(0,0,0,.55); }
.pager button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 0; }
.pager button span { position: absolute; top: 50%; right: 30px; padding: 6px 10px; color: var(--black); background: var(--yellow); font-family: var(--mono); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(6px,-50%); transition: opacity .2s, transform .2s; }
.pager button:hover span, .pager button:focus-visible span { opacity: 1; transform: translate(0,-50%); }
