/* ══════════════════════════════════════════════════════════════════════
   Tema ESPIA IMÓVEIS — "Broadsheet" (identidade Claude Design, nov/2026)
   Fonte da verdade: docs/espia/HANDOFF_DESIGN.md (tokens e regras).
   Carregado só quando TenantService.TemaEspia; tudo prefixado com es- e/ou
   escopado em .espia para não colidir com bootstrap/app.css.
   Regras de layout: sem caixas/divisórias estruturando a página — só espaço;
   a única moldura é a régua de jornal (2px + 1px). Fotos de imóveis ao natural.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --es-bg: #f6f1ea;          /* Papel */
  --es-surface: #ece0cf;
  --es-text: #231a15;        /* Tinta */
  --es-accent: #6d4b39;      /* Marrom Espia */
  --es-100: #f6ede6; --es-200: #e8d9c4; --es-300: #d4bba2; --es-400: #b08a6f;
  --es-500: #6d4b39; --es-600: #5b3e2f; --es-700: #4b3326; --es-800: #38261c; --es-900: #241812;
  --es-bege: #e8d9c4;        /* Bege Areia */
  --es-mar: #2f6c74;         /* uso raro (≤3%) */
  --es-divider: color-mix(in srgb, #231a15 16%, transparent);
  --es-muted: color-mix(in srgb, var(--es-text) 70%, transparent);
  --es-soft: color-mix(in srgb, var(--es-text) 80%, transparent);
  --es-font: "Source Serif 4", Georgia, serif;
  --es-gutter: clamp(20px, 5vw, 72px);
  --es-shadow-md: 0 3px 10px rgba(45,43,43,.16);
  --es-shadow-lg: 0 12px 32px rgba(45,43,43,.22);
}

body.espia-body {
  background: var(--es-bg);
  color: var(--es-text);
  font-family: var(--es-font);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

.espia { min-height: 100vh; background: var(--es-bg); color: var(--es-text); font-family: var(--es-font); }
.espia h1, .espia h2, .espia h3, .espia h4 { font-family: var(--es-font); font-weight: 600; color: inherit; margin: 0; }
.espia p { margin: 0; }
.espia a { color: var(--es-700); text-underline-offset: 3px; text-decoration: none; }
.espia a:hover { color: var(--es-900); }
.espia img { display: block; max-width: 100%; }
.espia :focus { outline: none; }
/* FocusOnNavigate foca o h1 a cada navegação (leitores de tela): sem anel visível. */
.espia h1:focus, .espia h1:focus-visible { outline: none; }
.espia :focus-visible { outline: 2px solid var(--es-accent); outline-offset: 2px; box-shadow: none; }
.espia ::selection { background: color-mix(in srgb, var(--es-accent) 30%, transparent); }
.espia i.ph-duotone { color: var(--es-accent); }

.es-wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--es-gutter); }

/* ── Tipografia ─────────────────────────────────────────────────────── */
.es-kicker {
  display: block; font-size: 13px; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase;
  color: var(--es-muted); margin-bottom: 14px;
}
.es-display {
  font-size: clamp(46px, 7.4vw, 104px) !important; line-height: 1.04; letter-spacing: -.025em;
  margin: 0 0 0 -.035em !important; max-width: 14ch;
}
.es-display span { display: block; }
.es-display .es-l2 { color: var(--es-accent); }
.es-h1 { font-size: clamp(40px, 5.6vw, 72px) !important; line-height: 1.05; letter-spacing: -.025em; margin-left: -.035em !important; }
.es-h2 { font-size: clamp(28px, 3vw, 42px) !important; line-height: 1.1; letter-spacing: -.02em; }
.es-h3 { font-size: 24px !important; line-height: 1.2; }
.es-lead { font-size: 19px; line-height: 1.6; max-width: 52ch; color: color-mix(in srgb, var(--es-text) 82%, transparent); }
.es-body { font-size: 16px; line-height: 1.7; color: var(--es-soft); }
.es-justify { text-align: justify; hyphens: auto; }
.es-small { font-size: 13px; color: var(--es-muted); }
.es-quote {
  font-style: italic; font-weight: 400; font-size: clamp(24px, 2.8vw, 36px); line-height: 1.4;
  letter-spacing: -.01em; max-width: 32ch; margin: 0; text-indent: -.475em;
}

/* ── Régua de jornal (a única moldura) ──────────────────────────────── */
.es-rule-top { height: 5px; border: 0; margin: 0; border-top: 2px solid var(--es-text); border-bottom: 1px solid var(--es-text); opacity: 1; background: none; }
.es-rule { height: 0; border: 0; border-top: 1px solid var(--es-text); margin: 0; opacity: 1; background: none; }
.es-dateline {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 28px; margin: 0; padding: 14px 0;
  font-size: 13px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: var(--es-muted);
}
/* Índice com pontilhado: label ······ número */
.es-leader { display: flex; align-items: baseline; gap: 8px; color: var(--es-text) !important; }
.es-leader .es-dots {
  flex: 1; min-width: 28px; align-self: flex-end; margin-bottom: .4em;
  border-bottom: 1px dotted color-mix(in srgb, var(--es-text) 45%, transparent);
}
.es-leader:hover { color: var(--es-accent) !important; }

/* ── Botões ─────────────────────────────────────────────────────────── */
.es-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font-family: var(--es-font); font-weight: 600; font-size: 14px; line-height: 1.2;
  color: var(--es-text); background: transparent; border: 1px solid transparent;
  padding: 10px 18px; border-radius: 2px; text-decoration: none !important; white-space: nowrap;
}
.es-btn i { font-size: 18px; }
.es-btn:disabled { opacity: .45; cursor: not-allowed; }
.espia .es-btn-primary, .espia .es-btn-primary i { background: var(--es-accent); color: var(--es-bg) !important; }
.espia .es-btn-primary:hover { background: var(--es-600); }
.espia .es-btn-primary:hover i { background: transparent; }
.espia .es-btn-primary:active { background: var(--es-700); }
.espia .es-btn-primary i { background: transparent; }
.es-btn-secondary { border-color: var(--es-divider); background: var(--es-bg); }
.es-btn-secondary:hover { background: color-mix(in srgb, var(--es-text) 7%, var(--es-bg)); }
.espia .es-btn-ghost { color: var(--es-accent); padding-inline: 6px; }
.es-btn-ghost:hover { background: color-mix(in srgb, var(--es-accent) 10%, transparent); }
.es-btn-block { width: 100%; }
.es-btn-lg { min-height: 42px; padding-inline: 22px; }

/* ── Formulários ────────────────────────────────────────────────────── */
.es-field > label { display: block; font-size: 12px; margin-bottom: 5px; color: var(--es-muted); }
.es-input {
  width: 100%; min-height: 38px; padding: 6px 10px; font: inherit; font-size: 14px;
  color: var(--es-text); caret-color: var(--es-accent);
  background: var(--es-surface); border: 1px solid var(--es-divider); border-radius: 2px;
  appearance: auto;
}
.es-input::placeholder { color: color-mix(in srgb, var(--es-text) 65%, transparent); opacity: 1; }
.es-input:hover { border-color: color-mix(in srgb, var(--es-text) 45%, transparent); }
.es-input:focus-visible, .es-input:focus { border-color: var(--es-accent); outline-offset: 0; box-shadow: none; }
textarea.es-input { min-height: 96px; resize: vertical; }
.es-seg { display: inline-flex; flex-wrap: wrap; overflow: hidden; border: 1px solid var(--es-divider); border-radius: 2px; }
.es-seg-opt {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; min-height: 38px;
  font-size: 14px; cursor: pointer; background: transparent; border: 0; color: var(--es-text); font-family: var(--es-font);
}
.es-seg-opt + .es-seg-opt { border-left: 1px solid var(--es-divider); }
.es-seg-opt[aria-checked="true"] { background: var(--es-accent); color: var(--es-bg); }
.es-seg-opt[aria-checked="false"]:hover { background: color-mix(in srgb, var(--es-text) 7%, transparent); }
.es-seg-lg .es-seg-opt { min-height: 42px; padding: 0 16px; }
.es-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.es-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.es-radio .es-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--es-divider); }
.es-radio:hover .es-dot { border-color: var(--es-accent); }
.es-radio input:checked + .es-dot { border-color: var(--es-accent); background: var(--es-accent); box-shadow: inset 0 0 0 4px var(--es-bg); }
.es-radio input:focus-visible + .es-dot { outline: 2px solid var(--es-accent); outline-offset: 2px; }
.es-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.es-erro { font-size: 14px; color: #8a2b1a; }

/* ── Tags ───────────────────────────────────────────────────────────── */
.es-tag { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: .02em; padding: 3px 10px; border-radius: 1.5px; }
.es-tag-accent { background: var(--es-100); color: var(--es-800); }
.es-tag-neutral { background: #f8f4f4; color: #444141; }

/* ── Nav ────────────────────────────────────────────────────────────── */
.es-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px clamp(16px, 2.4vw, 32px);
  padding: 15px var(--es-gutter);
}
.es-nav .es-brand { margin-right: auto; display: flex; align-items: center; }
.es-nav .es-brand img { height: 34px; width: auto; }
.espia .es-nav a.es-navlink { color: var(--es-text); font-size: 14px; }
.espia .es-nav a.es-navlink:hover, .espia .es-nav a.es-navlink[aria-current="page"] { color: var(--es-accent); }
@media (max-width: 480px) { .es-nav .es-navlink { display: none; } }

/* ── Card de imóvel (sem fundo; hover muda o texto) ─────────────────── */
.es-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 40px 32px; }
.espia a.es-card { display: flex; flex-direction: column; color: var(--es-text); text-decoration: none; }
.espia a.es-card:hover { color: var(--es-700); }
.es-card-foto { aspect-ratio: 4/3; position: relative; background: var(--es-surface); overflow: hidden; }
.es-card-foto img { width: 100%; height: 100%; object-fit: cover; }
.es-card-foto .es-tag { position: absolute; top: 12px; left: 12px; pointer-events: none; }
.es-card-txt { display: flex; flex-direction: column; gap: 6px; padding: 16px 0 0; }
.es-card-onde { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--es-muted); }
.es-card-titulo { font-weight: 600; font-size: 21px; line-height: 1.2; }
.es-card-icones { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: color-mix(in srgb, var(--es-text) 78%, transparent); margin-top: 2px; }
.es-card-icones span { display: flex; align-items: center; gap: 5px; }
.es-card-preco { font-weight: 600; font-size: 18px; margin-top: 6px; color: var(--es-700); }

/* ── Seções ─────────────────────────────────────────────────────────── */
.es-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 40px clamp(28px, 4vw, 64px); }
.es-servicos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 32px 48px; }
.espia a.es-servico { display: flex; flex-direction: column; gap: 8px; color: var(--es-text); }
.espia a.es-servico:hover { color: var(--es-accent); }
.es-servico i { font-size: 28px; }
.es-servico strong { font-weight: 600; font-size: 20px; }
.es-servico span { font-size: 15px; line-height: 1.6; color: color-mix(in srgb, var(--es-text) 78%, transparent); }
.es-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 40px clamp(24px, 5vw, 96px); align-items: center; }

/* ── Foto institucional (efeito CMYK leve, só CSS) ──────────────────── */
/* O protótipo usa filtros SVG por chapa; aqui fica a versão barata: a mesma
   foto em multiply, com franjas ciano/magenta deslocadas, que se alinham no
   hover. Fotos de imóveis NUNCA usam isto. */
.es-cmyk { position: relative; overflow: hidden; background: var(--es-surface); isolation: isolate; }
.es-cmyk img { width: 100%; height: 100%; object-fit: cover; }
.es-cmyk::before, .es-cmyk::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background-image: var(--es-foto); background-size: cover; background-position: center;
  transition: transform .6s ease, opacity .6s ease;
}
.es-cmyk::before { filter: grayscale(1) sepia(1) hue-rotate(150deg) saturate(3); opacity: .35; transform: translate(4px, 3px); }
.es-cmyk::after { filter: grayscale(1) sepia(1) hue-rotate(290deg) saturate(3); opacity: .3; transform: translate(-3px, -2px); }
.es-cmyk:hover::before, .es-cmyk:hover::after { transform: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .es-cmyk::before, .es-cmyk::after { transition: none; }
}
.es-legenda { font-size: 13px; margin: 10px 0 0; color: var(--es-muted); }

/* ── Detalhe do imóvel ─────────────────────────────────────────────── */
.es-galeria {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px; aspect-ratio: 16/8;
}
.es-galeria > div { position: relative; background: var(--es-surface); overflow: hidden; cursor: zoom-in; }
.es-galeria > div:first-child { grid-row: 1 / 3; }
.es-galeria img { width: 100%; height: 100%; object-fit: cover; }
.es-galeria .es-btn { position: absolute; right: 12px; bottom: 12px; }
@media (max-width: 640px) {
  .es-galeria { grid-template-columns: 1fr; grid-template-rows: auto; aspect-ratio: auto; }
  .es-galeria > div { aspect-ratio: 4/3; }
  .es-galeria > div:first-child { grid-row: auto; }
  .es-galeria > div:not(:first-child):not(:last-child) { display: none; }
}
.es-ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 20px 32px; padding: 22px 0; }
.es-ficha div { display: flex; flex-direction: column; gap: 4px; }
.es-ficha i { font-size: 24px; }
.es-ficha strong { font-weight: 600; font-size: 20px; margin-top: 4px; }
.es-ficha span { font-size: 13px; color: var(--es-muted); }
.es-checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 32px; }
.es-checks li { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.es-checks i { font-size: 18px; flex: none; }
.es-aside {
  flex: 1 1 300px; max-width: 400px; position: sticky; top: 24px; padding: 28px;
  display: flex; flex-direction: column; gap: 16px; background: var(--es-bg); border-radius: 2px; box-shadow: var(--es-shadow-md);
}
.es-lightbox {
  position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; background: color-mix(in srgb, #241812 92%, transparent);
}
.es-lightbox img { max-width: min(1400px, 100%); max-height: calc(100vh - 120px); object-fit: contain; }
.es-lightbox .es-lb-bar { display: flex; gap: 12px; align-items: center; color: var(--es-bg); font-size: 14px; }
.es-lightbox .es-btn { background: var(--es-bg); }

/* ── Rodapé ─────────────────────────────────────────────────────────── */
.es-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 48px 0 40px; font-size: 13px; line-height: 1.8; color: var(--es-muted);
}
.es-footer img { height: 44px; width: auto; }
.es-footer div { display: flex; flex-wrap: wrap; gap: 8px 32px; }
