/* ============================================================
   imovel.css — ficha de imóvel (catálogo e aluguel)
   RASCUNHO 25/11/2026. Usa só os tokens do global.css
   (MANUAL-DA-MARCA.md, seções 3 a 6). Carregar depois do global.css.
============================================================ */

.pg-imovel { background: var(--bg); color: var(--text); }
.pg-imovel :focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 2px; border-radius: 4px; }
.im-sticky :focus-visible, .cta-banner :focus-visible { outline-color: #fff; }
.pg-imovel .skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: #fff; color: var(--azul); padding: 10px 14px; border-radius: var(--radius); font-weight: 700; }
.pg-imovel .skip:focus { left: 12px; }
html { scroll-padding-top: 84px; }

/* ── Topo: trilha, H1, linha de apoio ── */
.im-top { padding: 20px 0 8px; }
.im-crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.im-crumbs a { color: var(--muted); font-weight: 600; display: inline-block; padding: 12px 0; }
.im-crumbs a:hover { color: var(--azul); }
.im-top h1 {
  /* Ficha de imóvel: título longo, por isso 44 px no máximo (proposta para o manual) */
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 900; line-height: 1.15; letter-spacing: -.03em;
  color: var(--azul); margin: 6px 0 10px; max-width: 30ch;
}
.im-sub { font-size: 17px; font-weight: 500; color: var(--muted); }

/* ── Galeria + cartão de preço ── */
.im-hero { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); padding: 16px 0 8px; }
.im-hero > * { min-width: 0; }
@media (min-width: 960px) {
  .im-hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .im-card { position: sticky; top: 88px; }
}

.im-gallery .track {
  list-style: none; display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; padding-bottom: 8px; border-radius: var(--radius-lg);
}
.im-gallery li { flex: 0 0 82%; scroll-snap-align: start; }
@media (min-width: 640px) { .im-gallery li { flex-basis: calc(50% - 6px); } }
.im-gallery figure { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--cinza-100); border: 1px solid var(--border); }
.im-gallery img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 640px) { .im-gallery img { aspect-ratio: 3 / 4; } }
.im-gallery figcaption {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(4, 12, 36, .78); color: #fff;
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.im-gallery-hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.im-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 24px;
}
.im-card .pill { margin-bottom: 10px; }
.im-price { font-size: clamp(32px, 4vw, 40px); font-weight: 900; letter-spacing: -.02em; color: var(--azul); line-height: 1.1; }
.im-price-sub { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 6px; letter-spacing: 0; }
.im-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.im-chips li {
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600;
}
.im-ctas { display: grid; gap: 10px; }
.im-ctas .btn, .im-prose .btn { white-space: normal; text-align: center; }
.im-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ── Sumário ── */
.im-toc { margin: 20px 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); padding: 4px 18px; }
.im-toc summary { cursor: pointer; font-weight: 800; color: var(--azul); min-height: 48px; display: flex; align-items: center; }
.im-toc ul { list-style: none; padding: 0 0 10px; display: grid; gap: 0; }
.im-toc ul ul { padding: 0 0 0 16px; }
.im-toc a { display: inline-block; padding: 10px 0; font-weight: 600; color: var(--azul-claro); }
.im-toc a:hover { text-decoration: underline; }

/* ── Seções ── */
.im-sec { padding: 56px 0; }
.im-sec-alt { background: var(--bg-alt); }
@media (max-width: 640px) { .im-sec { padding: 40px 0; } }
.im-narrow { max-width: 780px; }
.im-sec h2, .im-prose h2 {
  font-size: clamp(26px, 4vw, 40px); font-weight: 800; line-height: 1.15;
  letter-spacing: -.02em; color: var(--azul); margin-bottom: 18px;
}

/* Texto corrido: devolve margens e listas que o reset do global.css zera */
.im-prose { font-size: 16px; line-height: 1.6; }
.im-prose p { margin: 0 0 14px; }
.im-prose h3 { font-size: clamp(19px, 2.4vw, 22px); font-weight: 800; line-height: 1.3; color: var(--azul); margin: 32px 0 10px; }
.im-prose h4 { font-size: 16px; font-weight: 800; color: var(--azul); margin: 22px 0 8px; }
.im-prose ul, .im-prose ol { padding-left: 1.3em; margin: 0 0 16px; }
.im-prose li { margin: 6px 0; }
.im-prose a:not(.btn) { color: var(--azul-claro); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.im-meta { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

/* Lista com marca de verificação (sem emoji) */
.im-checks { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.im-checks li { position: relative; padding-left: 32px; margin: 0 !important; }
.im-checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--verde-pale) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23388E3C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
@media (min-width: 760px) { .im-checks.cols { grid-template-columns: 1fr 1fr; column-gap: 28px; } }

/* Ficha técnica */
.im-ficha { display: grid; grid-template-columns: 1fr; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px 24px; }
.im-ficha div { display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.im-ficha div:last-child { border-bottom: 0; }
.im-ficha dt { color: var(--muted); }
.im-ficha dd { font-weight: 700; color: var(--azul); text-align: right; }
@media (min-width: 760px) {
  .im-ficha { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .im-ficha div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}

/* Guia de compra */
.im-guia { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px); }
.im-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
@media (max-width: 600px) { .im-cta-row .btn { width: 100%; } }
.im-entorno li { margin: 0; }
.im-entorno a { display: inline-block; padding: 11px 0; }

/* Perguntas frequentes */
.im-faq details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.im-faq summary {
  cursor: pointer; list-style: none; min-height: 56px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-weight: 700; color: var(--azul);
}
.im-faq summary::-webkit-details-marker { display: none; }
.im-faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--verde-esc); flex: 0 0 auto; }
.im-faq details[open] summary::after { content: "–"; }
.im-faq details p { padding: 0 18px 16px; margin: 0; }

/* Autor */
.im-author { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.im-author .av { flex: 0 0 52px; height: 52px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 900; }
.im-author strong { color: var(--azul); }

/* Relacionados e leituras */
.im-related { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.im-related a { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; font-weight: 600; transition: box-shadow .2s ease, transform .2s ease; }
.im-related a:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.im-related strong { display: block; color: var(--azul); font-weight: 800; margin-bottom: 4px; }
.im-links { list-style: none; padding: 0 !important; display: grid; gap: 2px; }
.im-links a { display: inline-block; padding: 10px 0; color: var(--azul-claro); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Barra fixa no celular: substitui o FAB nesta página para não sobrepor */
.im-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 998;
  background: var(--azul); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  box-shadow: 0 -8px 24px rgba(4, 12, 36, .18);
}
.im-sticky span { color: #fff; font-weight: 900; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.im-sticky .btn { min-height: 48px; padding: 12px 16px; font-size: 16px; flex: 0 0 auto; }
.pg-imovel { padding-bottom: 76px; }
@media (max-width: 959px) { .pg-imovel .fab-wa { display: none; } }
@media (min-width: 960px) { .im-sticky { display: none; } .pg-imovel { padding-bottom: 0; } }

/* Mostruário (construção própria): fotos horizontais e quadradas, recorte 4:3 */
.pg-mostruario .im-gallery img { aspect-ratio: 4 / 3; }
@media (min-width: 960px) { .pg-mostruario .im-gallery li { flex-basis: 100%; } }
.pg-mostruario .im-price { font-size: clamp(26px, 3vw, 32px); }
.im-planta { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.im-planta img { width: 100%; height: auto; }
.im-planta figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .im-related a, .btn { transition: none; }
}
