/* Via Traço · refinamento universal de touch e responsivo · v37 */
html { -webkit-text-size-adjust: 100%; }

/* Fallback por classe para navegadores que não refletem corretamente as
   media queries de ponteiro, mas informam suporte a toque via JavaScript. */
html.vt-touch, html.vt-touch body { overscroll-behavior-x: none; }
html.vt-touch body { -webkit-tap-highlight-color: transparent; }
html.vt-touch a, html.vt-touch button, html.vt-touch input,
html.vt-touch select, html.vt-touch textarea,
html.vt-touch [role="button"], html.vt-touch [tabindex="0"] {
  touch-action: manipulation;
}
html.vt-touch .line-cursor, html.vt-touch #lineCursor,
html.vt-touch .cursor-line, html.vt-touch canvas.line-cursor {
  display: none !important;
}

@media (hover: none), (pointer: coarse), (any-hover: none), (any-pointer: coarse) {
  html, body { overscroll-behavior-x: none; }
  body { -webkit-tap-highlight-color: transparent; }

  a, button, input, select, textarea,
  [role="button"], [tabindex="0"] {
    touch-action: manipulation;
  }

  .line-cursor,
  #lineCursor,
  .cursor-line,
  canvas.line-cursor { display: none !important; }

  .h-carousel__arrow,
  .ic-car__arrow,
  .iv-car__arrow,
  .proj-car__arrow,
  .iv-lb__arrow,
  .proj-lb__arrow,
  .ic-lightbox__arrow,
  .deck-dots button,
  .nav-hamburger {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .h-carousel__frame,
  .ic-car__frame,
  .iv-car__frame,
  .proj-car__frame,
  .proj-carousel,
  .ic-car,
  .iv-car {
    touch-action: pan-y;
  }

  .mobile-menu a,
  .contact-link,
  .h-link,
  .cat-card-cta,
  .form-submit {
    min-height: 44px;
  }
}

/* O monitor do vídeo de Sites mantém o tamanho, mas ganha uma caixa mais larga.
   Assim as laterais do arquivo não são recortadas pelo painel direito. */
@media (min-width: 901px) {
  body.home #sites-digital .h-scrub-sticky {
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  }
  body.home #sites-digital .h-video-wrap {
    width: calc(100% + 7vw) !important;
    max-width: none !important;
    margin-left: -3.5vw !important;
    margin-right: -3.5vw !important;
    flex: 0 0 calc(100% + 7vw) !important;
  }
  body.home #sitesVideo {
    width: 80% !important;
    height: 100% !important;
  }
}

@media (max-width: 900px) {
  /* Vídeos ainda respondem ao gesto vertical, mas sem os corredores de 5 telas. */
  body.home #design-editorial .h-scrub-driver,
  body.home #sites-digital .h-scrub-driver {
    display: block !important;
    height: 175svh !important;
    min-height: 175svh !important;
  }

  body.home #design-editorial .h-scrub-wrap,
  body.home #sites-digital .h-scrub-wrap {
    min-height: 275svh !important;
  }

  body.home #design-editorial .h-scrub-sticky,
  body.home #sites-digital .h-scrub-sticky {
    height: 100svh !important;
    min-height: 100svh !important;
    touch-action: pan-y !important;
  }

  body.home #design-editorial .h-section__art,
  body.home #sites-digital .h-section__art {
    height: 53svh !important;
    min-height: 235px !important;
    padding: 62px 14px 0 !important;
  }

  body.home #design-editorial .h-section__text,
  body.home #sites-digital .h-section__text {
    height: 47svh !important;
    min-height: 0 !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 18px 20px max(30px, env(safe-area-inset-bottom)) !important;
  }

  body.home #sites-digital .h-video-wrap {
    width: calc(100% + 22px) !important;
    margin-left: -11px !important;
    margin-right: -11px !important;
  }

  body.home #sitesVideo { transform: scale(.96) !important; }

  /* Carrossel da Home no celular: navegação direta por swipe/setas, sem
     sequestrar o scroll da página e sem driver de centenas de telas. */
  body.home #identidade-visual .h-scrub-wrap {
    height: auto !important;
    min-height: auto !important;
  }
  body.home #identidade-visual .h-scrub-sticky {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }
  body.home #identidade-visual .h-carousel-driver {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
  }
  body.home #identidade-visual .h-section__art {
    order: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 76px 20px 20px !important;
  }
  body.home #identidade-visual .h-section__text {
    order: 2 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 12px 22px 58px !important;
    opacity: 1 !important;
    transform: none !important;
  }
  body.home #identidade-visual .h-carousel__frame {
    width: min(82vw, 520px) !important;
  }

  /* A Expografia tem uma única imagem. No touch ela vira uma seção normal. */
  body.home #expografia .h-scrub-wrap { min-height: auto !important; height: auto !important; }
  body.home #expografia .h-scrub-sticky {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }
  body.home #expografia .h-carousel-driver { display: none !important; height: 0 !important; }
  body.home #expografia .h-section__art {
    order: 1 !important;
    width: 100% !important;
    height: auto !important;
    padding: 64px 18px 16px !important;
  }
  body.home #expografia .h-section__text {
    order: 2 !important;
    width: 100% !important;
    height: auto !important;
    padding: 14px 22px 58px !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Evita que a inércia do navegador continue arrastando trilhos após um swipe. */
  .h-carousel__track,
  .ic-car__track,
  .iv-car__track,
  .proj-car__track {
    will-change: transform;
    backface-visibility: hidden;
  }
}

@media (max-width: 430px) {
  body.home #design-editorial .h-section__art,
  body.home #sites-digital .h-section__art { height: 50svh !important; }
  body.home #design-editorial .h-section__text,
  body.home #sites-digital .h-section__text { height: 50svh !important; }
}


/* Fallback de altura para navegadores móveis sem suporte completo a svh/dvh. */
@supports not (height: 100svh) {
  @media (max-width: 900px) {
    body.home #design-editorial .h-scrub-sticky,
    body.home #sites-digital .h-scrub-sticky {
      height: calc(var(--vt-vh, 1vh) * 100) !important;
      min-height: calc(var(--vt-vh, 1vh) * 100) !important;
    }
    body.home #design-editorial .h-section__art,
    body.home #sites-digital .h-section__art {
      height: calc(var(--vt-vh, 1vh) * 53) !important;
    }
    body.home #design-editorial .h-section__text,
    body.home #sites-digital .h-section__text {
      height: calc(var(--vt-vh, 1vh) * 47) !important;
    }
  }
}
