@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap");

:root {
  --font-heading: "Libre Baskerville", serif;
  --font-body: "Inter", sans-serif;

  --background: 30 20% 97%;
  --foreground: 20 15% 10%;
  --card: 0 0% 100%;
  --card-foreground: 20 15% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 20 15% 10%;
  --primary: 20 15% 10%;
  --primary-foreground: 30 20% 97%;
  --secondary: 30 15% 93%;
  --secondary-foreground: 20 15% 10%;
  --muted: 30 10% 92%;
  --muted-foreground: 20 8% 45%;
  --accent: 38 30% 85%;
  --accent-foreground: 20 15% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --success: 142 71% 36%;
  --success-foreground: 0 0% 98%;
  --border: 30 12% 88%;
  --input: 30 12% 88%;
  --ring: 20 15% 10%;
  --radius: 0.25rem;
}

*,
*::before,
*::after {
  border-color: hsl(var(--border));
  box-sizing: border-box;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body), sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Home — fade-up reutilizável (hero, stats, CTA, cards AJAX) */
.home-reveal,
.property-card.home-card-enter {
  opacity: 0;
  transform: translateY(1.25rem);
}

.home-reveal.home-reveal-active,
.property-card.home-card-enter.home-card-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

/* Fade-in (sem translateY) — ex.: imagem em quem-somos */
.home-reveal-fade {
  opacity: 0;
}

.home-reveal-fade.home-reveal-active {
  opacity: 1;
  transition: opacity 0.8s ease-out;
}

/* Fade-in lateral — ex.: colunas em contato */
.home-reveal-left {
  opacity: 0;
  transform: translateX(-1.5rem);
}

.home-reveal-left.home-reveal-active,
.home-reveal-right.home-reveal-active {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.home-reveal-right {
  opacity: 0;
  transform: translateX(1.5rem);
}

@media (prefers-reduced-motion: reduce) {
  .home-reveal,
  .property-card.home-card-enter {
    opacity: 1;
    transform: none;
  }

  .home-reveal-fade,
  .home-reveal-left,
  .home-reveal-right {
    opacity: 1;
    transform: none;
  }

  .home-reveal.home-reveal-active,
  .property-card.home-card-enter.home-card-enter-active,
  .home-reveal-fade.home-reveal-active,
  .home-reveal-left.home-reveal-active,
  .home-reveal-right.home-reveal-active {
    transition: none;
  }
}

/* Quem Somos — CTA com feixe percorrendo a borda (efeito cobrinha) */
.about-cta-wrap {
  border-radius: var(--radius, 0.25rem);
  margin: 0.75rem;
  isolation: isolate;
}

.about-cta-snake {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  pointer-events: none;
  z-index: 2;
  overflow: visible;
  filter:
    drop-shadow(0 0 5px rgba(255, 255, 255, 1))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.85))
    drop-shadow(0 0 3px rgba(20, 15, 10, 0.4));
}

.about-cta-snake__path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 28 72;
  stroke-dashoffset: 0;
  animation: about-cta-snake-travel 1.6s linear infinite;
}

.about-cta {
  position: relative;
  z-index: 1;
}

@keyframes about-cta-snake-travel {
  to {
    stroke-dashoffset: -100;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-cta-snake__path {
    animation: none;
    stroke-dasharray: none;
    stroke-opacity: 0.7;
  }
}

/* Lightbox — dicas de zoom (desktop vs touch) */
.property-gallery-lightbox-hint-desktop {
  display: none;
}

.property-gallery-lightbox-hint-mobile {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .property-gallery-lightbox-hint-desktop {
    display: block;
  }

  .property-gallery-lightbox-hint-mobile {
    display: none;
  }
}

/* Galeria do imóvel — full-bleed (referência) vs letterbox (imagens menores) */
.property-gallery-stage[data-gallery-fit="contain"] .property-gallery-main {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.05));
}

.property-gallery-stage[data-gallery-fit="cover"] .property-gallery-viewport {
  display: block;
  height: 60vh;
  min-height: 360px;
  max-height: none;
  padding-left: 0;
  padding-right: 0;
}

.property-gallery-stage[data-gallery-fit="cover"] .property-gallery-main {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: none;
}

.property-gallery-stage[data-gallery-fit="cover"] .property-gallery-bg {
  display: none;
}

/* Detalhe do imóvel — grid de specs */
.property-detail-spec-grid {
  display: flex;
  flex-wrap: wrap;
  background: transparent;
}

.property-detail-spec-cell {
  box-sizing: border-box;
  border-right: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

/* Mobile — 2 colunas, borda no container */
@media (max-width: 639px) {
  .property-detail-spec-cell {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .property-detail-spec-cell:nth-child(2n) {
    border-right: none;
  }

  .property-detail-spec-grid--m-rem-1 .property-detail-spec-cell:last-child {
    margin-left: auto;
    margin-right: auto;
    border-right: none;
    border-bottom: none;
  }

  .property-detail-spec-grid--m-rem-0 .property-detail-spec-cell:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

/*
 * Desktop — até 4 colunas; borda só nas células ocupadas.
 * - 1–3 itens: grid encolhe (25% / 50% / 75%), sem colunas vazias.
 * - 4+ itens: 4 colunas full-width; última linha incompleta sem esticar.
 * - 1 item sozinho na última linha (--d-rem-1, total > 1): centralizado 25%.
 */
@media (min-width: 640px) {
  .property-detail-spec-grid.border {
    border-width: 0 !important;
  }

  .property-detail-spec-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .property-detail-spec-cell {
    flex: unset;
    width: auto;
    max-width: none;
    margin: 0;
    border-top: none;
    border-left: none;
    border-right: 1px solid hsl(var(--border));
    border-bottom: 1px solid hsl(var(--border));
  }

  .property-detail-spec-cell:nth-child(4n + 1) {
    border-left: 1px solid hsl(var(--border));
  }

  .property-detail-spec-cell:nth-child(-n + 4) {
    border-top: 1px solid hsl(var(--border));
  }

  /* Linha única com menos de 4 itens — grid proporcional, borda contorna só o conteúdo */
  .property-detail-spec-grid--d-total-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    width: 25%;
    margin-left: auto;
    margin-right: auto;
  }

  .property-detail-spec-grid--d-total-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 50%;
  }

  .property-detail-spec-grid--d-total-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 75%;
  }

  /* Último item sozinho na linha (ex.: 5º de 5) */
  .property-detail-spec-grid--d-rem-1:not(.property-detail-spec-grid--d-total-1) .property-detail-spec-cell:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: 25%;
    max-width: 25%;
    border-left: 1px solid hsl(var(--border));
  }
}

/* Toast — componente compartilhado (site-toast-viewport + site.js NsToast) */
.site-toast-viewport {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 110;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  width: 100%;
  max-height: 100vh;
  padding: 1rem;
  pointer-events: none;
}

@media (min-width: 640px) {
  .site-toast-viewport {
    top: auto;
    bottom: 0;
    flex-direction: column;
    width: auto;
    max-width: 26.25rem;
  }
}

.site-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 2.5rem 1rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  opacity: 0;
  transform: translateY(-0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (min-width: 640px) {
  .site-toast {
    transform: translateY(0.75rem);
  }
}

.site-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-toast.is-leaving {
  opacity: 0;
  transform: translateY(-0.5rem);
}

@media (min-width: 640px) {
  .site-toast.is-leaving {
    transform: translateY(0.5rem);
  }
}

.site-toast--success {
  border-color: hsl(var(--success));
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}

.site-toast--destructive {
  border-color: hsl(var(--destructive));
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.site-toast__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
}

.site-toast__content {
  flex: 1;
  min-width: 0;
}

.site-toast__title {
  margin: 0;
  font-family: var(--font-body), sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.site-toast__message {
  margin: 0.25rem 0 0;
  font-family: var(--font-body), sans-serif;
  font-size: 0.875rem;
  line-height: 1.45;
  opacity: 0.9;
}

.site-toast__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.site-toast__close:hover,
.site-toast__close:focus-visible {
  opacity: 1;
  outline: none;
}

.site-toast__close:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--ring));
}
