﻿/* Refinos leves além do Tailwind CDN */

/* Hero / banners: caixa com aspect-ratio da imagem; imagem inteira visível (sem crop) */
.hero-banner-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
}

/* Largura = tamanho real da imagem (px), até o máximo do ecrã; centrado (evita “zoom” em ecrãs largos) */
#hero-slider-aspect {
  box-sizing: content-box;
  width: 100%;
  min-width: 0;
  max-width: min(100%, var(--hero-native-w, 4000px));
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 130px;
  overflow-x: clip;
  touch-action: pan-y pinch-zoom;
  pointer-events: auto;
  -webkit-touch-callout: none;
}

@media (max-width: 767px) {
  #hero-slider-aspect {
    padding-bottom: clamp(3rem, 16vw, 5.5rem);
  }
}

/* Destaques: evita arrastar o slide horizontalmente a ativar “voltar” no browser */
section[aria-label='Destaques'] {
  overscroll-behavior-x: contain;
}

html {
  scroll-padding-top: 8.5rem;
  overflow-x: clip;
}

body {
  background-color: #e8f4fc;
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 7rem;
  }
}

.touch-manipulation {
  touch-action: manipulation;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Faixa de contacto: ícones centrados no círculo (sem “descida” óptica) */
.info-strip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.info-strip-icon svg {
  display: block;
  flex-shrink: 0;
}

@media (max-width: 639px) {
  main h2.font-display.text-3xl {
    font-size: 1.625rem;
    line-height: 1.2;
  }
}

/* h2 (Playfair + marca): sombra suave para leitura em fundo claro ou escuro */
main h2.font-display.text-brand {
  text-shadow:
    0 0 1px rgba(6, 18, 24, 0.22),
    0 1px 2px rgba(6, 18, 24, 0.16),
    0 2px 16px rgba(6, 18, 24, 0.1);
  letter-spacing: -0.01em;
}

main h2.font-display.text-white {
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(0, 0, 0, 0.28);
}

/* Painel admin: h2 brancos (cards, formulários) */
body.min-h-screen.bg-void main h2.font-semibold.text-white {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(0, 0, 0, 0.22);
}

/* Header: logo grande no topo; encolhe ao rolar a página */
.site-header {
  transition:
    box-shadow 0.35s ease,
    background-color 0.35s ease,
    border-color 0.35s ease;
}

#site-header .header-nav-main a {
  position: relative;
}

#site-header .header-nav-main a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 2px;
  background: rgba(251, 191, 36, 0.95);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

#site-header .header-nav-main a:hover::after {
  transform: scaleX(1);
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(26, 47, 74, 0.1);
  background-color: #fff;
  border-bottom-color: rgba(26, 47, 74, 0.1);
}

.site-header-inner {
  transition:
    padding-top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    padding-bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

@media (min-width: 768px) {
  .site-header-inner {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

.site-header.is-scrolled .site-header-inner {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.header-logo-link {
  text-decoration: none;
}

.header-logo-img {
  display: block;
  width: auto;
  height: 2.75rem;
  max-height: 2.75rem;
  max-width: min(12rem, calc(100vw - 5.5rem));
  object-fit: contain;
  object-position: center center;
  transition:
    height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  .header-logo-img {
    height: 3rem;
    max-height: 3rem;
    max-width: min(14rem, calc(100vw - 6rem));
  }
}

@media (min-width: 768px) {
  .header-logo-img {
    height: 3.25rem;
    max-height: 3.25rem;
    max-width: min(15rem, 40vw);
  }
}

@media (min-width: 1024px) {
  .header-logo-img {
    height: 3.5rem;
    max-height: 3.5rem;
    max-width: 16rem;
  }
}

.site-header.is-scrolled .header-logo-img {
  height: 2.25rem;
  max-height: 2.25rem;
}

@media (min-width: 640px) {
  .site-header.is-scrolled .header-logo-img {
    height: 2.35rem;
    max-height: 2.35rem;
  }
}

@media (min-width: 768px) {
  .site-header.is-scrolled .header-logo-img {
    height: 2.5rem;
    max-height: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .site-header.is-scrolled .header-logo-img {
    height: 2.5rem;
    max-height: 2.5rem;
  }
}

/* Logo circular (marca Chaveiro Beira Mar) — não forçar retângulo */
.header-logo-img.logo-round {
  width: 3.5rem !important;
  height: 3.5rem !important;
  max-width: 3.5rem !important;
  max-height: 3.5rem !important;
  object-fit: cover;
  object-position: center;
}

@media (min-width: 640px) {
  .header-logo-img.logo-round {
    width: 4rem !important;
    height: 4rem !important;
    max-width: 4rem !important;
    max-height: 4rem !important;
  }
}

.site-header.is-scrolled .header-logo-img.logo-round {
  width: 3rem !important;
  height: 3rem !important;
  max-width: 3rem !important;
  max-height: 3rem !important;
}

.header-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  transition:
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-logo-fallback svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

@media (min-width: 768px) {
  .header-logo-fallback {
    width: 3.25rem;
    height: 3.25rem;
  }
}

@media (min-width: 1024px) {
  .header-logo-fallback {
    width: 3.5rem;
    height: 3.5rem;
  }
}

.site-header.is-scrolled .header-logo-fallback {
  width: 2.25rem;
  height: 2.25rem;
}

@media (min-width: 768px) {
  .site-header.is-scrolled .header-logo-fallback {
    width: 2.35rem;
    height: 2.35rem;
  }
}

@media (min-width: 1024px) {
  .site-header.is-scrolled .header-logo-fallback {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/**
 * Degradê na foto: base 100% opaca com a cor do card para não “vazar”
 * fundo claro da imagem nem o fundo da página atrás do card.
 */
.pillar-image-fade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Base clara para cards em layout light */
  background: linear-gradient(
    to top,
    rgb(255, 255, 255) 0%,
    rgb(255, 255, 255) 24%,
    rgba(255, 255, 255, 0.92) 42%,
    rgba(255, 255, 255, 0.55) 64%,
    rgba(255, 255, 255, 0.1) 86%,
    transparent 100%
  );
}

/* Fotos claras: degradê mais baixo para não “apagar” a imagem */
.pillar-image-fade--bright {
  background: linear-gradient(
    to top,
    rgb(255, 255, 255) 0%,
    rgb(255, 255, 255) 14%,
    rgba(255, 255, 255, 0.82) 32%,
    rgba(255, 255, 255, 0.35) 58%,
    rgba(255, 255, 255, 0.08) 82%,
    transparent 100%
  );
}

/* Entrada ao rolar a página */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Mobile: texto e cards visíveis sem depender do JS (evita “página vazia” + melhora LCP percebido) */
@media (max-width: 767px) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal-group > .reveal:nth-child(n) {
    --reveal-delay: 0ms;
  }
}

.reveal-group > .reveal:nth-child(1) {
  --reveal-delay: 0ms;
}
.reveal-group > .reveal:nth-child(2) {
  --reveal-delay: 85ms;
}
.reveal-group > .reveal:nth-child(3) {
  --reveal-delay: 170ms;
}
.reveal-group > .reveal:nth-child(4) {
  --reveal-delay: 255ms;
}
.reveal-group > .reveal:nth-child(5) {
  --reveal-delay: 340ms;
}
.reveal-group > .reveal:nth-child(6) {
  --reveal-delay: 425ms;
}
.reveal-group > .reveal:nth-child(7) {
  --reveal-delay: 510ms;
}
.reveal-group > .reveal:nth-child(8) {
  --reveal-delay: 595ms;
}
.reveal-group > .reveal:nth-child(9) {
  --reveal-delay: 680ms;
}

/* Cards claros (faixa de informações, figuras de seção, formulário) */
.card-lift {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease;
  border-radius: 1rem;
}

@media (hover: hover) and (pointer: fine) {
  .card-lift:hover {
    transform: translateY(-8px);
    box-shadow:
      0 22px 44px -16px rgba(26, 47, 74, 0.15),
      0 0 0 1px rgba(56, 189, 248, 0.45);
  }

  .card-lift:hover .card-lift-img {
    transform: scale(1.06);
  }
}

.card-lift .card-lift-img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

#contato .card-lift {
  box-shadow: 0 16px 40px -20px rgba(15, 23, 42, 0.22);
}

footer {
  backdrop-filter: none;
}

/* Crédito F5 no rodapé — tamanho fixo e discreto (não herda escala do header) */
.footer-dev-logo {
  height: auto;
  width: auto;
}

/* Pilares escuros */
.card-lift-dark {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .card-lift-dark:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow:
      0 28px 56px -12px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(220, 38, 38, 0.35),
      0 0 28px rgba(220, 38, 38, 0.12);
  }

  .card-lift-dark:hover .pillar-card-img {
    transform: scale(1.05);
  }
}

.card-lift-dark .pillar-card-img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header-inner,
  .header-logo-img,
  .header-logo-fallback {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card-lift,
  .card-lift-dark,
  .card-lift .card-lift-img {
    transition: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .card-lift:hover,
    .card-lift-dark:hover {
      transform: none;
    }

    .card-lift:hover .card-lift-img {
      transform: none;
    }

    .card-lift-dark:hover .pillar-card-img {
      transform: none;
    }
  }
}

