/*
Theme Name: Carrancas Imóveis
Theme URI: https://carrancasimoveis.com.br
Author: Carrancas Imóveis
Author URI: https://carrancasimoveis.com.br
Description: Tema WordPress moderno e responsivo para imobiliária, recriado a partir do layout da Carrancas Imóveis. Inclui tipo de conteúdo "Imóveis", filtros de compra/aluguel, destaques na página inicial e opções de contato no Personalizador. Imóveis urbanos e rurais em Carrancas - MG e região.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carrancas-imoveis
Tags: real-estate, business, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  --verde:        #22362d;
  --verde-2:      #2c473a;
  --verde-3:      #38594a;
  --creme:        #f4ebe2;
  --creme-2:      #faf6f1;
  --dourado:      #c2a172;
  --dourado-2:    #a8895c;
  --texto:        #1f2a26;
  --texto-suave:  #5d6862;
  --linha:        #e7e0d6;
  --branco:       #ffffff;

  --fonte-ui:     "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fonte-serif:  "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --raio:         14px;
  --raio-sm:      10px;
  --sombra:       0 10px 30px -12px rgba(31,42,38,.18);
  --sombra-sm:    0 4px 14px -6px rgba(31,42,38,.16);
  --container:    1200px;
  --transicao:    .25s cubic-bezier(.4,0,.2,1);
}

/* =========================================================
   RESET / BASE
   ========================================================= */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fonte-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--texto);
  background: var(--branco);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--verde); text-decoration: none; transition: color var(--transicao); }
a:hover { color: var(--dourado-2); }
h1,h2,h3,h4 { margin: 0 0 .4em; line-height: 1.15; font-weight: 600; color: var(--texto); }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--dourado); outline-offset: 2px; }

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.eyebrow {
  display: block; text-align: center; font-size: .82rem; letter-spacing: .22em;
  text-transform: uppercase; font-weight: 600; color: var(--texto);
  position: relative; margin-bottom: 2.4rem;
}
.eyebrow::before, .eyebrow::after {
  content: ""; position: absolute; top: 50%; width: 70px; height: 1px; background: var(--linha);
}
.eyebrow::before { right: calc(50% + 130px); }
.eyebrow::after  { left:  calc(50% + 130px); }
@media (max-width: 640px){ .eyebrow::before,.eyebrow::after{ display:none; } }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.6rem; border-radius: 999px; font-weight: 600;
  font-size: .92rem; letter-spacing: .02em; cursor: pointer; border: 1.5px solid transparent;
  transition: var(--transicao); text-align: center; line-height: 1.2;
}
.btn--primary { background: var(--verde); color: #fff; }
.btn--primary:hover { background: var(--verde-2); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--verde); border-color: var(--verde); }
.btn--ghost:hover { background: var(--verde); color: #fff; }
.btn--light { background: #fff; color: var(--verde); }
.btn--light:hover { background: var(--creme); }
.btn--wpp { background: #fff; color: var(--verde); border-color: var(--linha); }
.btn--wpp:hover { background: var(--creme); }
.btn .icon { width: 1.05em; height: 1.05em; flex: none; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--linha);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 84px; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand__icon { width: 46px; height: 54px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: .92; font-family: var(--fonte-serif); }
.brand__line1 { font-size: 1.35rem; font-weight: 500; color: var(--verde); letter-spacing: .01em; }
.brand__line2 { font-size: 2rem; font-weight: 600; color: var(--dourado-2); letter-spacing: .06em; }
.brand img.custom-logo { width: auto; max-height: 60px; }

.main-nav ul { display: flex; gap: 2rem; align-items: center; }
.main-nav a {
  font-weight: 500; font-size: .95rem; color: var(--texto); letter-spacing: .04em;
  text-transform: uppercase; position: relative; padding: .3rem 0;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--dourado); transition: width var(--transicao);
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--verde); }
.main-nav a:hover::after, .main-nav .current-menu-item > a::after { width: 100%; }

.header-cta { display: flex; align-items: center; gap: 1rem; }
.menu-toggle {
  display: none; background: var(--verde); border: 0; border-radius: 10px; padding: .55rem .65rem;
  cursor: pointer;
}
.menu-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; transition: var(--transicao); }
.menu-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 420px; display: flex; align-items: center;
  color: #fff; padding: 4rem 0;
  background: linear-gradient(90deg, rgba(20,32,27,.72) 0%, rgba(20,32,27,.30) 60%, rgba(20,32,27,.08) 100%),
              var(--hero-img, none) center/cover no-repeat;
}
.hero h1 {
  color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 600; max-width: 16ch;
  text-shadow: 0 2px 18px rgba(0,0,0,.3);
}
.hero p { font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 46ch; opacity: .95; margin: 0; }

/* =========================================================
   SEARCH BOX
   ========================================================= */
.search-wrap { margin-top: -52px; position: relative; z-index: 5; }
.search-box {
  background: #fff; border: 1px solid var(--linha); border-radius: var(--raio);
  box-shadow: var(--sombra); max-width: 760px; margin-inline: auto; overflow: hidden;
}
.search-tabs { display: flex; }
.search-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 1rem; background: var(--creme-2); border: 0; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: .95rem; color: var(--texto-suave); transition: var(--transicao);
  border-bottom: 1px solid var(--linha);
}
.search-tab .icon { width: 1.1em; height: 1.1em; }
.search-tab[aria-selected="true"] { background: var(--verde); color: #fff; }
.search-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; padding: 1.5rem; align-items: end; }
.field label { display: block; font-size: .8rem; color: var(--texto-suave); margin-bottom: .4rem; font-weight: 500; }
.field .control {
  display: flex; align-items: center; gap: .5rem; border: 1px solid var(--linha);
  border-radius: var(--raio-sm); padding: .7rem .85rem; background: #fff;
}
.field .control .icon { width: 1.1em; height: 1.1em; color: var(--verde); flex: none; }
.field select { border: 0; background: transparent; font-family: inherit; font-size: .92rem; width: 100%; color: var(--texto); cursor: pointer; }
.field select:focus { outline: none; }
.search-fields .btn { height: 47px; }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 4.5rem 0; }
.section--cream { background: var(--creme-2); }
.section-title { text-align: center; font-size: clamp(1.5rem,3vw,2rem); }

/* CATEGORIES */
.cat-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 1.1rem; }
.cat-card {
  background: var(--creme); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 1.6rem 1rem; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: .9rem; transition: var(--transicao); color: var(--texto);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-sm); border-color: var(--dourado); color: var(--texto); }
.cat-card .icon { width: 40px; height: 40px; color: var(--verde); }
.cat-card span { font-weight: 600; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }

/* PROPERTY CARDS */
.props { position: relative; }
.props-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.prop-card {
  background: #fff; border: 1px solid var(--linha); border-radius: var(--raio);
  overflow: hidden; box-shadow: var(--sombra-sm); transition: var(--transicao);
  display: flex; flex-direction: column;
}
.prop-card:hover { transform: translateY(-5px); box-shadow: var(--sombra); }
.prop-card__media { position: relative; aspect-ratio: 16/11; overflow: hidden; }
.prop-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.prop-card:hover .prop-card__media img { transform: scale(1.06); }
.prop-card__tag {
  position: absolute; top: .8rem; left: .8rem; background: var(--verde); color: #fff;
  font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .7rem; border-radius: 6px;
}
.prop-card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.prop-card__title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.prop-card__title a { color: var(--texto); }
.prop-card__title a:hover { color: var(--verde); }
.prop-card__loc { display: flex; align-items: center; gap: .4rem; color: var(--texto-suave); font-size: .88rem; margin: 0; }
.prop-card__loc .icon { width: 1em; height: 1em; }
.prop-card__specs { display: flex; gap: 1.1rem; flex-wrap: wrap; padding: .7rem 0; border-top: 1px solid var(--linha); margin-top: .3rem; }
.prop-card__specs span { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--texto-suave); }
.prop-card__specs .icon { width: 1.05em; height: 1.05em; color: var(--verde); }
.prop-card__price { font-size: 1.35rem; font-weight: 700; color: var(--verde); margin-top: auto; }

.carousel-btn {
  position: absolute; top: 38%; transform: translateY(-50%); z-index: 4;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linha);
  background: #fff; box-shadow: var(--sombra-sm); cursor: pointer; display: grid; place-items: center;
  color: var(--verde); transition: var(--transicao);
}
.carousel-btn:hover { background: var(--verde); color: #fff; }
.carousel-btn--prev { left: -22px; }
.carousel-btn--next { right: -22px; }
.center-cta { text-align: center; margin-top: 2.5rem; }

/* COMPRAR / ALUGAR BANNERS */
.duo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.duo-card {
  position: relative; border-radius: var(--raio); overflow: hidden; min-height: 280px;
  display: flex; align-items: center; padding: 2.5rem; color: #fff;
  background: linear-gradient(90deg, rgba(20,32,27,.78), rgba(20,32,27,.25)), var(--bg) center/cover;
}
.duo-card h3 { color: #fff; font-size: 1.9rem; font-weight: 600; }
.duo-card p { max-width: 24ch; opacity: .95; }
.duo-card .inner { max-width: 60%; }

/* WHY US */
.why-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.3rem; }
.why-card {
  background: var(--creme); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 1.8rem 1.4rem; text-align: center; transition: var(--transicao);
}
.why-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-sm); }
.why-card .badge {
  width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--verde); color: #fff;
}
.why-card .badge .icon { width: 26px; height: 26px; }
.why-card h4 { font-size: 1rem; margin-bottom: .4rem; }
.why-card p { font-size: .88rem; color: var(--texto-suave); margin: 0; }

/* AGENT / CORRETOR */
.agent-card {
  background: var(--creme); border-radius: var(--raio); padding: 2.5rem;
  display: grid; grid-template-columns: 200px 1fr; gap: 2.5rem; align-items: center;
}
.agent-card__photo { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; box-shadow: var(--sombra); }
.agent-card__name { font-size: 1.9rem; font-weight: 700; color: var(--verde); margin-bottom: .1rem; }
.agent-card__role { font-weight: 600; margin-bottom: .8rem; }
.agent-card__bio { color: var(--texto-suave); max-width: 52ch; margin-bottom: 1.3rem; }
.agent-card__actions { display: flex; gap: .9rem; flex-wrap: wrap; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--verde); color: rgba(255,255,255,.78); padding: 4rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr 1.1fr; gap: 2rem; }
.footer-brand .brand__line1 { color: #fff; }
.footer-brand .brand__line2 { color: var(--dourado); }
.footer-brand p { margin: 1.2rem 0; font-size: .92rem; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-col li { margin-bottom: .65rem; }
.footer-col a, .footer-contact li { color: rgba(255,255,255,.78); font-size: .92rem; }
.footer-col a:hover { color: var(--dourado); }
.footer-contact li { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .9rem; }
.footer-contact .icon { width: 1.1em; height: 1.1em; color: var(--dourado); flex: none; margin-top: .25rem; }
.footer-social { display: flex; gap: .7rem; margin-bottom: 1.2rem; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25);
  display: grid; place-items: center; color: #fff;
}
.footer-social a:hover { background: rgba(255,255,255,.12); color: #fff; }
.insta-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; max-width: 200px; }
.insta-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,.12); margin-top: 3rem; padding-top: 1.5rem; font-size: .85rem; }

/* =========================================================
   GENERIC CONTENT (single / archive / page)
   ========================================================= */
.page-hero { background: var(--verde); color: #fff; padding: 3rem 0; }
.page-hero h1 { color: #fff; }
.page-hero .crumb { font-size: .85rem; opacity: .8; }
.content-area { padding: 3.5rem 0; }
.entry-content { max-width: 760px; margin-inline: auto; }
.entry-content h2,.entry-content h3 { margin-top: 1.6em; }
.entry-content img { border-radius: var(--raio); margin: 1.4rem 0; }
.archive-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 2.5rem; }
.filter-bar a {
  padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--linha);
  font-size: .85rem; font-weight: 500; color: var(--texto);
}
.filter-bar a.is-active, .filter-bar a:hover { background: var(--verde); color: #fff; border-color: var(--verde); }
.single-imovel-gallery { border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra); margin-bottom: 2rem; }
.imovel-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: 1.3rem 0; border-block: 1px solid var(--linha); margin: 1.5rem 0; }
.imovel-meta span { display: inline-flex; align-items: center; gap: .5rem; font-size: .95rem; }
.imovel-meta .icon { width: 1.2em; height: 1.2em; color: var(--verde); }
.imovel-price { font-size: 2rem; font-weight: 700; color: var(--verde); }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 3rem; }
.pagination .page-numbers {
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--linha); color: var(--texto);
}
.pagination .current { background: var(--verde); color: #fff; border-color: var(--verde); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px){
  .cat-grid { grid-template-columns: repeat(3,1fr); }
  .why-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px){
  .props-grid, .archive-grid { grid-template-columns: repeat(2,1fr); }
  .duo-grid { grid-template-columns: 1fr; }
  .agent-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .agent-card__bio { margin-inline: auto; }
  .agent-card__actions { justify-content: center; }
  .carousel-btn { display: none; }
}
@media (max-width: 768px){
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column;
    border-bottom: 1px solid var(--linha); box-shadow: var(--sombra);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .main-nav.is-open { max-height: 420px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: .5rem 20px 1rem; }
  .main-nav li { width: 100%; border-bottom: 1px solid var(--creme); }
  .main-nav a { display: block; padding: .9rem 0; }
  .menu-toggle { display: block; }
  .header-cta .btn--primary { display: none; }
  .search-fields { grid-template-columns: 1fr; }
  .search-fields .btn { width: 100%; justify-content: center; }
}
@media (max-width: 560px){
  .cat-grid { grid-template-columns: repeat(2,1fr); }
  .props-grid, .archive-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Galeria interna dos imóveis: miniaturas horizontais 1:1 */
.imovel-gallery-section {
  margin: 32px 0 36px;
}

.imovel-gallery-section h2 {
  margin: 0 0 16px;
  color: var(--verde, #17382c);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.2;
}

.imovel-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.imovel-gallery-item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  background: var(--creme, #f4ebe2);
  box-shadow: 0 10px 26px rgba(20, 39, 31, 0.08);
}

.imovel-gallery-item img,
.imovel-gallery-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.imovel-gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.96);
}

@media (max-width: 760px) {
  .imovel-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .imovel-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .imovel-gallery-section {
    margin-top: 24px;
  }
}
