/* =========================================================
   03 · As casas (Figma 709:2 desktop · 721:159 mobile)
   Abas: 709:57 · estados 727:139–727:234 / 727:265–727:370
   ========================================================= */
.casas {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
}

.casas {
  height: auto;
  min-height: 0;
  padding: 80px 0;
  overflow: visible;
}

.casas { background: var(--c-linho); }

.casas__container {
  position: relative;
  height: 100%;
  max-width: none;
  padding-inline: 80px;
}

.casas__container { height: auto; }

/* ---------- Topo: fachada recortada (311) + texto (Figma 798:445) ---------- */
.casas__topo {
  display: flex;
  align-items: center;
  gap: 40px;
}

.casas__fachada {
  flex: none;
  width: 311px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.casas__fachada-img-wrap {
  width: 100%;
  aspect-ratio: 311 / 529;
}
.casas__fachada-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.casas__fachada .casas__legenda-texto {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
}
.casas__fachada .casas__legenda-selo {
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 1.44px;
  text-transform: none;
}

.casas__texto {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.casas__eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 1.44px;
}
.casas__eyebrow-num { color: #7e6439; }
.casas__eyebrow-label { color: var(--c-ardosia); }
.casas__eyebrow-linha {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--c-ardosia);
  opacity: 0.5;
}

.casas__titulo {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: 48px;
  line-height: 56px;
  color: var(--c-azul);
}

.casas__lead {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--c-azul);
}

/* Lista numerada */
.casas__lista {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.casas__item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-block: 8px;
  border-top: 1px solid var(--c-linha);
}
.casas__item-num {
  flex: none;
  width: 18px;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 1.44px;
  color: #7e6439;
}
.casas__item-corpo {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.casas__item-nome {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--c-azul);
  white-space: nowrap;
}
.casas__item-desc {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 24px;
  color: var(--c-ardosia);
  white-space: nowrap;
}

/* Legenda das imagens */
.casas__legenda {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: var(--c-ardosia);
  line-height: normal;
  white-space: nowrap;
}
.casas__legenda-texto {
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.72px;
}

/* =========================================================
   Telas médias e tablet 641–1200
   ========================================================= */
@media (min-width: 641px) and (max-width: 1200px) {
  .casas__container { padding-inline: var(--gutter); }
  .casas__fachada { width: 240px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .casas__item-corpo { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* =========================================================
   Mobile ≤640 (Figma 721:159 · abas 725:129 / 727:265)
   ========================================================= */
@media (max-width: 640px) {
  .casas {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
  .casas { padding: 64px 0 48px; }
  .casas__container {
    width: 100%;
    height: auto;
    min-height: 0;
    padding-inline: 20px;
  }
  .casas__topo {
    flex-direction: column;
    align-items: stretch;
    gap: 48px;
  }
  /* No celular o texto vem antes; a fachada recortada fica menor, abaixo */
  .casas__texto { order: -1; }
  .casas__fachada { width: 200px; align-self: center; }
  .casas__fachada .casas__legenda { justify-content: center; gap: 12px; }

  .casas__eyebrow { gap: 12px; }
  .casas__eyebrow-linha { width: 40px; }

  .casas__titulo { font-size: 38px; line-height: 44px; }

  .casas__item { align-items: flex-start; }
  .casas__item-num { padding-top: 4px; }
  .casas__item-corpo {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
  }
  .casas__item-desc { font-size: 13px; line-height: 20px; }

  .casas__legenda-texto { font-size: 11px; letter-spacing: 0.66px; }
  .casas__legenda-selo { font-size: 9px; letter-spacing: 1.62px; }

}

/* =========================================================
   Fotos dos ambientes — grade (Figma 799:1591)
   Grande 650×650 à esquerda + 2×2 de 315 à direita, gaps de 20
   ========================================================= */
.casas-fotos {
  background: var(--c-linho);
  padding-bottom: 80px;
}
.casas-fotos__grade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 20px;
}
.casas-fotos__item { aspect-ratio: 1 / 1; min-width: 0; }
.casas-fotos__item--grande { grid-column: span 2; grid-row: span 2; }
/* Última foto da grade: véu escuro com desfoque e "+N" (abre a galeria) */
.casas-fotos__mais {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 24, 38, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: 64px;
  line-height: 72px;
  color: var(--c-linho);
  transition: background-color var(--t-base) var(--ease);
}
.casas-fotos__item--mais .casas-fotos__legenda,
.casas-fotos__item--mais .casas-fotos__sombra,
.casas-fotos__item--mais .casas-fotos__zoom { display: none; }
@media (hover: hover) {
  .casas-fotos__item--mais .casas-fotos__btn:hover .casas-fotos__mais { background-color: rgba(14, 24, 38, 0.45); }
}

.casas-fotos__btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c-linha);
  cursor: zoom-in;
}
.casas-fotos__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.casas-fotos__sombra {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(to bottom, rgba(20, 35, 55, 0), rgba(20, 35, 55, 0.7));
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.casas-fotos__legenda {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 1.44px;
  color: var(--c-linho);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.casas-fotos__zoom {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
  pointer-events: none;
}

/* Hover (estado do Figma: "hover na 3ª imagem") e foco pelo teclado */
@media (hover: hover) {
  .casas-fotos__btn:hover .casas-fotos__img { transform: scale(1.04); }
  .casas-fotos__btn:hover .casas-fotos__sombra,
  .casas-fotos__btn:hover .casas-fotos__legenda,
  .casas-fotos__btn:hover .casas-fotos__zoom { opacity: 1; }
}
.casas-fotos__btn:focus-visible { outline: 2px solid var(--c-latao); outline-offset: 3px; }
.casas-fotos__btn:focus-visible .casas-fotos__sombra,
.casas-fotos__btn:focus-visible .casas-fotos__legenda { opacity: 1; }

/* Toque: sem hover, a legenda fica sempre visível */
@media (hover: none) {
  .casas-fotos__sombra,
  .casas-fotos__legenda { opacity: 1; }
}

@media (max-width: 640px) {
  .casas-fotos { padding-bottom: 56px; }
  .casas-fotos__grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .casas-fotos__mais { font-size: 40px; line-height: 40px; }
  .casas-fotos__legenda { left: 12px; bottom: 10px; font-size: 11px; letter-spacing: 1px; }
}

/* =========================================================
   Lightbox (Figma 799:1611)
   ========================================================= */
.casas-lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 24, 38, 0.96);
  animation: casas-lb-in 250ms var(--ease) both;
}
.casas-lb__palco {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 62px 164px;     /* (1440 − 1112) / 2 de cada lado para as setas */
  min-width: 0;
}
.casas-lb__figura {
  width: 100%;
  max-width: 1112px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.casas-lb__img {
  width: 100%;
  max-height: calc(100vh - 124px - 48px);
  max-height: calc(100svh - 124px - 48px);
  object-fit: contain;
  animation: casas-lb-in 300ms var(--ease) both;
}
.casas-lb__legenda {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: var(--c-linho);
  white-space: nowrap;
}

.casas-lb__fechar,
.casas-lb__seta {
  z-index: 2;              /* sempre acima da foto (a animação da foto cria uma camada própria) */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-weight: 300;
  color: var(--c-linho);
  opacity: 0.85;
  transition: opacity var(--t-base) var(--ease);
}
.casas-lb__fechar:hover,
.casas-lb__seta:hover { opacity: 1; }
.casas-lb__fechar:focus-visible,
.casas-lb__seta:focus-visible { outline: 2px solid var(--c-latao); outline-offset: 2px; opacity: 1; }

.casas-lb__fechar {
  position: absolute;
  top: 12px;
  right: 24px;
  width: 56px;
  height: 56px;
  font-size: 40px;
  line-height: 40px;
}
/* Setas só do tamanho do ícone: o resto das laterais é fundo (clique fecha) */
.casas-lb__seta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 88px;
  font-size: 64px;
  line-height: 72px;
}
.casas-lb__seta--ant { left: 54px; }
.casas-lb__seta--prox { right: 54px; }

@keyframes casas-lb-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1200px) {
  .casas-lb__palco { padding-inline: 96px; }
  .casas-lb__seta--ant { left: 20px; }
  .casas-lb__seta--prox { right: 20px; }
}
@media (max-width: 640px) {
  .casas-lb__seta { width: 44px; font-size: 48px; }
  .casas-lb__seta--ant { left: 0; }
  .casas-lb__seta--prox { right: 0; }
  .casas-lb__palco { padding: 72px 16px; }
  .casas-lb__figura { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .casas-lb, .casas-lb__img { animation: none; }
  .casas-fotos__img { transition: none; }
}
