/* ==========================================================================
   theme.css — camada de marca sobre o Bootstrap 5.3
   --------------------------------------------------------------------------
   Regra do projeto: layout e componentes SEMPRE com classes nativas do
   Bootstrap (container/row/col/card/navbar/offcanvas/btn/form-*).
   Este arquivo só faz três coisas:
     1) declara os tokens de marca em :root
     2) sobrescreve as CSS vars do proprio Bootstrap (--bs-*)
     3) adiciona 8 utilitarios que o Bootstrap nao tem
   Para trocar de cliente, mexa APENAS no bloco "TEMAS".
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* cores base (comuns a todos os temas) */
  --ink:          #1B1917;   /* texto principal / fundos escuros */
  --ink-soft:     #6E655D;   /* texto secundario */
  --paper:        #FBF8F4;   /* fundo da pagina */
  --panel:        #F3EDE5;   /* faixas e cards de apoio */
  --line:         rgba(27, 25, 23, .12);
  --line-strong:  rgba(27, 25, 23, .22);

  /* tipografia */
  --font-head: "Outfit", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  /* escala de espaco (multiplos de 4px) */
  --space-1: .25rem;  /*  4px */
  --space-2: .5rem;   /*  8px */
  --space-3: .75rem;  /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.5rem;  /* 24px */
  --space-6: 2rem;    /* 32px */
  --space-7: 2.75rem; /* 44px */
  --space-8: 4rem;    /* 64px */
  --space-9: 4.75rem; /* 76px */

  /* cantos: o design e reto. NAO usar rounded-pill/rounded-3 do Bootstrap. */
  --bs-border-radius:    2px;
  --bs-border-radius-sm: 2px;
  --bs-border-radius-lg: 3px;
  --bs-border-radius-xl: 3px;
  --bs-border-radius-pill: 3px;

  /* overrides globais do Bootstrap */
  --bs-body-bg:          var(--paper);
  --bs-body-color:       var(--ink);
  --bs-body-font-family: var(--font-body);
  --bs-border-color:     var(--line);
  --bs-link-color:       var(--ink);
  --bs-link-hover-color: var(--brand);
}

/* O Bootstrap 5.3 calcula a cor de <a> por rgba(var(--bs-link-color-rgb), …),
   entao sobrescrever apenas --bs-link-color nao basta. */
a {
  color: inherit;
  text-decoration-color: var(--line-strong);
}
a:hover, a:focus-visible { color: var(--brand); }
/* links que vivem sobre fundo escuro mantem o branco das classes utilitarias */
.text-white:hover, .bg-ink a.text-white:hover { color: #fff; }

/* --------------------------------------------------------------------------
   2. TEMAS — uma classe no <body> define a marca da pagina
   -------------------------------------------------------------------------- */
.theme-servicos  { --brand: #B4552F; }
.theme-produtos  { --brand: #B4552F; }
/* Every design system token below reads the master's editor value
   first (--curated-*), then falls back to the segment default. This
   bridges the "editor namespace" (the settings the drawer writes)
   with the "design system namespace" (the tokens the CSS/utilities
   consume). Without this bridge, editing brand color / font / etc.
   in the drawer would set --curated-brand but nothing would read it,
   because the utilities all consume --brand.
   `--curated-*` vars are set by the editor's inline <style> block
   (only when the master saved a value); the fallback in var() is what
   loads for every unedited setting. */
.theme-imobiliaria {
    --brand:       var(--curated-brand,        #1F4E45);
    --brand-text:  var(--curated-brand-text,   #FFFFFF);
    --ink:         var(--curated-text,         #1B1917);
    --ink-soft:    var(--curated-text-muted,   #6E655D);
    --paper:       var(--curated-body-bg,      #FBF8F4);
    --panel:       var(--curated-surface,      #EFEDE8);
    --line:        var(--curated-border,       color-mix(in srgb, var(--ink) 12%, transparent));
    --line-strong:                             color-mix(in srgb, var(--ink) 22%, transparent);
    --font-head:   var(--curated-font-heading, "Outfit", system-ui, sans-serif);
    --font-body:   var(--curated-font-body,    "Manrope", system-ui, sans-serif);
    /* Bridge into Bootstrap's own tokens so utility classes
       (.border, .border-top, .text-muted, .bg-body, etc.) that read
       --bs-* directly pick up the master's palette instead of the
       Bootstrap defaults. Without this bridge, .border-top stays
       #dee2e6 (Bootstrap gray) even after the master edits
       --curated-border. */
    --bs-border-color:    var(--line);
    --bs-secondary-color: var(--ink-soft);
    --bs-body-bg:         var(--paper);
    --bs-body-color:      var(--ink);
}
.theme-veiculos {
    --brand:       var(--curated-brand,        #9E2F2A);
    --brand-text:  var(--curated-brand-text,   #FFFFFF);
    --ink:         var(--curated-text,         #1B1917);
    --ink-soft:    var(--curated-text-muted,   #6E655D);
    --paper:       var(--curated-body-bg,      #FBF8F4);
    --panel:       var(--curated-surface,      #EFEDE8);
    --line:        var(--curated-border,       color-mix(in srgb, var(--ink) 12%, transparent));
    --line-strong:                             color-mix(in srgb, var(--ink) 22%, transparent);
    --font-head:   var(--curated-font-heading, "Outfit", system-ui, sans-serif);
    --font-body:   var(--curated-font-body,    "Manrope", system-ui, sans-serif);
    --bs-border-color:    var(--line);
    --bs-secondary-color: var(--ink-soft);
    --bs-body-bg:         var(--paper);
    --bs-body-color:      var(--ink);
}
.theme-institucional-classico,
.theme-institucional-moderno {
    /* Shared neutral warm palette for the institutional segments.
       Only the brand hue diverges (see the overrides below). Master
       can override any of these via the drawer. */
    --brand-text:  var(--curated-brand-text,   #FFFFFF);
    --ink:         var(--curated-text,         #1B1917);
    --ink-soft:    var(--curated-text-muted,   #6E655D);
    --paper:       var(--curated-body-bg,      #FBF8F4);
    --panel:       var(--curated-surface,      #EFEDE8);
    --line:        var(--curated-border,       color-mix(in srgb, var(--ink) 12%, transparent));
    --line-strong:                             color-mix(in srgb, var(--ink) 22%, transparent);
    --font-head:   var(--curated-font-heading, "Outfit", system-ui, sans-serif);
    --font-body:   var(--curated-font-body,    "Manrope", system-ui, sans-serif);
    --bs-border-color:    var(--line);
    --bs-secondary-color: var(--ink-soft);
    --bs-body-bg:         var(--paper);
    --bs-body-color:      var(--ink);
}
/* Brand hue per institutional segment — ambos default a terracota-warm
   (batendo com os modelos "servicos-a" e "servicos-b" do designer).
   Se um dia quisermos distinguir os dois visualmente por default,
   mudar aqui. Ambos deferem a --curated-brand quando o master
   personaliza no drawer. */
.theme-institucional-classico { --brand: var(--curated-brand, #B4552F); }
.theme-institucional-moderno  { --brand: var(--curated-brand, #B4552F); }
.theme-noticias  { --brand: #B01E23; --ink: #14161A; --ink-soft: #5B6169; --paper: #FFFFFF; --panel: #F7F6F3;
                   --font-head: "Newsreader", Georgia, serif; }

/* --------------------------------------------------------------------------
   3. BASE
   -------------------------------------------------------------------------- */
/* Bind the body font to the theme token. `base.css` (legacy stylesheet)
   sets `body { font-family: var(--site-font-family) }` — a variable
   that is undefined in the curated flow, so browsers were falling back
   to their serif default (Times New Roman). This rule wins by cascade
   order (curated-theme.css is included after base.css) and leaves the
   legacy sites untouched. */
body {
  font-family: var(--font-body);
  /* Bind to the design system tokens (--paper, --ink) — those are
     already wired to the drawer's tokens above via the theme bridge
     (`--paper: var(--curated-body-bg, ...)`, etc.). Falling back
     through paper/ink keeps a segment without any --curated-* set
     still rendering the correct segment palette. Final fallback of
     #ffffff/dark-gray avoids the serif triggering when nothing at
     all is defined. */
  background: var(--paper, #ffffff);
  color: var(--ink, #16181C);
  -webkit-font-smoothing: antialiased;
}

/* Bootstrap's .offcanvas z-index (1045) is normally enough, but our
   sticky header uses backdrop-filter which promotes it into its own
   stacking context and can end up painting above the drawer in Chrome.
   Pinning the offcanvas and its backdrop into the modal band (1090)
   guarantees the drawer paints above the shell in every browser. */
.offcanvas { z-index: 1090; }
.offcanvas-backdrop { z-index: 1085; }

/* Reserve the scrollbar space permanently AND cancel Bootstrap's
   ScrollBarHelper compensation. Bootstrap injects `padding-right:
   <sbw>px` on body plus on every fixed/sticky element when a modal
   or offcanvas opens; the injection is meant to keep content in
   place while the scrollbar disappears, but with
   `scrollbar-gutter: stable` the gutter is already reserved and the
   extra padding actively shifts sticky/fixed children (the header,
   the navbar). Zeroing padding-right + margin-right on those
   elements with !important stops the shift entirely.

   `overflow-y: scroll` on html forces the scrollbar to always be
   present, so browsers without full scrollbar-gutter support (older
   Safari, some embedded WebViews) still see no layout jump. */
html {
    scrollbar-gutter: stable !important;
    overflow-y: scroll !important;
}
/* Cancel `overflow-x: hidden` from base.css.
   base.css sets `html, body { overflow-x: hidden }` as a defensive
   horizontal-scroll guard, but that creates a scroll container on
   body and traps every `position: sticky` element inside it — the
   header-sticky toggle in the drawer would flip the class but the
   header would never actually stick to the viewport.
   `overflow-x: clip` cuts overflow the same way WITHOUT establishing
   a scroll container, so sticky works and horizontal-overflow is
   still protected. */
html, body { overflow-x: clip; }
body,
.fixed-top, .fixed-bottom,
.sticky-top, .sticky-bottom,
.is-fixed, .is-sticky,
header, header.sticky-top,
.navbar, nav.navbar {
    padding-right: 0 !important;
    margin-right: 0 !important;
}
/* GLightbox lock-fix. The lib injects `body.glightbox-open {
   overflow: hidden }` from its own CSS. That interacts poorly with
   `scrollbar-gutter: stable` + our sticky/fixed padding-right cancel:
   the layout shifts when the lightbox opens because the body's
   scroll container disappears while sticky children lose their
   sticky context. Using `overflow: clip` gives the same visual
   overflow protection without collapsing the scroll container, and
   we also zero any padding-right the lib (or Bootstrap) might inject
   on body/sticky/fixed while the class is present. The extra sticky
   selectors + `right: 0` are the third leg — some browsers preserve
   the offset even after our earlier padding-right cancel kicks in. */
body.glightbox-open {
    overflow: clip !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
}
body.glightbox-open header.sticky-top,
body.glightbox-open .navbar,
body.glightbox-open .sticky-top,
body.glightbox-open .fixed-top {
    padding-right: 0 !important;
    margin-right: 0 !important;
    right: 0 !important;
}

/* Curated price range — dual-slider stack.
   Duas <input type="range"> sobrepostas. Bootstrap desenha o track
   (a barra cinza) via `::-webkit-slider-runnable-track` — se deixamos
   os dois tracks visíveis, o da 2ª range cobre o thumb da 1ª (o
   "primeira bolinha por trás da barra"). Solução:
     - Ambos os tracks ficam transparentes;
     - Uma única barra visual é desenhada via `::before` do container;
     - Os thumbs recebem `z-index: 3` pra ficar na frente do ::before.
   `overflow: visible` no container + padding lateral deixa espaço
   pro thumb nas extremidades (valor min=0 e max=100%) sem clip. */
.curated-price-range {
    position: relative;
    overflow: visible !important;
    padding: 0 12px;
    height: 22px;
}
.curated-price-range::before {
    content: '';
    position: absolute;
    left: 12px; right: 12px;
    top: 50%; transform: translateY(-50%);
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    z-index: 1;
}
.curated-price-range .form-range { background: transparent !important; }
.curated-price-range .form-range::-webkit-slider-runnable-track,
.curated-price-range .form-range::-moz-range-track,
.curated-price-range .form-range::-ms-track {
    background: transparent !important;
    border: none;
}
.curated-price-range .form-range::-webkit-slider-thumb {
    pointer-events: auto;
    position: relative;
    z-index: 3;
}
.curated-price-range .form-range::-moz-range-thumb {
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

h1, h2, h3, h4, h5, .font-head {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.12;
  text-wrap: pretty;
}
.theme-noticias h1,
.theme-noticias h2,
.theme-noticias h3,
.theme-noticias .font-head { font-weight: 600; }

/* --------------------------------------------------------------------------
   4. UTILITARIOS PROPRIOS (o Bootstrap nao cobre estes)
   -------------------------------------------------------------------------- */

/* .eyebrow — o chapeu/label de secao usado em todo o layout. Cor
   default ink-soft (contexto funcional, ex: labels de filtros).
   Contextos editoriais usam .eyebrow-brand pra puxar --brand. */
.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow-brand { color: var(--brand); }

/* cores de marca */
.text-brand   { color: var(--brand) !important; }
.bg-brand     { background-color: var(--brand) !important; color: var(--brand-text) !important; }
/* Chips/badges com fundo "ink" (marcadores de destaque tipo
   DESTAQUE, EXCLUSIVO, etc). Cascata de tokens:
   1. Se o mestre setou badge_bg_color explícito → usa ele.
   2. Senão, usa --ink (cor texto) como fundo.
   3. Texto: badge_text_color se setado, senão --paper (cor oposta
      ao body — sempre contrasta).
   Assim o mestre pode ter DESTAQUE dourado, vermelho, ou default
   automático que sempre funciona. */
.bg-ink       {
    background-color: var(--curated-badge-bg, var(--ink)) !important;
    color:            var(--curated-badge-text, var(--paper)) !important;
}
.bg-panel     { background-color: var(--panel) !important; }
.text-ink     { color: var(--ink) !important; }
.text-soft    { color: var(--ink-soft) !important; }
.border-line  { border-color: var(--line) !important; }

/* .btn-brand / .btn-ink — variantes de botao no padrao do Bootstrap 5.3.
   `--bs-btn-color` reads --brand-text so the drawer's "Texto sobre a
   marca" setting actually paints the button label. Hardcoded #fff was
   a silent orphan. */
.btn-brand {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: var(--brand-text);
  --bs-btn-hover-bg: color-mix(in oklab, var(--brand) 86%, #000);
  --bs-btn-hover-border-color: color-mix(in oklab, var(--brand) 86%, #000);
  --bs-btn-hover-color: var(--brand-text);
  --bs-btn-active-bg: color-mix(in oklab, var(--brand) 78%, #000);
  --bs-btn-active-color: var(--brand-text);
  font-weight: 600;
}
.btn-ink {
  --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-color: var(--paper);
  --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-hover-color: #fff;
  font-weight: 600;
}
/* .btn-outline-ink — border sólida `--line-strong` (22% dark), com
   hover em currentColor pra reforçar estado. Bate 1:1 com o modelo
   do designer em fundo claro. Trade-off conhecido: em fundo escuro
   (`.bg-ink`) o border fica ~invisível porque `--line-strong` é
   22% do --ink; se um dia surgir CTA outline-ink em CTA banner
   escuro, use `.btn-outline-light` do Bootstrap ou crie variante. */
.btn-outline-ink {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--panel);
  --bs-btn-hover-border-color: currentColor;
  --bs-btn-hover-color: var(--ink);
  font-weight: 600;
}

/* .grid-hairline — grade de cartoes separada por rEgua de 1px (usada em varias
   secoes). Substitui o gap por linhas, como no design. */
.grid-hairline {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.grid-hairline > * { background: var(--paper); }
.grid-hairline.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-hairline.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-hairline.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-hairline.cols-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 767.98px) {
  .grid-hairline.cols-3, .grid-hairline.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479.98px) {
  .grid-hairline.cols-2, .grid-hairline.cols-3, .grid-hairline.cols-4 { grid-template-columns: 1fr; }
}

/* .media-slot — o lugar da imagem. Trocar por <img class="w-100 h-100 object-fit-cover">.
   O ratio vem das classes ratio do Bootstrap (ratio-16x9, ratio-4x3...). */
.media-slot {
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  overflow: hidden;
}
.media-slot img { width: 100%; height: 100%; object-fit: cover; }

/* .scrim — gradiente de leitura sobre foto (hero) */
.scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.58) 62%, rgba(0,0,0,.80) 100%);
  pointer-events: none;
}

/* .section-rule — titulo de secao com regua grossa embaixo (padrao editorial) */
.section-rule { border-bottom: 2px solid var(--ink); padding-bottom: var(--space-3); }

/* .link-arrow — link de texto com seta */
.link-arrow { font-weight: 600; color: var(--brand); text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* .card-flat — card sem raio e sem sombra (o padrao do projeto) */
/* Superfícies de card — bg e cor de texto tokenizados. Fallback pra
   branco/ink pra manter o visual atual em qualquer tenant que ainda
   não tenha os tokens novos (retrocompatibilidade). Cobre também
   `.curated-filters` (que usa `card-flat`) e a tabela de Custos
   (`.table` mais abaixo) — assim uma paleta dark completa é feita
   ajustando só 4 tokens no editor, sem custom_css. */
.card-flat {
    border: 1px solid var(--line);
    background: var(--curated-card-bg, #fff);
    color: var(--curated-card-text, inherit);
    /* Cascata: card_border_radius → border_radius global → 0 (retangular).
       Permite ter cards retos + botões pill num mesmo tema. */
    border-radius: var(--curated-card-radius, var(--curated-radius, 0));
}
.card-flat .text-muted, .card-flat .text-soft,
.curated-filters .text-muted, .curated-filters .text-soft {
    color: var(--curated-card-text, inherit);
    opacity: .7;
}
/* Tabelas herdam a cor de texto da superfície do card em que estão */
.table { color: var(--curated-card-text, inherit); }

/* estado "sem resultado" dos filtros */
[data-empty-state] { display: none; }
[data-empty-state].is-visible { display: block; }

/* --------------------------------------------------------------------------
   5. TOKENS EXTRAS — consumidos pelos campos avançados do editor
   --------------------------------------------------------------------------
   Cada regra abaixo tem um fallback razoável no `var(--…, fallback)` para
   que um segmento que NÃO declare esses tokens ainda renderize bem. Ou
   seja: adicionar essas regras não quebra segmentos que ainda não
   tenham os campos correspondentes no theme.json. */

/* Header — links do menu principal.
   Bootstrap ativa `.nav-link.show` no trigger de um dropdown
   aberto E `.nav-link.active` no item da URL corrente. Ambos
   caem em --bs-navbar-active-color (default = --bs-emphasis-
   color, quase preto em tema dark). E os IRMÃOS não-ativos
   pegam --bs-navbar-color (também quase preto). Sobrescrevemos
   os 3 (default/hover/active) via variáveis do próprio
   .navbar dentro do header pra manter todos os estados
   coerentes com o header_link do tema. */
header .navbar {
    --bs-navbar-color:         var(--curated-header-link,       var(--ink));
    --bs-navbar-hover-color:   var(--curated-header-link-hover, var(--brand));
    --bs-navbar-active-color:  var(--curated-header-link-hover, var(--brand));
    --bs-navbar-disabled-color: color-mix(in srgb, var(--curated-header-link, var(--ink)) 45%, transparent);
}
header .nav-link {
    color: var(--curated-header-link, var(--ink));
}
header .nav-link:hover,
header .nav-link:focus-visible {
    color: var(--curated-header-link-hover, var(--brand));
}
/* Item ativo (URL match) e trigger de dropdown aberto: cor
   brand + peso 600 pra affordance clara. `.show` marca o
   trigger enquanto o menu está aberto. */
header .nav-link.active,
header .nav-link.show,
header .nav-link[aria-current="page"] {
    color: var(--curated-header-link-hover, var(--brand)) !important;
    font-weight: 600;
}

/* Dropdown do menu principal do header — o Bootstrap default
   pinta bg branco + texto preto, o que quebra em tema dark
   e desalinha em qualquer tema custom. Escopa pra dentro do
   header pra não afetar outros dropdowns da página (ex:
   .curated-multi-dropdown do top_bar tem seu próprio CSS). */
header .navbar-nav .dropdown-menu {
    background: var(--curated-card-bg, var(--curated-header-bg, #fff));
    color: var(--curated-card-text, inherit);
    border: 1px solid var(--curated-border-subtle, rgba(0, 0, 0, 0.1));
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.35rem 0;
    min-width: 200px;
}
header .navbar-nav .dropdown-menu .dropdown-item {
    color: var(--curated-card-text, inherit);
    padding: 0.5rem 1rem;
}
header .navbar-nav .dropdown-menu .dropdown-item:hover,
header .navbar-nav .dropdown-menu .dropdown-item:focus {
    color: var(--curated-header-link-hover, var(--brand));
    background: var(--curated-surface-hover, rgba(0, 0, 0, 0.04));
}
header .navbar-nav .dropdown-menu .dropdown-item.active,
header .navbar-nav .dropdown-menu .dropdown-item[aria-current="page"] {
    /* Item ativo no dropdown: bg brand, texto contraste-brand. */
    color: var(--curated-brand-text, #fff);
    background: var(--curated-brand, var(--brand));
    font-weight: 500;
}
header .navbar-nav .dropdown-menu .dropdown-divider {
    border-top-color: var(--curated-border-subtle, rgba(0, 0, 0, 0.1));
}
/* Ícones dentro dos dropdown-items (ex: <i class="fas fa-list
   text-muted">) — text-muted default do Bootstrap (--bs-secondary-
   color) fica invisível em dark. Herda a cor do item. */
header .navbar-nav .dropdown-menu .dropdown-item i {
    color: currentColor;
    opacity: 0.65;
}

/* Header — padding vertical (o `.navbar.py-3` do Bootstrap emite 16px;
   default aqui bate esse valor para que um tenant que não editar o
   campo NÃO veja o header encolher). */
header .navbar {
    padding-top: var(--curated-header-py, 16px);
    padding-bottom: var(--curated-header-py, 16px);
}

/* Cards — sombra opcional. O value do select no theme.json já é a
   sombra CSS pronta (ex: "0 4px 12px rgba(0,0,0,.12)") ou "none",
   então a var é aplicada direto sem tabela de tradução.

   `.card-flat` é intencionalmente "flat sem sombra" (utilitário do
   design system), então ficou fora desses seletores — o master
   poderia definir uma sombra e ela quebrar o contrato do utility.
   O card_shadow do editor afeta somente `.card` do Bootstrap. */
.block-cards .card,
.card {
    box-shadow: var(--curated-card-shadow, none);
}

/* Cards — padding interno */
.card > .card-body {
    padding: var(--curated-card-padding, 1rem);
}

/* Formulários — borda + foco + arredondamento + bg/texto tokenizados
   (permite dark mode natural via editor sem custom_css). Cobre também
   os placeholders — o browser usa a `color` do input pra placeholder
   por padrão, então basta ajustar opacity. */
.form-control,
.form-select,
.filter-input,
textarea.form-control {
    background-color: var(--curated-input-bg, #fff);
    color: var(--curated-input-text, inherit);
    border-color: var(--curated-input-border, var(--line));
    border-radius: var(--curated-input-radius, var(--bs-border-radius));
}
.form-control::placeholder,
.form-select::placeholder,
textarea.form-control::placeholder {
    color: var(--curated-input-text, inherit);
    opacity: .55;
}
/* Focus: uses `outline` (which accepts any color) instead of the
   Bootstrap-style `box-shadow: 0 0 0 .2rem rgba(...)` — the ring
   color follows whatever cor the master picks in input_focus_color,
   without needing a companion --input-focus-rgb variable.

   Excludes .is-invalid / .is-valid so Bootstrap's validation ring
   (red for errors, green for success) survives — replacing it with
   the theme-focus color would hide the semantic feedback. */
.form-control:focus:not(.is-invalid):not(.is-valid),
.form-select:focus:not(.is-invalid):not(.is-valid),
.filter-input:focus:not(.is-invalid):not(.is-valid) {
    border-color: var(--curated-input-focus, var(--curated-accent, var(--brand)));
    outline: 2px solid var(--curated-input-focus, var(--curated-accent, var(--brand)));
    outline-offset: 1px;
    box-shadow: none;
}

/* Blocos — padding vertical padrão. Restrito EXATAMENTE a `.block.py-5`
   (que é o que os blocos emitem hoje). O seletor amplo
   `.block[class*="py-"]` casava também com py-0/py-1/py-2/py-3/py-4 e
   sobrescrevia qualquer bloco que quisesse padding diferente,
   destruindo intenções deliberadas. */
.curated-content .block.py-5 {
    padding-top: var(--curated-block-py, 3rem);
    padding-bottom: var(--curated-block-py, 3rem);
}

/* Stats — quando o wrap_style é panel-box a cor da fonte não pode
   herdar o padrão da variante default (text-white) porque agora o
   fundo é bege claro. */
.block-stats--wrap-panel-box {
    color: var(--ink);
}
/* A tipografia editorial (números grandes com font-head) só faz sentido
   nos layouts default e compact-left dentro do painel — layouts como
   list-editorial já têm sua própria hierarquia visual (h5 título + row
   com número) e o override quebraria essa estrutura. */
.block-stats--wrap-panel-box.block-stats--layout-default .stat-value {
    font-family: var(--font-head);
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 500;
    margin-bottom: .25rem;
}
.block-stats--wrap-panel-box.block-stats--layout-default .stat-label {
    color: var(--ink-soft);
    font-size: .95rem;
    margin-bottom: 0;
}
/* Panel-box + compact-left: numeros e labels centrados dentro de cada
   cell — bate com o modelo do designer que faz uma "grid de destaque"
   de 4 numeros com respiro horizontal e vertical equivalentes. */
.block-stats--wrap-panel-box.block-stats--compact-left .stat-item {
    text-align: center;
    padding: .75rem .5rem;
}
.block-stats--wrap-panel-box.block-stats--compact-left .stat-value {
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 500;
}
.block-stats--wrap-panel-box.block-stats--compact-left .stat-label {
    color: var(--ink-soft);
    font-size: .9rem;
}

/* Feedback colors — aplicados diretamente às classes utilitárias e ao
   texto de componentes. Nota: não sobrescrevemos --bs-success / --bs-warning
   / --bs-danger porque o Bootstrap 5 tem uma paleta paralela em -rgb
   (var(--bs-success-rgb)) usada em backgrounds com opacity — trocar só
   a cor primária e não a versão -rgb deixaria .bg-success com a cor
   antiga e .text-success com a nova, inconsistente. Preferimos aplicar
   nas classes utilitárias diretamente. */
.text-success,
.alert-success,
.badge.bg-success { color: var(--curated-success, #2E7D5B) !important; }
.text-warning,
.alert-warning,
.badge.bg-warning { color: var(--curated-warning, #B78103) !important; }
.text-danger,
.alert-danger,
.badge.bg-danger,
.invalid-feedback { color: var(--curated-error, #B23A48) !important; }

/* Footer — cores dos links e dos títulos de coluna. Ancorado no
   .theme-* do body para não vazar pra tenants legacy que carregam
   curated-theme.css num contexto diferente. Precisa !important pra
   vencer .text-white do Bootstrap (que tem !important). */
/* Footer rules scope by `body[class*="theme-"]` so any curated segment
   (present + future) picks them up without touching this CSS. */
body[class*="theme-"] footer a {
    color: var(--curated-footer-link, #FAF9F7) !important;
}
body[class*="theme-"] footer a:hover {
    color: var(--curated-footer-link-hover, #FFFFFF) !important;
}
body[class*="theme-"] footer .fw-semibold {
    color: var(--curated-footer-heading, var(--curated-accent, #FFFFFF));
}

/* Header — linha divisória inferior. Toggle via classe no template. */
header.curated-header--no-border {
    border-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   6. CONSUMERS ADICIONAIS — settings que não têm equivalente 1:1 no
      design system e precisam de uma regra CSS dedicada.
   -------------------------------------------------------------------------- */

/* Border radius global — os four sizes do Bootstrap seguem o slider único
   do editor. Um radius de 12px afeta cards, botões, inputs — mudança
   universal.

   `--bs-border-radius-pill` NÃO participa: `.rounded-pill` e
   `.form-switch` dependem do valor semântico "50rem" (totalmente
   arredondado). Sobrescrever com o slider achataria os toggles e
   qualquer botão pill do site. */
:root {
    --bs-border-radius:      var(--curated-radius, 2px);
    --bs-border-radius-sm:   var(--curated-radius, 2px);
    --bs-border-radius-lg:   var(--curated-radius, 3px);
    --bs-border-radius-xl:   var(--curated-radius, 3px);
}

/* Container width — controla o `.container` do Bootstrap APENAS no
   breakpoint xxl (≥1400px). Aplicar antes disso reduziria o container
   nos breakpoints menores (md/lg) que têm suas próprias regras
   responsivas do Bootstrap, quebrando o feel responsivo. */
@media (min-width: 1400px) {
    .container { max-width: var(--curated-container-max, 1320px); }
}
body.curated-layout-full .container {
    max-width: none;
}

/* Section gap — spacing entre blocos consecutivos. Só afeta blocos
   dentro de `.curated-content`. */
.curated-content .block + .block {
    margin-top: var(--curated-section-gap, 0);
}

/* Tipografia — consumers para os sliders de heading e body. Preferimos
   sobrescrever aqui em vez de colar `!important` na regra base
   (h1..h5) porque a especificidade acima aqui é maior que a do bloco 3
   quando o body carrega a classe .theme-*. */
body[class*="theme-"] h1,
body[class*="theme-"] h2,
body[class*="theme-"] h3,
body[class*="theme-"] h4,
body[class*="theme-"] h5,
body[class*="theme-"] .font-head {
    font-weight:    var(--curated-heading-weight,   500);
    line-height:    var(--curated-heading-lh,       1.12);
    letter-spacing: var(--curated-heading-tracking, -.02em);
}
body[class*="theme-"] {
    font-size: var(--curated-font-size, 16px);
}

/* Botões — Bootstrap 5 expõe --bs-btn-* vars por componente, mas o `.btn`
   base usa valores hardcoded no CSS compilado. Sobrescrevemos com uma
   regra própria pra que os sliders de padding e peso do texto passem
   direto pros botões (nossos + os do próprio Bootstrap).

   Excluímos .btn-sm e .btn-lg do padding override: essas variantes
   têm seu próprio padding intencional (menor / maior) e sobrescrever
   apagaria a hierarquia visual. Font-weight e text-transform ainda
   valem pra todas as sizes — são propriedades textuais que devem
   ficar consistentes entre tamanhos. */
body[class*="theme-"] .btn:not(.btn-sm):not(.btn-lg) {
    padding-top:    var(--curated-button-py, .375rem);
    padding-bottom: var(--curated-button-py, .375rem);
    padding-left:   var(--curated-button-px, .75rem);
    padding-right:  var(--curated-button-px, .75rem);
}
body[class*="theme-"] .btn {
    font-weight:    var(--curated-button-weight, 400);
    text-transform: var(--curated-button-uppercase-value, none);
}


/* Logo do header — remove qualquer bg escuro que herda de a:hover
   generico do Bootstrap/base. A logo é um <a class="navbar-brand">
   e visualmente NUNCA deve ganhar destaque de fundo no hover — a
   sinalização de link vem do próprio texto/color, não de uma pill
   preta ao redor. */
/* Logo do header — sem QUALQUER decoração visual no hover/focus.
   Reset comprehensive: bg, decoration, shadow, outline, tap-highlight
   (mobile Safari), text-decoration color. Também protege os filhos
   diretos exceto o `.bg-brand` (quadrado da logo, que TEM que
   manter a cor). Cobre também :focus-visible que browsers modernos
   usam pra distinguir focus por teclado.

   ⚠️ `color` é CRÍTICO: Bootstrap seta
   `--bs-navbar-brand-hover-color: rgba(var(--bs-emphasis-color-rgb), 1)`
   que em dark mode resolve pra uma cor quase preta — o texto da
   logo virava preto sobre header escuro, aparecendo como um bloco
   escuro no hover. Forçando color direto (não a var), ganhamos. */
.navbar-brand,
.navbar-brand:hover,
.navbar-brand:focus,
.navbar-brand:focus-visible,
.navbar-brand:active {
    color: var(--curated-header-link, var(--ink)) !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-decoration-color: transparent !important;
    text-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}
.navbar-brand > *:not(.bg-brand),
.navbar-brand:hover > *:not(.bg-brand),
.navbar-brand:focus > *:not(.bg-brand) {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: none !important;
    text-decoration-color: transparent !important;
}

/* ── Scoping local pra blocos com background claro HARDCODED ──
   Alguns blocos antigos (split_action, contact_form) desenham a
   própria caixa com um bg claro fixo (creme, off-white, #f8f9fa).
   Sem essa regra, quando o mestre entra em dark mode e deixa
   `text_primary_color` claro, os textos DENTRO desses blocos ficam
   claro-sobre-claro = invisíveis.
   Solução: sobrescrever TODOS os tokens de texto LOCALMENTE nesses
   blocos, forçando texto escuro. Cobre tanto os tokens curated
   (--ink, --ink-soft) quanto os aliases legacy (--site-text,
   --site-heading-color, etc) que blocos antigos leem. Como CSS
   custom properties propagam pra descendentes, todo elemento
   interno pega o valor escuro automaticamente. */
.block-contact-form,
.block-split-action__side--bg-default,
.block-split-action__side--bg-panel {
    /* Tokens de texto forçados escuros porque o bg desses blocos
       é claro hardcoded — texto claro (do dark mode) sumiria. */
    --ink:               #16181C;
    --ink-soft:          #5C6270;
    --site-text:         #16181C;
    --site-text-muted:   #5C6270;
    --site-heading:      #16181C;
    --site-heading-color: #16181C;
    --site-link:         #16181C;
    /* Inputs INTERNOS também têm que voltar pra claros — se o
       mestre estiver em dark mode com input_bg_color escuro, os
       campos dentro desse bloco claro apareceriam como retângulos
       pretos flutuando (mismatch visual com o bg do bloco). */
    --curated-input-bg:    #FFFFFF;
    --curated-input-text:  #16181C;
    --curated-input-border: #DAD5CC;
    color: var(--ink);
}
.block-contact-form .text-muted,
.block-split-action__side--bg-default .text-muted,
.block-split-action__side--bg-panel .text-muted { color: var(--ink-soft) !important; }

/* Sort direction toggle na listagem — o CSS legado usa
   var(--site-background, #fff) e var(--site-text) — variáveis que
   não existem no curated flow, então sempre caía no branco/preto
   default. Faz herdar do card_bg/card_text tokens no curated pra
   ficar consistente com o resto da listagem (em dark mode o botão
   também escurece). */
body[class*="theme-"] .sort-dir-btn {
    background-color: var(--curated-card-bg, #fff);
    color: var(--curated-card-text, inherit);
    border-color: var(--line);
}
body[class*="theme-"] .sort-dir-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background-color: var(--curated-card-bg, #fff);
}

/* .btn-outline-dark — Bootstrap tem cor preta hardcoded (--bs-btn-color:
   #212529) que fica invisível em dark mode. Reamarra pras vars do tema
   (--ink) que invertem naturalmente entre light/dark. Só escopa dentro
   dos temas curated (`body[class*="theme-"]`) — não afeta legacy. */
body[class*="theme-"] .btn-outline-dark {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-bg: var(--ink);
    --bs-btn-hover-color: var(--paper);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-color: var(--paper);
    --bs-btn-active-border-color: var(--ink);
}

/* ============================================================
   LEGACY --site-* ALIASES — ponte pro curated flow
   ============================================================
   `base.css` e `blocks.css` foram escritos antes do curated flow;
   consomem `var(--site-*)` em dezenas de lugares. No fluxo legacy
   essas vars são setadas via `<style>` inline (do painel).  No fluxo
   curated (`body[class*="theme-"]`) elas ficam undefined e caem nos
   fallbacks default do Bootstrap → resultado: qualquer bloco que
   use var(--site-*) IGNORA a paleta do mestre.

   Este alias força que TODA var `--site-*` reflita o token curated
   correspondente. Efeito: 40+ blocos do pagebuilder passam a
   respeitar cor/tipografia/borda do mestre automaticamente,
   sem precisar ajustar bloco por bloco.

   Zero regressão pro legacy: o seletor `body[class*="theme-"]` só
   casa tenants curated. Legacy continua lendo `--site-*` do seu
   próprio <style> inline como sempre. */
body[class*="theme-"] {
    /* Marca + acentos */
    --site-primary:        var(--brand);
    --site-primary-rgb:    31, 78, 69;   /* fallback pra rgba(); mestre customiza no custom_css se quiser */
    --site-secondary:      var(--ink-soft);
    --site-accent:         var(--brand);

    /* Texto e fundos */
    --site-text:           var(--ink);
    --site-text-muted:     var(--ink-soft);
    --site-background:     var(--paper);
    --site-background-alt: var(--curated-card-bg, var(--panel));
    --site-border:         var(--line);

    /* Links */
    --site-link:           var(--ink);
    --site-link-hover:     var(--brand);

    /* Headings */
    --site-heading:        var(--ink);
    --site-heading-color:  var(--ink);
    --site-heading-font:   var(--font-head);
    --site-heading-weight: var(--curated-heading-weight, 500);

    /* Corpo/tipografia */
    --site-font-family:    var(--font-body);
    --site-font-size:      var(--curated-font-size, 16px);

    /* Header */
    --site-header-bg:         var(--curated-header-bg, var(--paper));
    --site-header-text:       var(--curated-header-link, var(--ink));
    --site-header-text-hover: var(--curated-header-link-hover, var(--brand));
    --site-header-accent:     var(--brand);
    --site-header-toggler:    var(--ink);

    /* Footer */
    --site-footer-bg:      var(--curated-footer-bg, #16181C);
    --site-footer-text:    var(--curated-footer-text, #FAF9F7);
    --site-footer-heading: var(--curated-footer-heading, #FFFFFF);
    --site-footer-accent:  var(--curated-footer-link, var(--brand));

    /* Feedback (success/warning/error/info) */
    --site-success: var(--curated-success, #2E7D5B);
    --site-warning: var(--curated-warning, #B78103);
    --site-danger:  var(--curated-error,   #B23A48);
    --site-info:    #17a2b8;

    /* Layout/estruturais */
    --site-border-radius:     var(--bs-border-radius);
    --site-btn-border-radius: var(--bs-border-radius);
    --site-card-shadow:       var(--curated-card-shadow, none);
    --site-container-width:   var(--curated-container-max, 1280px);
    --site-section-padding:   var(--curated-block-py, 48px);
}

/* Fix específico do bloco `module_filters` do pagebuilder: base.css
   define `.block-module-filters .filter-input` com specificity (0,0,2,0)
   E hardcoded `background: var(--site-background, #f8f9fa)`. Meu alias
   acima resolve o var, mas eu quero garantir que os tokens de INPUT
   novos (input_bg_color / input_text_color) sobrescrevem — o mestre
   pode querer inputs de tom diferente dos cards. Cobre também o
   ::placeholder pra ficar legível (base.css hardcoded #adb5bd que
   fica invisível em dark mode). */
body[class*="theme-"] .block-module-filters .filter-input {
    background-color: var(--curated-input-bg, #fff) !important;
    color: var(--curated-input-text, inherit) !important;
    border-color: var(--curated-input-border, var(--line)) !important;
}
body[class*="theme-"] .block-module-filters .filter-input::placeholder {
    color: var(--curated-input-text, inherit) !important;
    opacity: .72 !important;
}
body[class*="theme-"] .block-module-filters .filter-input:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent) !important;
}

/* Ajuste geral no ::placeholder — meu fix anterior usava opacity .55
   que ficava apagado demais em dark mode. .72 fica visível sem confundir
   com texto real (100%). */
body[class*="theme-"] .form-control::placeholder,
body[class*="theme-"] .form-select::placeholder,
body[class*="theme-"] textarea.form-control::placeholder {
    opacity: .72 !important;
}

/* ── Efeitos de hover parametrizáveis (novos tokens) ──
   O mestre configura no editor visual OU a IA no .md.
   Toggles ligam/desligam o efeito; cores herdam da paleta
   por default se não configuradas. */

/* link_hover_color — cor pro hover de links. Cascata:
   1. Se o mestre configurou link_hover_color → usa ela.
   2. Senão, se configurou accent_color → usa accent.
   3. Senão → auto-cálculo (60% cor atual + 40% brand).
   Assim uma paleta 2-color (brand + accent) fica coerente sem
   o mestre precisar setar cada campo individualmente. */
body[class*="theme-"] a:hover,
body[class*="theme-"] a:focus-visible {
    color: var(--curated-link-hover, var(--curated-accent, color-mix(in srgb, currentColor 60%, var(--brand) 40%)));
}

/* card_hover_lift — habilita/desabilita elevação do card no hover.
   Aplica em article > .card-flat (cards do imob) E em qualquer .card-flat
   dentro de .block-cards--style-flat-bordered (cards editorial dos
   institucionais, que emitem <div class="card-flat">). O toggle usa
   1|0 via calc(1 * ... ou 0 * ...). */
body[class*="theme-"] article > .card-flat,
body[class*="theme-"] .block-cards--style-flat-bordered .card-flat {
    transition: transform .2s ease, box-shadow .2s ease;
}
body[class*="theme-"] article > .card-flat:hover,
body[class*="theme-"] .block-cards--style-flat-bordered .card-flat:hover {
    /* Efeito só quando o toggle está "1" — via calc que resulta em 0
       quando desligado. Fallback == 1 (efeito ligado). */
    transform: translateY(calc(-2px * var(--curated-card-hover-lift, 1)));
    box-shadow: 0 calc(8px * var(--curated-card-hover-lift, 1)) calc(24px * var(--curated-card-hover-lift, 1)) color-mix(in srgb, var(--ink) 15%, transparent);
}

/* image_hover_zoom — zoom sutil na imagem do card no hover */
body[class*="theme-"] article > .card-flat .ratio,
body[class*="theme-"] .block-cards--style-flat-bordered .card-flat .ratio {
    overflow: hidden;
}
body[class*="theme-"] article > .card-flat .ratio img,
body[class*="theme-"] .block-cards--style-flat-bordered .card-flat .ratio img {
    transition: transform .5s ease;
}
body[class*="theme-"] article > .card-flat:hover .ratio img,
body[class*="theme-"] .block-cards--style-flat-bordered .card-flat:hover .ratio img {
    /* scale = 1 + (0.04 * toggle) → 1.04 quando ligado, 1 quando desligado */
    transform: scale(calc(1 + (0.04 * var(--curated-image-hover-zoom, 1))));
}

/* ============================================================
   CARD-SCOPE TOKEN INHERITANCE — bug crítico do dark-misto
   ============================================================
   Root cause identificado: dentro de cards, elementos como
   eyebrow, título do imóvel, textos muted, labels de filtro
   continuavam puxando `--ink` / `--ink-soft` do BODY, não do
   CARD. Em dark-misto (body dark + card light) o texto do card
   ficava light-on-light = invisível.

   Solução: reescrever --ink e --ink-soft (e os aliases --site-*)
   DENTRO de qualquer container-tipo-card. Elementos filhos
   herdam esses valores automaticamente via CSS var cascade. */
.card-flat,
.imovel-card,
.curated-filters,
.module-filters-card--flat-white,
.module-filters-card--shadow,
.offcanvas,
.card {
    --ink:              var(--curated-card-text, var(--ink));
    --ink-soft:         color-mix(in srgb, var(--curated-card-text, var(--ink)) 65%, var(--curated-card-bg, transparent));
    --site-text:        var(--curated-card-text, var(--ink));
    --site-text-muted:  color-mix(in srgb, var(--curated-card-text, var(--ink)) 65%, var(--curated-card-bg, transparent));
    --site-heading:     var(--curated-card-text, var(--ink));
    --site-heading-color: var(--curated-card-text, var(--ink));
}

/* Native form controls — accent-color remove o azul default do
   browser em checkboxes, radios e range sliders. Aplica pra
   qualquer input dentro dos temas curated. */
body[class*="theme-"] {
    accent-color: var(--brand);
}

/* ── Novos tokens da 3ª auditoria ── */

/* Botões usam button_border_radius (separado do card). Cobre todos
   os .btn dentro dos temas curated com cascata pro global e default 3px. */
body[class*="theme-"] .btn {
    border-radius: var(--curated-btn-radius, var(--curated-radius, 3px)) !important;
}

/* Body font weight e line height — permite temas airy (Muji) ou
   densos (corporate) sem custom_css. */
body[class*="theme-"] {
    font-weight: var(--curated-body-weight, 400);
    line-height: var(--curated-body-lh, 1.6);
}

/* Inputs do pagebuilder (.filter-input, .form-control) também
   respeitam button_border_radius ou input_border_radius (que já
   existia) — antes só input_border_radius era honrado, deixando
   os inputs de blocos legacy nos defaults do Bootstrap. */
body[class*="theme-"] .filter-input,
body[class*="theme-"] .block-module-filters .filter-input,
body[class*="theme-"] .filter-submit-btn {
    border-radius: var(--curated-input-radius, var(--curated-radius, 3px)) !important;
}

/* Card shadow inteligente — a opção "Forte" do schema
   (0 8px 24px rgba(0,0,0,.18)) é preta e some em body escuro.
   Sobrepor com uma sombra derivada do body_bg — quando o body é
   claro usa preto discreto; quando escuro usa branco (halo). */
body[class*="theme-"] .card-flat {
    /* Se --curated-card-shadow é "none", não faz nada.
       Senão, usa sombra baseada em --ink (que sempre contrasta
       com --paper) — halo natural nos 2 modes. */
    box-shadow: var(--curated-card-shadow, none);
}

/* ============================================================
   META-TOKENS FOR LEGACY PAGEBUILDER BLOCKS
   ============================================================
   The pagebuilder's blocks.css file references these tokens
   directly (e.g. `background: var(--curated-surface-alt, #f8f9fa)`).
   Each meta-token is *derived* from the primary curated tokens
   (--curated-card-bg / --curated-card-text) via color-mix, so
   the master doesn't need to declare every subtle variant.

   Legacy tenants: these vars are unset, so blocks.css falls back
   to the original hardcoded hex → pixel-identical rendering.

   Curated tenants: these vars ARE set (below), so a subtle
   border becomes a subtle border against the actual card bg,
   an alt surface stays subtle, a muted text stays muted, etc.
   ============================================================ */
body[class*="theme-"] {
    /* Subtle border used across accordion frames, table rows,
       news card outlines, etc. In legacy = #e9ecef opaque. In
       curated = 10% of card_text over transparent (auto-adapts). */
    --curated-border-subtle: color-mix(in srgb, var(--curated-card-text, #000) 10%, transparent);

    /* Slightly stronger separator (table body bottom, tabs
       underline, timeline line). */
    --curated-border-strong: color-mix(in srgb, var(--curated-card-text, #000) 18%, transparent);

    /* Alt surface for zebra rows, thead backgrounds, hover
       states — 6-8% shift from card_bg toward card_text. */
    --curated-surface-alt: color-mix(in srgb, var(--curated-card-bg, #fff) 94%, var(--curated-card-text, #000) 6%);
    --curated-surface-hover: color-mix(in srgb, var(--curated-card-bg, #fff) 90%, var(--curated-card-text, #000) 10%);

    /* Text-muted derived from card_text — 70% opacity so it
       always contrasts with the same bg, dark or light. */
    --curated-text-muted-derived: color-mix(in srgb, var(--curated-card-text, currentColor) 70%, transparent);
}

/* ============================================================
   LEGACY BLOCK OVERRIDES — cases blocks.css can't self-adapt
   ============================================================
   These rules stay in curated-theme.css because they cannot be
   expressed as a simple `var(--x, #hex)` swap inside blocks.css:
   - SVG data-URIs (Bootstrap accordion chevron) don't respect
     currentColor from CSS custom properties.
   - Bootstrap component vars (--bs-accordion-*, --bs-table-*)
     are the right rebind point.
   Everything else flows through the meta-tokens above.
   ============================================================ */

/* Accordion chevron — Bootstrap draws it via a dark-hex SVG data-URI
   in --bs-accordion-btn-icon (fill=#212529). `currentColor` inside a
   data-URI does NOT resolve to the element's color (browsers load
   the SVG as a separate document, losing CSS context). Use a mask
   instead — the SVG shape becomes an alpha mask and background-color
   fills it with the button's card_text. Also rebind the two
   Bootstrap active-state vars so the expanded button follows theme. */
body[class*="theme-"] .block-accordion .accordion-button {
    --bs-accordion-active-color: var(--curated-card-text, inherit);
    --bs-accordion-active-bg: var(--curated-surface-hover, #f8f9fa);
    /* Nuke Bootstrap's default hard-coded chevron so its dark fill
       doesn't paint underneath our mask (would show as double-image). */
    --bs-accordion-btn-icon: none;
    --bs-accordion-btn-active-icon: none;
}
body[class*="theme-"] .block-accordion .accordion-button::after {
    background-image: none;
    background-color: var(--curated-card-text, currentColor);
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: 1.25rem;
            mask-size: 1.25rem;
}

/* Bootstrap .table component variables — the pagebuilder table
   block wraps the standard Bootstrap .table; the striped/hover/
   border colors flow through --bs-table-* vars that blocks.css
   can't rebind on its own without touching Bootstrap's own layer. */
body[class*="theme-"] .block-table .table {
    --bs-table-bg: var(--curated-card-bg, transparent);
    --bs-table-color: var(--curated-card-text, inherit);
    --bs-table-striped-bg: var(--curated-surface-alt, rgba(0, 0, 0, 0.02));
    --bs-table-striped-color: var(--curated-card-text, inherit);
    --bs-table-border-color: var(--curated-border-subtle, #dee2e6);
}

/* ============================================================
   IMOVEL CARD — list layout
   ============================================================
   The imovel/veiculo card partials add the `card-flat--list`
   modifier when the listing is in list mode (as opposed to
   grid). The partial keeps the exact same HTML — image inside
   `.position-relative > .ratio.ratio-4x3`, then a `.p-3` body
   below — and relies on this CSS to arrange them horizontally:
   thumbnail on the left, details on the right.

   Without these rules the `.ratio` box stretched to the full
   column width and the aspect-ratio filled a screen-high slab
   (the "128 gigante" bug in the QA prints).

   The card still stacks (image on top, details below) on
   narrow screens because a 30% thumbnail beside a 70% body
   collapses under ~420px.
   ============================================================ */
.imoveis-list .card-flat--list {
    flex-direction: row;
    align-items: stretch;
    height: auto;
}
.imoveis-list .card-flat--list > .position-relative {
    flex: 0 0 34%;
    max-width: 320px;
    min-width: 0;
    align-self: stretch;
}
/* The .ratio wrapper inside the media slot needs to fill the
   thumbnail column, not push it to a fixed 4:3 of the column
   width. Overriding aspect-ratio lets the image simply cover
   whatever height the details column claims. */
.imoveis-list .card-flat--list > .position-relative > .ratio {
    aspect-ratio: auto;
    height: 100%;
    min-height: 180px;
}
.imoveis-list .card-flat--list > .p-3 {
    flex: 1 1 auto;
    min-width: 0;
}
@media (max-width: 575.98px) {
    .imoveis-list .card-flat--list {
        flex-direction: column;
    }
    .imoveis-list .card-flat--list > .position-relative {
        flex: 0 0 auto;
        max-width: none;
    }
    .imoveis-list .card-flat--list > .position-relative > .ratio {
        aspect-ratio: 4 / 3;
        height: auto;
        min-height: 0;
    }
}

/* ============================================================
   FILTROS — variante horizontal (posição = top_bar)
   ============================================================
   O partial `_filters-curated.blade.php` sempre renderiza o
   markup em coluna (uma seção por row, hairline separator entre).
   Quando o master escolhe "top_bar" como posição, a mesma
   marcação recebe a classe `.curated-filters--horizontal` que
   quebra a coluna em uma FILA de blocos compactos, com wrap
   natural em telas estreitas. Nenhum override de markup, só
   CSS — o partial continua servindo modal e sidebar como antes.

   Regras:
   - Container vira flex-wrap row.
   - Cada bloco (`.mb-3`, `.pt-3.mt-3.border-top`) neutraliza a
     margem/borda vertical e vira uma célula com largura mínima
     controlada — o wrap acontece por conta do flex-wrap.
   - Grid interno do "Finalidade" força 1 linha só, pra caber
     sem quebrar.
   - Header "Filtros" some (redundante numa barra horizontal).
   - Faixa de preço perde o slider dual (não cabe em modo
     compacto) e mantém só os 2 inputs number.
   ============================================================ */
/* ============================================================
   .curated-filters--horizontal
   ------------------------------------------------------------
   Layout: FLEX WRAP com gap uniforme. Cada seção de filtro é
   uma "célula" de 220px min → cresce se sobrar espaço, quebra
   pra próxima linha quando não couber. Sem inline-block +
   margin (o gap resolve espaçamento consistente).

   Property type e Neighborhood: partial já emite DROPDOWN
   MULTISELECT (via if $layout==='horizontal'), não chips
   empilhados. Esta CSS apenas dá o polish visual.

   Quartos/Suítes/Banheiros/Vagas: partial ainda emite 4
   sub-linhas empilhadas — colapsa aqui em UMA linha via
   `flex-direction: row` + `flex-wrap` no wrapper interno.
   ============================================================ */
.curated-filters--horizontal {
    padding: 1rem 1.25rem !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: flex-start;
}
/* Header "Filtros" — some no top_bar (o container já é o
   affordance visual do filtro; título é redundante). */
.curated-filters--horizontal > .d-flex.mb-3 {
    display: none !important;
}
/* Cada célula filtro: flex-basis 220px, cresce se sobrar,
   quebra bonito na próxima linha. Zera border/padding/margin
   verticais que faziam sentido só no layout empilhado. */
.curated-filters--horizontal > .mb-3,
.curated-filters--horizontal > .pt-3 {
    flex: 0 1 220px;
    min-width: 200px;
    margin: 0 !important;
    padding-top: 0 !important;
    border-top: 0 !important;
}
/* Eyebrow (label da seção) menor pra caber sem ocupar espaço. */
.curated-filters--horizontal .eyebrow {
    font-size: 0.7rem;
    margin-bottom: 0.35rem !important;
    white-space: nowrap;
}

/* Finalidade — grid 2x2 fica compacto em 220px de largura. */
.curated-filters--horizontal > .mb-3:first-of-type > div[role="group"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.25rem !important;
}

/* Preço — inputs number lado a lado, ocultar o slider dual
   (não cabe compact) e a régua de labels do slider. */
.curated-filters--horizontal .curated-price-range,
.curated-filters--horizontal .curated-price-range + .d-flex {
    display: none !important;
}
.curated-filters--horizontal .input-group {
    margin-bottom: 0 !important;
}

/* Quartos e vagas — bloco pai contém 4 sub-blocos (bedrooms,
   suites, bathrooms, parking) empilhados por `<div class="mb-2">`.
   Colapsa em fila horizontal, cada sub-bloco vira uma coluna
   compacta com seu btn-group inline. Como esse "célula-pai"
   pode ficar maior que 220px (4 blocos × 130px cada), permite
   ela ocupar até 100% da linha. */
.curated-filters--horizontal .pt-3.mt-3.border-top.border-line:has(.btn-group.w-100) {
    flex: 1 1 100%;
    min-width: 200px;
}
.curated-filters--horizontal .pt-3.mt-3.border-top.border-line:has(.btn-group.w-100) > .mb-2 {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0 1rem 0.5rem 0 !important;
    vertical-align: top;
}
.curated-filters--horizontal .btn-group.w-100 {
    width: auto !important;
}
.curated-filters--horizontal small.text-soft {
    font-size: 0.7rem;
    display: block;
    margin-bottom: 0.15rem;
}

/* Características (form-check em coluna) — em top_bar,
   coloca em fila com wrap, cada checkbox inline. */
.curated-filters--horizontal .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0.75rem 0.25rem 0;
    padding-left: 0;
}
.curated-filters--horizontal .form-check-input {
    margin-top: 0;
    margin-right: 0;
    float: none;
}

/* Mobile: cada célula ocupa 100% da linha (empilha),
   sub-blocos de quartos/vagas voltam a empilhar. */
@media (max-width: 767.98px) {
    .curated-filters--horizontal {
        gap: 0.75rem;
    }
    .curated-filters--horizontal > .mb-3,
    .curated-filters--horizontal > .pt-3 {
        flex: 1 1 100%;
        min-width: 0;
    }
    .curated-filters--horizontal .pt-3.mt-3.border-top.border-line:has(.btn-group.w-100) > .mb-2 {
        display: block;
        margin: 0 0 0.75rem 0 !important;
    }
}

/* Bootstrap .nav-tabs — as abas de finalidade (Todos/Venda/
   Aluguel/Temporada) na listagem de imóveis usam
   `.nav.nav-tabs`. Bootstrap põe a aba ativa com fundo BRANCO
   hardcoded e texto na cor do body (--bs-nav-tabs-link-active-
   color = --bs-emphasis-color). Em tema dark, texto fica quase
   preto sobre fundo branco quase, invisível. Escopa pra
   body[class*="theme-"] pra não afetar tenants legacy. */
body[class*="theme-"] .nav-tabs {
    --bs-nav-tabs-link-active-color: var(--curated-card-text, inherit);
    --bs-nav-tabs-link-active-bg: transparent;
    --bs-nav-tabs-link-active-border-color: transparent transparent var(--curated-brand, currentColor);
    --bs-nav-tabs-link-hover-border-color: transparent transparent var(--curated-border-strong, currentColor);
    --bs-nav-tabs-border-color: var(--curated-border-subtle, currentColor);
    --bs-nav-link-color: var(--curated-text-muted-derived, inherit);
    --bs-nav-link-hover-color: var(--curated-card-text, inherit);
}
body[class*="theme-"] .nav-tabs .nav-link.active {
    /* Aba ativa: borda inferior brand grossa, texto card_text,
       fundo transparente pra não pintar por cima do body. */
    border-bottom-width: 2px;
    font-weight: 600;
}

/* Dropdown multiselect usado pra Tipo/Bairro no top_bar. */
.curated-multi-dropdown .dropdown-toggle {
    background: var(--curated-input-bg, transparent);
    color: var(--curated-input-text, inherit);
    border-color: var(--curated-input-border, currentColor);
    text-align: left;
    padding: 0.375rem 0.75rem;
    max-width: 100%;
    overflow: hidden;
}
.curated-multi-dropdown__label {
    display: inline-block;
    max-width: calc(100% - 1.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.curated-multi-dropdown__menu {
    max-height: 320px;
    overflow-y: auto;
    min-width: 220px;
    background: var(--curated-card-bg, #fff);
    color: var(--curated-card-text, inherit);
    border-color: var(--curated-border-subtle, rgba(0, 0, 0, 0.1));
}
.curated-multi-dropdown__menu .dropdown-item {
    color: var(--curated-card-text, inherit);
    cursor: pointer;
    white-space: normal;
    line-height: 1.35;
}
.curated-multi-dropdown__menu .dropdown-item:hover {
    background: var(--curated-surface-hover, rgba(0, 0, 0, 0.05));
}
.curated-multi-dropdown__menu .form-check-input {
    flex-shrink: 0;
}

/* Offcanvas dos filtros (position = modal) — o partial já tem
   .card-flat com borda; dentro do offcanvas não precisa duplicar. */
.offcanvas .curated-filters.card-flat {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 1rem !important;
}



/* ============================================================
   Footer widget slot — respeita max-width configurada
   ============================================================
   Var `--curated-footer-widget-max-w` vem do drawer (schema
   range 200-900px, default 500px). Slot centralizado quando
   valor < largura do container pra ficar bonito em rodapés
   full-width. Newsletter inline se ajusta automaticamente ao
   wrapper (input + botão dividindo o espaço disponível).

   Só aplica quando o slot NÃO está numa coluna inline do
   sitemap (col-6 col-lg-3) — nesse caso o Bootstrap grid já
   define a largura via col class, e o max-width viria em cima
   quebrando o alinhamento com as outras colunas. */
.curated-footer-widget-slot:not([class*="col-"]) {
    max-width: var(--curated-footer-widget-max-w, 500px);
    margin-left: auto;
    margin-right: auto;
}

/* Newsletter form no rodape do curated. O componente <x-front.newsletter-
   form theme="dark"> aplica Bootstrap `.bg-dark text-light border-secondary`
   no input — cor `#212529` + border cinza escuro que ficam ilegiveis sobre
   qualquer rodape dark (contraste ruim com placeholder rgba(255,255,255,.5)
   default do Bootstrap). Override com bg semi-transparente sobre o footer
   color, border e placeholder claros. Adapta a qualquer cor de rodape sem
   precisar setar var por segmento. Scoped ao slot pra nao vazar em usos
   do newsletter fora do rodape. */
body[class*="theme-"] .curated-footer-widget-slot .newsletter-form-wrapper input.form-control {
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .18) !important;
    color: var(--curated-footer-text, #FAF9F7) !important;
}
body[class*="theme-"] .curated-footer-widget-slot .newsletter-form-wrapper input.form-control::placeholder {
    color: rgba(255, 255, 255, .55) !important;
    opacity: 1;
}
body[class*="theme-"] .curated-footer-widget-slot .newsletter-form-wrapper input.form-control:focus {
    background: rgba(255, 255, 255, .12) !important;
    border-color: rgba(255, 255, 255, .35) !important;
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .08) !important;
}

/* ── Slider inline (curated) — editorial nav ──────────────────────────
   Base do designer usa botões prev/next quadrados agrupados no canto
   bottom-right da caixa do slider, com contorno hairline em vez das
   pilulas redondas que o Owl ships. Escopado a .slider-inline-carousel
   pra não afetar outros carousels do projeto (module_content, etc). */
body[class*="theme-"] .slider-inline-carousel {
    position: relative;
}
/* Search box em contexto de header editorial (moderno). Wrapper
   ja limita largura via max-width no template. Aqui garantimos que
   .search-box-header ocupe 100% do wrapper, e o Bootstrap
   input-group faz o input crescer no espaco restante (menos o
   botao) — SEM override de width no .search-input pra nao quebrar
   o flex do input-group (que ai empurraria o botao pra segunda
   linha). O default .search-input width:200px do search-box e
   sobrescrito pelo min-width:0 + flex: 1 do input-group. */
[data-editor-hook="header_search"] .search-box-header,
[data-editor-hook="header_search"] .search-box-header form {
    width: 100%;
}
[data-editor-hook="header_search"] .search-box-header .input-group {
    flex-wrap: nowrap;
}
[data-editor-hook="header_search"] .search-box-header .search-input {
    width: auto !important;
    flex: 1 1 auto;
    min-width: 0;
}
[data-editor-hook="header_search"] .search-box-header .search-input:focus {
    width: auto !important;
}

/* .block-contact-form tem `style="background: #f8f9fa"` inline
   no blade (padrão legacy). Nos temas curated queremos que ele
   herde o `--paper` do body pra continuar o fundo warm; o inline
   style é sobrescrito com `!important` porque é a única forma
   externa de vencer specificity de inline style. */
body[class*="theme-"] .block-contact-form {
    background: var(--paper) !important;
}

body[class*="theme-"] .slider-inline-carousel .owl-nav {
    /* Reset das props que blocks.css:~1251 setou pra centrar
       verticalmente com botões spread: precisamos de bottom-right
       cluster, então top/width/transform vão pra auto/none.
       z-index > 10 porque .owl-dots do blocks.css tem width:100% +
       z-index:10 (area transparente cobre o canto bottom-right e
       rouba clicks) — subimos acima pra os botoes receberem clique. */
    position: absolute;
    top: auto;
    left: auto;
    right: .75rem;
    bottom: .75rem;
    width: auto;
    transform: none;
    display: flex;
    justify-content: flex-end;
    gap: .375rem;
    padding: 0;
    margin: 0;
    z-index: 15;
    pointer-events: none;
}
body[class*="theme-"] .slider-inline-carousel .owl-nav button.owl-prev,
body[class*="theme-"] .slider-inline-carousel .owl-nav button.owl-next {
    pointer-events: auto;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(255, 255, 255, .92) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line-strong);
    border-radius: 0 !important;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
    transform: none !important;
}
body[class*="theme-"] .slider-inline-carousel .owl-nav button.owl-prev:hover,
body[class*="theme-"] .slider-inline-carousel .owl-nav button.owl-next:hover {
    background: #fff !important;
    transform: none !important;
}
body[class*="theme-"] .slider-inline-carousel .owl-nav button.owl-prev i,
body[class*="theme-"] .slider-inline-carousel .owl-nav button.owl-next i {
    font-size: .85rem;
}

