/* ==========================================================================
   Terra & Lar Sombrio - site público
   Paleta: terra, mata e colheita (Santa Catarina), sem depender de fontes
   externas - degrada bem se não houver internet no navegador do visitante.
   ========================================================================== */

:root{
  --sand: #F2ECD9;
  --sand-deep: #E8DFC4;
  --ink: #22201A;
  --pine: #1F3D2B;
  --pine-deep: #16291D;
  --clay: #AE4E30;
  --clay-deep: #8C3D25;
  --gold: #C6952F;
  --paper: #FBF8EF;
  --line: rgba(34,32,26,0.12);
}

*{ box-sizing: border-box; }

.site{
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--sand);
  color: var(--ink);
  margin: 0;
}

h1, h2, h3{
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}
p{ margin: 0; line-height: 1.55; }
a{ color: inherit; }

/* Header */
.header-wrap{ position: sticky; top: 0; z-index: 20; }
.header{
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
  padding: 1rem 1.75rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-lado{ display: flex; align-items: center; }
.header-lado-esq{ justify-content: flex-start; }
.header-lado-dir{ justify-content: flex-end; gap: 0.9rem; }
.header-menu-btn{
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: none; background: none; cursor: pointer;
}
.header-menu-icon{ position: relative; display: block; width: 22px; height: 16px; }
.header-menu-icon span{
  position: absolute; left: 0; width: 100%; height: 2px; background: var(--pine-deep);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.header-menu-icon span:nth-child(1){ top: 0; }
.header-menu-icon span:nth-child(2){ top: 7px; }
.header-menu-icon span:nth-child(3){ top: 14px; }
.header-menu-btn[aria-expanded="true"] .header-menu-icon span:nth-child(1){ top: 7px; transform: rotate(45deg); }
.header-menu-btn[aria-expanded="true"] .header-menu-icon span:nth-child(2){ opacity: 0; }
.header-menu-btn[aria-expanded="true"] .header-menu-icon span:nth-child(3){ top: 7px; transform: rotate(-45deg); }

.mobile-nav{
  display: none; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  position: absolute; top: calc(100% + 0.5rem); right: 1.75rem; left: auto;
  min-width: 180px;
  box-shadow: 0 8px 20px rgba(22,41,29,0.15);
  overflow: hidden;
}
.mobile-nav[hidden]{ display: none; }
.mobile-nav:not([hidden]){ display: flex; }
.mobile-nav-link{
  padding: 0.85rem 1.4rem; font-size: 0.95rem; text-decoration: none; color: var(--ink);
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
.mobile-nav-link:first-child{ border-top: none; }
.mobile-nav-wa{ color: var(--clay); font-weight: 600; }
.brand{
  display: flex; align-items: center; gap: 0.5rem; justify-self: center;
  text-decoration: none;
  font-family: Georgia, serif; font-size: 1.1rem; font-weight: 600;
  color: var(--pine-deep);
}
.brand-mark{ font-size: 1.3rem; color: var(--clay); }
.brand-logo{ max-height: 40px; width: auto; display: block; }
.nav-link{ font-size: 0.92rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav-wa{ color: var(--clay); font-weight: 600; }

/* Buttons */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.4rem; border-radius: 3px;
  font-size: 0.95rem; font-weight: 600;
  border: 1px solid transparent; text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--clay); color: var(--paper); }
@media (hover: hover){ .btn-primary:hover{ background: var(--clay-deep); } }
.btn-whatsapp{ background: var(--pine); color: var(--paper); }
@media (hover: hover){ .btn-whatsapp:hover{ background: var(--pine-deep); } }
.btn-outline{ background: transparent; color: var(--pine-deep); border-color: var(--pine-deep); }
@media (hover: hover){ .btn-outline:hover{ background: rgba(31,61,43,0.08); } }

/* Hero */
.hero{ padding: 4.5rem 1.75rem 3.5rem; max-width: 760px; margin: 0 auto; text-align: left; }
.hero-eyebrow{ color: var(--clay); font-weight: 600; font-size: 0.85rem; margin-bottom: 0.9rem; }
.hero-title{ font-size: clamp(2rem, 4.5vw, 3.1rem); color: var(--pine-deep); margin-bottom: 1.1rem; }
.hero-sub{ font-size: 1.05rem; max-width: 46ch; color: #4A4636; margin-bottom: 1.75rem; }
.hero-actions{ display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero com carrossel de fotos (home, quando há imóveis com foto de capa) */
.hero-carousel{
  position: relative;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  text-align: left;
}
.hero-slides{ position: absolute; inset: 0; }
.hero-slide{
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.hero-slide.is-active{ opacity: 1; }
.hero-overlay{
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,41,29,0.18) 0%, rgba(22,41,29,0.8) 100%);
}
.hero-carousel .hero-content{
  position: relative; z-index: 2;
  padding: 4.5rem 1.75rem 4rem;
  max-width: 760px;
}
.hero-carousel .hero-eyebrow{ color: var(--gold); }
.hero-carousel .hero-title{ color: var(--paper); transition: opacity 0.3s ease; }
.hero-carousel .hero-sub{
  color: rgba(251,248,239,0.9);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; transition: opacity 0.3s ease;
}

.hero-arrow{
  position: absolute; top: 1.5rem;
  z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.35); color: #fff; border: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
@media (hover: hover){ .hero-arrow:hover{ background: rgba(0,0,0,0.55); } }
.hero-arrow-prev{ left: 1.2rem; }
.hero-arrow-next{ right: 1.2rem; }

.hero-dots{
  position: absolute; z-index: 3; right: 1.5rem; bottom: 1.5rem;
  display: flex; gap: 0.55rem;
}
.hero-dot{
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.45); border: none; padding: 0; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
@media (hover: hover){ .hero-dot:hover{ background: rgba(255,255,255,0.7); } }
.hero-dot.is-active{ background: #fff; transform: scale(1.15); }

@media (prefers-reduced-motion: reduce){
  .hero-slide{ transition: none; }
}

@media (max-width: 640px){
  .hero-carousel{ min-height: 420px; }
  .hero-carousel .hero-content{ padding: 3rem 1.1rem 3.2rem; }
  .hero-arrow{ top: 1rem; width: 36px; height: 36px; font-size: 1.3rem; }
  .hero-dots{ right: 1.1rem; bottom: 1.1rem; }
}

/* Listing */
.listing{ padding: 1rem 1.75rem 3rem; max-width: 1080px; margin: 0 auto; }
.listing-head{
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding-bottom: 0.75rem; margin-bottom: 1.75rem;
}
.listing-head h2{ font-size: 1.5rem; color: var(--pine-deep); }
.listing-head p{ color: #6B6653; font-size: 0.9rem; }

.empty{
  padding: 3rem 1.5rem; text-align: center; color: #6B6653;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 4px;
}
.empty p{ max-width: 42ch; margin: 0 auto; }

.grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.card{
  display: flex; flex-direction: column; text-align: left; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; color: inherit;
}
@media (hover: hover){ .card:hover{ border-color: var(--clay); } }
.card-img-wrap{ aspect-ratio: 4/3; background: var(--sand-deep); overflow: hidden; }
.card-img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-fallback{
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #9C9578; font-size: 1.6rem;
}
.card-body{ padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-body h3{ font-size: 1.05rem; color: var(--pine-deep); }
.card-body p{
  font-size: 0.88rem; color: #5E5A47;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-link{ display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--clay); }

/* Quote */
.quote{ background: var(--pine-deep); color: var(--paper); padding: 3.5rem 1.75rem; text-align: center; }
.quote-mark{ font-family: Georgia, serif; font-size: 3rem; color: var(--gold); display: block; line-height: 0.5; }
.quote p{ font-family: Georgia, serif; font-size: clamp(1.3rem, 3vw, 1.9rem); max-width: 32ch; margin: 0.5rem auto 0; }

/* Detail */
.detail{ max-width: 900px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.back-link{ display: inline-flex; align-items: center; gap: 0.3rem; color: #6B6653; font-size: 0.88rem; text-decoration: none; margin-bottom: 0.75rem; }
.detail-cover{ border-radius: 4px; overflow: hidden; margin-bottom: 1.75rem; }
.detail-cover img{ width: 100%; max-height: 460px; object-fit: cover; display: block; }
.detail-body h1{ font-size: clamp(1.6rem, 3.5vw, 2.3rem); color: var(--pine-deep); margin-bottom: 1rem; }
.detail-desc{ font-size: 1.02rem; color: #4A4636; max-width: 65ch; margin-bottom: 1.75rem; }
.detail-desc p{ margin: 0 0 1rem; }
.detail-desc p:last-child{ margin-bottom: 0; }
.detail-desc ul, .detail-desc ol{ margin: 0 0 1rem; padding-left: 1.4rem; }
.detail-desc h3, .detail-desc h4{ font-family: Georgia, serif; color: var(--pine-deep); margin: 1.2rem 0 0.6rem; }
.detail-desc blockquote{ margin: 0 0 1rem; padding-left: 0.9rem; border-left: 3px solid var(--line); color: #6B6653; }
.detail-desc a{ color: var(--clay); text-decoration: underline; }
.detail-ctas{ display: flex; gap: 0.85rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.detail-ctas .wa-cta{ margin-bottom: 0; }
.gallery-heading{ font-size: 1.2rem; color: var(--pine-deep); margin-bottom: 1rem; }
.gallery-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
.gallery-thumb{
  border: none; padding: 0; aspect-ratio: 4/3; border-radius: 4px; overflow: hidden;
  background: var(--sand-deep); cursor: pointer;
}
.gallery-thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
@media (hover: hover){ .gallery-thumb:hover img{ transform: scale(1.04); } }
.detail-missing{ padding: 4rem 1.5rem; text-align: center; display: flex; flex-direction: column; gap: 1rem; align-items: center; }

/* Lightbox */
.lightbox{ position: fixed; inset: 0; background: rgba(15,14,10,0.92); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 2rem; touch-action: none; }
.lightbox[hidden]{ display: none; }
.lb-img{ max-width: 100%; max-height: 88vh; border-radius: 2px; touch-action: none; }
.lb-close{
  position: absolute; top: 1.2rem; right: 1.2rem;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.35); color: #fff;
  border-radius: 50%; width: 40px; height: 40px; font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
@media (hover: hover){ .lb-close:hover{ background: rgba(0,0,0,0.75); } }
.lb-nav{
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.35); color: #fff; border-radius: 50%;
  width: 48px; height: 48px; font-size: 1.7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
@media (hover: hover){ .lb-nav:hover{ background: rgba(0,0,0,0.75); } }
.lb-prev{ left: 1.2rem; }
.lb-next{ right: 1.2rem; }
.lb-count{
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 0.85rem;
  background: rgba(0,0,0,0.5); padding: 0.25rem 0.7rem; border-radius: 20px;
}

/* Foto de capa clicável (abre a galeria) */
.detail-cover-btn{ display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer; }
.detail-cover-btn img{ transition: filter 0.15s ease; }
@media (hover: hover){ .detail-cover-btn:hover img{ filter: brightness(0.92); } }

/* Footer */
.footer{ background: var(--pine); color: var(--paper); }
.footer-inner{
  max-width: 1080px; margin: 0 auto; padding: 2.75rem 1.75rem 1.5rem;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
  align-items: start;
}
.footer-col{ display: flex; flex-direction: column; gap: 0.6rem; }
.footer-titulo{
  display: flex; align-items: center; gap: 0.5rem;
  font-family: Georgia, serif; font-size: 1.02rem; margin-bottom: 0.3rem;
}
.footer-col-texto p{ font-size: 0.85rem; color: #D9E3D4; }
.footer-col-texto p.footer-linha-icone{ display: flex; align-items: flex-start; gap: 0.5rem; }
.footer-links{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a{ font-size: 0.88rem; color: #D9E3D4; text-decoration: none; }
@media (hover: hover){ .footer-links a:hover{ color: var(--paper); text-decoration: underline; } }
.footer-fine{ text-align: center; font-size: 0.78rem; color: #9FB39A; border-top: 1px solid rgba(255,255,255,0.12); padding: 1rem 1.75rem 1.5rem; margin-top: 0.5rem; }

@media (max-width: 800px){
  .footer-inner{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px){
  .footer-inner{ grid-template-columns: 1fr; }
}

@media (max-width: 640px){
  .header{ padding: 0.85rem 1.1rem; }
  .mobile-nav{ right: 1.1rem; }
  .hero{ padding: 3rem 1.1rem 2.5rem; }
  .listing{ padding: 0.5rem 1.1rem 2.5rem; }
}
