:root {
  --site-header-height: 5.25rem;
}

html {
  scroll-padding-top: calc(var(--site-header-height) + 1rem);
}

body {
  overflow-x: clip;
}

[id] {
  scroll-margin-top: calc(var(--site-header-height) + 1rem);
}

h1,
h2,
h3,
blockquote {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

button,
.motion-button,
.testimonial-control,
.gallery-expand {
  min-height: 2.75rem;
  min-width: 2.75rem;
  touch-action: manipulation;
}

.reactive-photo-stage img,
.clinic-gallery-item img,
.lightbox-image {
  backface-visibility: hidden;
}

.testimonials-rail {
  scroll-padding-inline: 1.25rem;
}

/* Identificação visual discreta das avaliações públicas do Google. */
.testimonial-panel > div:last-child > span:first-child {
  width: 2.5rem !important;
  height: 2.5rem !important;
  flex: 0 0 2.5rem;
  border: 1px solid rgba(96, 64, 46, 0.1);
  border-radius: 999px;
  background-color: rgba(211, 171, 158, 0.24) !important;
  background-position: center;
  background-size: cover;
  box-shadow: 0 0 0 0.22rem #f5efe5;
}

.testimonial-panel:nth-child(1) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjUCsVK9NUgCcQukMH3ig3iPvtk1IPAUaT2lvRJo08kM3v8NbpMhkg=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(2) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjWc7qES8HYAzn0_bEg6nHAcLLE6WnBZMwrlfBorV1lT_EI2WS3sbw=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(3) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjWyuL4R69ea97Uhgyt7EKumXHsmmHAXrankS2OEc7Klz4AuRGY3KA=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(4) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjVPVhfYZWIkXdjo1u5BNQvoFUhHALCaGfAP98SytKrWmCMxsd0=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(5) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjXGI-dsSAKB26F6Sdq_CeKxig439DIRyMWAd9HOIV8VuM0ojkXnTw=s96-c-rp-mo-ba12-br100");
}

.testimonial-panel:nth-child(6) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjWYYfAUulOa66sQHn2Zp3QEcrIP4JhZCufQo7PYdJzMiXY48qXNyA=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(7) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjXMuqZSCnVI8ayH7Z1AXJiH891-_cM-_dRovUyEgfPvGAh_pGJR=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(8) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjUmNL3k7DTgJ3jrFM8yUTEzIFuYOI1NedxgPivwd1lnOm7TyOk=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(9) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjX-381LKwndSeZY7EStFNnKob0Pp9DdKzLilg0qbWGKfRixwv0m=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(10) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a/ACg8ocIGjgl1rfPdoNkVP_Qv6pG2UFX1-XSojCLkSGHBlPbjgkLUGA=s96-c-rp-mo-br100");
}

.testimonial-panel:nth-child(11) > div:last-child > span:first-child {
  background-image: url("https://lh3.googleusercontent.com/a-/ALV-UjWjxVnqnVvdYirESGPflayXR3JVP7usfYokfQaRHquzGXqN9V1H=s96-c-rp-mo-ba12-br100");
}

/* Abertura aprovada: texto e fotografia em blocos independentes. */
.hero-image {
  object-position: 52% 48%;
}

.hero-quote {
  border: 1px solid rgba(96, 64, 46, 0.08);
}

/* Mantém a legenda abaixo da moldura e impede que a frase quebre. */
.sobre-caption {
  z-index: 20;
  max-width: 52% !important;
  padding: 0.75rem 1.25rem 0.25rem 0;
  background: #60402e;
  line-height: 1.85 !important;
  white-space: nowrap;
}

/* O CTA mantém a largura do conteúdo em telas estreitas. */
.specialties-cta-row .motion-button {
  align-self: flex-start;
  flex: none;
  width: auto;
  max-width: 100%;
}

.clinic-gallery-item:nth-child(1) img {
  object-position: 50% 52%;
}

.clinic-gallery-item:nth-child(2) img {
  object-position: 62% 50%;
}

.clinic-gallery-item:nth-child(3) img {
  object-position: 50% 72%;
}

.clinic-gallery-item:nth-child(4) img {
  object-position: 50% 50%;
}

.clinic-gallery-item:nth-child(5) img,
.clinic-gallery-item:nth-child(6) img {
  object-position: 50% 48%;
}

.clinic-gallery-item:nth-child(7) img {
  object-position: 50% 55%;
}

/* WhatsApp flutuante: mesma linguagem material e cromática do site. */
.whatsapp-float {
  position: fixed;
  z-index: 35;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: inline-flex;
  min-height: 3.5rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.25rem 0.7rem 0.9rem;
  overflow: visible;
  border: 1px solid rgba(245, 239, 229, 0.2);
  border-radius: 999px;
  background: rgba(96, 64, 46, 0.94);
  color: #f5efe5;
  box-shadow: 0 1.1rem 3.2rem rgba(54, 32, 20, 0.22);
  text-decoration: none;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: translate3d(0, 0, 0);
  opacity: 0;
  animation: whatsapp-float-in 560ms cubic-bezier(0.22, 1, 0.36, 1) 1100ms forwards;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease, box-shadow 180ms ease;
}

.whatsapp-float::before {
  position: absolute;
  z-index: -1;
  inset: -0.45rem;
  border: 1px solid rgba(211, 171, 158, 0.22);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.whatsapp-float:hover {
  background: #60402e;
  box-shadow: 0 1.35rem 3.6rem rgba(54, 32, 20, 0.27);
  transform: translate3d(0, -0.2rem, 0);
}

.whatsapp-float:active {
  transform: translate3d(0, 0, 0) scale(0.98);
}

.whatsapp-float:focus-visible {
  outline: 2px solid #d3ab9e;
  outline-offset: 0.28rem;
}

.whatsapp-float__icon {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.whatsapp-float__label {
  font-family: Manrope, sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.whatsapp-float__signal {
  position: absolute;
  top: 0.32rem;
  right: 0.45rem;
  width: 0.42rem;
  height: 0.42rem;
  border: 1px solid rgba(245, 239, 229, 0.75);
  border-radius: 50%;
  background: #d3ab9e;
}

@keyframes whatsapp-float-in {
  from {
    opacity: 0;
    transform: translate3d(0, 0.8rem, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (width <= 639px) {
  :root {
    --site-header-height: 5.25rem;
  }

  #inicio > section > div:first-child {
    padding-top: 3.5rem;
    padding-bottom: 3.25rem;
  }

  #inicio h1 {
    max-width: 11.5ch;
    font-size: clamp(3.75rem, 18vw, 4.5rem);
    line-height: 0.84;
    letter-spacing: -0.052em;
  }

  #inicio h1 + div {
    margin-top: 2rem;
    padding-left: 1.25rem;
  }

  #inicio h1 + div p {
    line-height: 1.75;
  }

  #inicio > section > div:last-child {
    min-height: clamp(33rem, 145vw, 38rem);
  }

  /* Galeria mobile: todas as imagens ficam acessíveis em uma faixa horizontal,
     sem criar uma sequência longa de cards empilhados. */
  .clinic-gallery {
    display: flex;
    gap: 0.75rem;
    margin-right: -1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .clinic-gallery::-webkit-scrollbar {
    display: none;
  }

  .clinic-gallery-item,
  .clinic-gallery-item:nth-child(n + 3) {
    display: block !important;
    flex: 0 0 min(82vw, 22rem);
    min-height: 0;
    aspect-ratio: 4 / 5;
    scroll-snap-align: start;
  }

  .hero-image {
    object-position: 50% 50%;
  }

  .hero-quote {
    max-width: min(17rem, calc(100% - 2.5rem)) !important;
  }

  .sobre-caption {
    bottom: 0.5rem !important;
    max-width: 58% !important;
    padding-right: 0.65rem;
    font-size: 0.58rem !important;
    letter-spacing: 0.13em !important;
  }

  .specialties-cta-row .motion-button {
    max-width: calc(100vw - 2.5rem);
  }

  .kinetic-trace-b {
    display: none;
  }

  .reactive-photo-stage {
    will-change: auto;
  }

  .testimonials-rail {
    scroll-padding-inline: 1.25rem;
  }

  .whatsapp-float {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 3.65rem;
    min-width: 3.65rem;
    height: 3.65rem;
    min-height: 3.65rem;
    justify-content: center;
    padding: 0;
  }

  .whatsapp-float__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (width >= 640px) and (width <= 1023px) {
  #inicio > section > div:first-child {
    padding-top: 5rem;
    padding-bottom: 4.5rem;
  }

  #inicio > section > div:last-child {
    min-height: 46rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonials-rail {
    scroll-behavior: auto;
  }

  .whatsapp-float {
    opacity: 1;
    animation: none;
    transition: none;
  }
}
