/**
 * Faixa editorial longa compartilhada por /imoveis/ e pelos arquivos de
 * localidade/tipo/finalidade. Sobrescreve APENAS o miolo, sem tocar filtros,
 * paginação, hero ou cards. A paleta continua herdada do tema/faixa.
 */
.pty-lp .pty-pa-content {
  --pa-brand: var(--lp-brand, var(--pty-brand));
  --pa-ink: var(--lp-ink, var(--pty-text));
  --pa-muted: var(--lp-muted, var(--pty-text-muted));
  --pa-surface: var(--lp-surface, var(--pty-surface));
  --pa-card: var(--lp-card, var(--pty-bg));
  --pa-line: var(--lp-line, var(--pty-border));
  --pa-tint: var(--lp-tint, var(--pty-brand-wash));
  --pa-font-display: var(--lp-font-display, var(--pty-display-font, Georgia, serif));
}

.pty-pa-content {
  --pty-long-anchor-offset: 118px;
  --pty-long-toc-top: 104px;
  padding-block: clamp(54px, 7vw, 104px);
  /* Sticky exige que a faixa e seus ancestrais não sejam contêineres de scroll. */
  overflow: visible;
}
.pty-pa-content__layout {
  display: grid;
  grid-template-columns: minmax(210px, 245px) minmax(0, 1fr);
  gap: clamp(34px, 4.5vw, 64px);
  align-items: start;
  min-width: 0;
}
/* Correção estrutural: sem índice, o artigo era posto na coluna de 270px. */
.pty-pa-content__layout--no-toc {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.pty-pa-content__layout--no-toc > .pty-pa-article {
  grid-column: 1;
  width: min(100%, 820px);
  margin-inline: auto;
}
.pty-pa-article {
  width: 100%;
  max-width: 840px;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--pa-ink);
}
.pty-pa-article > :first-child { margin-top: 0; }
.pty-pa-article :is(p, li) {
  font-size: max(1em, 17px);
  line-height: 1.78;
  letter-spacing: normal;
  text-wrap: pretty;
}
.pty-pa-article p { margin: 0 0 1.15em; }
.pty-pa-article :is(ul, ol) { margin-block: 1.1em 1.4em; padding-left: 1.45em; }
.pty-pa-article li { margin-bottom: .45em; }
.pty-pa-article li > :is(ul, ol) { margin-top: .5em; }
.pty-pa-article :is(h2, h3, h4, h5, h6) {
  color: var(--pa-ink);
  overflow-wrap: break-word;
  scroll-margin-top: var(--pty-long-anchor-offset);
  text-wrap: balance;
}
.pty-pa-article h2 {
  margin: clamp(34px, 5vw, 56px) 0 22px;
  padding: 0 0 17px 20px;
  border-left: 3px solid var(--pa-brand);
  border-bottom: 1px solid var(--pa-line);
  font-family: var(--pa-font-display);
  font-size: clamp(1.65rem, 2.6vw, 2.45rem);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -.025em;
}
.pty-pa-article h3 {
  margin: 32px 0 12px;
  font-size: clamp(1.28rem, 1.9vw, 1.65rem);
  line-height: 1.32;
}
.pty-pa-article :is(h4,h5,h6) { margin: 26px 0 10px; line-height: 1.36; }
.pty-pa-article :is(h2,h3,h4,h5,h6) + p { margin-top: 0; }
.pty-pa-article :is(a, a:visited) { color: var(--pa-brand); text-underline-offset: .2em; }
.pty-pa-article a:focus-visible { outline: 2px solid var(--pa-brand); outline-offset: 4px; }
.pty-pa-article :is(img, video, iframe, figure, .wp-block-image, .wp-block-embed) {
  max-width: 100%; height: auto;
}
.pty-pa-article figure { margin: 1.6em 0; }
.pty-pa-article figcaption { margin-top: 8px; color: var(--pa-muted); font-size: .86em; }
.pty-pa-article .pty-pa-table-wrap { max-width: 100%; overflow-x: auto; }
.pty-pa-article table { width: 100%; }

/* Mesmo conceito visual das políticas: índice limpo, linha discreta e 16px. */
.pty-pa-toc {
  position: sticky;
  top: var(--pty-long-toc-top);
  align-self: start;
  width: 100%;
  max-height: calc(100vh - var(--pty-long-toc-top) - 20px);
  max-height: calc(100dvh - var(--pty-long-toc-top) - 20px);
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior: contain;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.pty-pa-toc__label { margin: 0 0 13px; color: var(--pa-muted); font-size: 13px; font-weight: 700; }
.pty-pa-toc__title, .pty-pa-toc__note { display: none; }
.pty-pa-toc__nav { display: flex; flex-direction: column; gap: 0; margin: 0; }
.pty-pa-toc__link,
.pty-pa-toc__link--h3 {
  display: block;
  padding: 10px 12px 10px 14px;
  border-radius: 0;
  border-left: 2px solid var(--pa-line);
  background: transparent;
  color: var(--pa-muted);
  font-size: 16px;
  line-height: 1.48;
  font-weight: 400;
  text-decoration: none;
  transform: none;
  transition: border-color .18s ease, color .18s ease;
}
.pty-pa-toc__link--h3 { padding-left: 26px; }
.pty-pa-toc__link:is(:hover, :focus-visible, .is-active) {
  color: var(--pa-brand);
  border-color: var(--pa-brand);
  background: transparent;
  transform: none;
}
.pty-pa-toc__link.is-active { font-weight: 700; }
.pty-pa-toc__link:focus-visible { outline: 2px solid var(--pa-brand); outline-offset: -2px; }

/* Layout linear, sem coluna em branco e sem sticky em telas estreitas. */
@media (max-width: 1100px) {
  .pty-pa-content__layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .pty-pa-content__layout > .pty-pa-article { width: min(100%, 840px); margin-inline: auto; }
  .pty-pa-toc { position: static; max-height: none; overflow: visible; width: 100%; }
  .pty-pa-toc__nav { display: flex; flex-direction: column; }
}
@media (max-width: 700px) {
  .pty-pa-content { padding-block: 54px; }
  .pty-pa-content__layout { gap: 26px; }
  .pty-pa-article :is(p, li) { font-size: 16px; line-height: 1.7; }
  .pty-pa-article h2 { padding-left: 13px; font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .pty-pa-toc__link, .pty-pa-toc__link--h3 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pty-pa-toc__link { transition: none; }
}
